vadivam-react 0.0.18 → 0.0.22
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 +14 -22
- package/dist/Icon.js +3 -2
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# vadivam-react
|
|
2
2
|
|
|
3
|
-
Pixel-perfect
|
|
3
|
+
Pixel-perfect 24px outline icon components for React with tree-shakeable imports.
|
|
4
4
|
|
|
5
|
-
](https://www.npmjs.com/package/vadivam-react)
|
|
6
|
+
[](https://www.npmjs.com/package/vadivam-react)
|
|
7
|
+
[](https://github.com/praveenjuge/vadivam/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+

|
|
6
10
|
|
|
7
11
|
```sh
|
|
8
|
-
|
|
12
|
+
npm install vadivam-react
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
```tsx
|
|
@@ -16,12 +20,7 @@ export function Example() {
|
|
|
16
20
|
}
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
`absoluteStrokeWidth`, `title`, refs, and SVG children. Use `fill` for filled
|
|
21
|
-
icons, or nest icons and SVG elements to combine them.
|
|
22
|
-
|
|
23
|
-
Apply shared defaults with the provider or target the generated `vadivam` and
|
|
24
|
-
`vadivam-{name}` classes in CSS:
|
|
23
|
+
Apply shared defaults with the provider:
|
|
25
24
|
|
|
26
25
|
```tsx
|
|
27
26
|
import { Activity, VadivamProvider } from "vadivam-react";
|
|
@@ -31,23 +30,16 @@ import { Activity, VadivamProvider } from "vadivam-react";
|
|
|
31
30
|
</VadivamProvider>;
|
|
32
31
|
```
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
Use the dynamic API only for names stored in external data:
|
|
35
34
|
|
|
36
35
|
```tsx
|
|
37
|
-
import { Activity, ActivityIcon, VadivamActivity } from "vadivam-react";
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Per-icon, generic-node, and dynamic APIs are generated during build:
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
import Activity, { __iconNode } from "vadivam-react/activity";
|
|
44
|
-
import { Icon } from "vadivam-react";
|
|
45
36
|
import { DynamicIcon, iconNames } from "vadivam-react/dynamic";
|
|
46
37
|
|
|
47
|
-
<Icon iconNode={__iconNode} />;
|
|
48
38
|
<DynamicIcon name="activity" />;
|
|
49
39
|
```
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
- Native SVG properties, accessible titles, refs, and children
|
|
42
|
+
- Tree-shakeable named, aliased, and per-icon imports
|
|
43
|
+
- Provider, generic-node, and typed dynamic APIs
|
|
44
|
+
|
|
45
|
+
[Browse icons](https://vadivam.praveenjuge.com) · [GitHub](https://github.com/praveenjuge/vadivam) · [Issues](https://github.com/praveenjuge/vadivam/issues)
|
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
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vadivam-react",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Pixel-perfect
|
|
3
|
+
"version": "0.0.22",
|
|
4
|
+
"description": "Pixel-perfect 24px outline icon components for React with tree-shakeable imports.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Praveen Juge",
|
|
7
7
|
"repository": {
|
|
@@ -15,11 +15,16 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"icons",
|
|
18
|
-
"react",
|
|
19
18
|
"svg",
|
|
19
|
+
"outline-icons",
|
|
20
|
+
"icon-library",
|
|
20
21
|
"icon-pack",
|
|
22
|
+
"24px",
|
|
23
|
+
"tree-shakeable",
|
|
21
24
|
"open-source",
|
|
22
|
-
"vadivam"
|
|
25
|
+
"vadivam",
|
|
26
|
+
"react",
|
|
27
|
+
"react-icons"
|
|
23
28
|
],
|
|
24
29
|
"type": "module",
|
|
25
30
|
"sideEffects": false,
|