mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-08-13 09:35:09 +02:00
fix icons css classes
This commit is contained in:
@@ -3,11 +3,12 @@
|
|||||||
import { buildIcons } from '../../.build/build-icons.mjs'
|
import { buildIcons } from '../../.build/build-icons.mjs'
|
||||||
|
|
||||||
const componentTemplate = ({
|
const componentTemplate = ({
|
||||||
|
name,
|
||||||
namePascal,
|
namePascal,
|
||||||
children
|
children
|
||||||
}) => `\
|
}) => `\
|
||||||
import createPreactComponent from '../createPreactComponent';
|
import createPreactComponent from '../createPreactComponent';
|
||||||
export default createPreactComponent('${namePascal}', ${JSON.stringify(children)});`;
|
export default createPreactComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
|
||||||
|
|
||||||
const indexItemTemplate = ({
|
const indexItemTemplate = ({
|
||||||
name,
|
name,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { h, toChildArray } from 'preact';
|
import { h, toChildArray } from 'preact';
|
||||||
import defaultAttributes from './defaultAttributes';
|
import defaultAttributes from './defaultAttributes';
|
||||||
|
|
||||||
export default (iconName, iconNode) => {
|
export default (iconName, iconNamePascal, iconNode) => {
|
||||||
const Component = ({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }) =>
|
const Component = ({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }) =>
|
||||||
h(
|
h(
|
||||||
'svg',
|
'svg',
|
||||||
@@ -17,7 +17,7 @@ export default (iconName, iconNode) => {
|
|||||||
[...iconNode.map(([tag, attrs]) => h(tag, attrs)), ...toChildArray(children)],
|
[...iconNode.map(([tag, attrs]) => h(tag, attrs)), ...toChildArray(children)],
|
||||||
);
|
);
|
||||||
|
|
||||||
Component.displayName = `${iconName}`;
|
Component.displayName = `${iconNamePascal}`;
|
||||||
|
|
||||||
return Component;
|
return Component;
|
||||||
};
|
};
|
||||||
|
@@ -8,7 +8,7 @@ const componentTemplate = ({
|
|||||||
children
|
children
|
||||||
}) => `\
|
}) => `\
|
||||||
import createReactComponent from '../createReactComponent';
|
import createReactComponent from '../createReactComponent';
|
||||||
export default createReactComponent('${namePascal}', ${JSON.stringify(children)});`;
|
export default createReactComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
|
||||||
|
|
||||||
const indexItemTemplate = ({
|
const indexItemTemplate = ({
|
||||||
name,
|
name,
|
||||||
|
@@ -2,7 +2,7 @@ import { forwardRef, createElement } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import defaultAttributes from './defaultAttributes';
|
import defaultAttributes from './defaultAttributes';
|
||||||
|
|
||||||
export default (iconName, iconNode) => {
|
export default (iconName, iconNamePascal, iconNode) => {
|
||||||
const Component = forwardRef(
|
const Component = forwardRef(
|
||||||
({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }, ref) =>
|
({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }, ref) =>
|
||||||
createElement(
|
createElement(
|
||||||
@@ -27,7 +27,7 @@ export default (iconName, iconNode) => {
|
|||||||
strokeWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
strokeWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
};
|
};
|
||||||
|
|
||||||
Component.displayName = `${iconName}`;
|
Component.displayName = `${iconNamePascal}`;
|
||||||
|
|
||||||
return Component;
|
return Component;
|
||||||
};
|
};
|
||||||
|
@@ -8,7 +8,7 @@ const componentTemplate = ({
|
|||||||
children
|
children
|
||||||
}) => `\
|
}) => `\
|
||||||
import createSolidComponent from '../createSolidComponent';
|
import createSolidComponent from '../createSolidComponent';
|
||||||
export default createSolidComponent('${namePascal}', ${JSON.stringify(children)});`;
|
export default createSolidComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
|
||||||
|
|
||||||
const indexItemTemplate = ({
|
const indexItemTemplate = ({
|
||||||
name,
|
name,
|
||||||
|
@@ -2,7 +2,7 @@ import defaultAttributes from './defaultAttributes'
|
|||||||
import { splitProps } from "solid-js"
|
import { splitProps } from "solid-js"
|
||||||
import h from "solid-js/h";
|
import h from "solid-js/h";
|
||||||
|
|
||||||
const createSolidComponent = (iconName, iconNode) => {
|
const createSolidComponent = (iconName, iconNamePascal, iconNode) => {
|
||||||
const Component = props => {
|
const Component = props => {
|
||||||
const [localProps, rest] = splitProps(props, [
|
const [localProps, rest] = splitProps(props, [
|
||||||
'color',
|
'color',
|
||||||
@@ -28,7 +28,7 @@ const createSolidComponent = (iconName, iconNode) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Component.displayName = `${iconName}`;
|
Component.displayName = `${iconNamePascal}`;
|
||||||
return Component;
|
return Component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ const componentTemplate = ({
|
|||||||
children
|
children
|
||||||
}) => `\
|
}) => `\
|
||||||
import createVueComponent from '../createVueComponent';
|
import createVueComponent from '../createVueComponent';
|
||||||
export default createVueComponent('${namePascal}', ${JSON.stringify(children)});`;
|
export default createVueComponent('${name}', '${namePascal}', ${JSON.stringify(children)});`;
|
||||||
|
|
||||||
const indexItemTemplate = ({
|
const indexItemTemplate = ({
|
||||||
name,
|
name,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import defaultAttributes from './defaultAttributes';
|
import defaultAttributes from './defaultAttributes';
|
||||||
|
|
||||||
const createVueComponent = (iconName, iconNode) => (
|
const createVueComponent = (iconName, iconNamePascal, iconNode) => (
|
||||||
{ size, color, ...props },
|
{ size, color, ...props },
|
||||||
{ attrs, slots }
|
{ attrs, slots }
|
||||||
) => {
|
) => {
|
||||||
|
Reference in New Issue
Block a user