Lucide Vue Package (#174)

* 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

* improvements package.json

* update tests

* update workflow
This commit is contained in:
Eric Fennis
2021-02-22 20:26:38 +01:00
committed by GitHub
parent acea1b4116
commit 4024911219
33 changed files with 4551 additions and 74 deletions

View File

@@ -0,0 +1,47 @@
export default (iconName, [tag, defaultAttrs, children]) => ({
name: iconName,
functional: true,
props: {
color: {
type: String,
default: 'currentColor',
},
size: {
type: Number,
default: 24,
},
strokeWidth: {
type: Number,
default: 2,
},
defaultClass: {
type: String,
default: 'lucide-icon',
},
},
render(
createElement,
{
props: { color, size, strokeWidth, defaultClass },
data,
},
) {
return createElement(
tag,
{
// eslint-disable-next-line prettier/prettier
class: [defaultClass, data.class, data.staticClass, data.attrs && data.attrs.class].filter(Boolean),
style: [data.style, data.staticStyle, data.attrs && data.attrs.style].filter(Boolean),
attrs: {
...defaultAttrs,
width: size,
height: size,
stroke: color,
'stroke-width': strokeWidth,
...data.attrs,
},
},
children.map(([childTag, childAttrs]) => createElement(childTag, { attrs: childAttrs })),
);
},
});

View File

@@ -0,0 +1,11 @@
export default {
xmlns: 'http://www.w3.org/2000/svg',
width: 24,
height: 24,
viewBox: '0 0 24 24',
fill: 'none',
stroke: 'currentColor',
'stroke-width': 2,
'stroke-linecap': 'round',
'stroke-linejoin': 'round',
};

View File

@@ -0,0 +1,5 @@
/*
Icons exports.
Will be generated
*/

View File

@@ -0,0 +1 @@
export * from './icons';