1
0
mirror of https://github.com/tabler/tabler-icons.git synced 2025-01-16 20:28:28 +01:00

fix icons css classes

This commit is contained in:
codecalm 2023-01-23 18:17:40 +01:00
parent 3386d469a8
commit c2df29c460
8 changed files with 12 additions and 11 deletions

View File

@ -3,11 +3,12 @@
import { buildIcons } from '../../.build/build-icons.mjs'
const componentTemplate = ({
name,
namePascal,
children
}) => `\
import createPreactComponent from '../createPreactComponent';
export default createPreactComponent('${namePascal}', ${JSON.stringify(children)});`;
export default createPreactComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
const indexItemTemplate = ({
name,

View File

@ -1,7 +1,7 @@
import { h, toChildArray } from 'preact';
import defaultAttributes from './defaultAttributes';
export default (iconName, iconNode) => {
export default (iconName, iconNamePascal, iconNode) => {
const Component = ({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }) =>
h(
'svg',
@ -17,7 +17,7 @@ export default (iconName, iconNode) => {
[...iconNode.map(([tag, attrs]) => h(tag, attrs)), ...toChildArray(children)],
);
Component.displayName = `${iconName}`;
Component.displayName = `${iconNamePascal}`;
return Component;
};

View File

@ -8,7 +8,7 @@ const componentTemplate = ({
children
}) => `\
import createReactComponent from '../createReactComponent';
export default createReactComponent('${namePascal}', ${JSON.stringify(children)});`;
export default createReactComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
const indexItemTemplate = ({
name,

View File

@ -2,7 +2,7 @@ import { forwardRef, createElement } from 'react';
import PropTypes from 'prop-types';
import defaultAttributes from './defaultAttributes';
export default (iconName, iconNode) => {
export default (iconName, iconNamePascal, iconNode) => {
const Component = forwardRef(
({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }, ref) =>
createElement(
@ -27,7 +27,7 @@ export default (iconName, iconNode) => {
strokeWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
Component.displayName = `${iconName}`;
Component.displayName = `${iconNamePascal}`;
return Component;
};

View File

@ -8,7 +8,7 @@ const componentTemplate = ({
children
}) => `\
import createSolidComponent from '../createSolidComponent';
export default createSolidComponent('${namePascal}', ${JSON.stringify(children)});`;
export default createSolidComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
const indexItemTemplate = ({
name,

View File

@ -2,7 +2,7 @@ import defaultAttributes from './defaultAttributes'
import { splitProps } from "solid-js"
import h from "solid-js/h";
const createSolidComponent = (iconName, iconNode) => {
const createSolidComponent = (iconName, iconNamePascal, iconNode) => {
const Component = props => {
const [localProps, rest] = splitProps(props, [
'color',
@ -28,7 +28,7 @@ const createSolidComponent = (iconName, iconNode) => {
);
};
Component.displayName = `${iconName}`;
Component.displayName = `${iconNamePascal}`;
return Component;
}

View File

@ -8,7 +8,7 @@ const componentTemplate = ({
children
}) => `\
import createVueComponent from '../createVueComponent';
export default createVueComponent('${namePascal}', ${JSON.stringify(children)});`;
export default createVueComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
const indexItemTemplate = ({
name,

View File

@ -1,7 +1,7 @@
import { h } from 'vue';
import defaultAttributes from './defaultAttributes';
const createVueComponent = (iconName, iconNode) => (
const createVueComponent = (iconName, iconNamePascal, iconNode) => (
{ size, color, ...props },
{ attrs, slots }
) => {