@nice2dev/icons 1.3.15 → 1.3.16

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 (140) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/NiceDesktopIconExporter.js +688 -599
  3. package/dist/cjs/NiceFaviconGenerator.js +603 -417
  4. package/dist/cjs/NiceIconPicker.js +788 -508
  5. package/dist/cjs/NiceIconPreview.js +246 -188
  6. package/dist/cjs/NiceIconSetCreator.js +683 -552
  7. package/dist/cjs/NiceIconStacker.js +547 -171
  8. package/dist/cjs/NiceIconValue.js +27 -35
  9. package/dist/cjs/NtdIconBadge.js +384 -360
  10. package/dist/cjs/NtdIconMorph.js +419 -354
  11. package/dist/cjs/NtdStateMorph.js +150 -147
  12. package/dist/cjs/advancedIconSearch.js +373 -510
  13. package/dist/cjs/animationControls.js +518 -642
  14. package/dist/cjs/client.js +12 -15
  15. package/dist/cjs/createIcon.js +349 -251
  16. package/dist/cjs/design-tokens.js +324 -390
  17. package/dist/cjs/figmaExport.js +162 -257
  18. package/dist/cjs/figmaSync.js +234 -316
  19. package/dist/cjs/headless-ui.js +240 -368
  20. package/dist/cjs/iconAnalytics.js +337 -393
  21. package/dist/cjs/iconHtml.js +64 -86
  22. package/dist/cjs/iconMetadata.js +392 -472
  23. package/dist/cjs/iconParts.js +120 -90
  24. package/dist/cjs/iconStack.js +136 -155
  25. package/dist/cjs/iconStyles.js +1609 -504
  26. package/dist/cjs/iconValue.js +359 -430
  27. package/dist/cjs/icons/accessibility.js +1119 -134
  28. package/dist/cjs/icons/actions.js +1290 -330
  29. package/dist/cjs/icons/ai.js +1424 -144
  30. package/dist/cjs/icons/brand.js +1344 -172
  31. package/dist/cjs/icons/business.js +903 -193
  32. package/dist/cjs/icons/devtech.js +1656 -227
  33. package/dist/cjs/icons/ecommerce.js +802 -111
  34. package/dist/cjs/icons/education.js +1345 -199
  35. package/dist/cjs/icons/files.js +1597 -328
  36. package/dist/cjs/icons/fintech.js +793 -104
  37. package/dist/cjs/icons/food.js +1507 -153
  38. package/dist/cjs/icons/fun.js +786 -109
  39. package/dist/cjs/icons/gaming.js +916 -170
  40. package/dist/cjs/icons/health.js +623 -112
  41. package/dist/cjs/icons/index.js +32 -35
  42. package/dist/cjs/icons/input.js +282 -83
  43. package/dist/cjs/icons/legal.js +1065 -122
  44. package/dist/cjs/icons/media.js +1061 -267
  45. package/dist/cjs/icons/navigation.js +387 -122
  46. package/dist/cjs/icons/omniverk.js +747 -90
  47. package/dist/cjs/icons/realestate.js +1520 -193
  48. package/dist/cjs/icons/saas.js +867 -98
  49. package/dist/cjs/icons/science.js +1451 -202
  50. package/dist/cjs/icons/shapes.js +1316 -308
  51. package/dist/cjs/icons/smarthome.js +786 -90
  52. package/dist/cjs/icons/social.js +591 -59
  53. package/dist/cjs/icons/sports.js +1225 -133
  54. package/dist/cjs/icons/sustainability.js +1211 -139
  55. package/dist/cjs/icons/travel.js +1470 -148
  56. package/dist/cjs/icons/ui.js +1508 -315
  57. package/dist/cjs/icons/weather.js +1160 -173
  58. package/dist/cjs/index.js +566 -568
  59. package/dist/cjs/lottieIntegration.js +261 -266
  60. package/dist/cjs/nicetodev-icons.css +1 -1
  61. package/dist/cjs/particleEffects.js +270 -251
  62. package/dist/cjs/resolver.js +229 -284
  63. package/dist/cjs/rsc.js +175 -193
  64. package/dist/cjs/sharpen.js +73 -130
  65. package/dist/cjs/smilAnimations.js +371 -165
  66. package/dist/cjs/stacking.js +87 -122
  67. package/dist/cjs/tailwind-plugin.js +280 -320
  68. package/dist/cjs/types.js +46 -72
  69. package/dist/cjs/utilities.js +163 -324
  70. package/dist/cjs/variantProps.js +12 -52
  71. package/dist/esm/NiceDesktopIconExporter.js +671 -598
  72. package/dist/esm/NiceFaviconGenerator.js +583 -416
  73. package/dist/esm/NiceIconPicker.js +789 -507
  74. package/dist/esm/NiceIconPreview.js +247 -187
  75. package/dist/esm/NiceIconSetCreator.js +685 -551
  76. package/dist/esm/NiceIconStacker.js +549 -170
  77. package/dist/esm/NiceIconValue.js +29 -34
  78. package/dist/esm/NtdIconBadge.js +388 -359
  79. package/dist/esm/NtdIconMorph.js +423 -353
  80. package/dist/esm/NtdStateMorph.js +152 -146
  81. package/dist/esm/advancedIconSearch.js +391 -509
  82. package/dist/esm/animationControls.js +527 -641
  83. package/dist/esm/client.js +48 -10
  84. package/dist/esm/createIcon.js +350 -250
  85. package/dist/esm/design-tokens.js +334 -387
  86. package/dist/esm/figmaExport.js +170 -256
  87. package/dist/esm/figmaSync.js +237 -315
  88. package/dist/esm/headless-ui.js +254 -365
  89. package/dist/esm/iconAnalytics.js +342 -392
  90. package/dist/esm/iconHtml.js +67 -85
  91. package/dist/esm/iconMetadata.js +404 -471
  92. package/dist/esm/iconParts.js +125 -89
  93. package/dist/esm/iconStack.js +145 -154
  94. package/dist/esm/iconStyles.js +1620 -503
  95. package/dist/esm/iconValue.js +361 -429
  96. package/dist/esm/icons/accessibility.js +1133 -133
  97. package/dist/esm/icons/actions.js +1320 -329
  98. package/dist/esm/icons/ai.js +1441 -143
  99. package/dist/esm/icons/brand.js +1351 -171
  100. package/dist/esm/icons/business.js +931 -201
  101. package/dist/esm/icons/devtech.js +1687 -226
  102. package/dist/esm/icons/ecommerce.js +816 -110
  103. package/dist/esm/icons/education.js +1364 -198
  104. package/dist/esm/icons/files.js +1628 -327
  105. package/dist/esm/icons/fintech.js +807 -103
  106. package/dist/esm/icons/food.js +1524 -152
  107. package/dist/esm/icons/fun.js +801 -108
  108. package/dist/esm/icons/gaming.js +933 -169
  109. package/dist/esm/icons/health.js +636 -111
  110. package/dist/esm/icons/index.js +596 -32
  111. package/dist/esm/icons/input.js +326 -82
  112. package/dist/esm/icons/legal.js +1079 -121
  113. package/dist/esm/icons/media.js +1086 -266
  114. package/dist/esm/icons/navigation.js +401 -121
  115. package/dist/esm/icons/omniverk.js +759 -89
  116. package/dist/esm/icons/realestate.js +1544 -198
  117. package/dist/esm/icons/saas.js +880 -97
  118. package/dist/esm/icons/science.js +1477 -208
  119. package/dist/esm/icons/shapes.js +1343 -307
  120. package/dist/esm/icons/smarthome.js +799 -89
  121. package/dist/esm/icons/social.js +599 -58
  122. package/dist/esm/icons/sports.js +1240 -132
  123. package/dist/esm/icons/sustainability.js +1226 -138
  124. package/dist/esm/icons/travel.js +1486 -147
  125. package/dist/esm/icons/ui.js +1540 -314
  126. package/dist/esm/icons/weather.js +1181 -172
  127. package/dist/esm/index.js +756 -58
  128. package/dist/esm/lottieIntegration.js +264 -265
  129. package/dist/esm/nicetodev-icons.css +1 -1
  130. package/dist/esm/particleEffects.js +271 -250
  131. package/dist/esm/resolver.js +231 -283
  132. package/dist/esm/rsc.js +182 -192
  133. package/dist/esm/sharpen.js +78 -129
  134. package/dist/esm/smilAnimations.js +376 -164
  135. package/dist/esm/stacking.js +99 -121
  136. package/dist/esm/tailwind-plugin.js +282 -319
  137. package/dist/esm/types.js +50 -71
  138. package/dist/esm/utilities.js +177 -321
  139. package/dist/esm/variantProps.js +23 -52
  140. package/package.json +15 -22
@@ -1,5 +1,5 @@
1
- 'use strict';
2
-
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  /**
4
4
  * @file figmaExport.ts
5
5
  * @description Export utilities for Figma/Sketch integration
@@ -11,284 +11,189 @@
11
11
  * @since 2026-03
12
12
  * @license MIT
13
13
  */
14
- /* ────────────────────────────────────────────────────────────────────────────
15
- 2. HELPER FUNCTIONS
16
- ───────────────────────────────────────────────────────────────────────────── */
17
- /**
18
- * Convert hex color to Figma RGB (0-1 range)
19
- */
20
- /**
21
- * Generate readable name from icon component name
22
- */
23
14
  function getReadableName(name) {
24
- return name
25
- .replace(/^Ntd/, '')
26
- .replace(/([A-Z])/g, ' $1')
27
- .trim();
15
+ return name.replace(/^Ntd/, "").replace(/([A-Z])/g, " $1").trim();
28
16
  }
29
- /**
30
- * Generate search tags from icon name and category
31
- */
32
17
  function generateTags(name, category) {
33
- const readable = getReadableName(name).toLowerCase();
34
- const words = readable.split(/\s+/);
35
- const categoryLower = category.toLowerCase();
36
- return [...new Set([...words, categoryLower])];
18
+ const readable = getReadableName(name).toLowerCase();
19
+ const words = readable.split(/\s+/);
20
+ const categoryLower = category.toLowerCase();
21
+ return [.../* @__PURE__ */ new Set([...words, categoryLower])];
37
22
  }
38
- /* ────────────────────────────────────────────────────────────────────────────
39
- 3. EXPORT FUNCTIONS
40
- ───────────────────────────────────────────────────────────────────────────── */
41
- /**
42
- * Export a single icon to Figma vector node JSON
43
- *
44
- * @example
45
- * ```ts
46
- * import { exportIconToFigmaNode, NtdHome } from '@nice2dev/icons';
47
- *
48
- * const figmaNode = exportIconToFigmaNode(NtdHome, {
49
- * size: 24,
50
- * variant: 'solid',
51
- * primaryColor: '#6c5ce7',
52
- * });
53
- * // Use in Figma plugin: figma.createNodeFromFigmaNode(figmaNode)
54
- * ```
55
- */
56
23
  function exportIconToFigmaNode(IconComponent, options = {}) {
57
- const { size = 24, variant = 'solid', primaryColor: _primaryColor = '#000000', strokeWidth: _strokeWidth = 2, } = options;
58
- // Render to string (requires a DOM or ReactDOMServer for real impl)
59
- // This is a simplified structure - actual implementation needs SVG rendering
60
- const name = IconComponent.displayName || 'Icon';
61
- return {
62
- type: 'FRAME',
63
- name: `${getReadableName(name)} / ${variant}`,
24
+ const {
25
+ size = 24,
26
+ variant = "solid",
27
+ primaryColor: _primaryColor = "#000000",
28
+ strokeWidth: _strokeWidth = 2
29
+ } = options;
30
+ const name = IconComponent.displayName || "Icon";
31
+ return {
32
+ type: "FRAME",
33
+ name: `${getReadableName(name)} / ${variant}`,
34
+ width: size,
35
+ height: size,
36
+ children: [
37
+ {
38
+ type: "VECTOR",
39
+ name: "icon",
64
40
  width: size,
65
41
  height: size,
66
- children: [
67
- {
68
- type: 'VECTOR',
69
- name: 'icon',
70
- width: size,
71
- height: size,
72
- vectorPaths: [],
73
- constraints: {
74
- horizontal: 'SCALE',
75
- vertical: 'SCALE',
76
- },
77
- },
78
- ],
79
- fills: [],
80
- padding: { top: 0, right: 0, bottom: 0, left: 0 },
81
- };
42
+ vectorPaths: [],
43
+ constraints: {
44
+ horizontal: "SCALE",
45
+ vertical: "SCALE"
46
+ }
47
+ }
48
+ ],
49
+ fills: [],
50
+ padding: { top: 0, right: 0, bottom: 0, left: 0 }
51
+ };
82
52
  }
83
- /**
84
- * Export icon to SVG string for Figma import
85
- *
86
- * Returns a clean SVG string that can be imported into Figma.
87
- *
88
- * @example
89
- * ```ts
90
- * import { exportIconToSvgString } from '@nice2dev/icons';
91
- *
92
- * const svg = exportIconToSvgString(NtdHome, { variant: 'solid', size: 24 });
93
- * // Copy to clipboard or use in Figma plugin's figma.createNodeFromSvg()
94
- * ```
95
- */
96
53
  function exportIconToSvgString(svgElement, options = {}) {
97
- const { size = 24, removeAnimations = true } = options;
98
- // Clone the element to avoid modifying the original
99
- const clone = svgElement.cloneNode(true);
100
- // Set size
101
- clone.setAttribute('width', String(size));
102
- clone.setAttribute('height', String(size));
103
- // Remove animation classes and styles
104
- if (removeAnimations) {
105
- clone.classList.remove(...Array.from(clone.classList).filter((c) => c.startsWith('ntd-anim-')));
106
- clone.style.animation = '';
107
- clone.style.animationName = '';
108
- clone.style.animationDuration = '';
109
- clone.style.removeProperty('--ntd-anim-duration');
110
- // Remove SMIL animation elements
111
- clone.querySelectorAll('animate, animateTransform, animateMotion').forEach((el) => el.remove());
112
- }
113
- // Remove data- attributes used for interaction
114
- clone.removeAttribute('data-name');
115
- // Serialize
116
- return new XMLSerializer().serializeToString(clone);
54
+ const { size = 24, removeAnimations = true } = options;
55
+ const clone = svgElement.cloneNode(true);
56
+ clone.setAttribute("width", String(size));
57
+ clone.setAttribute("height", String(size));
58
+ if (removeAnimations) {
59
+ clone.classList.remove(...Array.from(clone.classList).filter((c) => c.startsWith("ntd-anim-")));
60
+ clone.style.animation = "";
61
+ clone.style.animationName = "";
62
+ clone.style.animationDuration = "";
63
+ clone.style.removeProperty("--ntd-anim-duration");
64
+ clone.querySelectorAll("animate, animateTransform, animateMotion").forEach((el) => el.remove());
65
+ }
66
+ clone.removeAttribute("data-name");
67
+ return new XMLSerializer().serializeToString(clone);
117
68
  }
118
- /**
119
- * Export icon as base64 data URL
120
- */
121
69
  function exportIconToDataUrl(svgElement, options) {
122
- const svgString = exportIconToSvgString(svgElement, options);
123
- const base64 = btoa(unescape(encodeURIComponent(svgString)));
124
- return `data:image/svg+xml;base64,${base64}`;
70
+ const svgString = exportIconToSvgString(svgElement, options);
71
+ const base64 = btoa(unescape(encodeURIComponent(svgString)));
72
+ return `data:image/svg+xml;base64,${base64}`;
125
73
  }
126
- /**
127
- * Generate Figma plugin manifest for all icons
128
- *
129
- * Creates a JSON manifest that can be used by a Figma plugin
130
- * to display and insert icons.
131
- *
132
- * @example
133
- * ```ts
134
- * import { generateFigmaPluginManifest, allIcons } from '@nice2dev/icons';
135
- *
136
- * const manifest = generateFigmaPluginManifest(allIcons, {
137
- * name: 'Nice2Dev Icons',
138
- * version: '1.0.0',
139
- * });
140
- *
141
- * // Save as icons.json for your Figma plugin
142
- * ```
143
- */
144
74
  function generateFigmaPluginManifest(icons, options = {}) {
145
- const { name = '@nice2dev/icons', version = '1.0.0' } = options;
146
- // Collect categories
147
- const categorySet = new Set();
148
- icons.forEach((icon) => categorySet.add(icon.category));
149
- const categories = Array.from(categorySet).sort();
150
- // Build icon entries
151
- const iconEntries = icons.map((icon) => ({
152
- name: getReadableName(icon.name),
153
- category: icon.category,
154
- variants: [
155
- 'solid',
156
- 'sharp',
157
- 'outline',
158
- 'wireframe',
159
- 'duotone',
160
- 'cutout',
161
- 'vivid',
162
- 'mini',
163
- '3d',
164
- 'rounded',
165
- ],
166
- tags: generateTags(icon.name, icon.category),
167
- paths: {
168
- // Paths would be extracted from actual rendering
169
- // This is a placeholder structure
170
- },
171
- }));
172
- return {
173
- name,
174
- version,
175
- iconCount: icons.length,
176
- categories,
177
- icons: iconEntries,
178
- };
75
+ const { name = "@nice2dev/icons", version = "1.0.0" } = options;
76
+ const categorySet = /* @__PURE__ */ new Set();
77
+ icons.forEach((icon) => categorySet.add(icon.category));
78
+ const categories = Array.from(categorySet).sort();
79
+ const iconEntries = icons.map((icon) => ({
80
+ name: getReadableName(icon.name),
81
+ category: icon.category,
82
+ variants: [
83
+ "solid",
84
+ "sharp",
85
+ "outline",
86
+ "wireframe",
87
+ "duotone",
88
+ "cutout",
89
+ "vivid",
90
+ "mini",
91
+ "3d",
92
+ "rounded"
93
+ ],
94
+ tags: generateTags(icon.name, icon.category),
95
+ paths: {
96
+ // Paths would be extracted from actual rendering
97
+ // This is a placeholder structure
98
+ }
99
+ }));
100
+ return {
101
+ name,
102
+ version,
103
+ iconCount: icons.length,
104
+ categories,
105
+ icons: iconEntries
106
+ };
179
107
  }
180
- /**
181
- * Download icons as SVG files (browser)
182
- *
183
- * Triggers a download of the icon as an SVG file.
184
- */
185
108
  function downloadIconAsSvg(svgElement, filename, options) {
186
- const svgString = exportIconToSvgString(svgElement, options);
187
- const blob = new Blob([svgString], { type: 'image/svg+xml' });
188
- const url = URL.createObjectURL(blob);
189
- const link = document.createElement('a');
190
- link.href = url;
191
- link.download = filename.endsWith('.svg') ? filename : `${filename}.svg`;
192
- document.body.appendChild(link);
193
- link.click();
194
- document.body.removeChild(link);
195
- URL.revokeObjectURL(url);
109
+ const svgString = exportIconToSvgString(svgElement, options);
110
+ const blob = new Blob([svgString], { type: "image/svg+xml" });
111
+ const url = URL.createObjectURL(blob);
112
+ const link = document.createElement("a");
113
+ link.href = url;
114
+ link.download = filename.endsWith(".svg") ? filename : `${filename}.svg`;
115
+ document.body.appendChild(link);
116
+ link.click();
117
+ document.body.removeChild(link);
118
+ URL.revokeObjectURL(url);
196
119
  }
197
- /**
198
- * Download icons as PNG (browser)
199
- *
200
- * Renders the SVG to canvas and downloads as PNG.
201
- */
202
120
  async function downloadIconAsPng(svgElement, filename, options = {}) {
203
- const { size = 24, scale = 2, backgroundColor } = options;
204
- const svgString = exportIconToSvgString(svgElement, { size });
205
- const svg64 = btoa(unescape(encodeURIComponent(svgString)));
206
- const imgSrc = `data:image/svg+xml;base64,${svg64}`;
207
- return new Promise((resolve, reject) => {
208
- const img = new Image();
209
- img.onload = () => {
210
- const canvas = document.createElement('canvas');
211
- const scaledSize = size * scale;
212
- canvas.width = scaledSize;
213
- canvas.height = scaledSize;
214
- const ctx = canvas.getContext('2d');
215
- if (!ctx) {
216
- reject(new Error('Could not get canvas context'));
217
- return;
218
- }
219
- // Fill background if specified
220
- if (backgroundColor) {
221
- ctx.fillStyle = backgroundColor;
222
- ctx.fillRect(0, 0, scaledSize, scaledSize);
223
- }
224
- // Draw image
225
- ctx.drawImage(img, 0, 0, scaledSize, scaledSize);
226
- // Download
227
- canvas.toBlob((blob) => {
228
- if (!blob) {
229
- reject(new Error('Could not create blob'));
230
- return;
231
- }
232
- const url = URL.createObjectURL(blob);
233
- const link = document.createElement('a');
234
- link.href = url;
235
- link.download = filename.endsWith('.png') ? filename : `${filename}.png`;
236
- document.body.appendChild(link);
237
- link.click();
238
- document.body.removeChild(link);
239
- URL.revokeObjectURL(url);
240
- resolve();
241
- }, 'image/png');
242
- };
243
- img.onerror = () => reject(new Error('Failed to load SVG image'));
244
- img.src = imgSrc;
245
- });
121
+ const { size = 24, scale = 2, backgroundColor } = options;
122
+ const svgString = exportIconToSvgString(svgElement, { size });
123
+ const svg64 = btoa(unescape(encodeURIComponent(svgString)));
124
+ const imgSrc = `data:image/svg+xml;base64,${svg64}`;
125
+ return new Promise((resolve, reject) => {
126
+ const img = new Image();
127
+ img.onload = () => {
128
+ const canvas = document.createElement("canvas");
129
+ const scaledSize = size * scale;
130
+ canvas.width = scaledSize;
131
+ canvas.height = scaledSize;
132
+ const ctx = canvas.getContext("2d");
133
+ if (!ctx) {
134
+ reject(new Error("Could not get canvas context"));
135
+ return;
136
+ }
137
+ if (backgroundColor) {
138
+ ctx.fillStyle = backgroundColor;
139
+ ctx.fillRect(0, 0, scaledSize, scaledSize);
140
+ }
141
+ ctx.drawImage(img, 0, 0, scaledSize, scaledSize);
142
+ canvas.toBlob((blob) => {
143
+ if (!blob) {
144
+ reject(new Error("Could not create blob"));
145
+ return;
146
+ }
147
+ const url = URL.createObjectURL(blob);
148
+ const link = document.createElement("a");
149
+ link.href = url;
150
+ link.download = filename.endsWith(".png") ? filename : `${filename}.png`;
151
+ document.body.appendChild(link);
152
+ link.click();
153
+ document.body.removeChild(link);
154
+ URL.revokeObjectURL(url);
155
+ resolve();
156
+ }, "image/png");
157
+ };
158
+ img.onerror = () => reject(new Error("Failed to load SVG image"));
159
+ img.src = imgSrc;
160
+ });
246
161
  }
247
- /**
248
- * Copy icon SVG to clipboard
249
- */
250
162
  async function copyIconToClipboard(svgElement, options) {
251
- var _a;
252
- const svgString = exportIconToSvgString(svgElement, options);
253
- if ((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText) {
254
- await navigator.clipboard.writeText(svgString);
255
- }
256
- else {
257
- // Fallback for older browsers
258
- const textarea = document.createElement('textarea');
259
- textarea.value = svgString;
260
- textarea.style.position = 'fixed';
261
- textarea.style.opacity = '0';
262
- document.body.appendChild(textarea);
263
- textarea.select();
264
- document.execCommand('copy');
265
- document.body.removeChild(textarea);
266
- }
163
+ const svgString = exportIconToSvgString(svgElement, options);
164
+ if (navigator.clipboard?.writeText) {
165
+ await navigator.clipboard.writeText(svgString);
166
+ } else {
167
+ const textarea = document.createElement("textarea");
168
+ textarea.value = svgString;
169
+ textarea.style.position = "fixed";
170
+ textarea.style.opacity = "0";
171
+ document.body.appendChild(textarea);
172
+ textarea.select();
173
+ document.execCommand("copy");
174
+ document.body.removeChild(textarea);
175
+ }
267
176
  }
268
- /**
269
- * Batch export multiple icons
270
- */
271
177
  function batchExportIcons(svgElements, format, options) {
272
- const result = {};
273
- for (const { element, name } of svgElements) {
274
- switch (format) {
275
- case 'svg':
276
- result[name] = exportIconToSvgString(element, options);
277
- break;
278
- case 'data-url':
279
- result[name] = exportIconToDataUrl(element, options);
280
- break;
281
- case 'json':
282
- result[name] = JSON.stringify({
283
- name,
284
- svg: exportIconToSvgString(element, options),
285
- });
286
- break;
287
- }
178
+ const result = {};
179
+ for (const { element, name } of svgElements) {
180
+ switch (format) {
181
+ case "svg":
182
+ result[name] = exportIconToSvgString(element, options);
183
+ break;
184
+ case "data-url":
185
+ result[name] = exportIconToDataUrl(element, options);
186
+ break;
187
+ case "json":
188
+ result[name] = JSON.stringify({
189
+ name,
190
+ svg: exportIconToSvgString(element, options)
191
+ });
192
+ break;
288
193
  }
289
- return result;
194
+ }
195
+ return result;
290
196
  }
291
-
292
197
  exports.batchExportIcons = batchExportIcons;
293
198
  exports.copyIconToClipboard = copyIconToClipboard;
294
199
  exports.downloadIconAsPng = downloadIconAsPng;