* add configs
* Add vue components
* Add documentation
* add alpha release version
* improve npm ignore files
* add tests
* Make style and class attrs work
* 📦 bump version
* Add Icon suffix for component names
* bump version
* Add icon component example
* remove space
* add new build strategy
* Write a better intro
* add other node design
* fix
* add new default template
* add tempalte
* improve code
* small improvements
* small improvements
* move files
* Connect lucide with lucide-react
* Add support for vue
* Add licenses to packages
* Fix tests
* refactor build scripts
* Minor code fixes
* update homepage readme
* Update footer text
* Add a better introduction to packages
* Split up in tempaltes
* Add new types build file
* Setup workflow file
* update readme
* update
* Fix build
* remove debug code
* Add check if svgs have duplicated children
* Add check if their are no children
* small fixes
* last fixes in the build
* Move script to packages folder
* Fix tests and add types for lucide
* Add rule to package.json
* add types in build
* add npm ignore
* update package.jsons
33 lines
863 B
JavaScript
33 lines
863 B
JavaScript
import { forwardRef, createElement } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import defaultAttributes from './defaultAttributes';
|
|
|
|
export default (iconName, iconNode) => {
|
|
const Component = forwardRef(
|
|
({ color = 'currentColor', size = 24, strokeWidth = 2, ...rest }, ref) =>
|
|
createElement(
|
|
'svg',
|
|
{
|
|
ref,
|
|
...defaultAttributes,
|
|
width: size,
|
|
height: size,
|
|
stroke: color,
|
|
strokeWidth,
|
|
...rest,
|
|
},
|
|
iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
),
|
|
);
|
|
|
|
Component.propTypes = {
|
|
color: PropTypes.string,
|
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
strokeWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
};
|
|
|
|
Component.displayName = `${iconName}`;
|
|
|
|
return Component;
|
|
};
|