-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
671 additions
and
954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ node_modules/ | |
solid/ | ||
outline/ | ||
mini/ | ||
micro/ | ||
src/ | ||
build/ | ||
heroicons/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,61 @@ | ||
export const template = ( | ||
{ template }: any, | ||
_opts: any, | ||
{ imports: _imports, componentName, props: _props, jsx, exports }: any | ||
) => { | ||
const tsTemplate = template.smart({ plugins: ["typescript"] }); | ||
|
||
return tsTemplate.ast` | ||
import * as React from "react"; | ||
import Svg, { Path, SvgProps, NumberProp } from "react-native-svg"; | ||
interface Props extends SvgProps { | ||
size?: NumberProp; | ||
} | ||
const ${componentName} = ({ size = 24, ...props }: Props) => { | ||
return ( | ||
${jsx} | ||
) | ||
}; | ||
${exports} | ||
`; | ||
import type { Options as TransformOptions } from "@svgr/babel-preset"; | ||
export type Template = TransformOptions["template"]; | ||
|
||
const template16: Template = (variables, { tpl }) => { | ||
return tpl` | ||
import * as React from "react"; | ||
import Svg, { Path, SvgProps, NumberProp } from "react-native-svg"; | ||
interface Props extends SvgProps { | ||
size?: NumberProp; | ||
} | ||
const ${variables.componentName} = ({ size = 16, ...props }: Props) => { | ||
return ( | ||
${variables.jsx} | ||
) | ||
}; | ||
${variables.exports}; | ||
`; | ||
}; | ||
|
||
const template20: Template = (variables, { tpl }) => { | ||
return tpl` | ||
import * as React from "react"; | ||
import Svg, { Path, SvgProps, NumberProp } from "react-native-svg"; | ||
interface Props extends SvgProps { | ||
size?: NumberProp; | ||
} | ||
const ${variables.componentName} = ({ size = 20, ...props }: Props) => { | ||
return ( | ||
${variables.jsx} | ||
) | ||
}; | ||
${variables.exports}; | ||
`; | ||
}; | ||
|
||
const template24: Template = (variables, { tpl }) => { | ||
return tpl` | ||
import * as React from "react"; | ||
import Svg, { Path, SvgProps, NumberProp } from "react-native-svg"; | ||
interface Props extends SvgProps { | ||
size?: NumberProp; | ||
} | ||
const ${variables.componentName} = ({ size = 24, ...props }: Props) => { | ||
return ( | ||
${variables.jsx} | ||
) | ||
}; | ||
${variables.exports}; | ||
`; | ||
}; | ||
|
||
export default template; | ||
export { template16, template20, template24 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.