@primeicons/metadata 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/LICENSE +21 -0
- package/README.md +140 -0
- package/dist/angular.json +3980 -0
- package/dist/cjs/angular/index.js +2 -0
- package/dist/cjs/angular/index.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lit/index.js +2 -0
- package/dist/cjs/lit/index.js.map +1 -0
- package/dist/cjs/react/index.js +2 -0
- package/dist/cjs/react/index.js.map +1 -0
- package/dist/cjs/solid/index.js +2 -0
- package/dist/cjs/solid/index.js.map +1 -0
- package/dist/cjs/svelte/index.js +2 -0
- package/dist/cjs/svelte/index.js.map +1 -0
- package/dist/cjs/vue/index.js +2 -0
- package/dist/cjs/vue/index.js.map +1 -0
- package/dist/esm/angular/index.mjs +2 -0
- package/dist/esm/angular/index.mjs.map +1 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/lit/index.mjs +2 -0
- package/dist/esm/lit/index.mjs.map +1 -0
- package/dist/esm/react/index.mjs +2 -0
- package/dist/esm/react/index.mjs.map +1 -0
- package/dist/esm/solid/index.mjs +2 -0
- package/dist/esm/solid/index.mjs.map +1 -0
- package/dist/esm/svelte/index.mjs +2 -0
- package/dist/esm/svelte/index.mjs.map +1 -0
- package/dist/esm/vue/index.mjs +2 -0
- package/dist/esm/vue/index.mjs.map +1 -0
- package/dist/lib/index.d.ts +12 -0
- package/dist/lit.json +3980 -0
- package/dist/react.json +3980 -0
- package/dist/solid.json +3980 -0
- package/dist/svelte.json +3980 -0
- package/dist/vue.json +3980 -0
- package/package.json +96 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PrimeTek Informatics
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# @primeicons/metadata
|
|
2
|
+
|
|
3
|
+
Central metadata exports for all PrimeIcons frameworks.
|
|
4
|
+
|
|
5
|
+
This package provides unified icon metadata and lazy-loaded component references for all framework integrations, allowing you to access icon metadata without directly depending on individual framework packages.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @primeicons/metadata
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Import metadata for your specific framework:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
// React
|
|
19
|
+
import { ICON_MAP, findIcons } from '@primeicons/metadata/react';
|
|
20
|
+
|
|
21
|
+
// Vue
|
|
22
|
+
import { ICON_MAP } from '@primeicons/metadata/vue';
|
|
23
|
+
|
|
24
|
+
// Angular
|
|
25
|
+
import { ICON_MAP } from '@primeicons/metadata/angular';
|
|
26
|
+
|
|
27
|
+
// Svelte
|
|
28
|
+
import { ICON_MAP } from '@primeicons/metadata/svelte';
|
|
29
|
+
|
|
30
|
+
// Solid
|
|
31
|
+
import { ICON_MAP } from '@primeicons/metadata/solid';
|
|
32
|
+
|
|
33
|
+
// Lit
|
|
34
|
+
import { ICON_MAP } from '@primeicons/metadata/lit';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- ✅ Framework-specific metadata exports
|
|
40
|
+
- ✅ Optional peer dependencies (no error if framework not installed)
|
|
41
|
+
- ✅ CJS and ESM support
|
|
42
|
+
- ✅ Full TypeScript support
|
|
43
|
+
- ✅ Tree-shakeable
|
|
44
|
+
|
|
45
|
+
## Metadata API
|
|
46
|
+
|
|
47
|
+
All framework exports include:
|
|
48
|
+
|
|
49
|
+
| Export | Type | Description |
|
|
50
|
+
| ----------------------- | ----------------------------------- | -------------------------- |
|
|
51
|
+
| `ICON_MAP` | `IconMetadataEntry[]` | All icons as array |
|
|
52
|
+
| `ICON_MAP_BY_NAME` | `Record<string, IconMetadataEntry>` | Indexed by kebab-case name |
|
|
53
|
+
| `ICON_MAP_BY_COMPONENT` | `Record<string, IconMetadataEntry>` | Indexed by component name |
|
|
54
|
+
| `ICON_MAP_BY_CAMEL` | `Record<string, IconMetadataEntry>` | Indexed by camelCase name |
|
|
55
|
+
| `TOTAL_ICONS` | `number` | Total icon count |
|
|
56
|
+
| `PACKAGE_INFO` | `object` | Package metadata |
|
|
57
|
+
| `getIconNames()` | `function` | Get all icon names |
|
|
58
|
+
| `getComponentNames()` | `function` | Get all component names |
|
|
59
|
+
| `findIcons()` | `function` | Search icons |
|
|
60
|
+
|
|
61
|
+
## Metadata Entry Structure
|
|
62
|
+
|
|
63
|
+
Each icon in the metadata is represented by an `IconMetadataEntry`:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
interface IconMetadataEntry {
|
|
67
|
+
/** Kebab-case icon name (e.g., 'check-circle') */
|
|
68
|
+
name: string;
|
|
69
|
+
|
|
70
|
+
/** camelCase version (e.g., 'checkCircle') */
|
|
71
|
+
camelName: string;
|
|
72
|
+
|
|
73
|
+
/** PascalCase component name (e.g., 'CheckCircle') */
|
|
74
|
+
as: string;
|
|
75
|
+
|
|
76
|
+
/** Lazy-loaded component reference (framework-specific) */
|
|
77
|
+
component: () => any;
|
|
78
|
+
|
|
79
|
+
/** Import path for the icon (e.g., '@primeicons/react/check-circle') */
|
|
80
|
+
from: string;
|
|
81
|
+
|
|
82
|
+
/** Searchable tags from selection.json */
|
|
83
|
+
tags: string[];
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## JSON Metadata
|
|
88
|
+
|
|
89
|
+
Access the raw metadata JSON directly:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// React example
|
|
93
|
+
import metadata from '@primeicons/metadata/react.json';
|
|
94
|
+
|
|
95
|
+
console.log(metadata[0]);
|
|
96
|
+
// {
|
|
97
|
+
// name: 'address-book',
|
|
98
|
+
// camelName: 'addressBook',
|
|
99
|
+
// as: 'AddressBook',
|
|
100
|
+
// from: '@primeicons/react/address-book',
|
|
101
|
+
// tags: ['address-book', 'contacts', 'directory', 'information', 'numbers']
|
|
102
|
+
// }
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Usage Examples
|
|
106
|
+
|
|
107
|
+
### Find icons by name
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
import { ICON_MAP_BY_NAME } from '@primeicons/metadata/react';
|
|
111
|
+
|
|
112
|
+
const icon = ICON_MAP_BY_NAME['check-circle'];
|
|
113
|
+
// {
|
|
114
|
+
// name: 'check-circle',
|
|
115
|
+
// camelName: 'checkCircle',
|
|
116
|
+
// component: lazy(() => import(...)),
|
|
117
|
+
// ...
|
|
118
|
+
// }
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Search icons by tag
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import { ICON_MAP } from '@primeicons/metadata/react';
|
|
125
|
+
|
|
126
|
+
const arrowIcons = ICON_MAP.filter((icon) => icon.tags.some((tag) => tag.includes('arrow')));
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Get all icon names
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import { getIconNames } from '@primeicons/metadata/react';
|
|
133
|
+
|
|
134
|
+
const names = getIconNames();
|
|
135
|
+
// ['address-book', 'align-center', 'align-justify', ...]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT - Copyright (c) PrimeTek Informatics
|