UNPKG

ivt

Version:

Ivt Components Library

61 lines (55 loc) 2.03 kB
import { forwardRef, createElement } from 'react'; /** * @license lucide-react v0.479.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const toKebabCase = (string)=>string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); const mergeClasses = (...classes)=>classes.filter((className, index, array)=>{ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index; }).join(" ").trim(); /** * @license lucide-react v0.479.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ var defaultAttributes = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }; const Icon = forwardRef(({ color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref)=>{ return createElement("svg", { ref, ...defaultAttributes, width: size, height: size, stroke: color, strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth, className: mergeClasses("lucide", className), ...rest }, [ ...iconNode.map(([tag, attrs])=>createElement(tag, attrs)), ...Array.isArray(children) ? children : [ children ] ]); }); const createLucideIcon = (iconName, iconNode)=>{ const Component = forwardRef(({ className, ...props }, ref)=>createElement(Icon, { ref, iconNode, className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className), ...props })); Component.displayName = `${iconName}`; return Component; }; export { createLucideIcon as c }; //# sourceMappingURL=createLucideIcon-C11Tr46U.mjs.map