chore(ui,icons,ui-preset,toolbox): Move design system packages to monorepo (#5470)
This commit is contained in:
committed by
GitHub
parent
71853eafdd
commit
e4ce2f4e07
@@ -0,0 +1,39 @@
|
||||
export const defaultTemplate = (
|
||||
{ jsx, componentName }: { jsx: any; componentName: string },
|
||||
{ tpl }: { tpl: any }
|
||||
) => {
|
||||
return tpl`
|
||||
import * as React from "react"
|
||||
|
||||
import type { IconProps } from "../types"
|
||||
|
||||
const ${componentName} = React.forwardRef<SVGSVGElement, IconProps>(({ color = "currentColor", ...props }, ref) => {
|
||||
return (
|
||||
${jsx}
|
||||
)
|
||||
})
|
||||
${componentName}.displayName = "${componentName}"
|
||||
|
||||
export default ${componentName}
|
||||
`
|
||||
}
|
||||
|
||||
export const fixedTemplate = (
|
||||
{ jsx, componentName }: { jsx: any; componentName: string },
|
||||
{ tpl }: { tpl: any }
|
||||
) => {
|
||||
return tpl`
|
||||
import * as React from "react"
|
||||
|
||||
import type { IconProps } from "../types"
|
||||
|
||||
const ${componentName} = React.forwardRef<SVGSVGElement, Omit<IconProps, "color">>((props, ref) => {
|
||||
return (
|
||||
${jsx}
|
||||
)
|
||||
})
|
||||
${componentName}.displayName = "${componentName}"
|
||||
|
||||
export default ${componentName}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./icon-templates"
|
||||
Reference in New Issue
Block a user