Merged in chore/fix-material-icons-types (pull request #3497)
chore: Fix MaterialIconName type * Fix MaterialIconName type Approved-by: Bianca Widstam Approved-by: Matilda Landström
This commit is contained in:
@@ -430,15 +430,16 @@ import YardOutlined from "./generated/YardOutlined"
|
|||||||
import YardFilled from "./generated/YardFilled"
|
import YardFilled from "./generated/YardFilled"
|
||||||
|
|
||||||
type SvgIcon = FunctionComponent<SVGProps<SVGSVGElement>>
|
type SvgIcon = FunctionComponent<SVGProps<SVGSVGElement>>
|
||||||
|
type IconMap = Record<
|
||||||
export const materialIcons: Record<
|
|
||||||
string,
|
string,
|
||||||
Partial<{
|
Partial<{
|
||||||
outlined: { outlined: SvgIcon; filled?: SvgIcon }
|
outlined: { outlined: SvgIcon; filled?: SvgIcon }
|
||||||
rounded: { outlined: SvgIcon; filled?: SvgIcon }
|
rounded: { outlined: SvgIcon; filled?: SvgIcon }
|
||||||
sharp: { outlined: SvgIcon; filled?: SvgIcon }
|
sharp: { outlined: SvgIcon; filled?: SvgIcon }
|
||||||
}>
|
}>
|
||||||
> = {
|
>
|
||||||
|
|
||||||
|
const _materialIcons = {
|
||||||
accessibility: {
|
accessibility: {
|
||||||
outlined: { outlined: AccessibilityOutlined, filled: AccessibilityFilled },
|
outlined: { outlined: AccessibilityOutlined, filled: AccessibilityFilled },
|
||||||
},
|
},
|
||||||
@@ -985,6 +986,8 @@ export const materialIcons: Record<
|
|||||||
},
|
},
|
||||||
wifi: { outlined: { outlined: WifiOutlined, filled: WifiFilled } },
|
wifi: { outlined: { outlined: WifiOutlined, filled: WifiFilled } },
|
||||||
yard: { outlined: { outlined: YardOutlined, filled: YardFilled } },
|
yard: { outlined: { outlined: YardOutlined, filled: YardFilled } },
|
||||||
}
|
} satisfies IconMap
|
||||||
|
|
||||||
export type MaterialIconName = keyof typeof materialIcons
|
export const materialIcons = _materialIcons as IconMap
|
||||||
|
|
||||||
|
export type MaterialIconName = keyof typeof _materialIcons
|
||||||
|
|||||||
@@ -349,19 +349,22 @@ import type { FunctionComponent, SVGProps } from "react"
|
|||||||
${imports.join("\n")}
|
${imports.join("\n")}
|
||||||
|
|
||||||
type SvgIcon = FunctionComponent<SVGProps<SVGSVGElement>>
|
type SvgIcon = FunctionComponent<SVGProps<SVGSVGElement>>
|
||||||
|
type IconMap = Record<
|
||||||
export const materialIcons: Record<
|
|
||||||
string,
|
string,
|
||||||
Partial<{
|
Partial<{
|
||||||
outlined: { outlined: SvgIcon; filled?: SvgIcon }
|
outlined: { outlined: SvgIcon; filled?: SvgIcon }
|
||||||
rounded: { outlined: SvgIcon; filled?: SvgIcon }
|
rounded: { outlined: SvgIcon; filled?: SvgIcon }
|
||||||
sharp: { outlined: SvgIcon; filled?: SvgIcon }
|
sharp: { outlined: SvgIcon; filled?: SvgIcon }
|
||||||
}>
|
}>
|
||||||
> = {
|
>
|
||||||
${registryEntries.join("\n")}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MaterialIconName = keyof typeof materialIcons
|
const _materialIcons = {
|
||||||
|
${registryEntries.join("\n")}
|
||||||
|
} satisfies IconMap
|
||||||
|
|
||||||
|
export const materialIcons = _materialIcons as IconMap
|
||||||
|
|
||||||
|
export type MaterialIconName = keyof typeof _materialIcons
|
||||||
`.trim() + "\n"
|
`.trim() + "\n"
|
||||||
|
|
||||||
await writeFile(OUT, content, "utf8")
|
await writeFile(OUT, content, "utf8")
|
||||||
|
|||||||
Reference in New Issue
Block a user