Skip to content

Commit

Permalink
Merge pull request #210 from microsoft/riacarmin/xx/add-svg-attribute…
Browse files Browse the repository at this point in the history
…s-to-icon

[Icon] Adds SVG attributes to Icon
  • Loading branch information
AkimaLunar authored Nov 12, 2024
2 parents 83bdc82 + 685837c commit 7746cd9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Adds SVG attributes to Icon",
"packageName": "@microsoft/arbutus.icon",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 2 additions & 0 deletions components/icon/src/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const Icon: FC<IconProps> = ({
iconName,
size = 'medium',
isInline,
...svgAttributes
}) => {
const Icon = useMemo(() => paths[iconName], [iconName]);

Expand Down Expand Up @@ -52,6 +53,7 @@ export const Icon: FC<IconProps> = ({
className={rootClasses}
fill="currentColor"
{...a11yProps}
{...svgAttributes}
>
{label && <title id={a11yId}>{label}</title>}
<Icon />
Expand Down
3 changes: 2 additions & 1 deletion components/icon/src/icon/icon.types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SVGAttributes } from 'react';
import type { sizeClasses } from './icon.styles';
import type { paths } from './icons';

Expand Down Expand Up @@ -56,4 +57,4 @@ export type IconProps = {
* Sets the Icon to be an inline element.
*/
isInline?: boolean;
};
} & SVGAttributes<SVGSVGElement>;
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@
"@babel/preset-typescript": "^7.23.2",
"@griffel/react": "^1.5.18",
"@microsoft/arbutus.aside-navigation": "1.0.7",
"@microsoft/arbutus.bookmark-tile": "1.0.12",
"@microsoft/arbutus.bookmark-tile": "1.0.13",
"@microsoft/arbutus.code-snippet": "1.0.6",
"@microsoft/arbutus.command": "1.0.9",
"@microsoft/arbutus.command": "1.0.10",
"@microsoft/arbutus.divider": "1.0.4",
"@microsoft/arbutus.file-to-string": "1.0.4",
"@microsoft/arbutus.icon": "1.2.1",
"@microsoft/arbutus.icon-button": "1.1.2",
"@microsoft/arbutus.link": "1.1.10",
"@microsoft/arbutus.main-navigation": "1.0.10",
"@microsoft/arbutus.mark-list": "1.0.11",
"@microsoft/arbutus.recommendation-tile": "1.0.12",
"@microsoft/arbutus.icon": "1.3.0",
"@microsoft/arbutus.icon-button": "1.1.3",
"@microsoft/arbutus.link": "1.1.11",
"@microsoft/arbutus.main-navigation": "1.0.11",
"@microsoft/arbutus.mark-list": "1.0.12",
"@microsoft/arbutus.recommendation-tile": "1.0.13",
"@microsoft/arbutus.tabs": "1.0.7",
"@microsoft/arbutus.text": "1.0.6",
"@microsoft/arbutus.theme-switch": "1.0.9",
"@microsoft/arbutus.theme-switch": "1.0.10",
"@microsoft/arbutus.theming": "1.1.2",
"@microsoft/arbutus.tile": "1.0.6",
"@microsoft/arbutus.ts": "0.0.2",
Expand Down

0 comments on commit 7746cd9

Please sign in to comment.