Skip to content

Commit

Permalink
Fix color SvgIcons type (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
raczyk authored May 30, 2023
1 parent 617f280 commit f84f7c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nordcloud/gnui",
"description": "Nordcloud Design System - a collection of reusable React components used in Nordcloud's SaaS products",
"version": "8.6.0",
"version": "8.6.1",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
7 changes: 5 additions & 2 deletions src/components/svgicon/SVGIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const StyledSVGIcon = styled.svg<Pick<SVGIconProps, "color" | "size">>`
${({ color }) =>
color &&
css`
fill: ${theme.colors[color] || color};
fill: ${theme.colors[color as SingleColors] || color};
`}
${({ size }) =>
Expand All @@ -26,9 +26,12 @@ const StyledSVGIcon = styled.svg<Pick<SVGIconProps, "color" | "size">>`

const VIEW_BOX = "0 0 24 24";

type AnyString = Record<never, never> & string;
type SvgColor = AnyString | SingleColors;

export type SVGIconProps = React.HTMLAttributes<HTMLOrSVGElement> & {
name: PathName;
color?: SingleColors;
color?: SvgColor;
size?: keyof typeof theme.iconSize;
};

Expand Down

0 comments on commit f84f7c6

Please sign in to comment.