@refineui/icon-cdn 0.2.1 → 0.2.2
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 +56 -46
- package/dist/filled-icons.d.ts +270 -270
- package/dist/filled-icons.js +270 -270
- package/dist/index.d.ts +2 -3
- package/dist/index.esm.js +783 -38350
- package/dist/index.js +792 -38356
- package/dist/index.umd.js +792 -38356
- package/dist/regular-icons.d.ts +270 -270
- package/dist/regular-icons.js +270 -270
- package/dist/utils.d.ts +2 -7
- package/dist/utils.js +9 -35
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -5,13 +5,14 @@ A CDN package providing direct URL access to RefineUI System Icons. Perfect for
|
|
|
5
5
|
## 🚀 Features
|
|
6
6
|
|
|
7
7
|
- 🌐 **Direct URL access**: Load icons directly from CDN
|
|
8
|
-
- 📦 **
|
|
9
|
-
- 🎨 **
|
|
8
|
+
- 📦 **5,207+ icons**: Complete icon collection (434 base icons × 2 styles × 6 sizes)
|
|
9
|
+
- 🎨 **SVG format**: High-quality vector icons
|
|
10
10
|
- 🎭 **Two styles**: Regular and filled variants
|
|
11
11
|
- 📱 **Multiple sizes**: 16, 20, 24, 28, 32, 48px variants
|
|
12
|
-
- 🚀 **Fast delivery**: Global CDN distribution
|
|
12
|
+
- 🚀 **Fast delivery**: Global CDN distribution via jsDelivr
|
|
13
13
|
- 💰 **Free to use**: No API keys or authentication required
|
|
14
14
|
- 🔧 **Framework agnostic**: Works with any technology stack
|
|
15
|
+
- ✅ **Real SVG icons**: Actual vector graphics, not placeholders
|
|
15
16
|
|
|
16
17
|
## 📦 Installation
|
|
17
18
|
|
|
@@ -28,22 +29,16 @@ yarn add @refineui/icon-cdn
|
|
|
28
29
|
```html
|
|
29
30
|
<!-- SVG icons -->
|
|
30
31
|
<img
|
|
31
|
-
src="https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
32
|
+
src="https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/24/add-regular.svg"
|
|
32
33
|
alt="Add"
|
|
33
34
|
/>
|
|
34
35
|
<img
|
|
35
|
-
src="https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
36
|
+
src="https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/32/heart-filled.svg"
|
|
36
37
|
alt="Heart"
|
|
37
38
|
/>
|
|
38
|
-
|
|
39
|
-
<!-- PNG icons -->
|
|
40
39
|
<img
|
|
41
|
-
src="https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
42
|
-
alt="Add"
|
|
43
|
-
/>
|
|
44
|
-
<img
|
|
45
|
-
src="https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@latest/icons/32/heart-filled.png"
|
|
46
|
-
alt="Heart"
|
|
40
|
+
src="https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/32/add_square-filled.svg"
|
|
41
|
+
alt="Add Square"
|
|
47
42
|
/>
|
|
48
43
|
```
|
|
49
44
|
|
|
@@ -51,7 +46,7 @@ yarn add @refineui/icon-cdn
|
|
|
51
46
|
|
|
52
47
|
```css
|
|
53
48
|
.add-icon {
|
|
54
|
-
background-image: url("https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
49
|
+
background-image: url("https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/24/add-regular.svg");
|
|
55
50
|
background-size: contain;
|
|
56
51
|
background-repeat: no-repeat;
|
|
57
52
|
width: 24px;
|
|
@@ -59,7 +54,7 @@ yarn add @refineui/icon-cdn
|
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
.heart-icon {
|
|
62
|
-
background-image: url("https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
57
|
+
background-image: url("https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/32/heart-filled.svg");
|
|
63
58
|
background-size: contain;
|
|
64
59
|
background-repeat: no-repeat;
|
|
65
60
|
width: 32px;
|
|
@@ -70,8 +65,8 @@ yarn add @refineui/icon-cdn
|
|
|
70
65
|
### JavaScript Dynamic Loading
|
|
71
66
|
|
|
72
67
|
```javascript
|
|
73
|
-
function loadIcon(iconName, size = 24, style = "regular"
|
|
74
|
-
const url = `https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
68
|
+
function loadIcon(iconName, size = 24, style = "regular") {
|
|
69
|
+
const url = `https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/${size}/${iconName}-${style}.svg`;
|
|
75
70
|
|
|
76
71
|
const img = new Image();
|
|
77
72
|
img.src = url;
|
|
@@ -81,8 +76,10 @@ function loadIcon(iconName, size = 24, style = "regular", format = "svg") {
|
|
|
81
76
|
}
|
|
82
77
|
|
|
83
78
|
// Usage
|
|
84
|
-
const addIcon = loadIcon("add", 24, "regular"
|
|
79
|
+
const addIcon = loadIcon("add", 24, "regular");
|
|
80
|
+
const heartIcon = loadIcon("heart", 32, "filled");
|
|
85
81
|
document.body.appendChild(addIcon);
|
|
82
|
+
document.body.appendChild(heartIcon);
|
|
86
83
|
```
|
|
87
84
|
|
|
88
85
|
## 📚 API Reference
|
|
@@ -90,7 +87,7 @@ document.body.appendChild(addIcon);
|
|
|
90
87
|
### URL Structure
|
|
91
88
|
|
|
92
89
|
```
|
|
93
|
-
https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
90
|
+
https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/{size}/{iconName}-{style}.svg
|
|
94
91
|
```
|
|
95
92
|
|
|
96
93
|
### Parameters
|
|
@@ -98,14 +95,12 @@ https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@latest/icons/{size}/{iconName}-{
|
|
|
98
95
|
| Parameter | Type | Description | Examples |
|
|
99
96
|
| ---------- | ------ | ----------------------- | ---------------------- |
|
|
100
97
|
| `size` | number | Icon size in pixels | 16, 20, 24, 28, 32, 48 |
|
|
101
|
-
| `iconName` | string | Icon name in snake_case | add, heart,
|
|
98
|
+
| `iconName` | string | Icon name in snake_case | add, heart, add_square |
|
|
102
99
|
| `style` | string | Icon style variant | regular, filled |
|
|
103
|
-
| `format` | string | File format | svg, png |
|
|
104
100
|
|
|
105
101
|
### Available Formats
|
|
106
102
|
|
|
107
|
-
- **SVG**: Vector format, scalable, best quality
|
|
108
|
-
- **PNG**: Raster format, fixed size, good for web
|
|
103
|
+
- **SVG**: Vector format, scalable, best quality (only format available)
|
|
109
104
|
|
|
110
105
|
### Icon Naming Convention
|
|
111
106
|
|
|
@@ -115,11 +110,12 @@ Icons follow a consistent naming pattern:
|
|
|
115
110
|
- **Examples**:
|
|
116
111
|
- `add-regular`
|
|
117
112
|
- `heart-filled`
|
|
118
|
-
- `
|
|
113
|
+
- `add_square-filled`
|
|
114
|
+
- `access_time-regular`
|
|
119
115
|
|
|
120
116
|
## 🎨 Available Icons
|
|
121
117
|
|
|
122
|
-
**All
|
|
118
|
+
**All 5,207+ icons are supported!** (434 base icons × 2 styles × 6 sizes)
|
|
123
119
|
|
|
124
120
|
### Key Icon Categories:
|
|
125
121
|
|
|
@@ -150,29 +146,29 @@ The package includes icons for every use case:
|
|
|
150
146
|
### URL Generation
|
|
151
147
|
|
|
152
148
|
```javascript
|
|
153
|
-
import {
|
|
149
|
+
import { generateCDNUrl, generateIconFileName } from "@refineui/icon-cdn";
|
|
154
150
|
|
|
155
151
|
// Generate icon URL
|
|
156
|
-
const iconUrl =
|
|
157
|
-
// Returns: "https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@
|
|
152
|
+
const iconUrl = generateCDNUrl("add", 24, "regular");
|
|
153
|
+
// Returns: "https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/24/add-regular.svg"
|
|
158
154
|
|
|
159
155
|
// Generate filename
|
|
160
|
-
const fileName = generateIconFileName("heart", "filled"
|
|
161
|
-
// Returns: "heart-filled.
|
|
156
|
+
const fileName = generateIconFileName("heart", "filled");
|
|
157
|
+
// Returns: "heart-filled.svg"
|
|
162
158
|
```
|
|
163
159
|
|
|
164
160
|
### Icon Validation
|
|
165
161
|
|
|
166
162
|
```javascript
|
|
167
|
-
import {
|
|
163
|
+
import { getIconInfo, searchIcons } from "@refineui/icon-cdn";
|
|
168
164
|
|
|
169
|
-
//
|
|
170
|
-
const
|
|
171
|
-
// Returns:
|
|
165
|
+
// Get icon information
|
|
166
|
+
const iconInfo = getIconInfo("add", 24, "regular");
|
|
167
|
+
// Returns: { name: "add", size: 24, style: "regular", url: "...", fileName: "add-regular.svg" }
|
|
172
168
|
|
|
173
|
-
//
|
|
174
|
-
const
|
|
175
|
-
// Returns: array of
|
|
169
|
+
// Search for icons
|
|
170
|
+
const searchResults = searchIcons("heart");
|
|
171
|
+
// Returns: array of matching icon info objects
|
|
176
172
|
```
|
|
177
173
|
|
|
178
174
|
## 📱 Examples
|
|
@@ -203,7 +199,7 @@ function createIconGallery(icons, size = 24, style = "regular") {
|
|
|
203
199
|
`;
|
|
204
200
|
|
|
205
201
|
const icon = document.createElement("img");
|
|
206
|
-
icon.src =
|
|
202
|
+
icon.src = `https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/${size}/${iconName}-${style}.svg`;
|
|
207
203
|
icon.alt = iconName;
|
|
208
204
|
icon.style.width = `${size}px`;
|
|
209
205
|
icon.style.height = `${size}px`;
|
|
@@ -239,7 +235,7 @@ document.body.appendChild(gallery);
|
|
|
239
235
|
```javascript
|
|
240
236
|
function loadIconAsync(iconName, size = 24, style = "regular") {
|
|
241
237
|
return new Promise((resolve, reject) => {
|
|
242
|
-
const url =
|
|
238
|
+
const url = `https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/${size}/${iconName}-${style}.svg`;
|
|
243
239
|
|
|
244
240
|
fetch(url)
|
|
245
241
|
.then((response) => {
|
|
@@ -285,7 +281,7 @@ function preloadIcons(iconNames, size = 24, style = "regular") {
|
|
|
285
281
|
const img = new Image();
|
|
286
282
|
img.onload = () => resolve(iconName);
|
|
287
283
|
img.onerror = () => resolve(iconName); // Continue even if some fail
|
|
288
|
-
img.src =
|
|
284
|
+
img.src = `https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/${size}/${iconName}-${style}.svg`;
|
|
289
285
|
});
|
|
290
286
|
});
|
|
291
287
|
|
|
@@ -317,7 +313,7 @@ criticalIcons.forEach((iconName) => {
|
|
|
317
313
|
const link = document.createElement("link");
|
|
318
314
|
link.rel = "preload";
|
|
319
315
|
link.as = "image";
|
|
320
|
-
link.href =
|
|
316
|
+
link.href = `https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/24/${iconName}-regular.svg`;
|
|
321
317
|
document.head.appendChild(link);
|
|
322
318
|
});
|
|
323
319
|
|
|
@@ -327,7 +323,7 @@ function lazyLoadIcon(iconName, container) {
|
|
|
327
323
|
entries.forEach((entry) => {
|
|
328
324
|
if (entry.isIntersecting) {
|
|
329
325
|
const icon = document.createElement("img");
|
|
330
|
-
icon.src =
|
|
326
|
+
icon.src = `https://cdn.jsdelivr.net/npm/@refineui/icon-cdn@0.2.1/icons/24/${iconName}-regular.svg`;
|
|
331
327
|
icon.alt = iconName;
|
|
332
328
|
entry.target.appendChild(icon);
|
|
333
329
|
observer.unobserve(entry.target);
|
|
@@ -368,13 +364,27 @@ MIT License - see [LICENSE](../../LICENSE) for details.
|
|
|
368
364
|
- [`@refineui/react-icons`](../react-icons) - React icon components
|
|
369
365
|
- [`@refineui/react-native-icons`](../react-native-icons) - React Native icon components
|
|
370
366
|
- [`@refineui/web-icons`](../web-icons) - Web icon library for non-React projects
|
|
367
|
+
- [`refineui_system_icons`](../../flutter) - Flutter icon package
|
|
371
368
|
|
|
372
369
|
## 🆘 Support
|
|
373
370
|
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
|
|
371
|
+
- 🐛 Issues: [GitHub Issues](https://github.com/pelagornis/refineui-system-icons/issues)
|
|
372
|
+
- 📖 Documentation: [GitHub Repository](https://github.com/pelagornis/refineui-system-icons)
|
|
373
|
+
- 💬 Community: [GitHub Discussions](https://github.com/pelagornis/refineui-system-icons/discussions)
|
|
374
|
+
|
|
375
|
+
## 📝 Changelog
|
|
376
|
+
|
|
377
|
+
### v0.2.1 (Latest)
|
|
378
|
+
|
|
379
|
+
- ✅ Fixed: Real SVG icons instead of text placeholders
|
|
380
|
+
- ✅ Updated: All 5,207+ icons now properly generated from source assets
|
|
381
|
+
- ✅ Improved: Build process now copies actual SVG files from assets directory
|
|
382
|
+
|
|
383
|
+
### v0.2.0
|
|
384
|
+
|
|
385
|
+
- 🎉 Initial release with CDN functionality
|
|
386
|
+
- 📦 5,207+ icons across 6 sizes and 2 styles
|
|
387
|
+
- 🌐 Global CDN distribution via jsDelivr
|
|
378
388
|
|
|
379
389
|
---
|
|
380
390
|
|