From 9edefe3dfc71b9883c1eb4a5f9bbf7747cc35a31 Mon Sep 17 00:00:00 2001 From: Belar Date: Fri, 6 Sep 2024 09:00:02 +0000 Subject: [PATCH 1/3] feat: add heroicons --- bin/config.ts | 10 ++++++++++ package-lock.json | 6 ++++++ package.json | 1 + src/icons.ts | 10 ++++++++++ 4 files changed, 27 insertions(+) diff --git a/bin/config.ts b/bin/config.ts index 0ccbbe6..c21fff3 100644 --- a/bin/config.ts +++ b/bin/config.ts @@ -27,4 +27,14 @@ 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}`, + })), ]; diff --git a/package-lock.json b/package-lock.json index 94e1759..0477a3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@penpot/plugin-styles": "^0.10.0", "@phosphor-icons/core": "^2.1.1", "bootstrap-icons": "^1.11.3", + "heroicons": "^2.1.5", "iconoir": "^7.8.0", "lucide-react": "^0.427.0", "lucide-static": "^0.427.0", @@ -2672,6 +2673,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", diff --git a/package.json b/package.json index d234373..773e363 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@penpot/plugin-styles": "^0.10.0", "@phosphor-icons/core": "^2.1.1", "bootstrap-icons": "^1.11.3", + "heroicons": "^2.1.5", "iconoir": "^7.8.0", "lucide-react": "^0.427.0", "lucide-static": "^0.427.0", diff --git a/src/icons.ts b/src/icons.ts index 9887a66..2a33efe 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -111,6 +111,16 @@ 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"]), + }, ]; export const defaultIconSetSettings: Record = From 7ebadceac29412e019a943a5acaf73d03a43f499 Mon Sep 17 00:00:00 2001 From: Belar Date: Fri, 6 Sep 2024 09:19:55 +0000 Subject: [PATCH 2/3] feat: add remixicon --- bin/config.ts | 8 ++++++++ bin/files.ts | 2 +- bin/generateIconSets.ts | 2 +- package-lock.json | 8 +++++++- package.json | 3 ++- src/icons.ts | 10 ++++++++++ 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/bin/config.ts b/bin/config.ts index c21fff3..b974563 100644 --- a/bin/config.ts +++ b/bin/config.ts @@ -37,4 +37,12 @@ export const iconPackages = [ variant, iconsDir: `../node_modules/heroicons/${path}`, })), + { + id: "remixicon", + getVariantFromIconName: (iconName: string) => { + if (iconName.endsWith("fill")) return "fill"; + return "regular"; + }, + iconsDir: "../node_modules/remixicon/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 0477a3d..c5d02e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,8 @@ "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", @@ -3748,6 +3749,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 773e363..8933a35 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "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 2a33efe..7da60ac 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -121,6 +121,16 @@ export const iconLibraries: IconLibrary[] = [ }, 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"]), + }, ]; export const defaultIconSetSettings: Record = From f845c845f91dc6cb9b29909988b9b42beed76260 Mon Sep 17 00:00:00 2001 From: Belar Date: Fri, 6 Sep 2024 10:04:44 +0000 Subject: [PATCH 3/3] feat: add feather --- bin/config.ts | 5 +++++ package-lock.json | 25 +++++++++++++++++++++++++ package.json | 1 + src/icons.ts | 10 ++++++++++ 4 files changed, 41 insertions(+) diff --git a/bin/config.ts b/bin/config.ts index b974563..f41a5e0 100644 --- a/bin/config.ts +++ b/bin/config.ts @@ -45,4 +45,9 @@ export const iconPackages = [ }, iconsDir: "../node_modules/remixicon/icons", }, + { + id: "feather", + variant: "regular", + iconsDir: "../node_modules/feather-icons/dist/icons", + }, ]; diff --git a/package-lock.json b/package-lock.json index c5d02e4..495cf8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@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", @@ -1585,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", @@ -1609,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", @@ -2296,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", diff --git a/package.json b/package.json index 8933a35..9d0f869 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@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", diff --git a/src/icons.ts b/src/icons.ts index 7da60ac..1258499 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -131,6 +131,16 @@ export const iconLibraries: IconLibrary[] = [ }, 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 =