@bigbinary/neeto-icons 1.20.89 → 1.21.1
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 +62 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# neetoIcons
|
|
2
2
|
|
|
3
|
-
The neetoIcons and neetoIconsRN library are a collection of SVG React component icons that drives
|
|
4
|
-
|
|
3
|
+
The neetoIcons and neetoIconsRN library are a collection of SVG React component icons that drives the experience in the
|
|
4
|
+
neeto products built at BigBinary.
|
|
5
5
|
|
|
6
6
|
## Contents
|
|
7
7
|
|
|
@@ -26,12 +26,13 @@ yarn add @bigbinary/neeto-icons-rn
|
|
|
26
26
|
|
|
27
27
|
### Instructions for development
|
|
28
28
|
|
|
29
|
-
Check the [Frontend package development guide](https://neeto-engineering.neetokb.com/p/a-d34cb4b0) for step-by-step
|
|
29
|
+
Check the [Frontend package development guide](https://neeto-engineering.neetokb.com/p/a-d34cb4b0) for step-by-step
|
|
30
|
+
instructions to develop the frontend package.
|
|
30
31
|
|
|
31
32
|
#### Adding a new icon to the library
|
|
32
33
|
|
|
33
|
-
1. **Add the SVG file -**
|
|
34
|
-
|
|
34
|
+
1. **Add the SVG file -** Place the SVG file for the new icon in the appropriate folder under the `source` directory.
|
|
35
|
+
For example:
|
|
35
36
|
- `icons/` for normal icons
|
|
36
37
|
- `logos/` for product logos
|
|
37
38
|
- `typefaceLogos/` for product typeface logos
|
|
@@ -39,11 +40,9 @@ Check the [Frontend package development guide](https://neeto-engineering.neetokb
|
|
|
39
40
|
- `misc/` for miscellaneous icons
|
|
40
41
|
- `elements/` for elements
|
|
41
42
|
|
|
42
|
-
2. **Name the file appropriately -**
|
|
43
|
-
Use PascalCase for the file name (e.g., `NewIcon.svg`).
|
|
43
|
+
2. **Name the file appropriately -** Use PascalCase for the file name (e.g., `NewIcon.svg`).
|
|
44
44
|
|
|
45
|
-
3. **Verify the icon -**
|
|
46
|
-
Run the `yarn start` command to verify the React component for the new icon:
|
|
45
|
+
3. **Verify the icon -** Run the `yarn start` command to verify the React component for the new icon:
|
|
47
46
|
|
|
48
47
|
### Usage
|
|
49
48
|
|
|
@@ -65,6 +64,54 @@ Anywhere in your React file
|
|
|
65
64
|
<Clock color="#1e1e20" size={24} />
|
|
66
65
|
```
|
|
67
66
|
|
|
67
|
+
### React Native imports
|
|
68
|
+
|
|
69
|
+
Every category is available as a barrel:
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
import { NeetoSite } from "@bigbinary/neeto-icons-rn/app-icons";
|
|
73
|
+
import { Keyboard } from "@bigbinary/neeto-icons-rn/elements";
|
|
74
|
+
import { Clock } from "@bigbinary/neeto-icons-rn/icons";
|
|
75
|
+
import { Neeto } from "@bigbinary/neeto-icons-rn/logos";
|
|
76
|
+
import { Windows } from "@bigbinary/neeto-icons-rn/misc";
|
|
77
|
+
import { Neeto as NeetoTypeface } from "@bigbinary/neeto-icons-rn/typeface-logos";
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Each icon can also be imported on its own, as a default export, so that the bundler only pulls in what is used:
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
import Clock from "@bigbinary/neeto-icons-rn/icons/Clock";
|
|
84
|
+
import Neeto from "@bigbinary/neeto-icons-rn/logos/Neeto";
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Every category is also reachable through a single namespaced entry point:
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
import { Icons, Logos, Misc } from "@bigbinary/neeto-icons-rn/namespaces";
|
|
91
|
+
|
|
92
|
+
<Icons.Clock size={24} />;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The props type is exported separately:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import type { IconProps } from "@bigbinary/neeto-icons-rn/types";
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Metro configuration
|
|
102
|
+
|
|
103
|
+
These subpaths are declared through the `exports` field of the package, which Metro honours by default only from React
|
|
104
|
+
Native 0.79 onward. On earlier versions the field is ignored and the imports above fail to resolve, so enable it in
|
|
105
|
+
`metro.config.js`:
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
module.exports = {
|
|
109
|
+
resolver: {
|
|
110
|
+
unstable_enablePackageExports: true,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
```
|
|
114
|
+
|
|
68
115
|
### Product logos
|
|
69
116
|
|
|
70
117
|
```javascript
|
|
@@ -152,11 +199,9 @@ Anywhere in your React file
|
|
|
152
199
|
|
|
153
200
|
## How it works
|
|
154
201
|
|
|
155
|
-
- We use a custom rollup plugin (which can be found in `build/index.mjs`) to
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
- The plugin accepts a configuration object as an argument which can contain the
|
|
159
|
-
following keys:
|
|
202
|
+
- We use a custom rollup plugin (which can be found in `build/index.mjs`) to take all the `.svg` files from the `source`
|
|
203
|
+
folder and convert them to React components that render the respective SVG icon.
|
|
204
|
+
- The plugin accepts a configuration object as an argument which can contain the following keys:
|
|
160
205
|
|
|
161
206
|
| Name | Type | Description |
|
|
162
207
|
| ----------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
@@ -170,4 +215,6 @@ Anywhere in your React file
|
|
|
170
215
|
|
|
171
216
|
## Instructions for Publishing
|
|
172
217
|
|
|
173
|
-
Consult the
|
|
218
|
+
Consult the
|
|
219
|
+
[building and releasing packages](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages) guide
|
|
220
|
+
for details on how to publish.
|