figma-lupa 0.3.0 → 0.3.1

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/dist/cli.js CHANGED
@@ -3743,17 +3743,17 @@ var init_package = __esm({
3743
3743
  "package.json"() {
3744
3744
  package_default = {
3745
3745
  name: "figma-lupa",
3746
- version: "0.3.0",
3746
+ version: "0.3.1",
3747
3747
  description: "Read-only Figma CLI, MCP server and plugin for pixel-faithful design-to-code with a small context footprint.",
3748
3748
  type: "module",
3749
3749
  license: "GPL-3.0-or-later",
3750
3750
  repository: {
3751
3751
  type: "git",
3752
- url: "git+https://github.com/wjkba/lupa.git"
3752
+ url: "git+https://github.com/wjkba/figma-lupa.git"
3753
3753
  },
3754
- homepage: "https://github.com/wjkba/lupa#readme",
3754
+ homepage: "https://github.com/wjkba/figma-lupa#readme",
3755
3755
  bugs: {
3756
- url: "https://github.com/wjkba/lupa/issues"
3756
+ url: "https://github.com/wjkba/figma-lupa/issues"
3757
3757
  },
3758
3758
  bin: {
3759
3759
  lupa: "dist/cli.js"
@@ -6208,6 +6208,26 @@ async function heroReact(pkgDir) {
6208
6208
  }
6209
6209
  return out;
6210
6210
  }
6211
+ function genSvg(n2) {
6212
+ const attrs3 = Object.entries(n2.attr ?? {}).map(([k, v]) => `${k === "viewBox" ? k : k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}="${String(v).replace(/"/g, """)}"`).join(" ");
6213
+ return `<${n2.tag} ${attrs3}>${(n2.child ?? []).map(genSvg).join("")}</${n2.tag}>`;
6214
+ }
6215
+ async function reactIcons(pkgDir, set2) {
6216
+ const out = [];
6217
+ const js = await readFile2(path3.join(pkgDir, set2, "index.mjs"), "utf8").catch(() => "");
6218
+ for (const m of js.matchAll(/export function (\w+) \(props\) \{\s*return GenIcon\((\{.*\})\)\(props\)/g)) {
6219
+ let tree;
6220
+ try {
6221
+ tree = JSON.parse(m[2]);
6222
+ } catch {
6223
+ continue;
6224
+ }
6225
+ const points = pointsOf(genSvg({ ...tree, attr: { fill: "currentColor", ...tree.attr } }));
6226
+ const comp = m[1];
6227
+ if (points) out.push({ usage: `<${comp} /> from react-icons/${set2}`, name: kebab(comp.replace(/^[A-Z][a-z]*/, "")), points });
6228
+ }
6229
+ return out;
6230
+ }
6211
6231
  async function heroPhoenix(base) {
6212
6232
  const out = [];
6213
6233
  for (const set2 of HERO_SETS) out.push(...await svgFolder(path3.join(base, set2.dir), (n2) => `<.icon name="hero-${n2}${set2.suffix}" />`));
@@ -6269,7 +6289,7 @@ async function bannedImports(root, pkgs) {
6269
6289
  }
6270
6290
  return out;
6271
6291
  }
6272
- async function iconLibraries(root, manifests, own2 = []) {
6292
+ async function iconLibraries(root, manifests, own2 = [], reactIconSets = []) {
6273
6293
  const libs = /* @__PURE__ */ new Map();
6274
6294
  if (own2.length) {
6275
6295
  libs.set("project", {
@@ -6315,6 +6335,10 @@ async function iconLibraries(root, manifests, own2 = []) {
6315
6335
  else if (pkg === "heroicons" && phoenix) add("heroicons (Phoenix)", () => heroPhoenix(at));
6316
6336
  else if (pkg === "lucide-static") {
6317
6337
  add(pkg, () => svgFolder(path3.join(at, "icons"), (n2) => `lucide-static/icons/${n2}.svg`));
6338
+ } else if (pkg === "react-icons") {
6339
+ for (const set2 of reactIconSets) {
6340
+ if (/^[a-z0-9]+$/.test(set2) && await exists(path3.join(at, set2, "index.mjs"))) add(`react-icons/${set2}`, () => reactIcons(at, set2));
6341
+ }
6318
6342
  }
6319
6343
  }
6320
6344
  }
@@ -6350,7 +6374,7 @@ function fitted(p) {
6350
6374
  const cx = (x0 + x1) / 2;
6351
6375
  const cy = (y0 + y1) / 2;
6352
6376
  const xy = p.xy.map((v, i) => (v - (i % 2 ? cy : cx)) / size + 0.5);
6353
- f = { xy, box: [(x0 - cx) / size + 0.5, (y0 - cy) / size + 0.5, (x1 - cx) / size + 0.5, (y1 - cy) / size + 0.5], kind: p.kind };
6377
+ f = { xy, box: [(x0 - cx) / size + 0.5, (y0 - cy) / size + 0.5, (x1 - cx) / size + 0.5, (y1 - cy) / size + 0.5], kind: p.kind, len: p.len / size };
6354
6378
  fits.set(p, f);
6355
6379
  return f;
6356
6380
  }
@@ -6364,6 +6388,12 @@ function compare(a, b, beat = Infinity) {
6364
6388
  const spread = all[all.length - 1] - offset;
6365
6389
  const maxOffset = a.kind === b.kind && a.kind !== "mixed" ? SAME_KIND_OFFSET : MAX_OFFSET;
6366
6390
  if (offset > maxOffset || spread > SPREAD) return void 0;
6391
+ const designStroke = a.kind === "stroke" && b.kind === "fill";
6392
+ if (designStroke || a.kind === "fill" && b.kind === "stroke") {
6393
+ const [fill, line] = designStroke ? [b, a] : [a, b];
6394
+ if (fill.len < line.len * MIN_OUTLINE_RATIO) return void 0;
6395
+ if (designStroke && Float64Array.from(d1).sort()[Math.floor(d1.length * 0.15)] < offset * 0.8) return void 0;
6396
+ }
6367
6397
  const score = spread + offset / 4;
6368
6398
  return score < beat + 0.01 ? score : void 0;
6369
6399
  }
@@ -6442,7 +6472,7 @@ function pointsOf(svg) {
6442
6472
  box[2] = Math.max(box[2], x);
6443
6473
  box[3] = Math.max(box[3], y);
6444
6474
  }
6445
- return { xy, box, kind: stroked && filled ? "mixed" : stroked ? "stroke" : "fill" };
6475
+ return { xy, box, kind: stroked && filled ? "mixed" : stroked ? "stroke" : "fill", len: len / size };
6446
6476
  }
6447
6477
  function attrs(tag) {
6448
6478
  const out = {};
@@ -6652,7 +6682,7 @@ function apply2(m, l) {
6652
6682
  for (let i = 0; i < l.length; i += 2) out.push(m[0] * l[i] + m[2] * l[i + 1] + m[4], m[1] * l[i] + m[3] * l[i + 1] + m[5]);
6653
6683
  return out;
6654
6684
  }
6655
- var pascal, HERO_SETS, kebab, plainSvg, ICON_PACKAGES, fits, MAX_OFFSET, SAME_KIND_OFFSET, SPREAD, STEP, MAX_POINTS, ARGS;
6685
+ var pascal, HERO_SETS, kebab, plainSvg, ICON_PACKAGES, fits, MAX_OFFSET, SAME_KIND_OFFSET, SPREAD, MIN_OUTLINE_RATIO, STEP, MAX_POINTS, ARGS;
6656
6686
  var init_icons = __esm({
6657
6687
  "src/tools/icons.ts"() {
6658
6688
  "use strict";
@@ -6665,11 +6695,12 @@ var init_icons = __esm({
6665
6695
  ];
6666
6696
  kebab = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
6667
6697
  plainSvg = (svg) => svg.replace(/\{\.\.\.[^{}]*\}/g, "").replace(/([\w:-]+)=\{[^{}]*\}/g, '$1="currentColor"');
6668
- ICON_PACKAGES = ["lucide-react", "lucide-vue-next", "@heroicons/react", "heroicons", "lucide-static"];
6698
+ ICON_PACKAGES = ["lucide-react", "lucide-vue-next", "@heroicons/react", "heroicons", "lucide-static", "react-icons"];
6669
6699
  fits = /* @__PURE__ */ new WeakMap();
6670
6700
  MAX_OFFSET = 0.09;
6671
6701
  SAME_KIND_OFFSET = 0.02;
6672
6702
  SPREAD = 0.025;
6703
+ MIN_OUTLINE_RATIO = 1.3;
6673
6704
  STEP = 0.02;
6674
6705
  MAX_POINTS = 240;
6675
6706
  ARGS = { M: 2, L: 2, H: 1, V: 1, C: 6, S: 4, Q: 4, T: 2, A: 7, Z: 0 };
@@ -7951,6 +7982,7 @@ async function scanProject(root, exclude = [], maxEntries = MAX_ENTRIES) {
7951
7982
  idx.icons.set(s.key, list);
7952
7983
  }
7953
7984
  const ownIcons = [];
7985
+ const reactIconSets = /* @__PURE__ */ new Set();
7954
7986
  for (const [k, f] of comps.entries()) {
7955
7987
  let stem = path4.basename(f).replace(/\.[^.]+$/, "");
7956
7988
  if (/^index$/i.test(stem)) stem = path4.basename(path4.dirname(f));
@@ -7958,6 +7990,7 @@ async function scanProject(root, exclude = [], maxEntries = MAX_ENTRIES) {
7958
7990
  const text2 = /\.(tsx|jsx)$/i.test(f) && k < MAX_CODE ? await readText(f, 2e5) : void 0;
7959
7991
  const found = text2 ? reactComponents(text2) : [];
7960
7992
  if (text2) ownIcons.push(...codeIcons(text2, shown(f)));
7993
+ for (const m of text2?.matchAll(/from\s+["']react-icons\/(\w+)["']/g) ?? []) reactIconSets.add(m[1]);
7961
7994
  for (const c of found) add(idx.components, slug2(c.name), `${c.api} (${shown(f)})`);
7962
7995
  if (!found.some((c) => slug2(c.name) === slug2(stem)) && !NOT_COMPONENT.test(stem)) add(idx.components, slug2(stem), shown(f));
7963
7996
  }
@@ -7970,7 +8003,7 @@ async function scanProject(root, exclude = [], maxEntries = MAX_ENTRIES) {
7970
8003
  for (const [c, f] of classes) add(idx.components, c.toLowerCase(), `.${c} (${f})`);
7971
8004
  const rank = (ref2) => /components?[/\\]ui[/\\]|core_components|_ui[/\\]|[/\\]components[/\\]/.test(ref2) ? 0 : /mail|email|stories|example/i.test(ref2) ? 2 : 1;
7972
8005
  for (const list of idx.components.values()) list.sort((a, b) => rank(a) - rank(b));
7973
- const libs = await iconLibraries(root, manifests, ownIcons).catch(() => []);
8006
+ const libs = await iconLibraries(root, manifests, ownIcons, reactIconSets).catch(() => []);
7974
8007
  if (libs.length) idx.iconLibs = libs;
7975
8008
  if (svgs.length > MAX_SVGS) incomplete ??= `read only the first ${MAX_SVGS} of ${svgs.length} SVG files`;
7976
8009
  if (incomplete) idx.incomplete = `project scan of ${shown(root) || "."} ${incomplete}`;
package/dist/server.js CHANGED
@@ -42436,17 +42436,17 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
42436
42436
  // package.json
42437
42437
  var package_default = {
42438
42438
  name: "figma-lupa",
42439
- version: "0.3.0",
42439
+ version: "0.3.1",
42440
42440
  description: "Read-only Figma CLI, MCP server and plugin for pixel-faithful design-to-code with a small context footprint.",
42441
42441
  type: "module",
42442
42442
  license: "GPL-3.0-or-later",
42443
42443
  repository: {
42444
42444
  type: "git",
42445
- url: "git+https://github.com/wjkba/lupa.git"
42445
+ url: "git+https://github.com/wjkba/figma-lupa.git"
42446
42446
  },
42447
- homepage: "https://github.com/wjkba/lupa#readme",
42447
+ homepage: "https://github.com/wjkba/figma-lupa#readme",
42448
42448
  bugs: {
42449
- url: "https://github.com/wjkba/lupa/issues"
42449
+ url: "https://github.com/wjkba/figma-lupa/issues"
42450
42450
  },
42451
42451
  bin: {
42452
42452
  lupa: "dist/cli.js"
@@ -44833,6 +44833,26 @@ async function heroReact(pkgDir) {
44833
44833
  }
44834
44834
  return out;
44835
44835
  }
44836
+ function genSvg(n2) {
44837
+ const attrs3 = Object.entries(n2.attr ?? {}).map(([k, v]) => `${k === "viewBox" ? k : k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}="${String(v).replace(/"/g, "&quot;")}"`).join(" ");
44838
+ return `<${n2.tag} ${attrs3}>${(n2.child ?? []).map(genSvg).join("")}</${n2.tag}>`;
44839
+ }
44840
+ async function reactIcons(pkgDir, set2) {
44841
+ const out = [];
44842
+ const js = await readFile2(path2.join(pkgDir, set2, "index.mjs"), "utf8").catch(() => "");
44843
+ for (const m of js.matchAll(/export function (\w+) \(props\) \{\s*return GenIcon\((\{.*\})\)\(props\)/g)) {
44844
+ let tree;
44845
+ try {
44846
+ tree = JSON.parse(m[2]);
44847
+ } catch {
44848
+ continue;
44849
+ }
44850
+ const points = pointsOf(genSvg({ ...tree, attr: { fill: "currentColor", ...tree.attr } }));
44851
+ const comp = m[1];
44852
+ if (points) out.push({ usage: `<${comp} /> from react-icons/${set2}`, name: kebab(comp.replace(/^[A-Z][a-z]*/, "")), points });
44853
+ }
44854
+ return out;
44855
+ }
44836
44856
  async function heroPhoenix(base) {
44837
44857
  const out = [];
44838
44858
  for (const set2 of HERO_SETS) out.push(...await svgFolder(path2.join(base, set2.dir), (n2) => `<.icon name="hero-${n2}${set2.suffix}" />`));
@@ -44896,8 +44916,8 @@ async function bannedImports(root, pkgs) {
44896
44916
  }
44897
44917
  return out;
44898
44918
  }
44899
- var ICON_PACKAGES = ["lucide-react", "lucide-vue-next", "@heroicons/react", "heroicons", "lucide-static"];
44900
- async function iconLibraries(root, manifests, own2 = []) {
44919
+ var ICON_PACKAGES = ["lucide-react", "lucide-vue-next", "@heroicons/react", "heroicons", "lucide-static", "react-icons"];
44920
+ async function iconLibraries(root, manifests, own2 = [], reactIconSets = []) {
44901
44921
  const libs = /* @__PURE__ */ new Map();
44902
44922
  if (own2.length) {
44903
44923
  libs.set("project", {
@@ -44943,6 +44963,10 @@ async function iconLibraries(root, manifests, own2 = []) {
44943
44963
  else if (pkg === "heroicons" && phoenix) add("heroicons (Phoenix)", () => heroPhoenix(at));
44944
44964
  else if (pkg === "lucide-static") {
44945
44965
  add(pkg, () => svgFolder(path2.join(at, "icons"), (n2) => `lucide-static/icons/${n2}.svg`));
44966
+ } else if (pkg === "react-icons") {
44967
+ for (const set2 of reactIconSets) {
44968
+ if (/^[a-z0-9]+$/.test(set2) && await exists(path2.join(at, set2, "index.mjs"))) add(`react-icons/${set2}`, () => reactIcons(at, set2));
44969
+ }
44946
44970
  }
44947
44971
  }
44948
44972
  }
@@ -44979,13 +45003,14 @@ function fitted(p) {
44979
45003
  const cx = (x0 + x1) / 2;
44980
45004
  const cy = (y0 + y1) / 2;
44981
45005
  const xy = p.xy.map((v, i) => (v - (i % 2 ? cy : cx)) / size + 0.5);
44982
- f = { xy, box: [(x0 - cx) / size + 0.5, (y0 - cy) / size + 0.5, (x1 - cx) / size + 0.5, (y1 - cy) / size + 0.5], kind: p.kind };
45006
+ f = { xy, box: [(x0 - cx) / size + 0.5, (y0 - cy) / size + 0.5, (x1 - cx) / size + 0.5, (y1 - cy) / size + 0.5], kind: p.kind, len: p.len / size };
44983
45007
  fits.set(p, f);
44984
45008
  return f;
44985
45009
  }
44986
45010
  var MAX_OFFSET = 0.09;
44987
45011
  var SAME_KIND_OFFSET = 0.02;
44988
45012
  var SPREAD = 0.025;
45013
+ var MIN_OUTLINE_RATIO = 1.3;
44989
45014
  function compare(a, b, beat = Infinity) {
44990
45015
  const d1 = nearest(a.xy, b.xy, MAX_OFFSET + SPREAD);
44991
45016
  if (!d1) return void 0;
@@ -44996,6 +45021,12 @@ function compare(a, b, beat = Infinity) {
44996
45021
  const spread = all[all.length - 1] - offset;
44997
45022
  const maxOffset = a.kind === b.kind && a.kind !== "mixed" ? SAME_KIND_OFFSET : MAX_OFFSET;
44998
45023
  if (offset > maxOffset || spread > SPREAD) return void 0;
45024
+ const designStroke = a.kind === "stroke" && b.kind === "fill";
45025
+ if (designStroke || a.kind === "fill" && b.kind === "stroke") {
45026
+ const [fill, line] = designStroke ? [b, a] : [a, b];
45027
+ if (fill.len < line.len * MIN_OUTLINE_RATIO) return void 0;
45028
+ if (designStroke && Float64Array.from(d1).sort()[Math.floor(d1.length * 0.15)] < offset * 0.8) return void 0;
45029
+ }
44999
45030
  const score = spread + offset / 4;
45000
45031
  return score < beat + 0.01 ? score : void 0;
45001
45032
  }
@@ -45076,7 +45107,7 @@ function pointsOf(svg) {
45076
45107
  box[2] = Math.max(box[2], x);
45077
45108
  box[3] = Math.max(box[3], y);
45078
45109
  }
45079
- return { xy, box, kind: stroked && filled ? "mixed" : stroked ? "stroke" : "fill" };
45110
+ return { xy, box, kind: stroked && filled ? "mixed" : stroked ? "stroke" : "fill", len: len / size };
45080
45111
  }
45081
45112
  function attrs(tag) {
45082
45113
  const out = {};
@@ -46568,6 +46599,7 @@ async function scanProject(root, exclude = [], maxEntries = MAX_ENTRIES) {
46568
46599
  idx.icons.set(s.key, list);
46569
46600
  }
46570
46601
  const ownIcons = [];
46602
+ const reactIconSets = /* @__PURE__ */ new Set();
46571
46603
  for (const [k, f] of comps.entries()) {
46572
46604
  let stem = path3.basename(f).replace(/\.[^.]+$/, "");
46573
46605
  if (/^index$/i.test(stem)) stem = path3.basename(path3.dirname(f));
@@ -46575,6 +46607,7 @@ async function scanProject(root, exclude = [], maxEntries = MAX_ENTRIES) {
46575
46607
  const text2 = /\.(tsx|jsx)$/i.test(f) && k < MAX_CODE ? await readText(f, 2e5) : void 0;
46576
46608
  const found = text2 ? reactComponents(text2) : [];
46577
46609
  if (text2) ownIcons.push(...codeIcons(text2, shown(f)));
46610
+ for (const m of text2?.matchAll(/from\s+["']react-icons\/(\w+)["']/g) ?? []) reactIconSets.add(m[1]);
46578
46611
  for (const c of found) add(idx.components, slug2(c.name), `${c.api} (${shown(f)})`);
46579
46612
  if (!found.some((c) => slug2(c.name) === slug2(stem)) && !NOT_COMPONENT.test(stem)) add(idx.components, slug2(stem), shown(f));
46580
46613
  }
@@ -46587,7 +46620,7 @@ async function scanProject(root, exclude = [], maxEntries = MAX_ENTRIES) {
46587
46620
  for (const [c, f] of classes) add(idx.components, c.toLowerCase(), `.${c} (${f})`);
46588
46621
  const rank = (ref2) => /components?[/\\]ui[/\\]|core_components|_ui[/\\]|[/\\]components[/\\]/.test(ref2) ? 0 : /mail|email|stories|example/i.test(ref2) ? 2 : 1;
46589
46622
  for (const list of idx.components.values()) list.sort((a, b) => rank(a) - rank(b));
46590
- const libs = await iconLibraries(root, manifests, ownIcons).catch(() => []);
46623
+ const libs = await iconLibraries(root, manifests, ownIcons, reactIconSets).catch(() => []);
46591
46624
  if (libs.length) idx.iconLibs = libs;
46592
46625
  if (svgs.length > MAX_SVGS) incomplete ??= `read only the first ${MAX_SVGS} of ${svgs.length} SVG files`;
46593
46626
  if (incomplete) idx.incomplete = `project scan of ${shown(root) || "."} ${incomplete}`;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "figma-lupa",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Read-only Figma CLI, MCP server and plugin for pixel-faithful design-to-code with a small context footprint.",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0-or-later",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/wjkba/lupa.git"
9
+ "url": "git+https://github.com/wjkba/figma-lupa.git"
10
10
  },
11
- "homepage": "https://github.com/wjkba/lupa#readme",
11
+ "homepage": "https://github.com/wjkba/figma-lupa#readme",
12
12
  "bugs": {
13
- "url": "https://github.com/wjkba/lupa/issues"
13
+ "url": "https://github.com/wjkba/figma-lupa/issues"
14
14
  },
15
15
  "bin": {
16
16
  "lupa": "dist/cli.js"
@@ -1118,7 +1118,7 @@
1118
1118
  t: "hello",
1119
1119
  role: "plugin",
1120
1120
  protocol: PROTOCOL_VERSION,
1121
- pluginVersion: "0.3.0",
1121
+ pluginVersion: "0.3.1",
1122
1122
  fileKey: fileKey(),
1123
1123
  editorType: figma.editorType
1124
1124
  }, state());
@@ -17,7 +17,7 @@ The target is a Figma URL (in quotes, because it contains `&`), node ids like `1
17
17
 
18
18
  1. From the project's root, run `lupa design [target] -d <the project's asset folder> --screenshot` and read the whole output before writing code. The format is described at the end of this file.
19
19
  - When the task names several frames or components (a screen and its component set, say), pass every link in this one call. Components and tokens they share are then printed once.
20
- - Lupa scans the project (CSS, SCSS and Less variables, Tailwind v4 `@theme` or v3 `tailwind.config`, SVG files, icon libraries, React and Phoenix components and CSS classes) and marks what it already has. `→ var(--x)` after a colour token, a raw colour or a font is the project's variable for that value, and `→ .t-body` after a typography token is the project's text style class. `// project has: …` under a component says where the project defines it, with its props when Lupa reads them: `<Button variant="default*|outline" size="sm|lg"> (src/components/ui/button.tsx)` or `<.button variant="primary*|ghost"> <:actions>` (Phoenix). Use that component and map the Figma variants onto those props. A `src:` outside your asset folder is the project's own icon with the same drawing, so Lupa wrote no copy. A `src:` like `<PlusIcon /> (components/icons/plus.tsx)` is the project's own icon component, and one like `<ChevronDown /> from lucide-react` or `<.icon name="hero-x-mark" />` is the same icon in an icon library the project uses (Lucide, Heroicons): use it as written, with the layer's size and colour.
20
+ - Lupa scans the project (CSS, SCSS and Less variables, Tailwind v4 `@theme` or v3 `tailwind.config`, SVG files, icon libraries, React and Phoenix components and CSS classes) and marks what it already has. `→ var(--x)` after a colour token, a raw colour or a font is the project's variable for that value, and `→ .t-body` after a typography token is the project's text style class. `// project has: …` under a component says where the project defines it, with its props when Lupa reads them: `<Button variant="default*|outline" size="sm|lg"> (src/components/ui/button.tsx)` or `<.button variant="primary*|ghost"> <:actions>` (Phoenix). Use that component and map the Figma variants onto those props. A `src:` outside your asset folder is the project's own icon with the same drawing, so Lupa wrote no copy. A `src:` like `<PlusIcon /> (components/icons/plus.tsx)` is the project's own icon component, and one like `<ChevronDown /> from lucide-react` or `<.icon name="hero-x-mark" />` is the same icon in an icon library the project uses (Lucide, Heroicons, react-icons): use it as written, with the layer's size and colour.
21
21
  - `-d` writes the other icons as SVG and the images as their original files. Each `svg` and `img` layer names its file in `src:`, so use that path where the layer is. You don't need to open the files. Add `--current-color` for monochrome icons that should inherit the text colour, and follow the project's icon conventions (sprite, components). If the project keeps its icons as components rather than files, point `-d` at a scratch folder outside the project and turn the icons you need into components, so no unused SVG files are left behind.
22
22
  - Open the `image:` file under `## screenshot` to see the intent: hierarchy, alignment, what is decorative.
23
23
  - `## components` holds the components used more than once. If the codebase already has one, use it and map its props. Otherwise build it once. `--components names` gives a smaller output when the codebase already has most of them.