@nice2dev/icons 1.3.14 → 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.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/NiceDesktopIconExporter.js +688 -599
- package/dist/cjs/NiceFaviconGenerator.js +603 -417
- package/dist/cjs/NiceIconPicker.js +788 -508
- package/dist/cjs/NiceIconPreview.js +246 -188
- package/dist/cjs/NiceIconSetCreator.js +683 -552
- package/dist/cjs/NiceIconStacker.js +547 -171
- package/dist/cjs/NiceIconValue.js +27 -35
- package/dist/cjs/NtdIconBadge.js +384 -360
- package/dist/cjs/NtdIconMorph.js +419 -354
- package/dist/cjs/NtdStateMorph.js +150 -147
- package/dist/cjs/advancedIconSearch.js +373 -510
- package/dist/cjs/animationControls.js +518 -642
- package/dist/cjs/client.js +12 -15
- package/dist/cjs/createIcon.js +349 -251
- package/dist/cjs/design-tokens.js +324 -390
- package/dist/cjs/figmaExport.js +162 -257
- package/dist/cjs/figmaSync.js +234 -316
- package/dist/cjs/headless-ui.js +240 -368
- package/dist/cjs/iconAnalytics.js +337 -393
- package/dist/cjs/iconHtml.js +64 -86
- package/dist/cjs/iconMetadata.js +392 -472
- package/dist/cjs/iconParts.js +120 -90
- package/dist/cjs/iconStack.js +136 -155
- package/dist/cjs/iconStyles.js +1609 -504
- package/dist/cjs/iconValue.js +359 -430
- package/dist/cjs/icons/accessibility.js +1119 -134
- package/dist/cjs/icons/actions.js +1290 -330
- package/dist/cjs/icons/ai.js +1424 -144
- package/dist/cjs/icons/brand.js +1344 -172
- package/dist/cjs/icons/business.js +903 -193
- package/dist/cjs/icons/devtech.js +1656 -227
- package/dist/cjs/icons/ecommerce.js +802 -111
- package/dist/cjs/icons/education.js +1345 -199
- package/dist/cjs/icons/files.js +1597 -328
- package/dist/cjs/icons/fintech.js +793 -104
- package/dist/cjs/icons/food.js +1507 -153
- package/dist/cjs/icons/fun.js +786 -109
- package/dist/cjs/icons/gaming.js +916 -170
- package/dist/cjs/icons/health.js +623 -112
- package/dist/cjs/icons/index.js +34 -35
- package/dist/cjs/icons/input.js +282 -83
- package/dist/cjs/icons/legal.js +1065 -122
- package/dist/cjs/icons/media.js +1061 -267
- package/dist/cjs/icons/navigation.js +387 -122
- package/dist/cjs/icons/omniverk.js +747 -90
- package/dist/cjs/icons/realestate.js +1520 -193
- package/dist/cjs/icons/saas.js +867 -98
- package/dist/cjs/icons/science.js +1465 -165
- package/dist/cjs/icons/shapes.js +1316 -308
- package/dist/cjs/icons/smarthome.js +786 -90
- package/dist/cjs/icons/social.js +591 -59
- package/dist/cjs/icons/sports.js +1225 -133
- package/dist/cjs/icons/sustainability.js +1211 -139
- package/dist/cjs/icons/travel.js +1470 -148
- package/dist/cjs/icons/ui.js +1508 -315
- package/dist/cjs/icons/weather.js +1160 -173
- package/dist/cjs/index.js +566 -566
- package/dist/cjs/lottieIntegration.js +261 -266
- package/dist/cjs/nicetodev-icons.css +1 -1
- package/dist/cjs/particleEffects.js +270 -251
- package/dist/cjs/resolver.js +229 -284
- package/dist/cjs/rsc.js +175 -193
- package/dist/cjs/sharpen.js +73 -130
- package/dist/cjs/smilAnimations.js +371 -165
- package/dist/cjs/stacking.js +87 -122
- package/dist/cjs/tailwind-plugin.js +280 -320
- package/dist/cjs/types.js +46 -72
- package/dist/cjs/utilities.js +163 -324
- package/dist/cjs/variantProps.js +12 -52
- package/dist/esm/NiceDesktopIconExporter.js +671 -598
- package/dist/esm/NiceFaviconGenerator.js +583 -416
- package/dist/esm/NiceIconPicker.js +789 -507
- package/dist/esm/NiceIconPreview.js +247 -187
- package/dist/esm/NiceIconSetCreator.js +685 -551
- package/dist/esm/NiceIconStacker.js +549 -170
- package/dist/esm/NiceIconValue.js +29 -34
- package/dist/esm/NtdIconBadge.js +388 -359
- package/dist/esm/NtdIconMorph.js +423 -353
- package/dist/esm/NtdStateMorph.js +152 -146
- package/dist/esm/advancedIconSearch.js +391 -509
- package/dist/esm/animationControls.js +527 -641
- package/dist/esm/client.js +48 -10
- package/dist/esm/createIcon.js +350 -250
- package/dist/esm/design-tokens.js +334 -387
- package/dist/esm/figmaExport.js +170 -256
- package/dist/esm/figmaSync.js +237 -315
- package/dist/esm/headless-ui.js +254 -365
- package/dist/esm/iconAnalytics.js +342 -392
- package/dist/esm/iconHtml.js +67 -85
- package/dist/esm/iconMetadata.js +404 -471
- package/dist/esm/iconParts.js +125 -89
- package/dist/esm/iconStack.js +145 -154
- package/dist/esm/iconStyles.js +1620 -503
- package/dist/esm/iconValue.js +361 -429
- package/dist/esm/icons/accessibility.js +1133 -133
- package/dist/esm/icons/actions.js +1320 -329
- package/dist/esm/icons/ai.js +1441 -143
- package/dist/esm/icons/brand.js +1351 -171
- package/dist/esm/icons/business.js +931 -201
- package/dist/esm/icons/devtech.js +1687 -226
- package/dist/esm/icons/ecommerce.js +816 -110
- package/dist/esm/icons/education.js +1364 -198
- package/dist/esm/icons/files.js +1628 -327
- package/dist/esm/icons/fintech.js +807 -103
- package/dist/esm/icons/food.js +1524 -152
- package/dist/esm/icons/fun.js +801 -108
- package/dist/esm/icons/gaming.js +933 -169
- package/dist/esm/icons/health.js +636 -111
- package/dist/esm/icons/index.js +596 -32
- package/dist/esm/icons/input.js +326 -82
- package/dist/esm/icons/legal.js +1079 -121
- package/dist/esm/icons/media.js +1086 -266
- package/dist/esm/icons/navigation.js +401 -121
- package/dist/esm/icons/omniverk.js +759 -89
- package/dist/esm/icons/realestate.js +1544 -198
- package/dist/esm/icons/saas.js +880 -97
- package/dist/esm/icons/science.js +1482 -164
- package/dist/esm/icons/shapes.js +1343 -307
- package/dist/esm/icons/smarthome.js +799 -89
- package/dist/esm/icons/social.js +599 -58
- package/dist/esm/icons/sports.js +1240 -132
- package/dist/esm/icons/sustainability.js +1226 -138
- package/dist/esm/icons/travel.js +1486 -147
- package/dist/esm/icons/ui.js +1540 -314
- package/dist/esm/icons/weather.js +1181 -172
- package/dist/esm/index.js +756 -58
- package/dist/esm/lottieIntegration.js +264 -265
- package/dist/esm/nicetodev-icons.css +1 -1
- package/dist/esm/particleEffects.js +271 -250
- package/dist/esm/resolver.js +231 -283
- package/dist/esm/rsc.js +182 -192
- package/dist/esm/sharpen.js +78 -129
- package/dist/esm/smilAnimations.js +376 -164
- package/dist/esm/stacking.js +99 -121
- package/dist/esm/tailwind-plugin.js +282 -319
- package/dist/esm/types.js +50 -71
- package/dist/esm/utilities.js +177 -321
- package/dist/esm/variantProps.js +23 -52
- package/dist/types/icons/index.d.ts +1 -1
- package/dist/types/icons/science.d.ts +9 -0
- package/package.json +15 -22
|
@@ -1,575 +1,709 @@
|
|
|
1
|
-
import { jsxs, jsx } from
|
|
2
|
-
import { useNiceTranslation } from
|
|
3
|
-
import { useState, useMemo, useCallback } from
|
|
4
|
-
import { NtdCheck } from
|
|
5
|
-
|
|
6
|
-
/* ══════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
Constants
|
|
8
|
-
══════════════════════════════════════════════════════════════════════════════ */
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation } from "@nice2dev/ui-core";
|
|
3
|
+
import { useState, useMemo, useCallback } from "react";
|
|
4
|
+
import { NtdCheck } from "./icons/actions.js";
|
|
9
5
|
const DEFAULT_CONFIG = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
name: "MyIcons",
|
|
7
|
+
packageName: "@myproject/icons",
|
|
8
|
+
// audit-allow: i18n — the generated package.json's default description, not UI copy
|
|
9
|
+
description: "Custom icon set",
|
|
10
|
+
version: "1.0.0",
|
|
11
|
+
author: "",
|
|
12
|
+
license: "MIT",
|
|
13
|
+
format: "esm",
|
|
14
|
+
generateTypes: true,
|
|
15
|
+
includeMetadata: false,
|
|
16
|
+
treeShaking: true
|
|
21
17
|
};
|
|
22
|
-
/**
|
|
23
|
-
* Converts to PascalCase.
|
|
24
|
-
*/
|
|
25
18
|
function toPascalCase(str) {
|
|
26
|
-
|
|
27
|
-
.split(/[-_\s]+/)
|
|
28
|
-
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
|
|
29
|
-
.join('');
|
|
19
|
+
return str.split(/[-_\s]+/).map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase()).join("");
|
|
30
20
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Generates ESM index file.
|
|
33
|
-
*/
|
|
34
21
|
function generateESMIndex(items, config) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
lines.push('');
|
|
74
|
-
lines.push(`export const iconMetadata = {`);
|
|
75
|
-
items
|
|
76
|
-
.filter((i) => i.included && i.metadata)
|
|
77
|
-
.forEach((item) => {
|
|
78
|
-
const exportName = toPascalCase(item.customName);
|
|
79
|
-
lines.push(` ${exportName}: ${JSON.stringify(item.metadata, null, 2)},`);
|
|
80
|
-
});
|
|
81
|
-
lines.push(`};`);
|
|
82
|
-
}
|
|
83
|
-
return lines.join('\n');
|
|
22
|
+
const lines = [
|
|
23
|
+
`/**`,
|
|
24
|
+
` * ${config.name}`,
|
|
25
|
+
` * ${config.description}`,
|
|
26
|
+
` * @version ${config.version}`,
|
|
27
|
+
` * @license ${config.license}`,
|
|
28
|
+
` */`,
|
|
29
|
+
""
|
|
30
|
+
];
|
|
31
|
+
if (config.treeShaking) {
|
|
32
|
+
items.filter((i) => i.included).forEach((item) => {
|
|
33
|
+
const exportName = toPascalCase(item.customName);
|
|
34
|
+
lines.push(`export { ${item.originalName} as ${exportName} } from '@nice2dev/icons';`);
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
lines.push(`import {`);
|
|
38
|
+
items.filter((i) => i.included).forEach((item) => {
|
|
39
|
+
lines.push(` ${item.originalName},`);
|
|
40
|
+
});
|
|
41
|
+
lines.push(`} from '@nice2dev/icons';`);
|
|
42
|
+
lines.push("");
|
|
43
|
+
lines.push(`export const ${config.name} = {`);
|
|
44
|
+
items.filter((i) => i.included).forEach((item) => {
|
|
45
|
+
const exportName = toPascalCase(item.customName);
|
|
46
|
+
lines.push(` ${exportName}: ${item.originalName},`);
|
|
47
|
+
});
|
|
48
|
+
lines.push(`};`);
|
|
49
|
+
}
|
|
50
|
+
if (config.includeMetadata) {
|
|
51
|
+
lines.push("");
|
|
52
|
+
lines.push(`export const iconMetadata = {`);
|
|
53
|
+
items.filter((i) => i.included && i.metadata).forEach((item) => {
|
|
54
|
+
const exportName = toPascalCase(item.customName);
|
|
55
|
+
lines.push(` ${exportName}: ${JSON.stringify(item.metadata, null, 2)},`);
|
|
56
|
+
});
|
|
57
|
+
lines.push(`};`);
|
|
58
|
+
}
|
|
59
|
+
return lines.join("\n");
|
|
84
60
|
}
|
|
85
|
-
/**
|
|
86
|
-
* Generates CommonJS index file.
|
|
87
|
-
*/
|
|
88
61
|
function generateCJSIndex(items, config) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
lines.push(` ${exportName}: icons.${item.originalName},`);
|
|
115
|
-
});
|
|
116
|
-
lines.push(`};`);
|
|
117
|
-
}
|
|
118
|
-
return lines.join('\n');
|
|
62
|
+
const lines = [
|
|
63
|
+
`/**`,
|
|
64
|
+
` * ${config.name}`,
|
|
65
|
+
` * ${config.description}`,
|
|
66
|
+
` * @version ${config.version}`,
|
|
67
|
+
` * @license ${config.license}`,
|
|
68
|
+
` */`,
|
|
69
|
+
"",
|
|
70
|
+
`const icons = require('@nice2dev/icons');`,
|
|
71
|
+
""
|
|
72
|
+
];
|
|
73
|
+
if (config.treeShaking) {
|
|
74
|
+
items.filter((i) => i.included).forEach((item) => {
|
|
75
|
+
const exportName = toPascalCase(item.customName);
|
|
76
|
+
lines.push(`exports.${exportName} = icons.${item.originalName};`);
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
lines.push(`exports.${config.name} = {`);
|
|
80
|
+
items.filter((i) => i.included).forEach((item) => {
|
|
81
|
+
const exportName = toPascalCase(item.customName);
|
|
82
|
+
lines.push(` ${exportName}: icons.${item.originalName},`);
|
|
83
|
+
});
|
|
84
|
+
lines.push(`};`);
|
|
85
|
+
}
|
|
86
|
+
return lines.join("\n");
|
|
119
87
|
}
|
|
120
|
-
/**
|
|
121
|
-
* Generates TypeScript types file.
|
|
122
|
-
*/
|
|
123
88
|
function generateTypes(items, config) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
lines.push(`export declare const ${config.name}: {`);
|
|
143
|
-
includedItems.forEach((item) => {
|
|
144
|
-
const exportName = toPascalCase(item.customName);
|
|
145
|
-
lines.push(` ${exportName}: ComponentType<NtdIconProps>;`);
|
|
146
|
-
});
|
|
147
|
-
lines.push(`};`);
|
|
148
|
-
}
|
|
149
|
-
// Icon names union type
|
|
150
|
-
lines.push('');
|
|
151
|
-
lines.push(`export type ${config.name}Name =`);
|
|
152
|
-
includedItems.forEach((item, i) => {
|
|
153
|
-
const exportName = toPascalCase(item.customName);
|
|
154
|
-
const suffix = i < includedItems.length - 1 ? ' |' : ';';
|
|
155
|
-
lines.push(` | '${exportName}'${suffix}`);
|
|
89
|
+
const lines = [
|
|
90
|
+
`/**`,
|
|
91
|
+
` * TypeScript declarations for ${config.name}`,
|
|
92
|
+
` * @version ${config.version}`,
|
|
93
|
+
` */`,
|
|
94
|
+
"",
|
|
95
|
+
`import type { ComponentType } from 'react';`,
|
|
96
|
+
`import type { NtdIconProps } from '@nice2dev/icons';`,
|
|
97
|
+
""
|
|
98
|
+
];
|
|
99
|
+
const includedItems = items.filter((i) => i.included);
|
|
100
|
+
if (config.treeShaking) {
|
|
101
|
+
includedItems.forEach((item) => {
|
|
102
|
+
const exportName = toPascalCase(item.customName);
|
|
103
|
+
lines.push(`export declare const ${exportName}: ComponentType<NtdIconProps>;`);
|
|
156
104
|
});
|
|
157
|
-
|
|
105
|
+
} else {
|
|
106
|
+
lines.push(`export declare const ${config.name}: {`);
|
|
107
|
+
includedItems.forEach((item) => {
|
|
108
|
+
const exportName = toPascalCase(item.customName);
|
|
109
|
+
lines.push(` ${exportName}: ComponentType<NtdIconProps>;`);
|
|
110
|
+
});
|
|
111
|
+
lines.push(`};`);
|
|
112
|
+
}
|
|
113
|
+
lines.push("");
|
|
114
|
+
lines.push(`export type ${config.name}Name =`);
|
|
115
|
+
includedItems.forEach((item, i) => {
|
|
116
|
+
const exportName = toPascalCase(item.customName);
|
|
117
|
+
const suffix = i < includedItems.length - 1 ? " |" : ";";
|
|
118
|
+
lines.push(` | '${exportName}'${suffix}`);
|
|
119
|
+
});
|
|
120
|
+
return lines.join("\n");
|
|
158
121
|
}
|
|
159
|
-
/**
|
|
160
|
-
* Generates package.json.
|
|
161
|
-
*/
|
|
162
122
|
function generatePackageJson(items, config) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
123
|
+
const pkg = {
|
|
124
|
+
name: config.packageName,
|
|
125
|
+
version: config.version,
|
|
126
|
+
description: config.description,
|
|
127
|
+
author: config.author,
|
|
128
|
+
license: config.license,
|
|
129
|
+
sideEffects: false,
|
|
130
|
+
peerDependencies: {
|
|
131
|
+
"@nice2dev/icons": "^1.0.0",
|
|
132
|
+
react: ">=17.0.0"
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
if (config.format === "esm" || config.format === "both") {
|
|
136
|
+
pkg.type = "module";
|
|
137
|
+
pkg.main = "./index.js";
|
|
138
|
+
pkg.module = "./index.js";
|
|
139
|
+
}
|
|
140
|
+
if (config.format === "cjs") {
|
|
141
|
+
pkg.main = "./index.cjs";
|
|
142
|
+
}
|
|
143
|
+
if (config.format === "both") {
|
|
144
|
+
pkg.exports = {
|
|
145
|
+
".": {
|
|
146
|
+
import: "./index.js",
|
|
147
|
+
require: "./index.cjs",
|
|
148
|
+
types: "./index.d.ts"
|
|
149
|
+
}
|
|
174
150
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
151
|
+
}
|
|
152
|
+
if (config.generateTypes) {
|
|
153
|
+
pkg.types = "./index.d.ts";
|
|
154
|
+
}
|
|
155
|
+
return JSON.stringify(pkg, null, 2);
|
|
156
|
+
}
|
|
157
|
+
function useIconSetCreator(options) {
|
|
158
|
+
const [items, setItems] = useState(
|
|
159
|
+
() => options.icons.map((i) => ({
|
|
160
|
+
originalName: i.name,
|
|
161
|
+
customName: i.name,
|
|
162
|
+
icon: i.icon,
|
|
163
|
+
metadata: i.metadata,
|
|
164
|
+
included: options.initialSelection?.includes(i.name) ?? false
|
|
165
|
+
}))
|
|
166
|
+
);
|
|
167
|
+
const [config, setConfig] = useState({
|
|
168
|
+
...DEFAULT_CONFIG,
|
|
169
|
+
...options.defaultConfig
|
|
170
|
+
});
|
|
171
|
+
const selectedCount = useMemo(() => items.filter((i) => i.included).length, [items]);
|
|
172
|
+
const toggleIcon = useCallback((name) => {
|
|
173
|
+
setItems(
|
|
174
|
+
(prev) => prev.map(
|
|
175
|
+
(item) => item.originalName === name ? { ...item, included: !item.included } : item
|
|
176
|
+
)
|
|
177
|
+
);
|
|
178
|
+
}, []);
|
|
179
|
+
const selectAll = useCallback(() => {
|
|
180
|
+
setItems((prev) => prev.map((item) => ({ ...item, included: true })));
|
|
181
|
+
}, []);
|
|
182
|
+
const deselectAll = useCallback(() => {
|
|
183
|
+
setItems((prev) => prev.map((item) => ({ ...item, included: false })));
|
|
184
|
+
}, []);
|
|
185
|
+
const renameIcon = useCallback((originalName, newName) => {
|
|
186
|
+
setItems(
|
|
187
|
+
(prev) => prev.map(
|
|
188
|
+
(item) => item.originalName === originalName ? { ...item, customName: newName } : item
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
}, []);
|
|
192
|
+
const updateConfig = useCallback((updates) => {
|
|
193
|
+
setConfig((prev) => ({ ...prev, ...updates }));
|
|
194
|
+
}, []);
|
|
195
|
+
const getSelectedItems = useCallback(() => items.filter((i) => i.included), [items]);
|
|
196
|
+
const generateExport = useCallback(() => {
|
|
197
|
+
const output = [];
|
|
198
|
+
const selectedItems = items.filter((i) => i.included);
|
|
199
|
+
if (selectedItems.length === 0) {
|
|
200
|
+
return output;
|
|
179
201
|
}
|
|
180
|
-
if (config.format ===
|
|
181
|
-
|
|
202
|
+
if (config.format === "esm" || config.format === "both") {
|
|
203
|
+
output.push({
|
|
204
|
+
filename: "index.js",
|
|
205
|
+
content: generateESMIndex(selectedItems, config),
|
|
206
|
+
type: "js"
|
|
207
|
+
});
|
|
182
208
|
}
|
|
183
|
-
if (config.format ===
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
};
|
|
209
|
+
if (config.format === "cjs" || config.format === "both") {
|
|
210
|
+
output.push({
|
|
211
|
+
filename: config.format === "both" ? "index.cjs" : "index.js",
|
|
212
|
+
content: generateCJSIndex(selectedItems, config),
|
|
213
|
+
type: "js"
|
|
214
|
+
});
|
|
191
215
|
}
|
|
192
216
|
if (config.generateTypes) {
|
|
193
|
-
|
|
217
|
+
output.push({
|
|
218
|
+
filename: "index.d.ts",
|
|
219
|
+
content: generateTypes(selectedItems, config),
|
|
220
|
+
type: "d.ts"
|
|
221
|
+
});
|
|
194
222
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
*/
|
|
200
|
-
function useIconSetCreator(options) {
|
|
201
|
-
const [items, setItems] = useState(() => options.icons.map((i) => {
|
|
202
|
-
var _a, _b;
|
|
203
|
-
return ({
|
|
204
|
-
originalName: i.name,
|
|
205
|
-
customName: i.name,
|
|
206
|
-
icon: i.icon,
|
|
207
|
-
metadata: i.metadata,
|
|
208
|
-
included: (_b = (_a = options.initialSelection) === null || _a === void 0 ? void 0 : _a.includes(i.name)) !== null && _b !== void 0 ? _b : false,
|
|
209
|
-
});
|
|
210
|
-
}));
|
|
211
|
-
const [config, setConfig] = useState({
|
|
212
|
-
...DEFAULT_CONFIG,
|
|
213
|
-
...options.defaultConfig,
|
|
223
|
+
output.push({
|
|
224
|
+
filename: "package.json",
|
|
225
|
+
content: generatePackageJson(selectedItems, config),
|
|
226
|
+
type: "json"
|
|
214
227
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
setConfig((prev) => ({ ...prev, ...updates }));
|
|
230
|
-
}, []);
|
|
231
|
-
const getSelectedItems = useCallback(() => items.filter((i) => i.included), [items]);
|
|
232
|
-
const generateExport = useCallback(() => {
|
|
233
|
-
const output = [];
|
|
234
|
-
const selectedItems = items.filter((i) => i.included);
|
|
235
|
-
if (selectedItems.length === 0) {
|
|
236
|
-
return output;
|
|
237
|
-
}
|
|
238
|
-
// ESM index
|
|
239
|
-
if (config.format === 'esm' || config.format === 'both') {
|
|
240
|
-
output.push({
|
|
241
|
-
filename: 'index.js',
|
|
242
|
-
content: generateESMIndex(selectedItems, config),
|
|
243
|
-
type: 'js',
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
// CJS index
|
|
247
|
-
if (config.format === 'cjs' || config.format === 'both') {
|
|
248
|
-
output.push({
|
|
249
|
-
filename: config.format === 'both' ? 'index.cjs' : 'index.js',
|
|
250
|
-
content: generateCJSIndex(selectedItems, config),
|
|
251
|
-
type: 'js',
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
// TypeScript types
|
|
255
|
-
if (config.generateTypes) {
|
|
256
|
-
output.push({
|
|
257
|
-
filename: 'index.d.ts',
|
|
258
|
-
content: generateTypes(selectedItems, config),
|
|
259
|
-
type: 'd.ts',
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
// package.json
|
|
263
|
-
output.push({
|
|
264
|
-
filename: 'package.json',
|
|
265
|
-
content: generatePackageJson(selectedItems, config),
|
|
266
|
-
type: 'json',
|
|
267
|
-
});
|
|
268
|
-
return output;
|
|
269
|
-
}, [items, config]);
|
|
270
|
-
return {
|
|
271
|
-
items,
|
|
272
|
-
config,
|
|
273
|
-
selectedCount,
|
|
274
|
-
toggleIcon,
|
|
275
|
-
selectAll,
|
|
276
|
-
deselectAll,
|
|
277
|
-
renameIcon,
|
|
278
|
-
updateConfig,
|
|
279
|
-
generateExport,
|
|
280
|
-
getSelectedItems,
|
|
281
|
-
};
|
|
228
|
+
return output;
|
|
229
|
+
}, [items, config]);
|
|
230
|
+
return {
|
|
231
|
+
items,
|
|
232
|
+
config,
|
|
233
|
+
selectedCount,
|
|
234
|
+
toggleIcon,
|
|
235
|
+
selectAll,
|
|
236
|
+
deselectAll,
|
|
237
|
+
renameIcon,
|
|
238
|
+
updateConfig,
|
|
239
|
+
generateExport,
|
|
240
|
+
getSelectedItems
|
|
241
|
+
};
|
|
282
242
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
243
|
+
function NiceIconSetCreator({
|
|
244
|
+
icons,
|
|
245
|
+
initialSelection,
|
|
246
|
+
defaultConfig,
|
|
247
|
+
onSelectionChange: _onSelectionChange,
|
|
248
|
+
onExport,
|
|
249
|
+
className = ""
|
|
250
|
+
}) {
|
|
251
|
+
const { t } = useNiceTranslation();
|
|
252
|
+
const creator = useIconSetCreator({ icons, initialSelection, defaultConfig });
|
|
253
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
254
|
+
const [categoryFilter, setCategoryFilter] = useState("all");
|
|
255
|
+
const [previewOutput, setPreviewOutput] = useState(null);
|
|
256
|
+
const filteredItems = useMemo(() => {
|
|
257
|
+
return creator.items.filter((item) => {
|
|
258
|
+
const matchesSearch = searchQuery === "" || item.originalName.toLowerCase().includes(searchQuery.toLowerCase()) || item.customName.toLowerCase().includes(searchQuery.toLowerCase()) || item.metadata?.tags?.some((t2) => t2.toLowerCase().includes(searchQuery.toLowerCase()));
|
|
259
|
+
const matchesCategory = categoryFilter === "all" || item.metadata?.category === categoryFilter;
|
|
260
|
+
return matchesSearch && matchesCategory;
|
|
261
|
+
});
|
|
262
|
+
}, [creator.items, searchQuery, categoryFilter]);
|
|
263
|
+
const categories = useMemo(() => {
|
|
264
|
+
const cats = /* @__PURE__ */ new Set();
|
|
265
|
+
icons.forEach((i) => {
|
|
266
|
+
if (i.metadata?.category) {
|
|
267
|
+
cats.add(i.metadata.category);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
return Array.from(cats);
|
|
271
|
+
}, [icons]);
|
|
272
|
+
const handleExport = useCallback(() => {
|
|
273
|
+
const output = creator.generateExport();
|
|
274
|
+
setPreviewOutput(output);
|
|
275
|
+
onExport?.(output);
|
|
276
|
+
}, [creator, onExport]);
|
|
277
|
+
const handleDownloadZip = useCallback(async () => {
|
|
278
|
+
const output = creator.generateExport();
|
|
279
|
+
if (output.length === 0) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
output.forEach((file) => {
|
|
283
|
+
const blob = new Blob([file.content], { type: "text/plain" });
|
|
284
|
+
const url = URL.createObjectURL(blob);
|
|
285
|
+
const a = document.createElement("a");
|
|
286
|
+
a.href = url;
|
|
287
|
+
a.download = file.filename;
|
|
288
|
+
document.body.appendChild(a);
|
|
289
|
+
a.click();
|
|
290
|
+
document.body.removeChild(a);
|
|
291
|
+
URL.revokeObjectURL(url);
|
|
292
|
+
});
|
|
293
|
+
}, [creator]);
|
|
294
|
+
return /* @__PURE__ */ jsxs("div", { className: `nice-icon-set-creator ${className}`, style: styles.container, children: [
|
|
295
|
+
/* @__PURE__ */ jsxs("div", { style: styles.header, children: [
|
|
296
|
+
/* @__PURE__ */ jsx("h2", { style: styles.title, children: t("iconSetCreator.iconSetCreator", "Icon Set Creator") }),
|
|
297
|
+
/* @__PURE__ */ jsx("div", { style: styles.stats, children: t("iconSetCreator.iconsSelected", "{selectedCount} / {items} icons selected").replace("{selectedCount}", String(creator.selectedCount)).replace("{items}", String(creator.items.length)) })
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ jsxs("div", { style: styles.content, children: [
|
|
300
|
+
/* @__PURE__ */ jsxs("div", { style: styles.configPanel, children: [
|
|
301
|
+
/* @__PURE__ */ jsx("h3", { style: styles.sectionTitle, children: t("iconSetCreator.configuration", "Configuration") }),
|
|
302
|
+
/* @__PURE__ */ jsxs("div", { style: styles.field, children: [
|
|
303
|
+
/* @__PURE__ */ jsx("label", { style: styles.fieldLabel, children: t("iconSetCreator.setName", "Set Name") }),
|
|
304
|
+
/* @__PURE__ */ jsx(
|
|
305
|
+
"input",
|
|
306
|
+
{
|
|
307
|
+
type: "text",
|
|
308
|
+
value: creator.config.name,
|
|
309
|
+
onChange: (e) => creator.updateConfig({ name: e.target.value }),
|
|
310
|
+
style: styles.input,
|
|
311
|
+
placeholder: "MyIcons"
|
|
314
312
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
313
|
+
)
|
|
314
|
+
] }),
|
|
315
|
+
/* @__PURE__ */ jsxs("div", { style: styles.field, children: [
|
|
316
|
+
/* @__PURE__ */ jsx("label", { style: styles.fieldLabel, children: t("iconSetCreator.packageName", "Package Name") }),
|
|
317
|
+
/* @__PURE__ */ jsx(
|
|
318
|
+
"input",
|
|
319
|
+
{
|
|
320
|
+
type: "text",
|
|
321
|
+
value: creator.config.packageName,
|
|
322
|
+
onChange: (e) => creator.updateConfig({ packageName: e.target.value }),
|
|
323
|
+
style: styles.input,
|
|
324
|
+
placeholder: "@myproject/icons"
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ jsxs("div", { style: styles.field, children: [
|
|
329
|
+
/* @__PURE__ */ jsx("label", { style: styles.fieldLabel, children: t("iconSetCreator.description", "Description") }),
|
|
330
|
+
/* @__PURE__ */ jsx(
|
|
331
|
+
"input",
|
|
332
|
+
{
|
|
333
|
+
type: "text",
|
|
334
|
+
value: creator.config.description,
|
|
335
|
+
onChange: (e) => creator.updateConfig({ description: e.target.value }),
|
|
336
|
+
style: styles.input
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ jsxs("div", { style: styles.fieldRow, children: [
|
|
341
|
+
/* @__PURE__ */ jsxs("div", { style: styles.field, children: [
|
|
342
|
+
/* @__PURE__ */ jsx("label", { style: styles.fieldLabel, children: t("iconSetCreator.version", "Version") }),
|
|
343
|
+
/* @__PURE__ */ jsx(
|
|
344
|
+
"input",
|
|
345
|
+
{
|
|
346
|
+
type: "text",
|
|
347
|
+
value: creator.config.version,
|
|
348
|
+
onChange: (e) => creator.updateConfig({ version: e.target.value }),
|
|
349
|
+
style: styles.input
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
] }),
|
|
353
|
+
/* @__PURE__ */ jsxs("div", { style: styles.field, children: [
|
|
354
|
+
/* @__PURE__ */ jsx("label", { style: styles.fieldLabel, children: t("iconSetCreator.license", "License") }),
|
|
355
|
+
/* @__PURE__ */ jsx(
|
|
356
|
+
"input",
|
|
357
|
+
{
|
|
358
|
+
type: "text",
|
|
359
|
+
value: creator.config.license,
|
|
360
|
+
onChange: (e) => creator.updateConfig({ license: e.target.value }),
|
|
361
|
+
style: styles.input
|
|
362
|
+
}
|
|
363
|
+
)
|
|
364
|
+
] })
|
|
365
|
+
] }),
|
|
366
|
+
/* @__PURE__ */ jsxs("div", { style: styles.field, children: [
|
|
367
|
+
/* @__PURE__ */ jsx("label", { style: styles.fieldLabel, children: t("iconSetCreator.exportFormat", "Export Format") }),
|
|
368
|
+
/* @__PURE__ */ jsxs(
|
|
369
|
+
"select",
|
|
370
|
+
{
|
|
371
|
+
value: creator.config.format,
|
|
372
|
+
onChange: (e) => creator.updateConfig({ format: e.target.value }),
|
|
373
|
+
style: styles.select,
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ jsx("option", { value: "esm", children: t("iconSetCreator.esModules", "ES Modules") }),
|
|
376
|
+
/* @__PURE__ */ jsx("option", { value: "cjs", children: "CommonJS" }),
|
|
377
|
+
/* @__PURE__ */ jsx("option", { value: "both", children: t("iconSetCreator.both", "Both") })
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
] }),
|
|
382
|
+
/* @__PURE__ */ jsxs("div", { style: styles.checkboxGroup, children: [
|
|
383
|
+
/* @__PURE__ */ jsxs("label", { style: styles.checkbox, children: [
|
|
384
|
+
/* @__PURE__ */ jsx(
|
|
385
|
+
"input",
|
|
386
|
+
{
|
|
387
|
+
type: "checkbox",
|
|
388
|
+
checked: creator.config.generateTypes,
|
|
389
|
+
onChange: (e) => creator.updateConfig({ generateTypes: e.target.checked })
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
t("iconSetCreator.generateTypescriptTypes", "Generate TypeScript types")
|
|
393
|
+
] }),
|
|
394
|
+
/* @__PURE__ */ jsxs("label", { style: styles.checkbox, children: [
|
|
395
|
+
/* @__PURE__ */ jsx(
|
|
396
|
+
"input",
|
|
397
|
+
{
|
|
398
|
+
type: "checkbox",
|
|
399
|
+
checked: creator.config.treeShaking,
|
|
400
|
+
onChange: (e) => creator.updateConfig({ treeShaking: e.target.checked })
|
|
401
|
+
}
|
|
402
|
+
),
|
|
403
|
+
t("iconSetCreator.treeShakingFriendly", "Tree-shaking friendly")
|
|
404
|
+
] }),
|
|
405
|
+
/* @__PURE__ */ jsxs("label", { style: styles.checkbox, children: [
|
|
406
|
+
/* @__PURE__ */ jsx(
|
|
407
|
+
"input",
|
|
408
|
+
{
|
|
409
|
+
type: "checkbox",
|
|
410
|
+
checked: creator.config.includeMetadata,
|
|
411
|
+
onChange: (e) => creator.updateConfig({ includeMetadata: e.target.checked })
|
|
412
|
+
}
|
|
413
|
+
),
|
|
414
|
+
t("iconSetCreator.includeMetadata", "Include metadata")
|
|
415
|
+
] })
|
|
416
|
+
] }),
|
|
417
|
+
/* @__PURE__ */ jsxs("div", { style: styles.exportActions, children: [
|
|
418
|
+
/* @__PURE__ */ jsx("button", { onClick: handleExport, style: styles.primaryButton, children: t("iconSetCreator.previewExport", "Preview Export") }),
|
|
419
|
+
/* @__PURE__ */ jsx("button", { onClick: handleDownloadZip, style: styles.secondaryButton, children: t("iconSetCreator.downloadFiles", "Download Files") })
|
|
420
|
+
] })
|
|
421
|
+
] }),
|
|
422
|
+
/* @__PURE__ */ jsxs("div", { style: styles.selectionPanel, children: [
|
|
423
|
+
/* @__PURE__ */ jsxs("div", { style: styles.selectionHeader, children: [
|
|
424
|
+
/* @__PURE__ */ jsx(
|
|
425
|
+
"input",
|
|
426
|
+
{
|
|
427
|
+
type: "text",
|
|
428
|
+
value: searchQuery,
|
|
429
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
430
|
+
placeholder: t("iconSetCreator.searchIcons", "Search icons..."),
|
|
431
|
+
style: styles.searchInput
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
/* @__PURE__ */ jsxs(
|
|
435
|
+
"select",
|
|
436
|
+
{
|
|
437
|
+
value: categoryFilter,
|
|
438
|
+
onChange: (e) => setCategoryFilter(e.target.value),
|
|
439
|
+
style: styles.categorySelect,
|
|
440
|
+
children: [
|
|
441
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: t("iconSetCreator.allCategories", "All Categories") }),
|
|
442
|
+
categories.map((cat) => /* @__PURE__ */ jsx("option", { value: cat, children: cat }, cat))
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
)
|
|
446
|
+
] }),
|
|
447
|
+
/* @__PURE__ */ jsxs("div", { style: styles.selectionActions, children: [
|
|
448
|
+
/* @__PURE__ */ jsx("button", { onClick: creator.selectAll, style: styles.smallButton, children: t("iconSetCreator.selectAll", "Select All") }),
|
|
449
|
+
/* @__PURE__ */ jsx("button", { onClick: creator.deselectAll, style: styles.smallButton, children: t("iconSetCreator.deselectAll", "Deselect All") })
|
|
450
|
+
] }),
|
|
451
|
+
/* @__PURE__ */ jsx("div", { style: styles.iconGrid, children: filteredItems.map((item) => /* @__PURE__ */ jsxs(
|
|
452
|
+
"div",
|
|
453
|
+
{
|
|
454
|
+
role: "checkbox",
|
|
455
|
+
"aria-checked": item.included,
|
|
456
|
+
"aria-label": item.customName,
|
|
457
|
+
tabIndex: 0,
|
|
458
|
+
onClick: () => creator.toggleIcon(item.originalName),
|
|
459
|
+
onKeyDown: (e) => {
|
|
460
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
461
|
+
e.preventDefault();
|
|
462
|
+
creator.toggleIcon(item.originalName);
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
style: {
|
|
466
|
+
...styles.iconItem,
|
|
467
|
+
borderColor: item.included ? "#3b82f6" : "#e5e7eb",
|
|
468
|
+
backgroundColor: item.included ? "#eff6ff" : "#fff"
|
|
469
|
+
},
|
|
470
|
+
children: [
|
|
471
|
+
/* @__PURE__ */ jsx(item.icon, { size: 32 }),
|
|
472
|
+
/* @__PURE__ */ jsx("span", { style: styles.iconName, children: item.customName }),
|
|
473
|
+
item.included && /* @__PURE__ */ jsx("span", { style: styles.checkmark, children: /* @__PURE__ */ jsx(NtdCheck, { size: 14 }) })
|
|
474
|
+
]
|
|
475
|
+
},
|
|
476
|
+
item.originalName
|
|
477
|
+
)) })
|
|
478
|
+
] }),
|
|
479
|
+
previewOutput && /* @__PURE__ */ jsxs("div", { style: styles.previewPanel, children: [
|
|
480
|
+
/* @__PURE__ */ jsx("h3", { style: styles.sectionTitle, children: t("iconSetCreator.exportPreview", "Export Preview") }),
|
|
481
|
+
previewOutput.map((file) => /* @__PURE__ */ jsxs("div", { style: styles.filePreview, children: [
|
|
482
|
+
/* @__PURE__ */ jsx("div", { style: styles.fileName, children: file.filename }),
|
|
483
|
+
/* @__PURE__ */ jsxs("pre", { style: styles.codePreview, children: [
|
|
484
|
+
file.content.slice(0, 1e3),
|
|
485
|
+
file.content.length > 1e3 && "..."
|
|
486
|
+
] })
|
|
487
|
+
] }, file.filename))
|
|
488
|
+
] })
|
|
489
|
+
] })
|
|
490
|
+
] });
|
|
356
491
|
}
|
|
357
|
-
/* ══════════════════════════════════════════════════════════════════════════════
|
|
358
|
-
Styles
|
|
359
|
-
══════════════════════════════════════════════════════════════════════════════ */
|
|
360
492
|
const styles = {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
493
|
+
container: {
|
|
494
|
+
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
495
|
+
fontSize: "14px",
|
|
496
|
+
border: "1px solid #e5e7eb",
|
|
497
|
+
borderRadius: "8px",
|
|
498
|
+
overflow: "hidden"
|
|
499
|
+
},
|
|
500
|
+
header: {
|
|
501
|
+
display: "flex",
|
|
502
|
+
justifyContent: "space-between",
|
|
503
|
+
alignItems: "center",
|
|
504
|
+
padding: "16px 20px",
|
|
505
|
+
borderBottom: "1px solid #e5e7eb",
|
|
506
|
+
backgroundColor: "#f9fafb"
|
|
507
|
+
},
|
|
508
|
+
title: {
|
|
509
|
+
margin: 0,
|
|
510
|
+
fontSize: "18px",
|
|
511
|
+
fontWeight: 600
|
|
512
|
+
},
|
|
513
|
+
stats: {
|
|
514
|
+
color: "#6b7280",
|
|
515
|
+
fontSize: "13px"
|
|
516
|
+
},
|
|
517
|
+
content: {
|
|
518
|
+
display: "flex",
|
|
519
|
+
minHeight: "500px"
|
|
520
|
+
},
|
|
521
|
+
configPanel: {
|
|
522
|
+
width: "280px",
|
|
523
|
+
padding: "16px",
|
|
524
|
+
borderRight: "1px solid #e5e7eb",
|
|
525
|
+
backgroundColor: "#fafafa"
|
|
526
|
+
},
|
|
527
|
+
sectionTitle: {
|
|
528
|
+
margin: "0 0 16px 0",
|
|
529
|
+
fontSize: "14px",
|
|
530
|
+
fontWeight: 600,
|
|
531
|
+
color: "#374151"
|
|
532
|
+
},
|
|
533
|
+
field: {
|
|
534
|
+
marginBottom: "12px"
|
|
535
|
+
},
|
|
536
|
+
fieldRow: {
|
|
537
|
+
display: "flex",
|
|
538
|
+
gap: "12px"
|
|
539
|
+
},
|
|
540
|
+
fieldLabel: {
|
|
541
|
+
display: "block",
|
|
542
|
+
marginBottom: "4px",
|
|
543
|
+
fontSize: "12px",
|
|
544
|
+
fontWeight: 500,
|
|
545
|
+
color: "#6b7280"
|
|
546
|
+
},
|
|
547
|
+
input: {
|
|
548
|
+
width: "100%",
|
|
549
|
+
padding: "8px 10px",
|
|
550
|
+
borderRadius: "4px",
|
|
551
|
+
border: "1px solid #d1d5db",
|
|
552
|
+
fontSize: "13px",
|
|
553
|
+
boxSizing: "border-box"
|
|
554
|
+
},
|
|
555
|
+
select: {
|
|
556
|
+
width: "100%",
|
|
557
|
+
padding: "8px 10px",
|
|
558
|
+
borderRadius: "4px",
|
|
559
|
+
border: "1px solid #d1d5db",
|
|
560
|
+
fontSize: "13px",
|
|
561
|
+
backgroundColor: "#fff"
|
|
562
|
+
},
|
|
563
|
+
checkboxGroup: {
|
|
564
|
+
display: "flex",
|
|
565
|
+
flexDirection: "column",
|
|
566
|
+
gap: "8px",
|
|
567
|
+
marginTop: "16px"
|
|
568
|
+
},
|
|
569
|
+
checkbox: {
|
|
570
|
+
display: "flex",
|
|
571
|
+
alignItems: "center",
|
|
572
|
+
gap: "8px",
|
|
573
|
+
fontSize: "13px",
|
|
574
|
+
cursor: "pointer"
|
|
575
|
+
},
|
|
576
|
+
exportActions: {
|
|
577
|
+
display: "flex",
|
|
578
|
+
flexDirection: "column",
|
|
579
|
+
gap: "8px",
|
|
580
|
+
marginTop: "20px"
|
|
581
|
+
},
|
|
582
|
+
primaryButton: {
|
|
583
|
+
padding: "10px 16px",
|
|
584
|
+
borderRadius: "6px",
|
|
585
|
+
border: "none",
|
|
586
|
+
backgroundColor: "#3b82f6",
|
|
587
|
+
color: "#fff",
|
|
588
|
+
fontWeight: 500,
|
|
589
|
+
cursor: "pointer"
|
|
590
|
+
},
|
|
591
|
+
secondaryButton: {
|
|
592
|
+
padding: "10px 16px",
|
|
593
|
+
borderRadius: "6px",
|
|
594
|
+
border: "1px solid #d1d5db",
|
|
595
|
+
backgroundColor: "#fff",
|
|
596
|
+
fontWeight: 500,
|
|
597
|
+
cursor: "pointer"
|
|
598
|
+
},
|
|
599
|
+
selectionPanel: {
|
|
600
|
+
flex: 1,
|
|
601
|
+
padding: "16px",
|
|
602
|
+
display: "flex",
|
|
603
|
+
flexDirection: "column"
|
|
604
|
+
},
|
|
605
|
+
selectionHeader: {
|
|
606
|
+
display: "flex",
|
|
607
|
+
gap: "12px",
|
|
608
|
+
marginBottom: "12px"
|
|
609
|
+
},
|
|
610
|
+
searchInput: {
|
|
611
|
+
flex: 1,
|
|
612
|
+
padding: "8px 12px",
|
|
613
|
+
borderRadius: "6px",
|
|
614
|
+
border: "1px solid #d1d5db",
|
|
615
|
+
fontSize: "13px"
|
|
616
|
+
},
|
|
617
|
+
categorySelect: {
|
|
618
|
+
padding: "8px 12px",
|
|
619
|
+
borderRadius: "6px",
|
|
620
|
+
border: "1px solid #d1d5db",
|
|
621
|
+
fontSize: "13px",
|
|
622
|
+
backgroundColor: "#fff"
|
|
623
|
+
},
|
|
624
|
+
selectionActions: {
|
|
625
|
+
display: "flex",
|
|
626
|
+
gap: "8px",
|
|
627
|
+
marginBottom: "12px"
|
|
628
|
+
},
|
|
629
|
+
smallButton: {
|
|
630
|
+
padding: "6px 12px",
|
|
631
|
+
borderRadius: "4px",
|
|
632
|
+
border: "1px solid #d1d5db",
|
|
633
|
+
backgroundColor: "#fff",
|
|
634
|
+
fontSize: "12px",
|
|
635
|
+
cursor: "pointer"
|
|
636
|
+
},
|
|
637
|
+
iconGrid: {
|
|
638
|
+
display: "grid",
|
|
639
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(100px, 1fr))",
|
|
640
|
+
gap: "8px",
|
|
641
|
+
overflowY: "auto",
|
|
642
|
+
flex: 1
|
|
643
|
+
},
|
|
644
|
+
iconItem: {
|
|
645
|
+
display: "flex",
|
|
646
|
+
flexDirection: "column",
|
|
647
|
+
alignItems: "center",
|
|
648
|
+
gap: "6px",
|
|
649
|
+
padding: "12px 8px",
|
|
650
|
+
borderRadius: "6px",
|
|
651
|
+
border: "2px solid",
|
|
652
|
+
cursor: "pointer",
|
|
653
|
+
transition: "all 0.15s ease",
|
|
654
|
+
position: "relative"
|
|
655
|
+
},
|
|
656
|
+
iconName: {
|
|
657
|
+
fontSize: "11px",
|
|
658
|
+
color: "#6b7280",
|
|
659
|
+
textAlign: "center",
|
|
660
|
+
wordBreak: "break-word"
|
|
661
|
+
},
|
|
662
|
+
checkmark: {
|
|
663
|
+
position: "absolute",
|
|
664
|
+
top: "4px",
|
|
665
|
+
right: "4px",
|
|
666
|
+
width: "18px",
|
|
667
|
+
height: "18px",
|
|
668
|
+
borderRadius: "50%",
|
|
669
|
+
backgroundColor: "#3b82f6",
|
|
670
|
+
color: "#fff",
|
|
671
|
+
fontSize: "11px",
|
|
672
|
+
display: "flex",
|
|
673
|
+
alignItems: "center",
|
|
674
|
+
justifyContent: "center"
|
|
675
|
+
},
|
|
676
|
+
previewPanel: {
|
|
677
|
+
width: "350px",
|
|
678
|
+
padding: "16px",
|
|
679
|
+
borderLeft: "1px solid #e5e7eb",
|
|
680
|
+
backgroundColor: "#f9fafb",
|
|
681
|
+
overflowY: "auto"
|
|
682
|
+
},
|
|
683
|
+
filePreview: {
|
|
684
|
+
marginBottom: "16px"
|
|
685
|
+
},
|
|
686
|
+
fileName: {
|
|
687
|
+
fontSize: "12px",
|
|
688
|
+
fontWeight: 600,
|
|
689
|
+
color: "#374151",
|
|
690
|
+
marginBottom: "6px",
|
|
691
|
+
fontFamily: "monospace"
|
|
692
|
+
},
|
|
693
|
+
codePreview: {
|
|
694
|
+
padding: "12px",
|
|
695
|
+
borderRadius: "6px",
|
|
696
|
+
backgroundColor: "#1e1e1e",
|
|
697
|
+
color: "#d4d4d4",
|
|
698
|
+
fontSize: "11px",
|
|
699
|
+
overflow: "auto",
|
|
700
|
+
maxHeight: "200px",
|
|
701
|
+
fontFamily: "monospace",
|
|
702
|
+
whiteSpace: "pre-wrap",
|
|
703
|
+
margin: 0
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
export {
|
|
707
|
+
NiceIconSetCreator,
|
|
708
|
+
useIconSetCreator
|
|
573
709
|
};
|
|
574
|
-
|
|
575
|
-
export { NiceIconSetCreator, useIconSetCreator };
|