@primeicons/vue 8.0.0-alpha.4 → 8.0.0-alpha.6

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 +3 -2
package/README.md CHANGED
@@ -172,6 +172,58 @@ Each icon automatically includes these CSS classes:
172
172
  }
173
173
  ```
174
174
 
175
+ ## Metadata & Icon Lookup
176
+
177
+ Icon metadata is managed by the `@primeicons/metadata` package and re-exported here for convenience:
178
+
179
+ ```typescript
180
+ import { ICON_MAP, ICON_MAP_BY_NAME, findIcons } from '@primeicons/metadata/vue';
181
+
182
+ // Find icon by name (kebab-case)
183
+ const iconData = ICON_MAP_BY_NAME['check-circle'];
184
+ const CheckCircle = iconData.component; // Already lazy-loaded component
185
+
186
+ // Search and use
187
+ const results = findIcons('arrow');
188
+ results.forEach((icon) => {
189
+ const Component = icon.component;
190
+ // Use with <component :is="Component" />
191
+ });
192
+ ```
193
+
194
+ Alternatively, import directly from the metadata package:
195
+
196
+ ```typescript
197
+ import { ICON_MAP, findIcons } from '@primeicons/metadata/vue';
198
+ ```
199
+
200
+ ### Metadata API
201
+
202
+ | Variable | Type | Description |
203
+ | ----------------------- | ----------------------------------- | -------------------------- |
204
+ | `ICON_MAP` | `IconMetadataEntry[]` | All icons as array |
205
+ | `ICON_MAP_BY_NAME` | `Record<string, IconMetadataEntry>` | Indexed by kebab-case name |
206
+ | `ICON_MAP_BY_COMPONENT` | `Record<string, IconMetadataEntry>` | Indexed by component name |
207
+ | `ICON_MAP_BY_CAMEL` | `Record<string, IconMetadataEntry>` | Indexed by camelCase name |
208
+ | `TOTAL_ICONS` | `number` | Total icon count |
209
+ | `PACKAGE_INFO` | `object` | Package metadata |
210
+
211
+ | Function | Returns | Description |
212
+ | --------------------- | --------------------- | ----------------------------- |
213
+ | `getIconNames()` | `string[]` | All kebab-case icon names |
214
+ | `getComponentNames()` | `string[]` | All component names |
215
+ | `findIcons(query)` | `IconMetadataEntry[]` | Search icons by partial match |
216
+
217
+ ### JSON Metadata
218
+
219
+ Access the raw JSON metadata directly:
220
+
221
+ ```typescript
222
+ import metadata from '@primeicons/metadata/vue.json';
223
+
224
+ console.log(manifest.icons[0]); // { name: 'address-book', component: 'AddressBook', ... }
225
+ ```
226
+
175
227
  ## Icon List
176
228
 
177
229
  The library includes 300+ icons including:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primeicons/vue",
3
- "version": "8.0.0-alpha.4",
3
+ "version": "8.0.0-alpha.6",
4
4
  "author": "PrimeTek Informatics",
5
5
  "homepage": "https://primeicons.org/",
6
6
  "description": "PrimeIcons for Vue 3 - 300+ customizable SVG icons as Vue 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.6"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "vue": "^3"
@@ -68,6 +68,7 @@
68
68
  "build:package": "pnpm run build:prebuild && vite build",
69
69
  "build:dev:package": "pnpm run build:prebuild && vite build --watch",
70
70
  "build:prebuild": "node ./scripts/prebuild.mjs",
71
+ "build:postbuild": "node ./scripts/postbuild.mjs",
71
72
  "type:check": "tsc --noEmit",
72
73
  "dev:link": "pnpm link --global && npm link"
73
74
  }