igniteui-webcomponents 7.4.0 → 7.4.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/CHANGELOG.md +38 -0
- package/components/checkbox/checkbox-base.d.ts +2 -0
- package/components/checkbox/checkbox-base.js +4 -0
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +3 -11
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +1 -8
- package/components/checkbox/switch.js.map +1 -1
- package/components/color-picker/color-picker.js +3 -3
- package/components/color-picker/color-picker.js.map +1 -1
- package/components/combo/combo.d.ts +6 -4
- package/components/combo/combo.js +13 -24
- package/components/combo/combo.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +3 -3
- package/components/date-picker/date-picker.base.js +2 -2
- package/components/date-picker/date-picker.base.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +4 -4
- package/components/date-time-input/date-time-input.base.js +3 -5
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/file-input/file-input.d.ts +5 -0
- package/components/file-input/file-input.js +4 -0
- package/components/file-input/file-input.js.map +1 -1
- package/components/input/input-base.d.ts +2 -2
- package/components/input/input-base.js +3 -5
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +1 -1
- package/components/radio/radio.d.ts +2 -0
- package/components/radio/radio.js +7 -11
- package/components/radio/radio.js.map +1 -1
- package/components/rating/rating.d.ts +3 -0
- package/components/rating/rating.js +17 -18
- package/components/rating/rating.js.map +1 -1
- package/components/select/select.js +1 -1
- package/components/select/select.js.map +1 -1
- package/components/slider/range-slider.d.ts +0 -1
- package/components/slider/range-slider.js +6 -11
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.d.ts +4 -1
- package/components/slider/slider-base.js +20 -18
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider.d.ts +2 -0
- package/components/slider/slider.js +5 -1
- package/components/slider/slider.js.map +1 -1
- package/components/textarea/textarea.d.ts +1 -4
- package/components/textarea/textarea.js +3 -5
- package/components/textarea/textarea.js.map +1 -1
- package/components/validation-container/validation-container.js +2 -1
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +35 -4
- package/components/virtualization/engine.js +126 -61
- package/components/virtualization/engine.js.map +1 -1
- package/components/virtualization/recycle.d.ts +13 -0
- package/components/virtualization/recycle.js +152 -0
- package/components/virtualization/recycle.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +32 -11
- package/components/virtualization/virtualization.js +14 -11
- package/components/virtualization/virtualization.js.map +1 -1
- package/custom-elements.json +2382 -79
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/internals/controllers/aria-projection.d.ts +61 -23
- package/internals/controllers/aria-projection.js +77 -26
- package/internals/controllers/aria-projection.js.map +1 -1
- package/internals/mixins/forms/associated.js +34 -0
- package/internals/mixins/forms/associated.js.map +1 -1
- package/internals/mixins/forms/types.d.ts +5 -0
- package/internals/mixins/forms/types.js.map +1 -1
- package/internals/templates/toggle-shell.d.ts +15 -14
- package/internals/templates/toggle-shell.js +12 -8
- package/internals/templates/toggle-shell.js.map +1 -1
- package/internals/utils/dom.d.ts +2 -2
- package/internals/utils/dom.js +2 -2
- package/internals/utils/dom.js.map +1 -1
- package/package.json +1 -1
- package/skills/README.md +2 -4
- package/skills/igniteui-wc-choose-components/SKILL.md +2 -1
- package/skills/igniteui-wc-customize-component-theme/SKILL.md +2 -1
- package/skills/igniteui-wc-figma-to-app/SKILL.md +133 -712
- package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +42 -62
- package/skills/igniteui-wc-figma-to-app/references/design-provenance.md +199 -0
- package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +189 -107
- package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +129 -84
- package/skills/igniteui-wc-figma-to-app/references/figma-exploration.md +222 -0
- package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +81 -127
- package/skills/igniteui-wc-figma-to-app/references/project-setup.md +105 -0
- package/skills/igniteui-wc-figma-to-app/references/theme-generation.md +180 -0
- package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +74 -80
- package/skills/igniteui-wc-generate-from-image-design/SKILL.md +2 -1
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +3 -3
- package/skills/igniteui-wc-grids/SKILL.md +133 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +2 -1
- package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +2 -1
- package/skills/igniteui-wc-optimize-bundle-size/SKILL.md +2 -1
- package/web-types.json +1 -1
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> **Part of the [`igniteui-wc-figma-to-app`](../SKILL.md) skill.**
|
|
4
4
|
>
|
|
5
|
-
> Use this file in Phase 1h to identify and extract image assets from Figma artboards
|
|
6
|
-
> before implementation. Read it in full before calling any extraction tool.
|
|
5
|
+
> Use this file in Phase 1h to identify and extract image assets from Figma artboards before implementation. Read it in full before calling any extraction tool.
|
|
7
6
|
>
|
|
8
|
-
> **Zero-placeholder policy:** every image asset visible in the Figma design must be
|
|
9
|
-
> extracted and committed before Phase 4 begins. Gradient placeholders and empty `<div>`
|
|
10
|
-
> boxes are not acceptable. If the highest-fidelity method is unavailable, use the next
|
|
11
|
-
> tier — but always extract something real.
|
|
7
|
+
> **Zero-placeholder policy:** every image asset visible in the Figma design must be extracted and committed before Phase 4 begins. Gradient placeholders and empty `<div>` boxes are not acceptable. If the highest-fidelity method is unavailable, use the next tier — but always extract something real.
|
|
12
8
|
|
|
13
9
|
---
|
|
14
10
|
|
|
@@ -32,25 +28,20 @@ mkdir -p src/assets/images src/assets/icons # or public/images public/icons
|
|
|
32
28
|
|
|
33
29
|
## Step 1 — Acquire the Figma File Key (Required for the REST API)
|
|
34
30
|
|
|
35
|
-
The Figma REST API needs a **file key** — the identifier in every Figma file URL. If
|
|
36
|
-
connected Figma MCP is the addressable variant, you already have it from Phase 0c. If not,
|
|
37
|
-
ask:
|
|
31
|
+
The Figma REST API needs a **file key** — the identifier in every Figma file URL — and a **personal access token**. Reuse the file key from Phase 1 when you have it (the remote Figma server always has one). If not, ask:
|
|
38
32
|
|
|
39
|
-
> "To extract image assets at the highest quality, I need the Figma file key.
|
|
40
|
-
> In the Figma desktop app: right-click the file tab → **Copy link**.
|
|
41
|
-
> The URL looks like `https://www.figma.com/design/ABCDEF1234567890/My-File-Name` — the
|
|
42
|
-
> file key is the segment after `/design/`: **`ABCDEF1234567890`**.
|
|
43
|
-
> If you cannot access it right now, I will use the fallback methods and note which assets
|
|
44
|
-
> need re-exporting at higher quality."
|
|
33
|
+
> "To extract image assets at the highest quality, I need the Figma file key. In the Figma desktop app: right-click the file tab → **Copy link**. The URL looks like `https://www.figma.com/design/ABCDEF1234567890/My-File-Name` — the file key is the segment after `/design/`: **`ABCDEF1234567890`**. If you cannot access it right now, I will use the fallback methods and note which assets need re-exporting at higher quality."
|
|
45
34
|
|
|
46
35
|
```bash
|
|
47
36
|
echo "https://www.figma.com/design/ABCDEF1234567890/My-App" \
|
|
48
37
|
| sed -E 's|.*/design/([^/]+)/.*|\1|'
|
|
49
38
|
# → ABCDEF1234567890
|
|
50
39
|
export FILE_KEY="ABCDEF1234567890"
|
|
51
|
-
export FIGMA_TOKEN="your-personal-access-token" #
|
|
40
|
+
export FIGMA_TOKEN="your-personal-access-token" # REST API only — see below
|
|
52
41
|
```
|
|
53
42
|
|
|
43
|
+
The Figma MCP servers do **not** use a personal access token, so this is a separate token (see `mcp-setup.md § Personal access token`). Ask the user to export it in the agent's shell, and never write it into a project file.
|
|
44
|
+
|
|
54
45
|
---
|
|
55
46
|
|
|
56
47
|
## Two Fundamentally Different Types of Image Assets
|
|
@@ -60,8 +51,7 @@ export FIGMA_TOKEN="your-personal-access-token" # same token the MCP server us
|
|
|
60
51
|
| **Image fill** | A photo, texture, or raster image dragged/pasted into Figma, stored as an IMAGE fill | Layer has a fill of type `IMAGE`; `imageRef` in node data | REST API Method A → original source file |
|
|
61
52
|
| **Vector asset** | A logo, icon, or illustration drawn in Figma with vector tools | Node type `VECTOR`, `BOOLEAN_OPERATION`, or `GROUP` | REST API Method B → clean SVG |
|
|
62
53
|
|
|
63
|
-
Do **not** confuse either with Indigo.Design UI
|
|
64
|
-
Ignite UI components, not extracted assets.
|
|
54
|
+
Do **not** confuse either with component instances — from the Indigo.Design UI Kits or any other kit — that Phase 1f mapped to a canonical role. Those become Ignite UI components, not extracted assets.
|
|
65
55
|
|
|
66
56
|
---
|
|
67
57
|
|
|
@@ -81,42 +71,38 @@ Ignite UI components, not extracted assets.
|
|
|
81
71
|
|
|
82
72
|
> **Ignore these** — do NOT extract them as image assets:
|
|
83
73
|
>
|
|
84
|
-
> - Any layer
|
|
85
|
-
> - Icon glyphs available from a registerable
|
|
86
|
-
> — register them with `registerIconFromText` and render `<igc-icon>` instead
|
|
74
|
+
> - Any layer that Table A maps to a component (`_Button`, `_Input`, `Button`, `Text field`, … — kit component instances from any kit)
|
|
75
|
+
> - Icon glyphs available from a registerable package (Material Icons Extended, Material Symbols, Lucide, Fluent, …; see `figma-component-map.md § Icons`). Register them with `registerIconFromText` and render `<igc-icon>` instead
|
|
87
76
|
> - Artboard/frame boundaries themselves
|
|
88
77
|
|
|
89
78
|
### Size heuristic
|
|
90
79
|
|
|
91
|
-
Large rectangles (width or height > 200px) at key layout positions (hero area, sidebar
|
|
92
|
-
background, card thumbnail slot) are almost always image fills. Small nodes (< 48×48px)
|
|
93
|
-
with icon-like names are usually SVG icons.
|
|
80
|
+
Large rectangles (width or height > 200px) at key layout positions (hero area, sidebar background, card thumbnail slot) are almost always image fills. Small nodes (< 48×48px) with icon-like names are usually SVG icons.
|
|
94
81
|
|
|
95
82
|
### Confirm with design context
|
|
96
83
|
|
|
97
|
-
`figma_get_design_context` returns the reference code **plus a JSON block of download URLs
|
|
98
|
-
for the assets it references**. Each entry confirms the node is a real asset and gives you a
|
|
99
|
-
directly downloadable URL. Note them — Tier 2 depends on them, and they are short-lived.
|
|
84
|
+
`figma_get_design_context` returns the reference code **plus a JSON block of download URLs for the assets it references**. Each entry confirms the node is a real asset and gives you a directly downloadable URL. Note them — Tier 2 depends on them, and they are short-lived.
|
|
100
85
|
|
|
101
86
|
---
|
|
102
87
|
|
|
103
88
|
## Step 3 — Extract at the Highest Available Fidelity
|
|
104
89
|
|
|
105
90
|
```
|
|
106
|
-
Do you have the FILE_KEY?
|
|
91
|
+
Do you have BOTH the FILE_KEY and a FIGMA_TOKEN?
|
|
107
92
|
├─ YES → Tier 1 (REST API). Always the best.
|
|
108
93
|
└─ NO → Did figma_get_design_context return an asset URL for this node?
|
|
94
|
+
(desktop server: http://localhost:3845/assets/…; remote server: short-lived https URLs)
|
|
109
95
|
├─ YES → Tier 2 (download that URL now).
|
|
110
96
|
└─ NO → Can you render the node on its own?
|
|
111
97
|
├─ YES → Tier 3 (figma_get_screenshot per node).
|
|
112
98
|
└─ NO → Tier 4 (CSS placeholder + TODO — last resort only).
|
|
113
99
|
```
|
|
114
100
|
|
|
115
|
-
|
|
101
|
+
The remote server also offers `figma_download_assets` (up to 20 nodes per call, exports and original images). If it is in the tool list, use it for Tier 2 when there is no FIGMA_TOKEN.
|
|
102
|
+
|
|
103
|
+
**At the end of Phase 1h, if you used Tier 2 or Tier 3 for any asset:**
|
|
116
104
|
|
|
117
|
-
> Tell the user: "The following assets were extracted at reduced quality because the Figma
|
|
118
|
-
> file key was not available: [list]. To replace them with the original source files, run
|
|
119
|
-
> the Tier 1 REST API commands once you have the file key."
|
|
105
|
+
> Tell the user: "The following assets were extracted at reduced quality because the Figma REST API was not available (no file key or no personal access token): [list]. To replace them with the original source files, run the Tier 1 REST API commands once you have both."
|
|
120
106
|
|
|
121
107
|
---
|
|
122
108
|
|
|
@@ -183,14 +169,13 @@ done
|
|
|
183
169
|
| `svg_outline_text` | `false` | Keep text as `<text>` elements (smaller, accessible) |
|
|
184
170
|
| `contents_only` | `true` | Render the node in isolation |
|
|
185
171
|
|
|
186
|
-
> **Export URL expiry:** export URLs expire in **30 days**. Download immediately, then
|
|
187
|
-
> rename each file by purpose.
|
|
172
|
+
> **Export URL expiry:** export URLs expire in **30 days**. Download immediately, then rename each file by purpose.
|
|
188
173
|
|
|
189
174
|
---
|
|
190
175
|
|
|
191
176
|
### Tier 2 — Download the Design Context Asset URLs
|
|
192
177
|
|
|
193
|
-
**Use when:**
|
|
178
|
+
**Use when:** Tier 1 is unavailable, but `figma_get_design_context` returned asset URLs for the node.
|
|
194
179
|
|
|
195
180
|
```bash
|
|
196
181
|
curl -sL "<asset-url-from-design-context>" -o src/assets/images/hero-background.png
|
|
@@ -200,15 +185,12 @@ curl -sL "<asset-url-from-design-context>" -o src/assets/icons/logo.svg
|
|
|
200
185
|
Where the URLs appear in the response:
|
|
201
186
|
|
|
202
187
|
- the JSON block of download URLs accompanying the reference code, and
|
|
203
|
-
- `const imgXxx = "…";` declarations at the top of the generated code, referenced by
|
|
204
|
-
`<img src={imgXxx} />` or `background-image`
|
|
188
|
+
- `const imgXxx = "…";` declarations at the top of the generated code, referenced by `<img src={imgXxx} />` or `background-image`
|
|
205
189
|
|
|
206
|
-
**Limitations:** these are renderer outputs, not originals — vectors may come back
|
|
207
|
-
rasterized, and the URLs expire (a desktop-session URL dies when Figma closes). Download
|
|
208
|
-
before doing anything else, rename descriptively, and flag them in the manifest:
|
|
190
|
+
**Limitations:** these are renderer outputs, not originals — vectors may come back rasterized, and the URLs expire (a desktop-server URL dies when the Figma desktop app closes; a remote-server URL expires after a short time). Download before doing anything else, rename descriptively, and flag them in the manifest:
|
|
209
191
|
|
|
210
192
|
```typescript
|
|
211
|
-
// TODO: re-export via Tier 1 REST API once FILE_KEY
|
|
193
|
+
// TODO: re-export via Tier 1 REST API once FILE_KEY and FIGMA_TOKEN are available
|
|
212
194
|
heroBg: '/assets/images/hero-background.png',
|
|
213
195
|
```
|
|
214
196
|
|
|
@@ -216,15 +198,19 @@ heroBg: '/assets/images/hero-background.png',
|
|
|
216
198
|
|
|
217
199
|
### Tier 3 — `figma_get_screenshot` per Node
|
|
218
200
|
|
|
219
|
-
|
|
201
|
+
Address the node the same way as in Phase 1 (`figma-exploration.md § Before the First Call`):
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
// Remote server
|
|
205
|
+
figma_get_screenshot({ fileKey: "<fileKey>", nodeId: "<nodeId>", maxDimension: 2048 })
|
|
206
|
+
// Desktop server: the node ID (check the image), or ask the user to select the layer
|
|
207
|
+
figma_get_screenshot({ nodeId: "<nodeId>", maxDimension: 2048 })
|
|
208
|
+
figma_get_screenshot({})
|
|
209
|
+
```
|
|
220
210
|
|
|
221
|
-
|
|
222
|
-
assets directory. Raise `maxDimension` for detail; the metadata reports the node's natural
|
|
223
|
-
size so you can tell whether the render was clamped. On the session-bound Figma MCP variant,
|
|
224
|
-
ask the user to select the node first.
|
|
211
|
+
If the response is a URL, download it straight into the assets directory (it is short-lived); if the image comes back inline, save it from there. Raise `maxDimension` for detail.
|
|
225
212
|
|
|
226
|
-
**Limitations:** a render, not a source file; vectors are rasterized; may include
|
|
227
|
-
surrounding canvas. Label them:
|
|
213
|
+
**Limitations:** a render, not a source file; vectors are rasterized; may include surrounding canvas. Label them:
|
|
228
214
|
|
|
229
215
|
```typescript
|
|
230
216
|
// TODO: re-export at higher fidelity via Tier 1 — current version is a node render
|
|
@@ -235,12 +221,11 @@ heroBg: '/assets/images/hero-background.png',
|
|
|
235
221
|
|
|
236
222
|
### Tier 4 — CSS Fallback (Last Resort Only)
|
|
237
223
|
|
|
238
|
-
**Use only when** the layer is confirmed to be a pure color fill or gradient — never because
|
|
239
|
-
extraction felt difficult.
|
|
224
|
+
**Use only when** the layer is confirmed to be a pure color fill or gradient — never because extraction felt difficult.
|
|
240
225
|
|
|
241
226
|
```css
|
|
242
227
|
.hero-banner {
|
|
243
|
-
/* TODO: replace with real asset — extraction blocked (no
|
|
228
|
+
/* TODO: replace with real asset — extraction blocked (no REST token and no design-context asset URL) */
|
|
244
229
|
background: linear-gradient(135deg, #0d1b3e 0%, #1a0533 100%);
|
|
245
230
|
}
|
|
246
231
|
```
|
|
@@ -289,9 +274,7 @@ render() {
|
|
|
289
274
|
}
|
|
290
275
|
```
|
|
291
276
|
|
|
292
|
-
Always set `width`/`height` (or a CSS aspect ratio) to avoid layout shift, and `alt` for the
|
|
293
|
-
Phase 5g accessibility check. Use `loading="lazy"` for below-the-fold images and
|
|
294
|
-
`fetchpriority="high"` for the LCP image.
|
|
277
|
+
Always set `width`/`height` (or a CSS aspect ratio) to avoid layout shift, and `alt` for the Phase 5g accessibility check. Use `loading="lazy"` for below-the-fold images and `fetchpriority="high"` for the LCP image.
|
|
295
278
|
|
|
296
279
|
### Background images in component styles
|
|
297
280
|
|
|
@@ -305,9 +288,7 @@ static styles = css`
|
|
|
305
288
|
`;
|
|
306
289
|
```
|
|
307
290
|
|
|
308
|
-
> **Use root-absolute paths inside `css`.** A Lit `css` template is not a stylesheet file on
|
|
309
|
-
> disk — relative URLs resolve against the *document*, not the component, so `url('../x.png')`
|
|
310
|
-
> breaks on nested routes. Either use `/assets/...`, or let the bundler hash the asset:
|
|
291
|
+
> **Use root-absolute paths inside `css`.** A Lit `css` template is not a stylesheet file on disk — relative URLs resolve against the *document*, not the component, so `url('../x.png')` breaks on nested routes. Either use `/assets/...`, or let the bundler hash the asset:
|
|
311
292
|
>
|
|
312
293
|
> ```typescript
|
|
313
294
|
> import heroUrl from '../../assets/images/hero-background.jpg';
|
|
@@ -339,8 +320,7 @@ registerIconFromText('brand-logo', logoSvg, 'app');
|
|
|
339
320
|
<igc-icon name="brand-logo" collection="app"></igc-icon>
|
|
340
321
|
```
|
|
341
322
|
|
|
342
|
-
Registering an extracted SVG lets it inherit `color` and the theme, which a plain `<img>`
|
|
343
|
-
cannot. See `figma-component-map.md § Icons` for the Material Icons Extended setup.
|
|
323
|
+
Registering an extracted SVG lets it inherit `color` and the theme, which a plain `<img>` cannot. See `figma-component-map.md § Icons` for the Material Icons Extended setup.
|
|
344
324
|
|
|
345
325
|
---
|
|
346
326
|
|
|
@@ -349,15 +329,15 @@ cannot. See `figma-component-map.md § Icons` for the Material Icons Extended se
|
|
|
349
329
|
| Pitfall | Consequence | Fix |
|
|
350
330
|
| ------------------------------------------------------------ | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
351
331
|
| Skipping asset extraction (gradient placeholders) | Implementation looks nothing like the design; Phase 5 fails | Always use at least Tier 2 or Tier 3 — never skip |
|
|
352
|
-
| Not asking for the file key before starting | Falls back to Tier 2/3 when Tier 1 was possible |
|
|
332
|
+
| Not asking for the file key before starting | Falls back to Tier 2/3 when Tier 1 was possible | Reuse the Phase 1 file key, or ask for it in Step 1, and ask for a REST token |
|
|
353
333
|
| Leaving design-context or CDN URLs in source code | URLs expire in hours to 30 days; production breaks | Download during the session; reference only local paths |
|
|
354
334
|
| Naming assets by node ID (`node-123-456.png`) | Unmaintainable | Name by purpose: `hero-background.jpg`, `company-logo.svg` |
|
|
355
335
|
| Relative `url()` inside a Lit `css` template | 404s on nested routes — the URL resolves against the document | Use `/assets/...` or a bundler import |
|
|
356
|
-
| Putting assets in `src/` in a stock Vite app |
|
|
336
|
+
| Putting assets in `src/` in a stock Vite app | Served in dev, but not emitted by `vite build` unless imported or copied (the Ignite UI CLI scaffold copies `src/assets`); 404 in production | Use `public/`, or import the asset so the bundler emits it |
|
|
357
337
|
| Using a node screenshot for an SVG logo | Rasterized logo, no scaling, no theming | Tier 1 Method B with `format=svg` |
|
|
358
338
|
| Exporting PNG at `scale=1` | Blurry on HiDPI screens | Always `scale=2` |
|
|
359
339
|
| `svg_outline_text=true` (the default) | Text converted to paths; larger file; no accessibility | Set `svg_outline_text=false` |
|
|
360
|
-
| Extracting kit component instances as images | A static picture instead of a working component | Check `figma-component-map.md` — those are components
|
|
340
|
+
| Extracting kit component instances as images | A static picture instead of a working component | Check Table A / `figma-component-map.md` — those are components, whatever kit they came from |
|
|
361
341
|
| Extracting registerable icons as PNGs | Icons cannot inherit theme color | Register the SVG and use `<igc-icon>` |
|
|
362
342
|
| Extracting background colors or gradients as images | Bundle bloat, breaks theming | Colors → palette variables and component tokens |
|
|
363
343
|
| Not creating asset directories before `curl` | Silent failures or files in the wrong place | `mkdir -p` first |
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Design Provenance — Recognizing Components From Any UI Kit
|
|
2
|
+
|
|
3
|
+
> **Part of the [`igniteui-wc-figma-to-app`](../SKILL.md) skill.**
|
|
4
|
+
>
|
|
5
|
+
> Use this file in Phase 1f to decide **where every component in the design came from** and to normalize it into a **canonical role** that [figma-component-map.md](figma-component-map.md) resolves to an Ignite UI tag. Read it in full before building the Phase 1g decomposition table.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Why This Step Exists
|
|
10
|
+
|
|
11
|
+
Designers build Figma screens from many sources: the Infragistics **Indigo.Design UI Kits**, public kits (Material 3 Design Kit, Fluent 2, Bootstrap, shadcn/ui, Untitled UI, Ant Design, iOS/Apple kits), an in-house design system, or plain frames with no components at all. The Ignite UI kits map to Ignite UI one-to-one by layer name. Other kits do not, but they describe the same **roles** (a high-emphasis button, an outlined text field, a tab strip), using different names and variant properties.
|
|
12
|
+
|
|
13
|
+
Translating any kit directly into Ignite UI tags would need one mapping table per kit. Instead, this skill uses two steps: **kit → canonical role** (a small vocabulary, normalized here) and **canonical role → Ignite UI** (one table, in `figma-component-map.md`). A kit you have never seen still works if its variant names can be normalized.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Step 1 — Collect the Evidence for Each Instance
|
|
18
|
+
|
|
19
|
+
For every component-like layer in the target artboard, gather what the design data exposes. Use the cheapest source first.
|
|
20
|
+
|
|
21
|
+
| Evidence | Where it comes from | Strength |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| **Layer / main-component name** | `data-name` in `figma_get_design_context`; instance names in `figma_get_metadata` XML | Medium. Designers rename layers, and detached instances keep the old name. |
|
|
24
|
+
| **Variant properties** (`Variant=Primary`, `Size=md`, `State=Hover`) | The design-context code (component props), or the REST API (below) | Strong. This is the kit's own statement of role and variant. |
|
|
25
|
+
| **Component description** | REST `components` map, or design-context annotations | Strong when present. Kits often document intent here. |
|
|
26
|
+
| **Code Connect mapping** | `figma_get_code_connect_map` | Strong for **role**, but it may point at a *different* library. See the caveat below. |
|
|
27
|
+
| **Library / source file name** | `figma_get_libraries` (the libraries the file subscribes to: name, key, description) and `figma_search_design_system` (returns `libraryName` for a component name). Check the connected server's tool list, because availability varies by Figma MCP version. | Strong for kit identity. Call `get_libraries` **once per file**: it names the kits in play before you look at a single instance. |
|
|
28
|
+
| **Structure + visuals** | Auto-layout, children, fills, size, the screenshot | Weak alone. It is the only evidence for un-componentized frames. |
|
|
29
|
+
|
|
30
|
+
**Reading exact variant properties via the REST API** (use when names are ambiguous and `FIGMA_TOKEN` + `FILE_KEY` are available. This is the REST API token from `mcp-setup.md § Personal access token`, not an MCP credential):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
curl -s -H "X-Figma-Token: $FIGMA_TOKEN" \
|
|
34
|
+
"https://api.figma.com/v1/files/$FILE_KEY/nodes?ids=$ARTBOARD_ID" -o /tmp/figma_nodes.json
|
|
35
|
+
|
|
36
|
+
# Every instance with its variant properties
|
|
37
|
+
jq '[.. | objects | select(.type? == "INSTANCE")
|
|
38
|
+
| {id, name, componentId, props: (.componentProperties // {} | with_entries(.value |= .value))}]' \
|
|
39
|
+
/tmp/figma_nodes.json
|
|
40
|
+
|
|
41
|
+
# Main-component and component-set names/descriptions (remote == came from a library)
|
|
42
|
+
jq '.nodes[].components, .nodes[].componentSets' /tmp/figma_nodes.json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Design-context quirks that matter here:**
|
|
46
|
+
|
|
47
|
+
- `data-name` preserves the main-component name, for example `.Status badge`. Components can also appear as local functions with typed props (`Button({ variant = "outline" })`), which carry the variant values.
|
|
48
|
+
- Nodes inside an instance have IDs like `I9:12;6:3`. Treat those as parts of the parent component, not as components of their own.
|
|
49
|
+
- If the response is flagged **sparse** (large frames), fetch the visible child nodes in one parallel batch instead of guessing from the partial output.
|
|
50
|
+
- When Code Connect maps components to a non-Ignite library, pass `disableCodeConnect: true` (where the server supports it) to keep the reference output free of foreign imports. Read the mapping separately with `figma_get_code_connect_map`.
|
|
51
|
+
|
|
52
|
+
`remote: true` on a component means it came from a published library. `componentSetId` groups the variants of one component. Use the **component-set name** as the main-component name, because instance layer names are often edited.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 2 — Classify Provenance (Per Instance)
|
|
57
|
+
|
|
58
|
+
Classify **per instance**, not per file. Real files mix sources: an Ignite UI kit navbar next to a hand-drawn KPI tile and a third-party date picker.
|
|
59
|
+
|
|
60
|
+
| Tier | What it is | Recognized by | Resolution path |
|
|
61
|
+
| --- | --- | --- | --- |
|
|
62
|
+
| **A — Ignite UI kit** | Instance of an Indigo.Design UI Kit component | Leading-underscore names (`_Button/Contained`, `_Input/Border`), `Indigo.Design` library names, hidden `size-[0.5px]` variant-indicator nodes, the kit variable collections | Direct lookup in `figma-component-map.md` by kit name. Highest confidence. |
|
|
63
|
+
| **B — Other component library** | Instance of any other published or local component (public kit or in-house) | A main component / component set with variant properties, without Tier A fingerprints | **Normalize** (Step 3) to a canonical role, then look it up in the canonical role index of `figma-component-map.md`. |
|
|
64
|
+
| **C — Un-componentized** | Plain frames, groups, or detached instances | No main component. Type is `FRAME` / `GROUP`, or a detached copy that still carries a component-like name | **Infer** the role from structure and visuals (Step 4). Lowest confidence. Confirm with the user. |
|
|
65
|
+
|
|
66
|
+
Record the tier and a confidence (**high / medium / low**) in the Phase 1g Table A.
|
|
67
|
+
|
|
68
|
+
### Recognizing common public kits (confirmation only)
|
|
69
|
+
|
|
70
|
+
These fingerprints help name the kit in the plan and choose the theme baseline (Phase 3b). Normalization does **not** depend on them. Kit files change between versions, so treat every row as a hint, not a rule.
|
|
71
|
+
|
|
72
|
+
| Kit | Typical fingerprints | Default icon set |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| Material 3 Design Kit (Google) | Variables/styles under `M3/…` or `md.sys.…` / `md.ref.…`; tonal roles (`primary`, `on-primary`, `primary-container`, `surface-container-*`); button styles *Filled / Tonal / Outlined / Text / Elevated*; text fields *Filled / Outlined* | Material Symbols |
|
|
75
|
+
| Fluent 2 (Microsoft) | Token names like `colorBrandBackground`, `colorNeutralForeground1`, `borderRadiusMedium`; button appearance *Primary / Secondary / Outline / Subtle / Transparent* | Fluent System Icons |
|
|
76
|
+
| Bootstrap kits | Variant names `primary / secondary / success / danger / warning / info / light / dark`; `btn-outline-*`; `form-control` / `form-select` | Bootstrap Icons |
|
|
77
|
+
| shadcn/ui kits | Semantic variables `background`, `foreground`, `primary`, `primary-foreground`, `muted`, `accent`, `border`, `input`, `ring`, `radius`; button variants *default / secondary / outline / ghost / link / destructive* | Lucide |
|
|
78
|
+
| Untitled UI | `Colors/Brand/600`, `Colors/Gray (light mode)/…`, `bg-primary`, `text-secondary`; button hierarchy *Primary / Secondary / Tertiary / Link* (+ *color / gray*) | Untitled UI Icons (paid Pro tier; check the license) |
|
|
79
|
+
| Ant Design kits | Button type *Primary / Default / Dashed / Text / Link*; `colorPrimary`, `colorBgContainer` tokens | Ant Design Icons |
|
|
80
|
+
| iOS / Apple kits | SF Pro type, *Filled / Tinted / Gray / Plain* buttons, grouped inset lists, tab bars at the bottom | SF Symbols (not licensed for web; substitute) |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Step 3 — Normalize Tier B Instances Into Canonical Roles
|
|
85
|
+
|
|
86
|
+
Normalize **role**, **emphasis**, **style**, **size**, and **state** separately. Match property values case-insensitively and by meaning, not exact spelling.
|
|
87
|
+
|
|
88
|
+
### Role (from the component or component-set name)
|
|
89
|
+
|
|
90
|
+
Strip prefixes, sigils, status emoji, numbering, and platform tags (`.Button`, `Button / Base`, `❖ Button`, `✅ Button`, `[Web] Button`, `Buttons`). A leading `.` usually marks a private or base component. A leading `_` with a `/` path (`_Button/Contained`) is the Tier A Indigo.Design fingerprint. Classify it before stripping anything. Ignore the order of variant axes: `Button (M, Accent)` is the same as `Button (Accent, M)`. Then match against the canonical roles in `figma-component-map.md § Canonical Role Index`. Common synonyms:
|
|
91
|
+
|
|
92
|
+
| Canonical role | Also called |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `button` | Btn, CTA, Action |
|
|
95
|
+
| `icon-button` | Button with `Icon only=true`, Icon Btn, Square button |
|
|
96
|
+
| `fab` | Floating action button, Extended FAB |
|
|
97
|
+
| `toggle-group` | Segmented button, Segmented control, Button group (selectable), Radio buttons (button style) |
|
|
98
|
+
| `text-field` | Input, Text input, Field, Form control, Textbox |
|
|
99
|
+
| `textarea` | Text area, Multiline input |
|
|
100
|
+
| `select` | Dropdown (as a form field), Picker, Listbox trigger |
|
|
101
|
+
| `combobox` | Autocomplete, Searchable select, Typeahead, Multi-select, Tag input |
|
|
102
|
+
| `menu` | Dropdown menu, Context menu, Overflow menu, Action sheet (desktop) |
|
|
103
|
+
| `app-bar` | Navbar, Top bar, Header, Toolbar (page-level) |
|
|
104
|
+
| `side-nav` | Sidebar, Drawer, Navigation rail, Rail |
|
|
105
|
+
| `tabs` | Tab bar, Tab list, Segmented tabs |
|
|
106
|
+
| `breadcrumbs` | Breadcrumb, Path |
|
|
107
|
+
| `dialog` | Modal, Alert dialog |
|
|
108
|
+
| `sheet` | Side sheet, Drawer (overlay), Bottom sheet |
|
|
109
|
+
| `toast` | Snackbar, Notification, Sonner |
|
|
110
|
+
| `inline-alert` | Alert, Banner, Callout, Message bar |
|
|
111
|
+
| `tag` | Badge (text pill), Label, Pill, Status |
|
|
112
|
+
| `count-badge` | Badge (dot or number on another element), Indicator |
|
|
113
|
+
| `chip` | Filter chip, Input chip, Assist chip, Removable tag |
|
|
114
|
+
| `data-table` | Table, Data grid, Grid |
|
|
115
|
+
| `list` | List, List group, Menu list (non-overlay) |
|
|
116
|
+
| `progress-linear` / `progress-circular` | Progress bar, Loader / Spinner (determinate or not) |
|
|
117
|
+
|
|
118
|
+
### Emphasis (buttons, icon buttons, links)
|
|
119
|
+
|
|
120
|
+
| Normalized | Kit values that mean it |
|
|
121
|
+
| --- | --- |
|
|
122
|
+
| **high** | Primary, Filled, Solid, Contained, Default (shadcn), Brand, Accent, Hierarchy=Primary |
|
|
123
|
+
| **medium** | Secondary, Tonal, Soft, Outline(d), Stroke, Bordered, Default (Ant/Fluent), Gray |
|
|
124
|
+
| **low** | Tertiary, Ghost, Subtle, Text, Plain, Transparent, Flat, Borderless |
|
|
125
|
+
| **link** | Link, Hyperlink, Link color / Link gray |
|
|
126
|
+
| **elevated** | Elevated, Raised |
|
|
127
|
+
| **danger** (modifier) | Destructive, Danger, Error, Critical |
|
|
128
|
+
|
|
129
|
+
"Secondary" means *outlined* in some kits and *a filled button in the secondary color* in others. Read the visuals of that instance (fill vs stroke) before choosing.
|
|
130
|
+
|
|
131
|
+
### Style (form fields)
|
|
132
|
+
|
|
133
|
+
| Normalized | Kit values / visuals |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| **outlined** | Outlined, Bordered, Border, Default with a full 1px stroke |
|
|
136
|
+
| **filled** | Filled, Box, Solid, Flushed-with-background, Tonal |
|
|
137
|
+
| **underlined** | Line, Underline, Flushed, Standard |
|
|
138
|
+
| **label-floating** | Label inside the field that moves to the top edge |
|
|
139
|
+
| **label-above** | Label as separate text above the field |
|
|
140
|
+
|
|
141
|
+
### Size and state
|
|
142
|
+
|
|
143
|
+
- **Size:** record the measured control **height** in px (from the design context), not the kit's size name. Kits disagree on what `md` means. Phase 3d turns heights into `--ig-size`.
|
|
144
|
+
- **State:** `Hover`, `Focused`, `Pressed`, `Disabled`, `Error`, `Selected` variants are **states**, not different components. Implement the default state, and use state values only as token inputs (hover color, focus ring) in Phase 3d. A screen showing a `State=Error` field means the design wants validation styling. It does not mean the field is permanently invalid.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Step 4 — Infer Tier C (Un-componentized) Layers
|
|
149
|
+
|
|
150
|
+
Use the exact values from the design context and the screenshot together:
|
|
151
|
+
|
|
152
|
+
| Structure observed | Likely role |
|
|
153
|
+
| --- | --- |
|
|
154
|
+
| Auto-layout row, 28–56px tall, one short text (± icon), solid fill or 1px stroke, radius | `button` (emphasis from fill vs stroke vs none) |
|
|
155
|
+
| Square 24–48px frame with only an icon | `icon-button` |
|
|
156
|
+
| 32–56px frame with a stroke or bottom border, placeholder-grey text, optional chevron/icon | `text-field` (chevron → `select`) |
|
|
157
|
+
| Repeated equal-height rows with leading icon/avatar + 1–2 text lines + trailing element | `list` |
|
|
158
|
+
| Header row of labels over repeated rows aligned in columns | `data-table` |
|
|
159
|
+
| Horizontal labels with one underlined or pill-highlighted item | `tabs` |
|
|
160
|
+
| Small rounded pill with short text | `tag` or `chip` (`chip` when it has a close or select affordance) |
|
|
161
|
+
| Circle 24–64px with an image or initials | `avatar` |
|
|
162
|
+
|
|
163
|
+
Rules for Tier C:
|
|
164
|
+
|
|
165
|
+
- **Confidence is low by default.** List Tier C mappings separately in the Phase 1g review so the user can correct them.
|
|
166
|
+
- **Purely decorative or bespoke layouts** (hero sections, marketing tiles, KPI cards) stay plain semantic HTML plus CSS. Do not force them into a component because a name suggests one.
|
|
167
|
+
- **Interactive controls stay components.** If a Tier C frame is clearly an input, select, date field, table, or tab strip, use the Ignite UI component even when its anatomy differs. The component brings keyboard, focus, ARIA, and form behavior that a custom frame lacks.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Code Connect Caveat
|
|
172
|
+
|
|
173
|
+
`figma_get_code_connect_map` may return mappings to **another** library, for example a shadcn kit connected to `@/components/ui/button`, or an in-house kit connected to the company's React package. Use these mappings as **strong evidence of the role and props** (a Code Connect snippet `<Button variant="outline" size="sm">` confirms *button / medium emphasis / small*). **Never** copy their imports, tags, or props into the implementation. The target is always Ignite UI.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## False Friends — Same Name, Different Ignite UI Component
|
|
178
|
+
|
|
179
|
+
| Name in the kit | Usually means | Ignite UI Web Components choice |
|
|
180
|
+
| --- | --- | --- |
|
|
181
|
+
| **Badge** (shadcn, Untitled UI, Bootstrap) | A text pill / status label | `igc-badge` with slotted text for short status; `igc-chip` when removable or selectable |
|
|
182
|
+
| **Badge** (Material, Fluent) | Dot or count on another element | `igc-badge` positioned over the host |
|
|
183
|
+
| **Dropdown** | A form field in some kits, a menu in others | `igc-select` (field) vs `igc-dropdown` (menu) |
|
|
184
|
+
| **Select** with search (shadcn Combobox, Ant Select `showSearch`) | Filterable single select | `igc-combo single-select` |
|
|
185
|
+
| **Tabs** styled as a pill track (shadcn, Fluent "segmented") | Either view switching or a value toggle | `igc-tabs` if it switches panels; `igc-button-group` if it sets a value |
|
|
186
|
+
| **Sheet** / **Drawer** (overlay) | Temporary side panel | `igc-nav-drawer` for navigation. There is no dedicated sheet component: for content panels use `igc-dialog` or custom markup, and record it as an anatomy delta |
|
|
187
|
+
| **Alert** | Inline message (not modal) | `igc-banner`, or semantic HTML for static callouts |
|
|
188
|
+
| **Toast** vs **Snackbar** | Transient message | `igc-toast` (text only) or `igc-snackbar` (with action) |
|
|
189
|
+
| **Card** with complex internal layout | A surface container | `igc-card` only if header/content/actions anatomy fits; otherwise a Table B surface |
|
|
190
|
+
| **Navigation rail** | Icon-only side nav | `igc-nav-drawer position="relative"` with the `mini` slot, and **without** `open`. The rail is hidden while the drawer is open |
|
|
191
|
+
| **Tab bar** at the bottom (iOS, M3 navigation bar) | App-level navigation | No bottom navigation in Web Components. Use `igc-tabs` or custom markup and document the substitution |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Output of This Step
|
|
196
|
+
|
|
197
|
+
Fill the **Tier**, **Kit / Source**, **Canonical Role + Props**, **Confidence**, **Token Work**, and **Suspected Anatomy Deltas** columns of the Phase 1g **Table A**. The table and its column rules are defined once, in `figma-exploration.md § 1g`.
|
|
198
|
+
|
|
199
|
+
Only the **Suspected Anatomy Deltas** column feeds the Phase 2d delta ledger. Token Work is never a delta.
|