@refineui/react-icons 0.1.4
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 +299 -0
- package/package.json +44 -0
- package/src/metadata.json +37709 -0
package/README.md
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# @refineui/react-icons
|
|
2
|
+
|
|
3
|
+
React components for RefineUI System Icons with TypeScript support.
|
|
4
|
+
|
|
5
|
+
## 📦 Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @refineui/react-icons
|
|
9
|
+
# or
|
|
10
|
+
yarn add @refineui/react-icons
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @refineui/react-icons
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 🚀 Quick Start
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Icon } from "@refineui/react-icons";
|
|
20
|
+
|
|
21
|
+
function App() {
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
{/* Basic usage */}
|
|
25
|
+
<Icon name="home" size={24} />
|
|
26
|
+
|
|
27
|
+
{/* With custom color */}
|
|
28
|
+
<Icon name="search" size={20} color="#0078d4" />
|
|
29
|
+
|
|
30
|
+
{/* With custom className */}
|
|
31
|
+
<Icon name="settings" size={16} className="my-icon" />
|
|
32
|
+
|
|
33
|
+
{/* With onClick handler */}
|
|
34
|
+
<Icon
|
|
35
|
+
name="heart"
|
|
36
|
+
size={24}
|
|
37
|
+
onClick={() => console.log("Heart clicked!")}
|
|
38
|
+
style={{ cursor: "pointer" }}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default App;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 🎨 Available Icons
|
|
48
|
+
|
|
49
|
+
### Icon Categories
|
|
50
|
+
|
|
51
|
+
- **Navigation**: `home`, `search`, `menu`, `back`, `forward`, `up`, `down`, `left`, `right`
|
|
52
|
+
- **Actions**: `add`, `edit`, `delete`, `save`, `cancel`, `refresh`, `download`, `upload`
|
|
53
|
+
- **Communication**: `mail`, `phone`, `chat`, `notification`, `bell`, `message`
|
|
54
|
+
- **Media**: `play`, `pause`, `stop`, `volume`, `mute`, `camera`, `image`, `video`
|
|
55
|
+
- **System**: `settings`, `gear`, `user`, `lock`, `unlock`, `key`, `shield`
|
|
56
|
+
- **Files**: `folder`, `file`, `document`, `image`, `pdf`, `zip`, `download`
|
|
57
|
+
- **And many more...** (434+ icons total)
|
|
58
|
+
|
|
59
|
+
### Icon Sizes
|
|
60
|
+
|
|
61
|
+
- **16px**: `size={16}`
|
|
62
|
+
- **20px**: `size={20}`
|
|
63
|
+
- **24px**: `size={24}` (default)
|
|
64
|
+
- **32px**: `size={32}`
|
|
65
|
+
- **48px**: `size={48}`
|
|
66
|
+
|
|
67
|
+
## 🔧 Advanced Usage
|
|
68
|
+
|
|
69
|
+
### TypeScript Support
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { Icon, IconProps } from "@refineui/react-icons";
|
|
73
|
+
|
|
74
|
+
interface MyComponentProps {
|
|
75
|
+
iconName: IconProps["name"];
|
|
76
|
+
iconSize?: IconProps["size"];
|
|
77
|
+
iconColor?: IconProps["color"];
|
|
78
|
+
iconStyle?: IconProps["iconStyle"];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function MyComponent({ iconName, iconSize = 24, iconColor }: MyComponentProps) {
|
|
82
|
+
return <Icon name={iconName} size={iconSize} color={iconColor} />;
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Custom Styling
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { Icon } from "@refineui/react-icons";
|
|
90
|
+
|
|
91
|
+
function CustomIcon() {
|
|
92
|
+
return (
|
|
93
|
+
<Icon
|
|
94
|
+
name="star"
|
|
95
|
+
size={24}
|
|
96
|
+
className="my-custom-icon"
|
|
97
|
+
style={{
|
|
98
|
+
color: "#ffd700",
|
|
99
|
+
filter: "drop-shadow(0 2px 4px rgba(0,0,0,0.2))",
|
|
100
|
+
transition: "transform 0.2s ease",
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### CSS Custom Properties
|
|
108
|
+
|
|
109
|
+
```css
|
|
110
|
+
.my-custom-icon {
|
|
111
|
+
--refineui-icon-color: #0078d4;
|
|
112
|
+
--refineui-icon-size: 24px;
|
|
113
|
+
--refineui-icon-stroke-width: 1.5;
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 🎯 Best Practices
|
|
118
|
+
|
|
119
|
+
### 1. **Icon Selection**
|
|
120
|
+
|
|
121
|
+
- Use consistent icon sizes throughout your application
|
|
122
|
+
- Choose icons that clearly represent their function
|
|
123
|
+
- Consider accessibility when selecting icons
|
|
124
|
+
|
|
125
|
+
### 2. **Performance**
|
|
126
|
+
|
|
127
|
+
- Use tree-shaking to include only needed icons
|
|
128
|
+
- Consider using CSS icons for static content
|
|
129
|
+
- Use React icons for interactive elements
|
|
130
|
+
|
|
131
|
+
### 3. **Accessibility**
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<Icon
|
|
135
|
+
name="search"
|
|
136
|
+
size={24}
|
|
137
|
+
aria-label="Search"
|
|
138
|
+
role="button"
|
|
139
|
+
tabIndex={0}
|
|
140
|
+
onKeyDown={(e) => {
|
|
141
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
142
|
+
handleSearch();
|
|
143
|
+
}
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 4. **Responsive Design**
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { Icon } from "@refineui/react-icons";
|
|
152
|
+
|
|
153
|
+
function ResponsiveIcon() {
|
|
154
|
+
return (
|
|
155
|
+
<Icon
|
|
156
|
+
name="menu"
|
|
157
|
+
size={window.innerWidth < 768 ? 20 : 24}
|
|
158
|
+
className="responsive-icon"
|
|
159
|
+
/>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## 📚 Examples
|
|
165
|
+
|
|
166
|
+
### Navigation Bar
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { Icon } from "@refineui/react-icons";
|
|
170
|
+
|
|
171
|
+
function NavigationBar() {
|
|
172
|
+
return (
|
|
173
|
+
<nav className="navbar">
|
|
174
|
+
<Icon name="menu" size={24} className="nav-icon" />
|
|
175
|
+
<Icon name="search" size={20} className="nav-icon" />
|
|
176
|
+
<Icon name="notification" size={20} className="nav-icon" />
|
|
177
|
+
<Icon name="user" size={20} className="nav-icon" />
|
|
178
|
+
</nav>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Button with Icon
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import { Icon } from "@refineui/react-icons";
|
|
187
|
+
|
|
188
|
+
function IconButton({ iconName, children, onClick }) {
|
|
189
|
+
return (
|
|
190
|
+
<button className="icon-button" onClick={onClick}>
|
|
191
|
+
<Icon name={iconName} size={16} />
|
|
192
|
+
{children}
|
|
193
|
+
</button>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Usage
|
|
198
|
+
<IconButton iconName="download" onClick={handleDownload}>
|
|
199
|
+
Download
|
|
200
|
+
</IconButton>;
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Icon Grid
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
import { Icon } from "@refineui/react-icons";
|
|
207
|
+
|
|
208
|
+
function IconGrid() {
|
|
209
|
+
const icons = ["home", "search", "settings", "user", "mail", "phone"];
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
<div className="icon-grid">
|
|
213
|
+
{icons.map((iconName) => (
|
|
214
|
+
<div key={iconName} className="icon-item">
|
|
215
|
+
<Icon name={iconName} size={24} />
|
|
216
|
+
<span>{iconName}</span>
|
|
217
|
+
</div>
|
|
218
|
+
))}
|
|
219
|
+
</div>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## 🔍 Icon Search
|
|
225
|
+
|
|
226
|
+
### Finding Icons by Name
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
// Search for icons containing "home"
|
|
230
|
+
const homeIcons = ["home", "home-filled", "home-outline"];
|
|
231
|
+
|
|
232
|
+
// Search for icons containing "arrow"
|
|
233
|
+
const arrowIcons = ["arrow-up", "arrow-down", "arrow-left", "arrow-right"];
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Icon Categories
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
const navigationIcons = [
|
|
240
|
+
"home",
|
|
241
|
+
"search",
|
|
242
|
+
"menu",
|
|
243
|
+
"back",
|
|
244
|
+
"forward",
|
|
245
|
+
"up",
|
|
246
|
+
"down",
|
|
247
|
+
"left",
|
|
248
|
+
"right",
|
|
249
|
+
"chevron-up",
|
|
250
|
+
"chevron-down",
|
|
251
|
+
"chevron-left",
|
|
252
|
+
"chevron-right",
|
|
253
|
+
];
|
|
254
|
+
|
|
255
|
+
const actionIcons = [
|
|
256
|
+
"add",
|
|
257
|
+
"edit",
|
|
258
|
+
"delete",
|
|
259
|
+
"save",
|
|
260
|
+
"cancel",
|
|
261
|
+
"refresh",
|
|
262
|
+
"download",
|
|
263
|
+
"upload",
|
|
264
|
+
"copy",
|
|
265
|
+
"cut",
|
|
266
|
+
];
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## 🐛 Troubleshooting
|
|
270
|
+
|
|
271
|
+
### Common Issues
|
|
272
|
+
|
|
273
|
+
1. **Icon not displaying**
|
|
274
|
+
|
|
275
|
+
- Check if the icon name is correct
|
|
276
|
+
- Verify the package is installed
|
|
277
|
+
- Check browser console for errors
|
|
278
|
+
|
|
279
|
+
2. **Styling issues**
|
|
280
|
+
|
|
281
|
+
- Ensure CSS is properly loaded
|
|
282
|
+
- Check for conflicting styles
|
|
283
|
+
- Verify CSS custom properties
|
|
284
|
+
|
|
285
|
+
3. **TypeScript errors**
|
|
286
|
+
- Update to latest version
|
|
287
|
+
- Check type definitions
|
|
288
|
+
- Verify import statements
|
|
289
|
+
|
|
290
|
+
### Getting Help
|
|
291
|
+
|
|
292
|
+
- 📧 Email: support@refineui.com
|
|
293
|
+
- 🐛 Issues: [GitHub Issues](https://github.com/refineui/system-icons/issues)
|
|
294
|
+
- 📖 Documentation: [docs.refineui.com](https://docs.refineui.com)
|
|
295
|
+
- 💬 Community: [Discord](https://discord.gg/refineui)
|
|
296
|
+
|
|
297
|
+
## 📄 License
|
|
298
|
+
|
|
299
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@refineui/react-icons",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "RefineUI System Icons for React",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"src/metadata.json"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "rollup -c && npm run copy-fonts",
|
|
14
|
+
"copy-fonts": "mkdir -p dist/fonts && cp fonts/*.woff2 dist/fonts/ && cp fonts/*.css dist/fonts/",
|
|
15
|
+
"dev": "rollup -c -w",
|
|
16
|
+
"clean": "rimraf dist"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": ">=16.8.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@rollup/plugin-commonjs": "^21.0.0",
|
|
23
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
24
|
+
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
25
|
+
"@types/react": "^18.0.0",
|
|
26
|
+
"rimraf": "^3.0.2",
|
|
27
|
+
"rollup": "^2.60.0",
|
|
28
|
+
"rollup-plugin-typescript2": "^0.31.0",
|
|
29
|
+
"typescript": "^4.5.0"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"react",
|
|
33
|
+
"icons",
|
|
34
|
+
"refineui",
|
|
35
|
+
"system-icons",
|
|
36
|
+
"ui"
|
|
37
|
+
],
|
|
38
|
+
"author": "RefineUI Team",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/refineui/system-icons.git"
|
|
43
|
+
}
|
|
44
|
+
}
|