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

support for Modularized Imports (#468)

This commit is contained in:
Paweł Kuna 2023-01-25 23:24:16 +01:00 committed by GitHub
parent 42ec7bcb95
commit 510f416376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

View File

@ -70,7 +70,7 @@ export const buildIcons = ({
parser: 'babel'
}) : component
let filePath = path.resolve(DIST_DIR, 'src/icons', `${svgFile.name}.${extension}`)
let filePath = path.resolve(DIST_DIR, 'src/icons', `${svgFile.namePascal}.${extension}`)
fs.writeFileSync(filePath, output, 'utf-8')
index.push(indexItemTemplate({

View File

@ -13,7 +13,7 @@ export default createPreactComponent('${name}', '${namePascal}', ${JSON.stringif
const indexItemTemplate = ({
name,
namePascal
}) => `export { default as ${namePascal} } from './icons/${name}';`
}) => `export { default as ${namePascal} } from './icons/${namePascal}';`
const typeDefinitionsTemplate = () => `/// <reference types="preact" />
import { JSX, RefObject } from 'preact'

View File

@ -13,7 +13,7 @@ export default createReactComponent('${name}', '${namePascal}', ${JSON.stringify
const indexItemTemplate = ({
name,
namePascal
}) => `export { default as ${namePascal} } from './icons/${name}';`
}) => `export { default as ${namePascal} } from './icons/${namePascal}';`
const typeDefinitionsTemplate = () => `/// <reference types="react" />
import { SVGAttributes } from 'react'
@ -25,7 +25,7 @@ export interface TablerIconsProps extends Partial<React.SVGProps<SVGSVGElement>>
size?: string | number
}
export declare const createReactComponent: (iconName: string, iconNode: any[]) => (props: TablerIconsProps) => JSX.Element;
export declare const createReactComponent: (iconName: string, iconNamePascal: string, iconNode: any[]) => (props: TablerIconsProps) => JSX.Element;
export type Icon = React.FC<TablerIconsProps>;

View File

@ -13,7 +13,7 @@ export default createSolidComponent('${name}', '${namePascal}', ${JSON.stringify
const indexItemTemplate = ({
name,
namePascal
}) => `export { default as ${namePascal} } from './icons/${name}';`
}) => `export { default as ${namePascal} } from './icons/${namePascal}';`
const typeDefinitionsTemplate = () => `/// <reference types="solid-js" />
import { JSX } from 'solid-js'

View File

@ -21,7 +21,7 @@ const iconNode = ${JSON.stringify(children)};
const indexItemTemplate = ({
name,
namePascal
}) => `export { default as ${namePascal} } from './icons/${name}.svelte';`
}) => `export { default as ${namePascal} } from './icons/${namePascal}.svelte';`
const typeDefinitionsTemplate = () => `/// <reference types="svelte" />
/// <reference types="svelte2tsx/svelte-jsx" />

View File

@ -13,7 +13,7 @@ export default createVueComponent('${name}', '${namePascal}', ${JSON.stringify(c
const indexItemTemplate = ({
name,
namePascal
}) => `export { default as ${namePascal} } from './icons/${name}';`
}) => `export { default as ${namePascal} } from './icons/${namePascal}';`
const typeDefinitionsTemplate = () => `import { SVGAttributes, FunctionalComponent } from 'vue';
declare module '@tabler/icons-vue'