Lucide preact package (#291)

* Add preact package

* Fix types

* update types

* fix types

* remove dependecies

* bump version

* improve test setup for react as well

* Add workflow for preact

* Fix types

* bump version

* Add white space

* remove forward ref

* bump package

* Fix types

* Fix types

* bump version

* Remove proptypings

* Test new version

* Add some extra documentation
This commit is contained in:
Eric Fennis
2021-05-23 13:13:18 +02:00
committed by GitHub
parent 81b85839eb
commit 9e63e97f31
27 changed files with 555 additions and 135 deletions

View File

@@ -0,0 +1,22 @@
import { h } from 'preact';
import defaultAttributes from './defaultAttributes';
export default (iconName, iconNode) => {
const Component = ({ color = 'currentColor', size = 24, strokeWidth = 2, ...rest }) =>
h(
'svg',
{
...defaultAttributes,
width: size,
height: size,
stroke: color,
'stroke-width': strokeWidth,
...rest,
},
iconNode.map(([tag, attrs]) => h(tag, attrs)),
);
Component.displayName = `${iconName}`;
return Component;
};