this repo has no description
1import { Icons, IconSize } from "@moonlight-mod/types/coreExtensions/common";
2import { tokens } from "@moonlight-mod/wp/discord/components/common/index";
3
4// This is defined in a Webpack module but we copy it here to be less breakage-prone
5const sizes: Partial<Record<IconSize, number>> = {
6 xxs: 12,
7 xs: 16,
8 sm: 18,
9 md: 24,
10 lg: 32,
11 refresh_sm: 20
12};
13
14export const icons: Icons = {
15 parseProps(props) {
16 // NOTE: var() fallback is non-standard behavior, just for safety reasons
17 const color = props?.color ?? tokens?.colors?.["INTERACTIVE_NORMAL"] ?? "var(--interactive-normal)";
18
19 const size = sizes[props?.size ?? "md"];
20
21 return {
22 // note: this default size is also non-standard behavior, just for safety
23 width: size ?? props?.width ?? sizes.md!,
24 height: size ?? props?.width ?? sizes.md!,
25
26 fill: typeof color === "string" ? color : color.css,
27 className: props?.colorClass ?? ""
28 };
29 }
30};
31export default icons;