From 30f7be3fd4fdaec5bf763a48416c89b35f68e902 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Wed, 10 Feb 2021 21:23:37 +0100 Subject: [PATCH 01/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3ed7c5..3006c79 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

Lucide Logo

+

Lucide Logo

# Lucide From 90e86767d845e8aacb73b4e619caf46ca39c872d Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Fri, 12 Feb 2021 20:22:02 +0530 Subject: [PATCH 02/11] add bell plus & minus icon (#202) * add bell plus & minus icon * adjust 2px spacing in bell-minus icon --- icons/bell-minus.svg | 15 +++++++++++++++ icons/bell-plus.svg | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 icons/bell-minus.svg create mode 100644 icons/bell-plus.svg diff --git a/icons/bell-minus.svg b/icons/bell-minus.svg new file mode 100644 index 0000000..4b9f6a8 --- /dev/null +++ b/icons/bell-minus.svg @@ -0,0 +1,15 @@ + + + + + diff --git a/icons/bell-plus.svg b/icons/bell-plus.svg new file mode 100644 index 0000000..542ad66 --- /dev/null +++ b/icons/bell-plus.svg @@ -0,0 +1,16 @@ + + + + + + From c4dfe6b8cb7c5b0589042ee8a42802c3be5c351a Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Fri, 12 Feb 2021 16:07:57 +0100 Subject: [PATCH 03/11] Update tags (#224) * Add script to add more tags * add tags * update tags * Fix tags --- package.json | 1 + scripts/addMissingKeysToTags.js | 41 + scripts/buildIcons.js | 1 + tags.json | 1916 ++++++++++++++++++++++++++----- 4 files changed, 1699 insertions(+), 260 deletions(-) create mode 100644 scripts/addMissingKeysToTags.js diff --git a/package.json b/package.json index 52456d1..9b22904 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "build:es": "babel build -d dist/esm", "build:bundles": "rollup -c rollup.config.js", "optimize": "npx babel-node ./scripts/optimizeSvgs.js --presets @babel/env", + "addtags": "npx babel-node ./scripts/addMissingKeysToTags.js --presets @babel/env", "test": "jest" }, "devDependencies": { diff --git a/scripts/addMissingKeysToTags.js b/scripts/addMissingKeysToTags.js new file mode 100644 index 0000000..73271ab --- /dev/null +++ b/scripts/addMissingKeysToTags.js @@ -0,0 +1,41 @@ +import path from 'path'; +import tags from '../tags.json'; +import { readSvgDirectory, writeFile } from './helpers'; + +const ICONS_DIR = path.resolve(__dirname, '../icons'); + +console.log(`Read all tags`); + +const svgFiles = readSvgDirectory(ICONS_DIR); + +const iconNames = svgFiles.map(icon => icon.split('.')[0]); + +const iconTags = iconNames + .map(iconName => ({ + name: iconName, + tags: tags[iconName] || [], + })) + .sort((a, b) => { + const nameA = a.name; + const nameB = b.name; + + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + + // names must be equal + return 0; + }); + +const newTags = iconTags.reduce((acc, { name, tags }) => { + acc[name] = tags; + + return acc; +}, {}); + +const tagsContent = JSON.stringify(newTags, null, 2); + +writeFile(tagsContent, 'tags.json', path.resolve(__dirname, '..')); diff --git a/scripts/buildIcons.js b/scripts/buildIcons.js index e731a33..6a29563 100644 --- a/scripts/buildIcons.js +++ b/scripts/buildIcons.js @@ -1,5 +1,6 @@ import fs from 'fs'; import path from 'path'; +// eslint-disable-next-line import/no-extraneous-dependencies import getArgumentOptions from 'minimist'; import renderIconsObject from './render/renderIconsObject'; diff --git a/tags.json b/tags.json index 0d99c00..beef889 100644 --- a/tags.json +++ b/tags.json @@ -1,262 +1,1658 @@ { - "activity": ["pulse", "health", "action", "motion"], - "airplay": ["stream", "cast", "mirroring"], - "alert-circle": ["warning", "alert", "danger"], - "alert-octagon": ["warning", "alert", "danger"], - "alert-triangle": ["warning", "alert", "danger"], - "align-center": ["text alignment", "center"], - "align-justify": ["text alignment", "justified"], - "align-left": ["text alignment", "left"], - "align-right": ["text alignment", "right"], - "anchor": [], - "archive": ["index", "box"], - "arrow-big-right": ["forward"], - "at-sign": ["mention", "at", "email", "message"], - "award": ["achievement", "badge"], - "axe": ["hatchet"], - "aperture": ["camera", "photo"], - "bar-chart": ["statistics", "diagram", "graph"], - "bar-chart-2": ["statistics", "diagram", "graph"], - "battery": ["power", "electricity"], - "beaker": ["cup"], - "battery-charging": ["power", "electricity"], - "bell": ["alarm", "notification", "sound"], - "bell-off": ["alarm", "notification", "silent"], - "bike": ["bicycle", "transport", "trip"], - "bluetooth": ["wireless"], - "book-open": ["read", "library"], - "book": ["read", "dictionary", "booklet", "magazine", "library"], - "bookmark": ["read", "clip", "marker", "tag"], - "box": ["cube"], - "briefcase": ["work", "bag", "baggage", "folder"], - "brush": ["draw", "paint"], - "building": ["organisation"], - "bus": ["bus", "vehicle", "transport", "trip"], - "calendar": ["date"], - "camera": ["photo"], - "car": ["vehicle", "transport", "trip"], - "cast": ["chromecast", "airplay"], - "circle": ["off", "zero", "record"], - "clipboard": ["copy"], - "clock": ["time", "watch", "alarm"], - "cloud-drizzle": ["weather", "shower"], - "cloud-lightning": ["weather", "bolt"], - "cloud-rain": ["weather"], - "cloud-snow": ["weather", "blizzard"], - "cloud": ["weather"], - "codepen": ["logo"], - "codesandbox": ["logo"], - "code": ["source", "programming"], - "coffee": ["drink", "cup", "mug", "tea", "cafe", "hot", "beverage"], - "columns": ["layout"], - "command": ["keyboard", "cmd", "terminal", "prompt"], - "compass": ["navigation", "safari", "travel", "direction"], - "copy": ["clone", "duplicate"], - "corner-down-left": ["arrow", "return"], - "corner-down-right": ["arrow"], - "corner-left-down": ["arrow"], - "corner-left-up": ["arrow"], - "corner-right-down": ["arrow"], - "corner-right-up": ["arrow"], - "corner-up-left": ["arrow"], - "corner-up-right": ["arrow"], - "cpu": ["processor", "technology"], - "credit-card": ["purchase", "payment", "cc"], - "crop": ["photo", "image"], - "crosshair": ["aim", "target"], - "crown": ["king", "winner", "favourite"], - "database": ["storage", "memory"], - "delete": ["remove"], - "disc": ["album", "cd", "dvd", "music"], - "dollar-sign": ["currency", "money", "payment"], - "droplet": ["water"], - "edit": ["pencil", "change"], - "edit-2": ["pencil", "change"], - "edit-3": ["pencil", "change"], - "eye": ["view", "watch"], - "eye-off": ["view", "watch", "hide", "hidden"], - "external-link": ["outbound"], - "facebook": ["logo", "social"], - "fast-forward": ["music"], - "figma": ["logo", "design", "tool"], - "file-minus": ["delete", "remove", "erase"], - "file-plus": ["add", "create", "new"], - "file-text": ["data", "txt", "pdf"], - "files": ["multiple", "copy"], - "film": ["movie", "video"], - "filter": ["funnel", "hopper"], - "flag": ["report"], - "flask-conical": ["beaker", "erlenmeyer"], - "flask-round": ["beaker"], - "folder-minus": ["directory"], - "folder-plus": ["directory"], - "folder": ["directory"], - "framer": ["logo", "design", "tool"], - "frown": ["emoji", "face", "bad", "sad", "emotion"], - "gavel": ["hammer", "mallet"], - "gift": ["present", "box", "birthday", "party"], - "git-branch": ["code", "version control"], - "git-commit": ["code", "version control"], - "git-merge": ["code", "version control"], - "git-pull-request": ["code", "version control"], - "github": ["logo", "version control"], - "gitlab": ["logo", "version control"], - "globe": ["world", "browser", "language", "translate"], - "hammer": ["mallet"], - "hard-drive": ["computer", "server", "memory", "data"], - "hard-hat": ["helmet", "construction"], - "hash": ["hashtag", "number", "pound"], - "headphones": ["music", "audio", "sound"], - "heart": ["like", "love", "emotion"], - "help-circle": ["question mark"], - "hexagon": ["shape", "node.js", "logo"], - "home": ["house", "living"], - "image": ["picture", "photo"], - "image-off": ["picture", "photo"], - "inbox": ["email"], - "instagram": ["logo", "camera"], - "key": ["password", "login", "authentication", "secure"], - "laptop": ["computer"], - "layers": ["stack"], - "layout": ["window", "webpage"], - "life-bouy": ["help", "life ring", "support"], - "link": ["chain", "url"], - "link-2": ["chain", "url"], - "linkedin": ["logo", "social media"], - "list": ["options"], - "locate-fixed": ["map", "gps", "location"], - "locate": ["map", "gps", "location"], - "lock": ["security", "password", "secure"], - "log-in": ["sign in", "arrow", "enter"], - "log-out": ["sign out", "arrow", "exit"], - "mail": ["email", "message"], - "map-pin": ["location", "navigation", "travel", "marker"], - "map": ["location", "navigation", "travel"], - "maximize": ["fullscreen"], - "maximize-2": ["fullscreen", "arrows", "expand"], - "meh": ["emoji", "face", "neutral", "emotion"], - "menu": ["bars", "navigation", "hamburger"], - "message-circle": ["comment", "chat"], - "message-square": ["comment", "chat"], - "mic-off": ["record", "sound", "mute"], - "mic": ["record", "sound", "listen"], - "minimize": ["exit fullscreen", "close"], - "minimize-2": ["exit fullscreen", "arrows", "close"], - "minus": ["subtract"], - "monitor": ["tv", "screen", "display"], - "moon": ["dark", "night"], - "more-horizontal": ["ellipsis"], - "more-vertical": ["ellipsis"], - "mouse-pointer": ["arrow", "cursor"], - "move": ["arrows"], - "music": ["note"], - "navigation": ["location", "travel"], - "navigation-2": ["location", "travel"], - "octagon": ["stop"], - "package": ["box", "container"], - "paperclip": ["attachment"], - "pause": ["music", "stop"], - "pause-circle": ["music", "audio", "stop"], - "pen-tool": ["vector", "drawing"], - "percent": ["discount"], - "phone-call": ["ring"], - "phone-forwarded": ["call"], - "phone-incoming": ["call"], - "phone-missed": ["call"], - "phone-off": ["call", "mute"], - "phone-outgoing": ["call"], - "phone": ["call"], - "play": ["music", "start"], - "pie-chart": ["statistics", "diagram"], - "pipette": ["eye dropper", "color picker"], - "plane": ["plane", "trip"], - "play-circle": ["music", "start"], - "plus": ["add", "new"], - "plus-circle": ["add", "new"], - "plus-square": ["add", "new"], - "pocket": ["logo", "save"], - "podcast": ["mic", "music"], - "power": ["on", "off"], - "printer": ["fax", "office", "device"], - "radio": ["signal"], - "refresh-cw": ["synchronise", "arrows"], - "refresh-ccw": ["arrows"], - "repeat": ["loop", "arrows"], - "rewind": ["music"], - "rotate-ccw": ["arrow"], - "rotate-cw": ["arrow"], - "rss": ["feed", "subscribe"], - "ruler": ["measure"], - "save": ["floppy disk"], - "scissors": ["cut"], - "search": ["find", "magnifier", "magnifying glass"], - "send": ["message", "mail", "email", "paper airplane", "paper aeroplane"], - "settings": ["cog", "edit", "gear", "preferences"], - "share-2": ["network", "connections"], - "shield": ["security", "secure"], - "shield-off": ["security", "insecure"], - "shopping-bag": ["ecommerce", "cart", "purchase", "store"], - "shopping-cart": ["ecommerce", "cart", "purchase", "store"], - "shovel": ["dig", "spade"], - "shuffle": ["music"], - "skip-back": ["music"], - "skip-forward": ["music"], - "slack": ["logo"], - "slash": ["ban", "no"], - "sliders": ["settings", "controls"], - "smartphone": ["cellphone", "device"], - "smile": ["emoji", "face", "happy", "good", "emotion"], - "speaker": ["audio", "music"], - "star": ["bookmark", "favorite", "like"], - "stop-circle": ["media", "music"], - "sun": ["brightness", "weather", "light"], - "sunrise": ["weather", "time", "morning", "day"], - "sunset": ["weather", "time", "evening", "night"], - "tablet": ["device"], - "tag": ["label"], - "target": ["logo", "bullseye"], - "terminal": ["code", "command line", "prompt"], - "thermometer": ["temperature", "celsius", "fahrenheit", "weather"], - "thumbs-down": ["dislike", "bad", "emotion"], - "thumbs-up": ["like", "good", "emotion"], - "timer": ["time", "timer", "stopwatch"], - "toggle-left": ["on", "off", "switch"], - "toggle-right": ["on", "off", "switch"], - "wrench": ["tool", "settings", "spanner"], - "trash": ["garbage", "delete", "remove", "bin"], - "trash-2": ["garbage", "delete", "remove", "bin"], - "triangle": ["delta"], - "truck": ["delivery", "van", "shipping", "transport", "lorry"], - "tv": ["television", "stream"], - "twitch": ["logo"], - "twitter": ["logo", "social"], - "type": ["text"], - "umbrella": ["rain", "weather"], - "unlock": ["security"], - "user-check": ["followed", "subscribed"], - "user-minus": ["delete", "remove", "unfollow", "unsubscribe"], - "user-plus": ["new", "add", "create", "follow", "subscribe"], - "user-x": ["delete", "remove", "unfollow", "unsubscribe", "unavailable"], - "user": ["person", "account"], - "users": ["group"], - "video-off": ["camera", "movie", "film"], - "video": ["camera", "movie", "film"], - "voicemail": ["phone"], - "volume": ["music", "sound", "mute"], - "volume-1": ["music", "sound"], - "volume-2": ["music", "sound"], - "volume-x": ["music", "sound", "mute"], - "watch": ["clock", "time"], - "wifi-off": ["disabled"], - "wifi": ["connection", "signal", "wireless"], - "wind": ["weather", "air"], - "x-circle": ["cancel", "close", "delete", "remove", "times", "clear"], - "x-octagon": ["delete", "stop", "alert", "warning", "times", "clear"], - "x-square": ["cancel", "close", "delete", "remove", "times", "clear"], - "x": ["cancel", "close", "delete", "remove", "times", "clear"], - "youtube": ["logo", "video", "play"], - "zap-off": ["flash", "camera", "lightning"], - "zap": ["flash", "camera", "lightning"], - "zoom-in": ["magnifying glass"], - "zoom-out": ["magnifying glass"] + "activity": [ + "pulse", + "health", + "action", + "motion" + ], + "airplay": [ + "stream", + "cast", + "mirroring" + ], + "alarm-check": [ + "done" + ], + "alarm-clock": [], + "alarm-minus": [ + "remove" + ], + "alarm-plus": [ + "add" + ], + "album": [ + "photo", + "book" + ], + "alert-circle": [ + "warning", + "alert", + "danger" + ], + "alert-octagon": [ + "warning", + "alert", + "danger" + ], + "alert-triangle": [ + "warning", + "alert", + "danger" + ], + "align-center": [ + "text alignment", + "center" + ], + "align-justify": [ + "text alignment", + "justified" + ], + "align-left": [ + "text alignment", + "left" + ], + "align-right": [ + "text alignment", + "right" + ], + "anchor": [ + "ship" + ], + "aperture": [ + "camera", + "photo" + ], + "archive": [ + "index", + "box" + ], + "arrow-big-down": [ + "key" + ], + "arrow-big-left": [ + "key" + ], + "arrow-big-right": [ + "key", + "forward" + ], + "arrow-big-up": [ + "key", + "forward" + ], + "arrow-down": [], + "arrow-down-circle": [], + "arrow-down-left": [], + "arrow-down-right": [], + "arrow-left": [], + "arrow-left-circle": [], + "arrow-right": [], + "arrow-right-circle": [], + "arrow-up": [], + "arrow-up-circle": [], + "arrow-up-left": [], + "arrow-up-right": [], + "asterisk": [ + "reference" + ], + "at-sign": [ + "mention", + "at", + "email", + "message" + ], + "award": [ + "achievement", + "badge" + ], + "axe": [ + "hatchet" + ], + "bar-chart": [ + "statistics", + "diagram", + "graph" + ], + "bar-chart-2": [ + "statistics", + "diagram", + "graph" + ], + "battery": [ + "power", + "electricity" + ], + "battery-charging": [ + "power", + "electricity" + ], + "battery-full": [], + "battery-low": [], + "battery-medium": [], + "beaker": [ + "cup" + ], + "bell": [ + "alarm", + "notification", + "sound" + ], + "bell-off": [ + "alarm", + "notification", + "silent" + ], + "bike": [ + "bicycle", + "transport", + "trip" + ], + "bluetooth": [ + "wireless" + ], + "bluetooth-connected": [ + "paired" + ], + "bluetooth-off": [ + "lost" + ], + "bluetooth-searching": [ + "pairing" + ], + "bold": [ + "strong" + ], + "book": [ + "read", + "dictionary", + "booklet", + "magazine", + "library" + ], + "book-open": [ + "read", + "library" + ], + "bookmark": [ + "read", + "clip", + "marker", + "tag" + ], + "bot": [ + "robot" + ], + "box": [ + "cube", + "package" + ], + "box-select": [ + "selection", + "square", + "rectangular", + "marquee", + "tool" + ], + "briefcase": [ + "work", + "bag", + "baggage", + "folder" + ], + "brush": [ + "draw", + "paint", + "color" + ], + "building": [ + "organisation", + "organization" + ], + "bus": [ + "bus", + "vehicle", + "transport", + "trip" + ], + "calculator": [ + "count", + "calculating machine" + ], + "calendar": [ + "date", + "birthdate" + ], + "camera": [ + "photo", + "webcam", + "video" + ], + "camera-off": [ + "photo", + "webcam", + "video" + ], + "car": [ + "vehicle", + "transport", + "trip" + ], + "cast": [ + "chromecast", + "airplay" + ], + "check": [ + "done" + ], + "check-circle": [ + "done" + ], + "check-square": [ + "done" + ], + "chevron-down": [], + "chevron-left": [], + "chevron-right": [], + "chevron-up": [], + "chevrons-down": [], + "chevrons-left": [], + "chevrons-right": [], + "chevrons-up": [], + "chrome": [ + "browser" + ], + "circle": [ + "off", + "zero", + "record" + ], + "clipboard": [ + "copy", + "paste" + ], + "clock": [ + "time", + "watch", + "alarm" + ], + "cloud": [ + "weather" + ], + "cloud-drizzle": [ + "weather", + "shower" + ], + "cloud-lightning": [ + "weather", + "bolt" + ], + "cloud-off": [], + "cloud-rain": [ + "weather" + ], + "cloud-snow": [ + "weather", + "blizzard" + ], + "clover": [ + "leaf", + "luck" + ], + "code": [ + "source", + "programming" + ], + "codepen": [ + "logo" + ], + "codesandbox": [ + "logo" + ], + "coffee": [ + "drink", + "cup", + "mug", + "tea", + "cafe", + "hot", + "beverage" + ], + "coins": [ + "money", + "cash", + "finance", + "gamble" + ], + "columns": [ + "layout" + ], + "command": [ + "keyboard", + "cmd", + "terminal", + "prompt" + ], + "compass": [ + "navigation", + "safari", + "travel", + "direction" + ], + "contact": [ + "person", + "user" + ], + "contrast": [], + "copy": [ + "clone", + "duplicate" + ], + "copyleft": [ + "licence" + ], + "copyright": [ + "licence" + ], + "corner-down-left": [ + "arrow", + "return" + ], + "corner-down-right": [ + "arrow" + ], + "corner-left-down": [ + "arrow" + ], + "corner-left-up": [ + "arrow" + ], + "corner-right-down": [ + "arrow" + ], + "corner-right-up": [ + "arrow" + ], + "corner-up-left": [ + "arrow" + ], + "corner-up-right": [ + "arrow" + ], + "cpu": [ + "processor", + "technology", + "computer", + "chip" + ], + "credit-card": [ + "bank", + "purchase", + "payment", + "cc" + ], + "crop": [ + "photo", + "image" + ], + "cross": [ + "healthcare", + "firstaid" + ], + "crosshair": [ + "aim", + "target" + ], + "crown": [ + "king", + "winner", + "favourite" + ], + "database": [ + "storage", + "memory" + ], + "delete": [ + "remove" + ], + "disc": [ + "album", + "cd", + "dvd", + "music" + ], + "divide": [ + "calculate" + ], + "divide-circle": [ + "calculate" + ], + "divide-square": [ + "calculate" + ], + "dollar-sign": [ + "currency", + "money", + "payment" + ], + "download": [], + "download-cloud": [], + "dribbble": [], + "droplet": [ + "water" + ], + "edit": [ + "pencil", + "change" + ], + "edit-2": [ + "pencil", + "change" + ], + "edit-3": [ + "pencil", + "change" + ], + "equal": [ + "calculate" + ], + "equal-not": [ + "calculate", + "off" + ], + "external-link": [ + "outbound" + ], + "eye": [ + "view", + "watch" + ], + "eye-off": [ + "view", + "watch", + "hide", + "hidden" + ], + "facebook": [ + "logo", + "social" + ], + "fast-forward": [ + "music" + ], + "feather": [], + "figma": [ + "logo", + "design", + "tool" + ], + "file": [], + "file-check": [ + "done" + ], + "file-check-2": [ + "done" + ], + "file-code": [ + "script" + ], + "file-digit": [ + "number" + ], + "file-minus": [ + "delete", + "remove", + "erase" + ], + "file-minus-2": [], + "file-plus": [ + "add", + "create", + "new" + ], + "file-plus-2": [ + "add", + "create", + "new" + ], + "file-search": [ + "lost" + ], + "file-text": [ + "data", + "txt", + "pdf" + ], + "file-x": [ + "lost", + "delete", + "remove" + ], + "file-x-2": [ + "lost", + "delete", + "remove" + ], + "files": [ + "multiple", + "copy" + ], + "film": [ + "movie", + "video" + ], + "filter": [ + "funnel", + "hopper" + ], + "flag": [ + "report" + ], + "flame": [ + "fire", + "lit" + ], + "flashlight": [ + "torch" + ], + "flashlight-off": [ + "torch" + ], + "flask-conical": [ + "beaker", + "erlenmeyer" + ], + "flask-round": [ + "beaker" + ], + "folder": [ + "directory" + ], + "folder-minus": [ + "directory" + ], + "folder-plus": [ + "directory" + ], + "framer": [ + "logo", + "design", + "tool" + ], + "frown": [ + "emoji", + "face", + "bad", + "sad", + "emotion" + ], + "gamepad": [ + "console" + ], + "gamepad-2": [ + "console" + ], + "gauge": [ + "dashboard" + ], + "gavel": [ + "hammer", + "mallet" + ], + "gift": [ + "present", + "box", + "birthday", + "party" + ], + "git-branch": [ + "code", + "version control" + ], + "git-branch-plus": [ + "add", + "create" + ], + "git-commit": [ + "code", + "version control" + ], + "git-merge": [ + "code", + "version control" + ], + "git-pull-request": [ + "code", + "version control" + ], + "github": [ + "logo", + "version control" + ], + "gitlab": [ + "logo", + "version control" + ], + "globe": [ + "world", + "browser", + "language", + "translate" + ], + "globe-2": [ + "world", + "browser", + "language", + "translate" + ], + "grab": [ + "hand" + ], + "grid": [ + "table" + ], + "grip-horizontal": [ + "grab", + "handle" + ], + "grip-vertical": [ + "grab", + "handle" + ], + "hammer": [ + "mallet" + ], + "hand": [ + "wave", + "move", + "mouse", + "grab" + ], + "hard-drive": [ + "computer", + "server", + "memory", + "data", + "ssd", + "disk", + "harddisk" + ], + "hard-hat": [ + "helmet", + "construction", + "savety" + ], + "hash": [ + "hashtag", + "number", + "pound" + ], + "headphones": [ + "music", + "audio", + "sound" + ], + "heart": [ + "like", + "love", + "emotion" + ], + "help-circle": [ + "question mark" + ], + "hexagon": [ + "shape", + "node.js", + "logo" + ], + "highlighter": [ + "mark", + "text" + ], + "home": [ + "house", + "living" + ], + "image": [ + "picture", + "photo" + ], + "image-off": [ + "picture", + "photo" + ], + "image-plus": [ + "add", + "create" + ], + "inbox": [ + "email" + ], + "indent": [ + "text", + "tab" + ], + "infinity": [ + "unlimited", + "forever", + "loop" + ], + "info": [ + "help" + ], + "instagram": [ + "logo", + "camera" + ], + "italic": [ + "oblique", + "text" + ], + "key": [ + "password", + "login", + "authentication", + "secure" + ], + "languages": [ + "translate" + ], + "laptop": [ + "computer" + ], + "laptop-2": [ + "computer" + ], + "lasso": [ + "select" + ], + "lasso-select": [], + "layers": [ + "stack", + "pages" + ], + "layout": [ + "window", + "webpage" + ], + "layout-dashboard": [ + "masonry", + "brick" + ], + "layout-grid": [ + "app", + "home", + "start" + ], + "layout-list": [ + "image", + "photo", + "item" + ], + "library": [ + "book", + "music", + "album" + ], + "life-buoy": [ + "help", + "rescue", + "ship" + ], + "lightbulb": [ + "idea", + "bright" + ], + "link": [ + "chain", + "url" + ], + "link-2": [ + "chain", + "url" + ], + "link-2-off": [ + "unchain", + "chain" + ], + "linkedin": [ + "logo", + "social media" + ], + "list": [ + "options" + ], + "list-checks": [ + "todo", + "done" + ], + "list-ordered": [ + "number", + "order" + ], + "loader": [], + "locate": [ + "map", + "gps", + "location", + "cross" + ], + "locate-fixed": [ + "map", + "gps", + "location", + "cross" + ], + "lock": [ + "security", + "password", + "secure", + "admin" + ], + "log-in": [ + "sign in", + "arrow", + "enter", + "auth" + ], + "log-out": [ + "sign out", + "arrow", + "exit", + "auth" + ], + "mail": [ + "email", + "message", + "letter" + ], + "map": [ + "location", + "navigation", + "travel" + ], + "map-pin": [ + "location", + "navigation", + "travel", + "marker" + ], + "maximize": [ + "fullscreen", + "expand" + ], + "maximize-2": [ + "fullscreen", + "arrows", + "expand" + ], + "meh": [ + "emoji", + "face", + "neutral", + "emotion" + ], + "menu": [ + "bars", + "navigation", + "hamburger", + "options" + ], + "message-circle": [ + "comment", + "chat", + "conversation" + ], + "message-square": [ + "comment", + "chat", + "conversation" + ], + "mic": [ + "record", + "sound", + "listen", + "radio", + "podcast" + ], + "mic-off": [ + "record", + "sound", + "mute" + ], + "minimize": [ + "exit fullscreen", + "close", + "shrink" + ], + "minimize-2": [ + "exit fullscreen", + "arrows", + "close", + "shrink" + ], + "minus": [ + "subtract", + "calculate" + ], + "minus-circle": [ + "subtract", + "calculate" + ], + "minus-square": [ + "subtract", + "calculate" + ], + "monitor": [ + "tv", + "screen", + "display" + ], + "monitor-off": [ + "share" + ], + "moon": [ + "dark", + "night" + ], + "more-horizontal": [ + "ellipsis", + "menu", + "options" + ], + "more-vertical": [ + "ellipsis", + "menu", + "options" + ], + "mouse-pointer": [ + "arrow", + "cursor", + "click" + ], + "mouse-pointer-2": [ + "arrow", + "cursor", + "click" + ], + "move": [ + "arrows" + ], + "move-diagonal": [ + "double", + "arrow" + ], + "move-diagonal-2": [ + "double", + "arrow" + ], + "move-horizontal": [ + "double", + "arrow" + ], + "move-vertical": [ + "double", + "arrow" + ], + "music": [ + "note" + ], + "navigation": [ + "location", + "travel" + ], + "navigation-2": [ + "location", + "travel" + ], + "network": [ + "tree" + ], + "octagon": [ + "stop" + ], + "outdent": [ + "text", + "tab" + ], + "package": [ + "box", + "container" + ], + "palette": [ + "color", + "theme" + ], + "paperclip": [ + "attachment", + "file" + ], + "pause": [ + "music", + "stop" + ], + "pause-circle": [ + "music", + "audio", + "stop" + ], + "pen-tool": [ + "vector", + "drawing", + "path" + ], + "percent": [ + "discount" + ], + "phone": [ + "call" + ], + "phone-call": [ + "ring" + ], + "phone-forwarded": [ + "call" + ], + "phone-incoming": [ + "call" + ], + "phone-missed": [ + "call" + ], + "phone-off": [ + "call", + "mute" + ], + "phone-outgoing": [ + "call" + ], + "pie-chart": [ + "statistics", + "diagram" + ], + "pipette": [ + "eye dropper", + "color picker" + ], + "plane": [ + "plane", + "trip" + ], + "play": [ + "music", + "start" + ], + "play-circle": [ + "music", + "start" + ], + "plus": [ + "add", + "new" + ], + "plus-circle": [ + "add", + "new" + ], + "plus-square": [ + "add", + "new" + ], + "pocket": [ + "logo", + "save" + ], + "podcast": [ + "mic", + "music" + ], + "pointer": [ + "mouse" + ], + "power": [ + "on", + "off" + ], + "printer": [ + "fax", + "office", + "device" + ], + "qr-code": [ + "barcode" + ], + "radio": [ + "signal" + ], + "redo": [ + "undo", + "history" + ], + "refresh-ccw": [ + "arrows", + "reload" + ], + "refresh-cw": [ + "reload", + "synchronise", + "arrows" + ], + "repeat": [ + "loop", + "arrows" + ], + "repeat-1": [ + "replay" + ], + "rewind": [ + "music" + ], + "rotate-ccw": [ + "arrow", + "left" + ], + "rotate-cw": [ + "arrow", + "right" + ], + "rss": [ + "feed", + "subscribe" + ], + "ruler": [ + "measure", + "meter", + "foot", + "inch" + ], + "save": [ + "floppy disk" + ], + "scissors": [ + "cut" + ], + "screen-share": [ + "host", + "desktop" + ], + "screen-share-off": [ + "desktop", + "disconnect" + ], + "search": [ + "find", + "magnifier", + "magnifying glass" + ], + "send": [ + "message", + "mail", + "email", + "paper airplane", + "paper aeroplane" + ], + "separator-horizontal": [ + "move", + "split" + ], + "separator-vertical": [ + "move", + "split" + ], + "server": [], + "server-crash": [], + "server-off": [], + "settings": [ + "cog", + "edit", + "gear", + "preferences" + ], + "share": [], + "share-2": [ + "network", + "connections" + ], + "sheet": [ + "spreadsheets", + "table", + "excel" + ], + "shield": [ + "security", + "secure" + ], + "shield-alert": [ + "security", + "secure", + "virus", + "admin", + "savety" + ], + "shield-check": [ + "security", + "secure", + "done", + "save" + ], + "shield-close": [ + "security", + "secure", + "wrong", + "unsave", + "virus" + ], + "shield-off": [ + "security", + "secure", + "security", + "insecure" + ], + "shirt": [ + "t-shirt", + "shopping", + "store", + "clothing", + "clothes" + ], + "shopping-bag": [ + "ecommerce", + "cart", + "purchase", + "store" + ], + "shopping-cart": [ + "ecommerce", + "cart", + "purchase", + "store" + ], + "shovel": [ + "dig", + "spade" + ], + "shuffle": [ + "music" + ], + "sidebar": [ + "menu" + ], + "sigma": [ + "sum", + "calculate" + ], + "skip-back": [ + "music" + ], + "skip-forward": [ + "music" + ], + "slack": [ + "logo" + ], + "slash": [ + "cancel", + "ban", + "no", + "stop", + "forbidden", + "prohibited", + "error" + ], + "sliders": [ + "settings", + "controls" + ], + "smartphone": [ + "phone", + "cellphone", + "device" + ], + "smile": [ + "emoji", + "face", + "happy", + "good", + "emotion" + ], + "snowflake": [ + "cold", + "weather", + "freeze", + "snow" + ], + "sort-asc": [ + "filter" + ], + "sort-desc": [ + "filter" + ], + "speaker": [ + "audio", + "music" + ], + "sprout": [ + "leaf", + "nature" + ], + "square": [ + "rectangle" + ], + "star": [ + "bookmark", + "favorite", + "like" + ], + "stop-circle": [ + "media", + "music" + ], + "strikethrough": [ + "cross out", + "delete", + "remove" + ], + "sun": [ + "brightness", + "weather", + "light" + ], + "sunrise": [ + "weather", + "time", + "morning", + "day" + ], + "sunset": [ + "weather", + "time", + "evening", + "night" + ], + "switch-camera": [ + "photo", + "selfy", + "front", + "back" + ], + "table": [ + "sheet", + "grid" + ], + "tablet": [ + "device" + ], + "tag": [ + "label" + ], + "target": [ + "logo", + "bullseye" + ], + "terminal": [ + "code", + "command line", + "prompt" + ], + "thermometer": [ + "temperature", + "celsius", + "fahrenheit", + "weather" + ], + "thumbs-down": [ + "dislike", + "bad", + "emotion" + ], + "thumbs-up": [ + "like", + "good", + "emotion" + ], + "timer": [ + "time", + "timer", + "stopwatch" + ], + "toggle-left": [ + "on", + "off", + "switch" + ], + "toggle-right": [ + "on", + "off", + "switch" + ], + "trash": [ + "garbage", + "delete", + "remove", + "bin" + ], + "trash-2": [ + "garbage", + "delete", + "remove", + "bin" + ], + "trello": [], + "trending-down": [ + "statistics" + ], + "trending-up": [ + "statistics" + ], + "triangle": [ + "delta" + ], + "truck": [ + "delivery", + "van", + "shipping", + "transport", + "lorry" + ], + "tv": [ + "television", + "stream" + ], + "twitch": [ + "logo" + ], + "twitter": [ + "logo", + "social" + ], + "type": [ + "text", + "font", + "typography" + ], + "umbrella": [ + "rain", + "weather" + ], + "underline": [ + "text" + ], + "undo": [ + "redo", + "history" + ], + "unlink": [ + "url", + "unchain", + "unchain" + ], + "unlink-2": [ + "url", + "unchain", + "unchain" + ], + "unlock": [ + "security" + ], + "upload": [ + "file" + ], + "upload-cloud": [ + "file" + ], + "user": [ + "person", + "account", + "contact" + ], + "user-check": [ + "followed", + "subscribed", + "done" + ], + "user-minus": [ + "delete", + "remove", + "unfollow", + "unsubscribe" + ], + "user-plus": [ + "new", + "add", + "create", + "follow", + "subscribe" + ], + "user-x": [ + "delete", + "remove", + "unfollow", + "unsubscribe", + "unavailable" + ], + "users": [ + "group", + "people" + ], + "video": [ + "camera", + "movie", + "film" + ], + "video-off": [ + "camera", + "movie", + "film" + ], + "view": [ + "eye", + "look" + ], + "voicemail": [ + "phone", + "cassette" + ], + "volume": [ + "music", + "sound", + "mute" + ], + "volume-1": [ + "music", + "sound" + ], + "volume-2": [ + "music", + "sound" + ], + "volume-x": [ + "music", + "sound", + "mute" + ], + "wallet": [ + "money", + "finance", + "pocket" + ], + "watch": [ + "clock", + "time" + ], + "webcam": [ + "camera", + "security" + ], + "wifi": [ + "connection", + "signal", + "wireless" + ], + "wifi-off": [ + "disabled" + ], + "wind": [ + "weather", + "air", + "blow" + ], + "wrench": [ + "tool", + "settings", + "spanner" + ], + "x": [ + "cancel", + "close", + "delete", + "remove", + "times", + "clear" + ], + "x-circle": [ + "cancel", + "close", + "delete", + "remove", + "times", + "clear" + ], + "x-octagon": [ + "delete", + "stop", + "alert", + "warning", + "times", + "clear" + ], + "x-square": [ + "cancel", + "close", + "delete", + "remove", + "times", + "clear" + ], + "youtube": [ + "logo", + "video", + "play" + ], + "zap": [ + "flash", + "camera", + "lightning" + ], + "zap-off": [ + "flash", + "camera", + "lightning" + ], + "zoom-in": [ + "magnifying glass", + "plus" + ], + "zoom-out": [ + "magnifying glass", + "plus" + ] } From a7e8b3bcb71a1cc5ebe466264dc8d7658f6c301a Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Fri, 12 Feb 2021 20:38:47 +0100 Subject: [PATCH 04/11] Add contributors to icon overlay and add dot (#223) * add contributers * Add icon fetcher * add contributing json * Fix fetch call * Add contributers to site * Add caching for github api * Fix build * Move context provider * Revert packages changes * Fix mobile layout * remove react-spring * remove incorrect type prop --- site/package.json | 3 +- site/src/components/Header.tsx | 32 ++++-- site/src/components/IconDetailOverlay.tsx | 100 +++++++++++------ site/src/components/IconList.tsx | 7 +- site/src/components/Layout.tsx | 4 +- site/src/components/ModifiedTooltip.tsx | 31 ++++++ site/src/lib/fetchAllContributors.ts | 129 ++++++++++++++++++++++ site/src/lib/icons.tsx | 12 +- site/src/pages/_app.tsx | 5 +- site/src/pages/icon/[iconName].tsx | 15 +-- site/src/pages/index.tsx | 19 ++-- site/yarn.lock | 58 ++++------ 12 files changed, 305 insertions(+), 110 deletions(-) create mode 100644 site/src/components/ModifiedTooltip.tsx create mode 100644 site/src/lib/fetchAllContributors.ts diff --git a/site/package.json b/site/package.json index 0c01f7c..d87d238 100644 --- a/site/package.json +++ b/site/package.json @@ -13,7 +13,7 @@ "dependencies": { "@chakra-ui/core": "^1.0.0-rc.8", "downloadjs": "^1.4.7", - "framer-motion": "^2.9.4", + "framer-motion": "^3.3.0", "fuse.js": "^6.0.4", "jszip": "^3.4.0", "lodash": "^4.17.20", @@ -23,7 +23,6 @@ "react": "^16.13.1", "react-color": "2.17.3", "react-dom": "^16.13.1", - "react-spring": "^8.0.27", "react-svg-loader": "^3.0.3" }, "devDependencies": { diff --git a/site/src/components/Header.tsx b/site/src/components/Header.tsx index 4d1dfaa..e8cd6c4 100644 --- a/site/src/components/Header.tsx +++ b/site/src/components/Header.tsx @@ -1,4 +1,4 @@ -import {Button, Flex, Link, Stack, Text,} from "@chakra-ui/core"; +import {Button, Flex, Link, WrapItem, Text, Wrap,} from "@chakra-ui/core"; import download from "downloadjs"; import JSZip from "jszip"; import { Download, Github } from 'lucide-react'; @@ -30,15 +30,26 @@ const Header = ({ data }) => { An open-source icon library, a fork of Feather Icons.
We're expanding the icon set as much as possible while keeping it nice-looking - join us!
- - + + + + + + + - + + ) }; diff --git a/site/src/components/IconDetailOverlay.tsx b/site/src/components/IconDetailOverlay.tsx index c2f751c..5f5b95d 100644 --- a/site/src/components/IconDetailOverlay.tsx +++ b/site/src/components/IconDetailOverlay.tsx @@ -1,41 +1,37 @@ -import { useSpring, animated } from "react-spring"; -import { Box, Text, IconButton, useColorMode, Flex, ButtonGroup, Button, useToast } from "@chakra-ui/core"; +import { Box, Text, IconButton, useColorMode, Flex, Slide, ButtonGroup, Button, useToast, Heading, Avatar, AvatarGroup, Link, Tooltip, useMediaQuery, useDisclosure } from "@chakra-ui/core"; import theme from "../lib/theme"; import download from 'downloadjs'; import copy from "copy-to-clipboard"; import { X as Close } from 'lucide-react'; -import {useContext, useRef} from "react"; +import {useContext, useEffect, useRef} from "react"; import {IconStyleContext} from "./CustomizeIconContext"; import {IconWrapper} from "./IconWrapper"; +import ModifiedTooltip from "./ModifiedTooltip"; type IconDownload = { src: string; name: string; }; -const IconDetailOverlay = ({ isOpen = true, onClose, icon }) => { +const IconDetailOverlay = ({ open = true, close, icon }) => { const toast = useToast(); const { colorMode } = useColorMode(); const { tags = [], name } = icon; const {color, strokeWidth, size} = useContext(IconStyleContext); const iconRef = useRef(null); - - const { transform, opacity } = useSpring({ - opacity: isOpen ? 1 : 0, - transform: `translateY(${isOpen ? -120 : 0}%)`, - config: { mass: 5, tension: 500, friction: 80 }, - }); + const [isMobile] = useMediaQuery("(max-width: 560px)") + const { isOpen, onOpen, onClose } = useDisclosure() const handleClose = () => { onClose(); + close(); }; - const panelStyling = { - transform: transform.interpolate(t => t), - opacity: opacity.interpolate(o => o), - width: "100%", - willChange: "transform" - } + useEffect(() => { + if(open) { + onOpen() + } + }, [open]) const iconStyling = (isLight) => ({ height: "25vw", @@ -88,6 +84,7 @@ const IconDetailOverlay = ({ isOpen = true, onClose, icon }) => { height={0} key={name} > + { w="full" px={8} > - + { - - - - {icon.name} - + + + + + + {icon.name} + + { icon?.contributors?.length ? ( ) : null} + + { tags?.length ? ( { Edit Tags */} - - - - - + + + + + + + + { icon?.contributors?.length ? ( + <> + + Contributors: + + + { icon.contributors.map((commit, index) => ( + + + + + + )) } + + + ) : null } - + + ); }; diff --git a/site/src/components/IconList.tsx b/site/src/components/IconList.tsx index 0b27c8a..f4f5ba3 100644 --- a/site/src/components/IconList.tsx +++ b/site/src/components/IconList.tsx @@ -6,6 +6,7 @@ import {useContext, useMemo} from "react"; import {IconStyleContext} from "./CustomizeIconContext"; import {IconWrapper} from "./IconWrapper"; import { useRouter } from "next/router"; +import ModifiedTooltip from './ModifiedTooltip'; const IconList = ({icons}) => { const router = useRouter() @@ -17,13 +18,13 @@ const IconList = ({icons}) => { return ( { icons.map((icon) => { const actualIcon = icon.item ? icon.item : icon; - const { name, content } = actualIcon; + const { name, content, contributors } = actualIcon; return ( { borderWidth="1px" rounded="lg" padding={16} + position="relative" onClick={(event) => { if (event.shiftKey) { copy(actualIcon.src); @@ -63,6 +65,7 @@ const IconList = ({icons}) => { key={name} alignItems="center" > + { contributors?.length ? ( ) : null} { maxW="1250px" margin="0 auto" w="full" - px={8} + px={5} > @@ -77,7 +77,7 @@ const Layout = ({ children }) => { - + {children}

diff --git a/site/src/components/ModifiedTooltip.tsx b/site/src/components/ModifiedTooltip.tsx new file mode 100644 index 0000000..9c8206b --- /dev/null +++ b/site/src/components/ModifiedTooltip.tsx @@ -0,0 +1,31 @@ +import { Box, Tooltip, useColorMode } from "@chakra-ui/core"; +import theme from '../lib/theme'; + +const ModifiedTooltip = ({}) => { + const { colorMode } = useColorMode(); + + return ( + + + + ) +} + +export default ModifiedTooltip; diff --git a/site/src/lib/fetchAllContributors.ts b/site/src/lib/fetchAllContributors.ts new file mode 100644 index 0000000..27ad1b4 --- /dev/null +++ b/site/src/lib/fetchAllContributors.ts @@ -0,0 +1,129 @@ +import crypto from 'crypto'; +import fs from 'fs'; +import path from 'path'; + +const IGNORE_COMMIT_MESSAGES = ['fork', 'optimize']; + +function getContentHashOfFile(path) { + return new Promise((resolve, reject) => { + const hash = crypto.createHash('md4'); + const stream = fs.createReadStream(path); + stream.on('error', err => reject(err)); + stream.on('data', chunk => hash.update(chunk)); + stream.on('end', () => resolve(hash.digest('hex'))); + }); +} + +const fetchCommitsOfIcon = (name) => + new Promise(async (resolve, reject) => { + try { + const headers = new Headers(); + const username = 'ericfennis'; + const password = process.env.GITHUB_API_KEY; + headers.set( + 'Authorization', + `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`, + ); + + const res = await fetch( + `https://api.github.com/repos/lucide-icons/lucide/commits?path=icons/${name}.svg`, + { + method: 'GET', + headers, + }, + ); + + const data = await res.json(); + + resolve({ + name, + commits: data, + }); + } catch (error) { + + reject(error); + } + }); + +export const filterCommits = (commits) => + commits.filter(({ commit }) => + !IGNORE_COMMIT_MESSAGES.some(ignoreItem => + commit.message.toLowerCase().includes(ignoreItem), + )) + .map(({ sha, author, commit }) => ({ + author: author && author.login ? author.login : null, + commit: sha, + })); + +const getIconHash = async (icon) => await getContentHashOfFile(path.join(process.cwd(), "../icons", `${icon}.svg`)) +const iconCacheDir = path.join(process.cwd(),'.next/cache/github-api'); +const iconCache = (hash) => path.join(iconCacheDir, `${hash}.json`); + +export async function checkIconCache(icon) { + const hash = await getIconHash(icon); + + const cachePath = iconCache(hash); + + if(fs.existsSync( cachePath )) { + const iconCache = fs.readFileSync(cachePath, "utf8"); + + return JSON.parse(iconCache) + } + + return false +} + +async function writeIconCache(icon, content) { + const hash = await getIconHash(icon); + + const iconCachePath = iconCache(hash); + + if (!fs.existsSync(iconCacheDir)){ + fs.mkdirSync(iconCacheDir); +} + + fs.writeFileSync(iconCachePath, JSON.stringify(content), 'utf-8'); +} + +export async function getContributors(icon) { + try { + let iconCommits + const iconCache = await checkIconCache(icon); + + if (iconCache) { + iconCommits = iconCache + } else { + const { commits } : any = await fetchCommitsOfIcon(icon); + + writeIconCache(icon, commits) + + iconCommits = commits + } + + if (iconCommits && iconCommits.length) { + return filterCommits(iconCommits); + } + + return []; + } catch (error) { + throw new Error(error); + } +} + +export async function getAllContributors(icons) { + try { + const AllIconCommits = await Promise.all(icons.map(fetchCommitsOfIcon)); + + const filteredCommits = AllIconCommits.reduce((acc, { name, commits }) => { + if (commits && commits.length) { + acc[name] = filterCommits(commits) + } + + return acc; + }, {}); + + return filteredCommits + } catch (error) { + console.error(error); + } +} diff --git a/site/src/lib/icons.tsx b/site/src/lib/icons.tsx index 8ed75c0..547c52f 100644 --- a/site/src/lib/icons.tsx +++ b/site/src/lib/icons.tsx @@ -2,6 +2,7 @@ import fs from "fs"; import path from "path"; import cheerio from 'cheerio'; import tags from '../../../tags.json'; +import { getContributors } from "./fetchAllContributors"; const directory = path.join(process.cwd(), "../icons"); @@ -13,25 +14,26 @@ export function getAllNames() { }); } -export function getData(name) { +export async function getData(name:string) { const fullPath = path.join(directory, `${name}.svg`); const fileContents = fs.readFileSync(fullPath, "utf8"); const $ = cheerio.load(fileContents); const content = $("svg").html(); + const contributors = await getContributors(name); + return { name, tags: tags[name] || [], + contributors, src: fileContents, content: content }; } -export function getAllData() { +export async function getAllData() { const names = getAllNames(); - return names.map((name) => { - return getData(name); - }); + return Promise.all(names.map((name) => getData(name))); } diff --git a/site/src/pages/_app.tsx b/site/src/pages/_app.tsx index d2bfb1b..17b119d 100644 --- a/site/src/pages/_app.tsx +++ b/site/src/pages/_app.tsx @@ -2,6 +2,7 @@ import { ChakraProvider } from '@chakra-ui/core'; import customTheme from '../lib/theme'; import '../assets/styling.css'; import Head from 'next/head'; +import { CustomizeIconContext } from "../components/CustomizeIconContext"; const App = ({ Component, pageProps }) => { return ( @@ -10,7 +11,9 @@ const App = ({ Component, pageProps }) => { Lucide - + + + ); diff --git a/site/src/pages/icon/[iconName].tsx b/site/src/pages/icon/[iconName].tsx index 988c265..59191b8 100644 --- a/site/src/pages/icon/[iconName].tsx +++ b/site/src/pages/icon/[iconName].tsx @@ -1,4 +1,3 @@ -import { useEffect } from 'react' import { useRouter } from 'next/router' import IconDetailOverlay from '../../components/IconDetailOverlay' import { getAllData, getData } from '../../lib/icons'; @@ -29,7 +28,7 @@ const IconPage = ({ icon, data }) => {

@@ -39,15 +38,17 @@ const IconPage = ({ icon, data }) => { export default IconPage -export function getStaticProps({ params: { iconName } }) { - const data = getAllData(); - const icon = getData(iconName); +export async function getStaticProps({ params: { iconName } }) { + const data = await getAllData(); + const icon = await getData(iconName); return { props: { icon, data } } } -export function getStaticPaths() { +export async function getStaticPaths() { + const data = await getAllData(); + return { - paths: getAllData().map(({name: iconName }) => ({ + paths: data.map(({ name: iconName }) => ({ params: { iconName }, })), fallback: false, diff --git a/site/src/pages/index.tsx b/site/src/pages/index.tsx index 945823b..91e8054 100644 --- a/site/src/pages/index.tsx +++ b/site/src/pages/index.tsx @@ -5,7 +5,6 @@ import IconOverview from "../components/IconOverview"; import IconDetailOverlay from "../components/IconDetailOverlay"; import { useRouter } from "next/router"; import Header from "../components/Header"; -import {CustomizeIconContext} from "../components/CustomizeIconContext"; const IndexPage = ({ data }) => { const router = useRouter(); @@ -13,21 +12,19 @@ const IndexPage = ({ data }) => { return ( - - router.push('/')} - /> -
- - + router.push('/')} + /> +
+ ); }; export async function getStaticProps() { - let data = getAllData(); + let data = await getAllData(); return { props: { diff --git a/site/yarn.lock b/site/yarn.lock index 023e681..3d2c4a7 100644 --- a/site/yarn.lock +++ b/site/yarn.lock @@ -356,7 +356,7 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@7.12.5", "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.9.2": +"@babel/runtime@7.12.5", "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.9.2": version "7.12.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== @@ -3774,25 +3774,23 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^2.9.4: - version "2.9.5" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-2.9.5.tgz#bbb185325d531c57f494cf3f6cf7719fc2c225c7" - integrity sha512-epSX4Co1YbDv0mjfHouuY0q361TpHE7WQzCp/xMTilxy4kXd+Z23uJzPVorfzbm1a/9q1Yu8T5bndaw65NI4Tg== +framer-motion@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-3.3.0.tgz#e355824369f03c8cd07a87ef59b7a8348c33fafd" + integrity sha512-bjUrwXfMJZ6D+HSMDiXbMGKmlWGnUux8HotWgORTZkdPTgKAndlRXjeC2ikCgNVo2ifmRvEla5ckP9JaZc7JKA== dependencies: - framesync "^4.1.0" + framesync "^5.0.0" hey-listen "^1.0.8" - popmotion "9.0.0-rc.20" - style-value-types "^3.1.9" + popmotion "^9.1.0" + style-value-types "^4.0.1" tslib "^1.10.0" optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" -framesync@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/framesync/-/framesync-4.1.0.tgz#69a8db3ca432dc70d6a76ba882684a1497ef068a" - integrity sha512-MmgZ4wCoeVxNbx2xp5hN/zPDCbLSKiDt4BbbslK7j/pM2lg5S0vhTNv1v8BCVb99JPIo6hXBFdwzU7Q4qcAaoQ== - dependencies: - hey-listen "^1.0.5" +framesync@5.0.0, framesync@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/framesync/-/framesync-5.0.0.tgz#7de8caedf53ac441118e79680f1beb7391c328b6" + integrity sha512-wd8t+JsQGisluSv1twiEeDv0aNGpavGb9q7xgIk9fGbcIWkNXF/KVtrjnOrCwBWJuiXxlJfNkcvGudsI32FxYA== from2@^2.1.0: version "2.3.0" @@ -4064,7 +4062,7 @@ he@1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hey-listen@^1.0.5, hey-listen@^1.0.8: +hey-listen@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" integrity sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q== @@ -6049,14 +6047,14 @@ pnp-webpack-plugin@1.6.4: dependencies: ts-pnp "^1.1.6" -popmotion@9.0.0-rc.20: - version "9.0.0-rc.20" - resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-9.0.0-rc.20.tgz#f3550042ae31957b5416793ae8723200951ad39d" - integrity sha512-f98sny03WuA+c8ckBjNNXotJD4G2utG/I3Q23NU69OEafrXtxxSukAaJBxzbtxwDvz3vtZK69pu9ojdkMoBNTg== +popmotion@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-9.1.0.tgz#4360d06bd18ce8baa8f9284ecec7d55344af6325" + integrity sha512-+J7pzzBy5kk2qsP8ilowKs/CH+HoZa3kOGEBNCleCvsPXEF3nKHdfAR3SboMyPvdpIrofaT7ZIy/xWgz446Azw== dependencies: - framesync "^4.1.0" + framesync "5.0.0" hey-listen "^1.0.8" - style-value-types "^3.1.9" + style-value-types "^4.0.1" tslib "^1.10.0" posix-character-classes@^0.1.0: @@ -6215,7 +6213,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -6421,14 +6419,6 @@ react-remove-scroll@2.4.0: use-callback-ref "^1.2.3" use-sidecar "^1.0.1" -react-spring@^8.0.27: - version "8.0.27" - resolved "https://registry.yarnpkg.com/react-spring/-/react-spring-8.0.27.tgz#97d4dee677f41e0b2adcb696f3839680a3aa356a" - integrity sha512-nDpWBe3ZVezukNRandTeLSPcwwTMjNVu1IDq9qA/AMiUqHuRN4BeSWvKr3eIxxg1vtiYiOLy4FqdfCP5IoP77g== - dependencies: - "@babel/runtime" "^7.3.1" - prop-types "^15.5.8" - react-style-singleton@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.1.1.tgz#ce7f90b67618be2b6b94902a30aaea152ce52e66" @@ -7343,10 +7333,10 @@ style-loader@1.2.1: loader-utils "^2.0.0" schema-utils "^2.6.6" -style-value-types@^3.1.9: - version "3.2.0" - resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-3.2.0.tgz#eb89cab1340823fa7876f3e289d29d99c92111bb" - integrity sha512-ih0mGsrYYmVvdDi++/66O6BaQPRPRMQHoZevNNdMMcPlP/cH28Rnfsqf1UEba/Bwfuw9T8BmIMwbGdzsPwQKrQ== +style-value-types@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-4.0.1.tgz#23f05dd03e8a850654defc22cf03ebac572aaa00" + integrity sha512-aOV/HHyynIyTmU27qfs0oAHhFde6BFIvV4+nMerE2MAPZMwYOeQk1/F3S6djxF2u4HdbiieCPs3ZzWsbNUoc9A== dependencies: hey-listen "^1.0.8" tslib "^1.10.0" From a3125d53cb1a67c755d51d51b25a589a8c7308bf Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Mon, 15 Feb 2021 20:50:30 +0530 Subject: [PATCH 05/11] change lucide domain url to lucide.dev (#228) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9b22904..9808aca 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Lucide is a community-run fork of Feather Icons, open for anyone to contribute icons.", "version": "0.13.0", "license": "ISC", - "homepage": "https://lucide.netlify.app", + "homepage": "https://lucide.dev", "repository": "github:lucide-icons/lucide", "bugs": { "url": "https://github.com/lucide-icons/lucide/issues" From b6ea440d7013569fa46a79b7eaa412be28594e1a Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Mon, 15 Feb 2021 20:50:47 +0530 Subject: [PATCH 06/11] add option icon (#225) --- icons/option.svg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 icons/option.svg diff --git a/icons/option.svg b/icons/option.svg new file mode 100644 index 0000000..d8ca90f --- /dev/null +++ b/icons/option.svg @@ -0,0 +1,14 @@ + + + + From 8ce52d834dd8383efe236282c6061b5c4626115a Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Mon, 15 Feb 2021 20:51:00 +0530 Subject: [PATCH 07/11] add inspect icon (#209) --- icons/inspect.svg | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 icons/inspect.svg diff --git a/icons/inspect.svg b/icons/inspect.svg new file mode 100644 index 0000000..ec015d9 --- /dev/null +++ b/icons/inspect.svg @@ -0,0 +1,15 @@ + + + + + From 891115f6fdb9a13da4bc9041284616ea21767f17 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Wed, 17 Feb 2021 13:04:50 +0100 Subject: [PATCH 08/11] Add pencil icon (#129) --- icons/pencil.svg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 icons/pencil.svg diff --git a/icons/pencil.svg b/icons/pencil.svg new file mode 100644 index 0000000..f3a5367 --- /dev/null +++ b/icons/pencil.svg @@ -0,0 +1,14 @@ + + + + From d042899a065548f00b876dc8b69b85d16753c56b Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Wed, 17 Feb 2021 17:48:42 +0530 Subject: [PATCH 09/11] add regex icon (#213) --- icons/regex.svg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 icons/regex.svg diff --git a/icons/regex.svg b/icons/regex.svg new file mode 100644 index 0000000..2d8ffce --- /dev/null +++ b/icons/regex.svg @@ -0,0 +1,16 @@ + + + + + + From 7e91be9e387a5ab4dab979251b529331b8151b73 Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Wed, 17 Feb 2021 17:54:11 +0530 Subject: [PATCH 10/11] add binary icon (#203) --- icons/binary.svg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 icons/binary.svg diff --git a/icons/binary.svg b/icons/binary.svg new file mode 100644 index 0000000..92112e1 --- /dev/null +++ b/icons/binary.svg @@ -0,0 +1,16 @@ + + + + + + From 0c460bc3dd5fe767abc8b3d9930e107c26331bf2 Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Thu, 18 Feb 2021 13:10:21 +0530 Subject: [PATCH 11/11] add image-minus icon (#191) * add image-minus icon * refactor the icon --- icons/image-minus.svg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 icons/image-minus.svg diff --git a/icons/image-minus.svg b/icons/image-minus.svg new file mode 100644 index 0000000..fe68065 --- /dev/null +++ b/icons/image-minus.svg @@ -0,0 +1,16 @@ + + + + + +