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:
parent
42ec7bcb95
commit
510f416376
@ -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({
|
||||
|
@ -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'
|
||||
|
@ -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>;
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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" />
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user