vadivam-react 0.0.18 → 0.0.21
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.
- package/README.md +1 -1
- package/dist/Icon.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Pixel-perfect, open-source, gorgeous React icons for refined interfaces.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
bun add vadivam-react
|
package/dist/Icon.js
CHANGED
|
@@ -18,8 +18,9 @@ export const Icon = forwardRef(({ color, size, strokeWidth, absoluteStrokeWidth,
|
|
|
18
18
|
const resolvedSize = size ?? context.size ?? 24;
|
|
19
19
|
const resolvedStrokeWidth = strokeWidth ?? context.strokeWidth ?? 2;
|
|
20
20
|
const numericSize = Number(resolvedSize);
|
|
21
|
+
const numericStrokeWidth = Number(resolvedStrokeWidth);
|
|
21
22
|
const useAbsoluteStrokeWidth = absoluteStrokeWidth ?? context.absoluteStrokeWidth ?? false;
|
|
22
|
-
const calculatedStrokeWidth = useAbsoluteStrokeWidth && Number.isFinite(numericSize)
|
|
23
|
+
const calculatedStrokeWidth = useAbsoluteStrokeWidth && Number.isFinite(numericSize) && numericSize !== 0 && Number.isFinite(numericStrokeWidth) ? numericStrokeWidth * 24 / numericSize : resolvedStrokeWidth;
|
|
23
24
|
const labelled = Boolean(title) || hasA11yProp(rest);
|
|
24
25
|
return React.createElement(
|
|
25
26
|
"svg",
|
|
@@ -31,7 +32,7 @@ export const Icon = forwardRef(({ color, size, strokeWidth, absoluteStrokeWidth,
|
|
|
31
32
|
stroke: color ?? context.color ?? "currentColor",
|
|
32
33
|
strokeWidth: calculatedStrokeWidth,
|
|
33
34
|
className: mergeClasses("vadivam", context.className, className),
|
|
34
|
-
...(!
|
|
35
|
+
...(!labelled ? { "aria-hidden": "true" } : {}),
|
|
35
36
|
...(title ? { role: "img" } : {}),
|
|
36
37
|
...rest
|
|
37
38
|
},
|