@primeicons/lit 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.
- package/README.md +55 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -247,6 +247,61 @@ Each icon element includes these CSS classes:
|
|
|
247
247
|
- `p-icon` - Base class for all icons
|
|
248
248
|
- `p-icon-{name}` - Specific class for each icon (e.g., `p-icon-search`)
|
|
249
249
|
|
|
250
|
+
## Metadata & Icon Lookup
|
|
251
|
+
|
|
252
|
+
Icon metadata is managed by the `@primeicons/metadata` package and re-exported here for convenience:
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
import { ICON_MAP, ICON_MAP_BY_NAME, findIcons } from '@primeicons/metadata/lit';
|
|
256
|
+
|
|
257
|
+
// Find icon by name (kebab-case)
|
|
258
|
+
const iconData = ICON_MAP_BY_NAME['check'];
|
|
259
|
+
|
|
260
|
+
// Web components use pi-{name} tag names
|
|
261
|
+
const tagName = `pi-${iconData.name}`; // 'pi-check'
|
|
262
|
+
|
|
263
|
+
// Search and use
|
|
264
|
+
const results = findIcons('arrow');
|
|
265
|
+
results.forEach((icon) => {
|
|
266
|
+
const element = document.createElement(`pi-${icon.name}`);
|
|
267
|
+
element.size = 24;
|
|
268
|
+
// Use element...
|
|
269
|
+
});
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Alternatively, import directly from the metadata package:
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
import { ICON_MAP, findIcons } from '@primeicons/metadata/lit';
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Metadata API
|
|
279
|
+
|
|
280
|
+
| Variable | Type | Description |
|
|
281
|
+
| ----------------------- | ----------------------------------- | -------------------------- |
|
|
282
|
+
| `ICON_MAP` | `IconMetadataEntry[]` | All icons as array |
|
|
283
|
+
| `ICON_MAP_BY_NAME` | `Record<string, IconMetadataEntry>` | Indexed by kebab-case name |
|
|
284
|
+
| `ICON_MAP_BY_COMPONENT` | `Record<string, IconMetadataEntry>` | Indexed by component name |
|
|
285
|
+
| `ICON_MAP_BY_CAMEL` | `Record<string, IconMetadataEntry>` | Indexed by camelCase name |
|
|
286
|
+
| `TOTAL_ICONS` | `number` | Total icon count |
|
|
287
|
+
| `PACKAGE_INFO` | `object` | Package metadata |
|
|
288
|
+
|
|
289
|
+
| Function | Returns | Description |
|
|
290
|
+
| --------------------- | --------------------- | ----------------------------- |
|
|
291
|
+
| `getIconNames()` | `string[]` | All kebab-case icon names |
|
|
292
|
+
| `getComponentNames()` | `string[]` | All component names |
|
|
293
|
+
| `findIcons(query)` | `IconMetadataEntry[]` | Search icons by partial match |
|
|
294
|
+
|
|
295
|
+
### JSON Metadata
|
|
296
|
+
|
|
297
|
+
Access the raw JSON metadata directly:
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
import metadata from '@primeicons/metadata/lit.json';
|
|
301
|
+
|
|
302
|
+
console.log(manifest.icons[0]); // { name: 'address-book', component: 'AddressBook', ... }
|
|
303
|
+
```
|
|
304
|
+
|
|
250
305
|
## Icon List
|
|
251
306
|
|
|
252
307
|
The library includes 300+ icons including:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primeicons/lit",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.5",
|
|
4
4
|
"author": "PrimeTek Informatics",
|
|
5
5
|
"homepage": "https://primeicons.org/",
|
|
6
6
|
"description": "PrimeIcons for Lit - 300+ customizable SVG icons as Lit web components",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"LICENSE"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@primeicons/core": "8.0.0-alpha.
|
|
56
|
+
"@primeicons/core": "8.0.0-alpha.5"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"lit": ">=2"
|