@dava96/osrs-icons 1.0.13 → 1.0.14
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 +27 -4
- package/dist/cjs/generated/meta.d.ts +2 -0
- package/dist/cjs/generated/meta.js +17421 -0
- package/dist/cjs/index.d.ts +30 -0
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/index_test.d.ts +1 -0
- package/dist/cjs/index_test.js +110 -0
- package/dist/esm/generated/meta.d.ts +2 -0
- package/dist/esm/generated/meta.js +17418 -0
- package/dist/esm/index.d.ts +30 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index_test.d.ts +1 -0
- package/dist/esm/index_test.js +105 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,14 +30,37 @@ function MyComponent() {
|
|
|
30
30
|
|
|
31
31
|
Each export is a fully formed CSS cursor value (e.g. `url('data:image/png;base64,...'), auto`).
|
|
32
32
|
|
|
33
|
-
###
|
|
33
|
+
### As an Image
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Use the `toDataUrl` helper to extract the raw data URL for use outside of CSS:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { abyssalWhip, dragonScimitar, toDataUrl } from '@dava96/osrs-icons';
|
|
39
|
+
|
|
40
|
+
// Single icon
|
|
41
|
+
<img src={toDataUrl(abyssalWhip)} alt="Abyssal Whip" />
|
|
42
|
+
|
|
43
|
+
// Multiple icons at once
|
|
44
|
+
const urls = toDataUrl({
|
|
45
|
+
whip: abyssalWhip,
|
|
46
|
+
sword: dragonScimitar,
|
|
47
|
+
});
|
|
48
|
+
// urls.whip → "data:image/png;base64,..."
|
|
49
|
+
// urls.sword → "data:image/png;base64,..."
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Icon Discovery
|
|
53
|
+
|
|
54
|
+
Browse all available icons programmatically with `iconNames`, or restrict values to valid names with the `IconName` type:
|
|
36
55
|
|
|
37
56
|
```ts
|
|
38
|
-
import {
|
|
57
|
+
import { iconNames, type IconName } from '@dava96/osrs-icons';
|
|
58
|
+
|
|
59
|
+
// Search / autocomplete
|
|
60
|
+
const results = iconNames.filter(name => name.includes('dragon'));
|
|
39
61
|
|
|
40
|
-
|
|
62
|
+
// Type-safe icon references
|
|
63
|
+
function setCustomCursor(name: IconName) { /* ... */ }
|
|
41
64
|
```
|
|
42
65
|
|
|
43
66
|
### CDN Usage (No Build Step)
|