diff --git a/bin/config.ts b/bin/config.ts index 0ccbbe6..f41a5e0 100644 --- a/bin/config.ts +++ b/bin/config.ts @@ -27,4 +27,27 @@ export const iconPackages = [ }, iconsDir: "../node_modules/bootstrap-icons/icons", }, + ...[ + ["outline", "24/outline"], + ["solid", "24/solid"], + ["mini", "20/solid"], + ["micro", "16/solid"], + ].map(([variant, path]) => ({ + id: `heroicons`, + variant, + iconsDir: `../node_modules/heroicons/${path}`, + })), + { + id: "remixicon", + getVariantFromIconName: (iconName: string) => { + if (iconName.endsWith("fill")) return "fill"; + return "regular"; + }, + iconsDir: "../node_modules/remixicon/icons", + }, + { + id: "feather", + variant: "regular", + iconsDir: "../node_modules/feather-icons/dist/icons", + }, ]; diff --git a/bin/files.ts b/bin/files.ts index 9164695..96dc31e 100644 --- a/bin/files.ts +++ b/bin/files.ts @@ -5,7 +5,7 @@ export const __dirname = import.meta.dirname; export function getFilesByExtension(directory: string, extension: string) { const path = resolve(__dirname, directory); - const files = readdirSync(path); + const files = readdirSync(path, { encoding: "utf8", recursive: true }); return files.filter((file) => extname(file) === extension); } diff --git a/bin/generateIconSets.ts b/bin/generateIconSets.ts index d277c18..0840084 100644 --- a/bin/generateIconSets.ts +++ b/bin/generateIconSets.ts @@ -28,7 +28,7 @@ iconPackages.forEach( throw new Error(`Failed to parse the SVG: ${file}`); } - const iconName = file.replace(".svg", ""); + const iconName = file.split("/").pop()!.replace(".svg", ""); const variantName = variant ?? getVariantFromIconName?.(iconName) ?? "regular"; diff --git a/package-lock.json b/package-lock.json index 94e1759..495cf8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,11 +12,14 @@ "@penpot/plugin-styles": "^0.10.0", "@phosphor-icons/core": "^2.1.1", "bootstrap-icons": "^1.11.3", + "feather-icons": "^4.29.2", + "heroicons": "^2.1.5", "iconoir": "^7.8.0", "lucide-react": "^0.427.0", "lucide-static": "^0.427.0", "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "remixicon": "^4.3.0" }, "devDependencies": { "@penpot/plugin-types": "^0.10.0", @@ -1583,6 +1586,11 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1607,6 +1615,16 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/core-js": { + "version": "3.38.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.38.1.tgz", + "integrity": "sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2294,6 +2312,15 @@ "reusify": "^1.0.4" } }, + "node_modules/feather-icons": { + "version": "4.29.2", + "resolved": "https://registry.npmjs.org/feather-icons/-/feather-icons-4.29.2.tgz", + "integrity": "sha512-0TaCFTnBTVCz6U+baY2UJNKne5ifGh7sMG4ZC2LoBWCZdIyPa+y6UiR4lEYGws1JOFWdee8KAsAIvu0VcXqiqA==", + "dependencies": { + "classnames": "^2.2.5", + "core-js": "^3.1.3" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2672,6 +2699,11 @@ "node": ">= 0.4" } }, + "node_modules/heroicons": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/heroicons/-/heroicons-2.1.5.tgz", + "integrity": "sha512-XLq3m45bJphmWdR6im52alaYajp0/fluJa2+7xh3x7CgItumbLsjhKYe+mCf0lErXLy7ZyiEgKIty2gFNxhoyA==" + }, "node_modules/iconoir": { "version": "7.8.0", "resolved": "https://registry.npmjs.org/iconoir/-/iconoir-7.8.0.tgz", @@ -3742,6 +3774,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/remixicon": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/remixicon/-/remixicon-4.3.0.tgz", + "integrity": "sha512-jRYQ37dTFSkJtvcxwTUAkIiXkYRvA9EDvVuXPNrmt2xf/VS//CRgFtsX2TAFBoQOhh9SDh7l6La4Xu12snEyxg==" + }, "node_modules/resolve": { "version": "2.0.0-next.5", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", diff --git a/package.json b/package.json index d234373..9d0f869 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,14 @@ "@penpot/plugin-styles": "^0.10.0", "@phosphor-icons/core": "^2.1.1", "bootstrap-icons": "^1.11.3", + "feather-icons": "^4.29.2", + "heroicons": "^2.1.5", "iconoir": "^7.8.0", "lucide-react": "^0.427.0", "lucide-static": "^0.427.0", "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "remixicon": "^4.3.0" }, "devDependencies": { "@penpot/plugin-types": "^0.10.0", diff --git a/src/icons.ts b/src/icons.ts index 9887a66..1258499 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -111,6 +111,36 @@ export const iconLibraries: IconLibrary[] = [ }, icons: generateVariants("bootstrap", ["regular", "fill"]), }, + { + id: "heroicons", + name: "Heroicons", + website: "https://heroicons.com", + license: { + name: "MIT", + url: "https://github.com/tailwindlabs/heroicons/blob/master/LICENSE", + }, + icons: generateVariants("heroicons", ["outline", "solid", "mini", "micro"]), + }, + { + id: "remixicon", + name: "Remix Icon", + website: "https://remixicon.com/", + license: { + name: "Apache-2.0", + url: "https://github.com/Remix-Design/remixicon/blob/master/License", + }, + icons: generateVariants("remixicon", ["regular", "fill"]), + }, + { + id: "feather", + name: "Feather", + website: "https://feathericons.com/", + license: { + name: "MIT", + url: "https://github.com/feathericons/feather/blob/main/LICENSE", + }, + icons: generateVariants("feather", ["regular"]), + }, ]; export const defaultIconSetSettings: Record =