react-magma-icons 3.2.2 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/SvgIcon.tsx +9 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-magma-icons",
3
3
  "license": "MIT",
4
- "version": "3.2.2",
4
+ "version": "3.2.3",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "typings": "dist/index.d.ts",
package/src/SvgIcon.tsx CHANGED
@@ -62,12 +62,16 @@ export const SvgIcon = ({
62
62
  testId,
63
63
  paths = [],
64
64
  circles = [],
65
- ariaHidden = title ? false : true,
66
- role = title ? "img" : "none",
65
+ ariaHidden,
66
+ role,
67
67
  ...other
68
68
  }: SvgIconProps) => {
69
69
  const id = useGenerateId(defaultId);
70
70
 
71
+ const computedAriaHidden =
72
+ ariaHidden !== undefined ? ariaHidden : title ? false : true;
73
+ const computedRole = role !== undefined ? role : title ? "img" : "none";
74
+
71
75
  return (
72
76
  <svg
73
77
  {...other}
@@ -77,8 +81,9 @@ export const SvgIcon = ({
77
81
  height={size}
78
82
  width={size}
79
83
  aria-labelledby={title ? id : undefined}
80
- aria-hidden={ariaHidden}
81
- role={role}
84
+ aria-hidden={computedAriaHidden}
85
+ role={computedRole}
86
+ data-testid={testId}
82
87
  >
83
88
  {title && <title id={id}>{title}</title>}
84
89
  {paths.length !== 0 && renderPaths(paths)}