chore(ui,icons,ui-preset,toolbox): Move design system packages to monorepo (#5470)

This commit is contained in:
Kasper Fabricius Kristensen
2023-11-07 22:17:44 +01:00
committed by GitHub
parent 71853eafdd
commit e4ce2f4e07
722 changed files with 30300 additions and 186 deletions
@@ -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"