Skip to content

Commit 493a7c8

Browse files
committed
fix(graph-editor): add 16 new icons to local NodeIcon component
Updates packages/fbp-graph-editor NodeIcon.tsx with mail, send, code, terminal, minus, globe, git-merge, scissors, shield, repeat, toggle, cpu, box, layers, filter, database icons — both React iconMap and SVG iconPaths for canvas rendering.
1 parent 1c43353 commit 493a7c8

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

packages/fbp-graph-editor/src/components/NodeIcon.tsx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,26 @@ import {
99
FiSquare,
1010
FiHash,
1111
FiPlus,
12+
FiMinus,
1213
FiX,
1314
FiCircle,
1415
FiZap,
1516
FiLink,
17+
FiMail,
18+
FiGlobe,
19+
FiGitMerge,
20+
FiScissors,
21+
FiShield,
22+
FiRepeat,
23+
FiToggleLeft,
24+
FiCpu,
25+
FiCode,
26+
FiSend,
27+
FiBox,
28+
FiLayers,
29+
FiFilter,
30+
FiDatabase,
31+
FiTerminal,
1632
} from 'react-icons/fi';
1733
import { SiGraphql } from 'react-icons/si';
1834
import { TbBraces, TbQuote, TbCursorText } from 'react-icons/tb';
@@ -34,13 +50,29 @@ const iconMap: Record<string, React.ComponentType<{ size?: number; className?: s
3450
'type': FiType,
3551
'hash': FiHash,
3652
'plus': FiPlus,
53+
'minus': FiMinus,
3754
'x': FiX,
3855
'circle': FiCircle,
3956
'braces': TbBraces,
4057
'zap': FiZap,
4158
'quote': TbQuote,
4259
'link': FiLink,
4360
'graphql': SiGraphql,
61+
'mail': FiMail,
62+
'globe': FiGlobe,
63+
'git-merge': FiGitMerge,
64+
'scissors': FiScissors,
65+
'shield': FiShield,
66+
'repeat': FiRepeat,
67+
'toggle': FiToggleLeft,
68+
'cpu': FiCpu,
69+
'code': FiCode,
70+
'send': FiSend,
71+
'box': FiBox,
72+
'layers': FiLayers,
73+
'filter': FiFilter,
74+
'database': FiDatabase,
75+
'terminal': FiTerminal,
4476
};
4577

4678
export function NodeIcon({ icon, size = 14, className = '' }: NodeIconProps) {
@@ -65,13 +97,29 @@ export function NodeIconSvg({ icon, size = 11 }: { icon: string; size?: number }
6597
'type': 'M4 7V4h16v3 M9 20h6 M12 4v16',
6698
'hash': 'M4 9h16 M4 15h16 M10 3v18 M14 3v18',
6799
'plus': 'M12 5v14 M5 12h14',
100+
'minus': 'M5 12h14',
68101
'x': 'M18 6L6 18 M6 6l12 12',
69102
'circle': 'M12 12m-10 0a10 10 0 1020 0 10 10 0 10-20 0',
70103
'braces': 'M8 3H7a2 2 0 00-2 2v5a2 2 0 01-2 2 2 2 0 012 2v5a2 2 0 002 2h1 M16 3h1a2 2 0 012 2v5a2 2 0 002 2 2 2 0 00-2 2v5a2 2 0 01-2 2h-1',
71104
'zap': 'M13 2L3 14h9l-1 8 10-12h-9l1-8z',
72105
'quote': 'M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z',
73106
'link': 'M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71 M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71',
74107
'graphql': 'M12 2L2 7v10l10 5 10-5V7L12 2z M12 22V12 M2 7l10 5 10-5',
108+
'mail': 'M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z M22 6l-10 7L2 6',
109+
'globe': 'M12 12m-10 0a10 10 0 1020 0 10 10 0 10-20 0 M2 12h20 M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z',
110+
'git-merge': 'M18 18m-3 0a3 3 0 106 0 3 3 0 10-6 0 M6 6m-3 0a3 3 0 106 0 3 3 0 10-6 0 M6 21V9a9 9 0 009 9',
111+
'scissors': 'M6 9m-3 0a3 3 0 106 0 3 3 0 10-6 0 M6 15m-3 0a3 3 0 106 0 3 3 0 10-6 0 M20 4L8.12 15.88 M14.47 14.48L20 20 M8.12 8.12L12 12',
112+
'shield': 'M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z',
113+
'repeat': 'M17 1l4 4-4 4 M3 11V9a4 4 0 014-4h14 M7 23l-4-4 4-4 M21 13v2a4 4 0 01-4 4H3',
114+
'toggle': 'M16 5H8a7 7 0 100 14h8a7 7 0 100-14z M8 12m-3 0a3 3 0 106 0 3 3 0 10-6 0',
115+
'cpu': 'M6 6h12v12H6z M9 1v3 M15 1v3 M9 20v3 M15 20v3 M20 9h3 M20 14h3 M1 9h3 M1 14h3',
116+
'code': 'M16 18l6-6-6-6 M8 6l-6 6 6 6',
117+
'send': 'M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z',
118+
'box': 'M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z M3.27 6.96L12 12.01l8.73-5.05 M12 22.08V12',
119+
'layers': 'M12 2L2 7l10 5 10-5-10-5z M2 17l10 5 10-5 M2 12l10 5 10-5',
120+
'filter': 'M22 3H2l8 9.46V19l4 2v-8.54L22 3z',
121+
'database': 'M12 2C6.48 2 2 4.02 2 6.5v11C2 19.98 6.48 22 12 22s10-2.02 10-4.5v-11C22 4.02 17.52 2 12 2z M2 6.5C2 8.98 6.48 11 12 11s10-2.02 10-4.5 M2 12c0 2.48 4.48 4.5 10 4.5s10-2.02 10-4.5',
122+
'terminal': 'M4 17l6-5-6-5 M12 19h8',
75123
};
76124

77125
const path = iconPaths[icon];

0 commit comments

Comments
 (0)