@primeicons/svelte 8.0.0-alpha.4 → 8.0.0-alpha.5

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.
Files changed (2) hide show
  1. package/README.md +52 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -206,6 +206,58 @@ Each icon automatically includes these CSS classes:
206
206
  </style>
207
207
  ```
208
208
 
209
+ ## Metadata & Icon Lookup
210
+
211
+ Icon metadata is managed by the `@primeicons/metadata` package and re-exported here for convenience:
212
+
213
+ ```typescript
214
+ import { ICON_MAP, ICON_MAP_BY_NAME, findIcons } from '@primeicons/metadata/svelte';
215
+
216
+ // Find icon by name (kebab-case)
217
+ const iconData = ICON_MAP_BY_NAME['check-circle'];
218
+ const CheckCircle = iconData.component; // Already lazy-loaded component
219
+
220
+ // Search and use
221
+ const results = findIcons('arrow');
222
+ results.forEach((icon) => {
223
+ const Component = icon.component;
224
+ // Use with <svelte:component this={Component} />
225
+ });
226
+ ```
227
+
228
+ Alternatively, import directly from the metadata package:
229
+
230
+ ```typescript
231
+ import { ICON_MAP, findIcons } from '@primeicons/metadata/svelte';
232
+ ```
233
+
234
+ ### Metadata API
235
+
236
+ | Variable | Type | Description |
237
+ | ----------------------- | ----------------------------------- | -------------------------- |
238
+ | `ICON_MAP` | `IconMetadataEntry[]` | All icons as array |
239
+ | `ICON_MAP_BY_NAME` | `Record<string, IconMetadataEntry>` | Indexed by kebab-case name |
240
+ | `ICON_MAP_BY_COMPONENT` | `Record<string, IconMetadataEntry>` | Indexed by component name |
241
+ | `ICON_MAP_BY_CAMEL` | `Record<string, IconMetadataEntry>` | Indexed by camelCase name |
242
+ | `TOTAL_ICONS` | `number` | Total icon count |
243
+ | `PACKAGE_INFO` | `object` | Package metadata |
244
+
245
+ | Function | Returns | Description |
246
+ | --------------------- | --------------------- | ----------------------------- |
247
+ | `getIconNames()` | `string[]` | All kebab-case icon names |
248
+ | `getComponentNames()` | `string[]` | All component names |
249
+ | `findIcons(query)` | `IconMetadataEntry[]` | Search icons by partial match |
250
+
251
+ ### JSON Metadata
252
+
253
+ Access the raw JSON metadata directly:
254
+
255
+ ```typescript
256
+ import metadata from '@primeicons/metadata/svelte.json';
257
+
258
+ console.log(manifest.icons[0]); // { name: 'address-book', component: 'AddressBook', ... }
259
+ ```
260
+
209
261
  ## Icon List
210
262
 
211
263
  The library includes 300+ icons including:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primeicons/svelte",
3
- "version": "8.0.0-alpha.4",
3
+ "version": "8.0.0-alpha.5",
4
4
  "author": "PrimeTek Informatics",
5
5
  "homepage": "https://primeicons.org/",
6
6
  "description": "PrimeIcons for Svelte - 300+ customizable SVG icons as Svelte components",
@@ -54,7 +54,7 @@
54
54
  ],
55
55
  "dependencies": {
56
56
  "@primeuix/utils": "^0.6.4",
57
- "@primeicons/core": "8.0.0-alpha.4"
57
+ "@primeicons/core": "8.0.0-alpha.5"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "svelte": "^5"