@primeicons/metadata 8.0.0-alpha.10

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 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,144 @@
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
+ # or
12
+ pnpm add @primeicons/metadata
13
+ # or
14
+ yarn add @primeicons/metadata
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Import metadata for your specific framework:
20
+
21
+ ```typescript
22
+ // React
23
+ import { ICON_MAP, findIcons } from '@primeicons/metadata/react';
24
+
25
+ // Vue
26
+ import { ICON_MAP } from '@primeicons/metadata/vue';
27
+
28
+ // Angular
29
+ import { ICON_MAP } from '@primeicons/metadata/angular';
30
+
31
+ // Svelte
32
+ import { ICON_MAP } from '@primeicons/metadata/svelte';
33
+
34
+ // Solid
35
+ import { ICON_MAP } from '@primeicons/metadata/solid';
36
+
37
+ // Lit
38
+ import { ICON_MAP } from '@primeicons/metadata/lit';
39
+ ```
40
+
41
+ ## Features
42
+
43
+ - ✅ Framework-specific metadata exports
44
+ - ✅ Optional peer dependencies (no error if framework not installed)
45
+ - ✅ CJS and ESM support
46
+ - ✅ Full TypeScript support
47
+ - ✅ Tree-shakeable
48
+
49
+ ## Metadata API
50
+
51
+ All framework exports include:
52
+
53
+ | Export | Type | Description |
54
+ | ----------------------- | ----------------------------------- | -------------------------- |
55
+ | `ICON_MAP` | `IconMetadataEntry[]` | All icons as array |
56
+ | `ICON_MAP_BY_NAME` | `Record<string, IconMetadataEntry>` | Indexed by kebab-case name |
57
+ | `ICON_MAP_BY_COMPONENT` | `Record<string, IconMetadataEntry>` | Indexed by component name |
58
+ | `ICON_MAP_BY_CAMEL` | `Record<string, IconMetadataEntry>` | Indexed by camelCase name |
59
+ | `TOTAL_ICONS` | `number` | Total icon count |
60
+ | `PACKAGE_INFO` | `object` | Package metadata |
61
+ | `getIconNames()` | `function` | Get all icon names |
62
+ | `getComponentNames()` | `function` | Get all component names |
63
+ | `findIcons()` | `function` | Search icons |
64
+
65
+ ## Metadata Entry Structure
66
+
67
+ Each icon in the metadata is represented by an `IconMetadataEntry`:
68
+
69
+ ```typescript
70
+ interface IconMetadataEntry {
71
+ /** Kebab-case icon name (e.g., 'check-circle') */
72
+ name: string;
73
+
74
+ /** camelCase version (e.g., 'checkCircle') */
75
+ camelName: string;
76
+
77
+ /** PascalCase component name (e.g., 'CheckCircle') */
78
+ as: string;
79
+
80
+ /** Lazy-loaded component reference (framework-specific) */
81
+ component: () => any;
82
+
83
+ /** Import path for the icon (e.g., '@primeicons/react/check-circle') */
84
+ from: string;
85
+
86
+ /** Searchable tags from selection.json */
87
+ tags: string[];
88
+ }
89
+ ```
90
+
91
+ ## JSON Metadata
92
+
93
+ Access the raw metadata JSON directly:
94
+
95
+ ```typescript
96
+ // React example
97
+ import metadata from '@primeicons/metadata/react.json';
98
+
99
+ console.log(metadata[0]);
100
+ // {
101
+ // name: 'address-book',
102
+ // camelName: 'addressBook',
103
+ // as: 'AddressBook',
104
+ // from: '@primeicons/react/address-book',
105
+ // tags: ['address-book', 'contacts', 'directory', 'information', 'numbers']
106
+ // }
107
+ ```
108
+
109
+ ## Usage Examples
110
+
111
+ ### Find icons by name
112
+
113
+ ```typescript
114
+ import { ICON_MAP_BY_NAME } from '@primeicons/metadata/react';
115
+
116
+ const icon = ICON_MAP_BY_NAME['check-circle'];
117
+ // {
118
+ // name: 'check-circle',
119
+ // camelName: 'checkCircle',
120
+ // component: lazy(() => import(...)),
121
+ // ...
122
+ // }
123
+ ```
124
+
125
+ ### Search icons by tag
126
+
127
+ ```typescript
128
+ import { ICON_MAP } from '@primeicons/metadata/react';
129
+
130
+ const arrowIcons = ICON_MAP.filter((icon) => icon.tags.some((tag) => tag.includes('arrow')));
131
+ ```
132
+
133
+ ### Get all icon names
134
+
135
+ ```typescript
136
+ import { getIconNames } from '@primeicons/metadata/react';
137
+
138
+ const names = getIconNames();
139
+ // ['address-book', 'align-center', 'align-justify', ...]
140
+ ```
141
+
142
+ ## License
143
+
144
+ MIT - Copyright (c) PrimeTek Informatics