@telefonica/mistica 16.66.0 → 16.68.0
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/README.md +21 -5
- package/css/mistica.css +1 -1
- package/dist/accordion.css-mistica.js +6 -6
- package/dist/align.css-mistica.js +1 -1
- package/dist/autocomplete.css-mistica.js +1 -1
- package/dist/avatar.css-mistica.js +1 -1
- package/dist/badge.css-mistica.js +1 -1
- package/dist/box.css-mistica.js +13 -13
- package/dist/boxed.css-mistica.js +24 -24
- package/dist/button-group.css-mistica.js +1 -1
- package/dist/button-layout.css-mistica.js +14 -14
- package/dist/button.css-mistica.js +55 -46
- package/dist/button.css.d.ts +3 -0
- package/dist/button.js +133 -124
- package/dist/callout.css-mistica.js +11 -11
- package/dist/card-internal.css-mistica.js +15 -15
- package/dist/carousel.css-mistica.js +8 -8
- package/dist/checkbox.css-mistica.js +11 -11
- package/dist/chip.css-mistica.js +15 -15
- package/dist/circle.css-mistica.js +1 -1
- package/dist/community/advanced-data-card.css-mistica.js +6 -6
- package/dist/community/ai-card.css-mistica.js +2 -2
- package/dist/community/blocks.css-mistica.js +1 -1
- package/dist/community/cyber/example-component.css-mistica.js +1 -1
- package/dist/community/example-component.css-mistica.js +1 -1
- package/dist/community/skins/cyber-skin.js +9 -8
- package/dist/counter.css-mistica.js +1 -1
- package/dist/cover-hero.css-mistica.js +2 -2
- package/dist/credit-card-number-field.css-mistica.js +3 -3
- package/dist/date-field.css-mistica.js +1 -1
- package/dist/date-time-picker.css-mistica.js +1 -1
- package/dist/dialog.css-mistica.js +4 -4
- package/dist/divider.css-mistica.js +5 -5
- package/dist/double-field.css-mistica.js +2 -2
- package/dist/drawer.css-mistica.js +1 -1
- package/dist/empty-state-card.css-mistica.js +1 -1
- package/dist/empty-state.css-mistica.js +5 -5
- package/dist/fade-in.css-mistica.js +1 -1
- package/dist/feedback.css-mistica.js +1 -1
- package/dist/file-upload.css-mistica.js +7 -7
- package/dist/fixed-footer-layout.css-mistica.js +2 -2
- package/dist/focus-trap.d.ts +3 -1
- package/dist/focus-trap.js +6 -5
- package/dist/form.css-mistica.js +1 -1
- package/dist/grid-layout.css-mistica.js +3 -3
- package/dist/grid.css-mistica.js +120 -120
- package/dist/header.css-mistica.js +1 -1
- package/dist/hero.css-mistica.js +2 -2
- package/dist/horizontal-scroll.css-mistica.js +1 -1
- package/dist/icon-button.css-mistica.js +53 -53
- package/dist/icons/icon-chevron.css-mistica.js +2 -2
- package/dist/icons/icon-error.css-mistica.js +1 -1
- package/dist/image.css-mistica.js +2 -2
- package/dist/inline.css-mistica.js +9 -9
- package/dist/list.css-mistica.js +1 -1
- package/dist/loading-bar.css-mistica.js +1 -1
- package/dist/loading-screen.css-mistica.js +4 -4
- package/dist/logo.css-mistica.js +5 -5
- package/dist/menu.css-mistica.js +13 -13
- package/dist/menu.js +27 -27
- package/dist/mosaic.css-mistica.js +1 -1
- package/dist/navigation-bar.css-mistica.js +18 -18
- package/dist/navigation-breadcrumbs.css-mistica.js +1 -1
- package/dist/package-version.js +1 -1
- package/dist/pin-field.css-mistica.js +1 -1
- package/dist/popover.css-mistica.js +1 -1
- package/dist/progress-bar.css-mistica.js +6 -6
- package/dist/radio-button.css-mistica.js +19 -19
- package/dist/rating.css-mistica.js +2 -2
- package/dist/responsive-layout.css-mistica.js +6 -6
- package/dist/screen-reader-only.css-mistica.js +1 -1
- package/dist/select.css-mistica.js +15 -15
- package/dist/sheet-action-row.css-mistica.js +1 -1
- package/dist/sheet-common.css-mistica.js +1 -1
- package/dist/sheet-info.css-mistica.js +1 -1
- package/dist/skeletons.css-mistica.js +6 -6
- package/dist/skins/skin-contract.css-mistica.js +684 -684
- package/dist/skip-link.css-mistica.js +1 -1
- package/dist/slider.css-mistica.js +18 -18
- package/dist/snackbar.css-mistica.js +4 -4
- package/dist/spinner.css-mistica.js +1 -1
- package/dist/square.css-mistica.js +1 -1
- package/dist/stack.css-mistica.js +5 -5
- package/dist/stacking-group.css-mistica.js +1 -1
- package/dist/stepper.css-mistica.js +2 -2
- package/dist/switch-component.css-mistica.js +35 -35
- package/dist/table.css-mistica.js +9 -9
- package/dist/tabs.css-mistica.js +17 -17
- package/dist/tag.css-mistica.js +1 -1
- package/dist/text-field-base.css-mistica.js +15 -15
- package/dist/text-field-components.css-mistica.js +3 -3
- package/dist/text-link.css-mistica.js +6 -6
- package/dist/text.css-mistica.js +6 -6
- package/dist/theme-context.css-mistica.js +1 -1
- package/dist/timeline.css-mistica.js +9 -9
- package/dist/timer.css-mistica.js +6 -6
- package/dist/tooltip.css-mistica.js +1 -1
- package/dist/touchable.css-mistica.js +1 -1
- package/dist/utils/aspect-ratio-support.css-mistica.js +2 -2
- package/dist/video.css-mistica.js +1 -1
- package/dist/video.d.ts +2 -0
- package/dist/video.js +40 -32
- package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
- package/dist-es/accordion.css-mistica.js +6 -6
- package/dist-es/align.css-mistica.js +1 -1
- package/dist-es/autocomplete.css-mistica.js +1 -1
- package/dist-es/avatar.css-mistica.js +1 -1
- package/dist-es/badge.css-mistica.js +1 -1
- package/dist-es/box.css-mistica.js +13 -13
- package/dist-es/boxed.css-mistica.js +23 -23
- package/dist-es/button-group.css-mistica.js +1 -1
- package/dist-es/button-layout.css-mistica.js +14 -14
- package/dist-es/button.css-mistica.js +35 -35
- package/dist-es/button.js +168 -159
- package/dist-es/callout.css-mistica.js +11 -11
- package/dist-es/card-internal.css-mistica.js +15 -15
- package/dist-es/carousel.css-mistica.js +8 -8
- package/dist-es/checkbox.css-mistica.js +11 -11
- package/dist-es/chip.css-mistica.js +15 -15
- package/dist-es/circle.css-mistica.js +1 -1
- package/dist-es/community/advanced-data-card.css-mistica.js +6 -6
- package/dist-es/community/ai-card.css-mistica.js +2 -2
- package/dist-es/community/blocks.css-mistica.js +1 -1
- package/dist-es/community/cyber/example-component.css-mistica.js +1 -1
- package/dist-es/community/example-component.css-mistica.js +1 -1
- package/dist-es/community/skins/cyber-skin.js +9 -8
- package/dist-es/counter.css-mistica.js +1 -1
- package/dist-es/cover-hero.css-mistica.js +2 -2
- package/dist-es/credit-card-number-field.css-mistica.js +3 -3
- package/dist-es/date-field.css-mistica.js +1 -1
- package/dist-es/date-time-picker.css-mistica.js +1 -1
- package/dist-es/dialog.css-mistica.js +4 -4
- package/dist-es/divider.css-mistica.js +5 -5
- package/dist-es/double-field.css-mistica.js +2 -2
- package/dist-es/drawer.css-mistica.js +1 -1
- package/dist-es/empty-state-card.css-mistica.js +1 -1
- package/dist-es/empty-state.css-mistica.js +5 -5
- package/dist-es/fade-in.css-mistica.js +1 -1
- package/dist-es/feedback.css-mistica.js +1 -1
- package/dist-es/file-upload.css-mistica.js +7 -7
- package/dist-es/fixed-footer-layout.css-mistica.js +2 -2
- package/dist-es/focus-trap.js +8 -7
- package/dist-es/form.css-mistica.js +1 -1
- package/dist-es/grid-layout.css-mistica.js +3 -3
- package/dist-es/grid.css-mistica.js +120 -120
- package/dist-es/header.css-mistica.js +1 -1
- package/dist-es/hero.css-mistica.js +2 -2
- package/dist-es/horizontal-scroll.css-mistica.js +1 -1
- package/dist-es/icon-button.css-mistica.js +53 -53
- package/dist-es/icons/icon-chevron.css-mistica.js +2 -2
- package/dist-es/icons/icon-error.css-mistica.js +1 -1
- package/dist-es/image.css-mistica.js +2 -2
- package/dist-es/inline.css-mistica.js +9 -9
- package/dist-es/list.css-mistica.js +1 -1
- package/dist-es/loading-bar.css-mistica.js +1 -1
- package/dist-es/loading-screen.css-mistica.js +4 -4
- package/dist-es/logo.css-mistica.js +5 -5
- package/dist-es/menu.css-mistica.js +13 -13
- package/dist-es/menu.js +35 -35
- package/dist-es/mosaic.css-mistica.js +1 -1
- package/dist-es/navigation-bar.css-mistica.js +18 -18
- package/dist-es/navigation-breadcrumbs.css-mistica.js +1 -1
- package/dist-es/package-version.js +1 -1
- package/dist-es/pin-field.css-mistica.js +1 -1
- package/dist-es/popover.css-mistica.js +1 -1
- package/dist-es/progress-bar.css-mistica.js +6 -6
- package/dist-es/radio-button.css-mistica.js +19 -19
- package/dist-es/rating.css-mistica.js +2 -2
- package/dist-es/responsive-layout.css-mistica.js +6 -6
- package/dist-es/screen-reader-only.css-mistica.js +1 -1
- package/dist-es/select.css-mistica.js +15 -15
- package/dist-es/sheet-action-row.css-mistica.js +1 -1
- package/dist-es/sheet-common.css-mistica.js +1 -1
- package/dist-es/sheet-info.css-mistica.js +1 -1
- package/dist-es/skeletons.css-mistica.js +6 -6
- package/dist-es/skins/skin-contract.css-mistica.js +684 -684
- package/dist-es/skip-link.css-mistica.js +1 -1
- package/dist-es/slider.css-mistica.js +18 -18
- package/dist-es/snackbar.css-mistica.js +4 -4
- package/dist-es/spinner.css-mistica.js +1 -1
- package/dist-es/square.css-mistica.js +1 -1
- package/dist-es/stack.css-mistica.js +5 -5
- package/dist-es/stacking-group.css-mistica.js +1 -1
- package/dist-es/stepper.css-mistica.js +2 -2
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.css-mistica.js +35 -35
- package/dist-es/table.css-mistica.js +9 -9
- package/dist-es/tabs.css-mistica.js +17 -17
- package/dist-es/tag.css-mistica.js +1 -1
- package/dist-es/text-field-base.css-mistica.js +15 -15
- package/dist-es/text-field-components.css-mistica.js +3 -3
- package/dist-es/text-link.css-mistica.js +6 -6
- package/dist-es/text.css-mistica.js +6 -6
- package/dist-es/theme-context.css-mistica.js +1 -1
- package/dist-es/timeline.css-mistica.js +9 -9
- package/dist-es/timer.css-mistica.js +6 -6
- package/dist-es/tooltip.css-mistica.js +1 -1
- package/dist-es/touchable.css-mistica.js +1 -1
- package/dist-es/utils/aspect-ratio-support.css-mistica.js +2 -2
- package/dist-es/video.css-mistica.js +1 -1
- package/dist-es/video.js +53 -45
- package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
- package/doc/llms/agents/figma-verifier.md +49 -0
- package/doc/{figma-mcp.md → llms/figma-mcp.md} +34 -20
- package/doc/{llms.md → llms/llms.md} +1 -1
- package/doc/patterns.md +2 -2
- package/package.json +1 -1
- package/src/button.css.ts +133 -401
- package/src/button.tsx +80 -60
- package/src/community/__screenshot_tests__/advanced-data-card-screenshot-test.tsx +5 -5
- package/src/community/__screenshot_tests__/blocks-screenshot-test.tsx +6 -6
- package/src/community/__stories__/advanced-data-card-carousel-story.tsx +1 -1
- package/src/community/__stories__/advanced-data-card-story.tsx +1 -1
- package/src/community/__stories__/ai-card-story.tsx +1 -1
- package/src/community/__stories__/blocks-story.tsx +1 -1
- package/src/community/skins/cyber-skin.tsx +8 -8
- package/src/focus-trap.tsx +10 -2
- package/src/menu.tsx +0 -1
- package/src/package-version.tsx +1 -1
- package/src/video.tsx +4 -0
- package/src/community/__stories__/example-component-story.tsx +0 -15
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Figma verifier
|
|
2
|
+
|
|
3
|
+
Audit a just-completed Figma implementation. Compare the running app against the Figma design visually and
|
|
4
|
+
structurally, then report drift. Re-read [../figma-mcp.md](../figma-mcp.md) for the prime directive and skill
|
|
5
|
+
rules before starting.
|
|
6
|
+
|
|
7
|
+
## Tasks
|
|
8
|
+
|
|
9
|
+
1. **Fetch the Figma screenshot** via `mcp__plugin_figma_figma__get_screenshot` for the entry node.
|
|
10
|
+
`get_metadata` gives the frame's viewport dimensions.
|
|
11
|
+
|
|
12
|
+
2. **Render the implementation**:
|
|
13
|
+
|
|
14
|
+
- Start the dev server in the background, piping output to a log file.
|
|
15
|
+
- Wait for it to start.
|
|
16
|
+
- Screenshot via Playwright CLI:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx -y playwright@1.60.0 screenshot \
|
|
20
|
+
--viewport-size=<width>,<height> \
|
|
21
|
+
--full-page \
|
|
22
|
+
<url> \
|
|
23
|
+
/tmp/verifier-actual.png
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use the Figma frame's dimensions. For responsive designs, repeat per breakpoint.
|
|
27
|
+
|
|
28
|
+
3. **Compare visually**: open `/tmp/verifier-actual.png` and compare against the Figma screenshot. Catalog
|
|
29
|
+
drift in: layout, spacing, typography (weight/size/line-height — compare letter forms), colors, assets
|
|
30
|
+
(missing / wrong), and component primitive choice.
|
|
31
|
+
|
|
32
|
+
4. **Structural / rule check**:
|
|
33
|
+
|
|
34
|
+
- Re-drill every composite component with `get_design_context({ disableCodeConnect: true })` and compare
|
|
35
|
+
props against the drilled-in DOM.
|
|
36
|
+
- Read each implementation file. Flag: hex literals or raw `var(--...)`, manual `font-size` /
|
|
37
|
+
`font-family`, composite props that don't match the non-CodeConnect DOM, spacing values absent from the
|
|
38
|
+
DOM, mismatched semantic structure (`Stack` vs `Inline`, flat vs nested), native HTML where a Mistica
|
|
39
|
+
primitive exists, wrong/missing skin/font/body-background for the file's brand.
|
|
40
|
+
|
|
41
|
+
5. **Report**. One summary line (`clean` or `N issues found, M blocking`), then a bullet list ordered by
|
|
42
|
+
severity. Each issue:
|
|
43
|
+
|
|
44
|
+
- `[VISUAL]` or `[RULE]` prefix
|
|
45
|
+
- Figma node id (or screenshot region) + what the design specifies
|
|
46
|
+
- File:line (for `[RULE]`) or screenshot region (for `[VISUAL]`)
|
|
47
|
+
- What's wrong + proposed fix
|
|
48
|
+
|
|
49
|
+
Only flag drift and rule violations — no architectural rewrites or "improvements".
|
|
@@ -4,6 +4,23 @@ Mandatory reading whenever you are implementing UI from Figma through the Figma
|
|
|
4
4
|
a `figma.com/...` URL. This file only covers the translation layer — the rest of the Mistica docs
|
|
5
5
|
(`patterns.md`, `components.md`, `layout.md`, `design-tokens.md`) still apply.
|
|
6
6
|
|
|
7
|
+
## Step 0: ask the user whether to run the verifier
|
|
8
|
+
|
|
9
|
+
Before fetching any Figma node or writing any code, ask the user this question exactly once (use a
|
|
10
|
+
structured-question tool if your harness has one):
|
|
11
|
+
|
|
12
|
+
- **Question**:
|
|
13
|
+
`Run the verifier loop after implementing? It compares the rendered app against Figma both visually (Playwright screenshot) and structurally (DOM + rule audit), then iterates fixes.`
|
|
14
|
+
- **Options**:
|
|
15
|
+
- **Yes, run the verifier** — recommended when fidelity matters. Catches drift the implementer can't see. It
|
|
16
|
+
will take more time and cost more tokens.
|
|
17
|
+
- **No, skip the verifier** — faster path. The agent still self-checks and reviews its work, but no
|
|
18
|
+
independent comparison runs.
|
|
19
|
+
|
|
20
|
+
Remember the answer for the rest of this task. **One answer covers the whole implementation — do not re-ask
|
|
21
|
+
per section.** If the user opted in, run the [verifier loop](#verifier-loop-run-before-declaring-done). If
|
|
22
|
+
they opted out, do not spawn the verifier; the self-checks are the only gate.
|
|
23
|
+
|
|
7
24
|
## Prime directive: read the DOM verbatim
|
|
8
25
|
|
|
9
26
|
The Figma MCP response gives you two things:
|
|
@@ -103,26 +120,6 @@ Every prop value you write — text, enum, aspect ratio, boolean — should be s
|
|
|
103
120
|
the real (non-CodeConnect) DOM, not something you copied from the snippet. If you can't say which node in the
|
|
104
121
|
drilled-in DOM justifies the value, gather more before committing it.
|
|
105
122
|
|
|
106
|
-
## Assets: always download, store, and serve locally
|
|
107
|
-
|
|
108
|
-
Figma MCP asset URLs (`https://www.figma.com/api/mcp/asset/<uuid>`) are valid for only ~7 days. Do **not**
|
|
109
|
-
inline them anywhere. Download the asset first, save it into the project (e.g. `public/images/...` or
|
|
110
|
-
`src/assets/...`), and reference the local path.
|
|
111
|
-
|
|
112
|
-
Do **not** substitute unrelated stock photos (Unsplash, Picsum, Lorem Picsum, etc.) for the designer's assets.
|
|
113
|
-
The real images are part of the design.
|
|
114
|
-
|
|
115
|
-
The right workflow for every image in a Figma design:
|
|
116
|
-
|
|
117
|
-
1. Drill into the node (per the composite section above) to get the real asset URL — initial CodeConnect stubs
|
|
118
|
-
often use `example.com/image.jpg` placeholders that hide the actual URL.
|
|
119
|
-
2. Download the file (`curl -o public/images/<name>.<ext> <mcp-asset-url>`). Use names that describe the
|
|
120
|
-
content (`hero-fibra.png`, `partner-eurosport.svg`), not the Figma UUID.
|
|
121
|
-
3. Reference it from code via the local path (e.g. `/images/hero-fibra.png` in Vite projects, `/images/...` or
|
|
122
|
-
`import heroFibra from './assets/hero-fibra.png'` in bundler-aware setups).
|
|
123
|
-
4. If you cannot resolve an asset — the URL 404s, the node has no fill, the design legitimately has no image
|
|
124
|
-
there — say so explicitly and ask, rather than inventing a stock replacement.
|
|
125
|
-
|
|
126
123
|
## Verification checklist
|
|
127
124
|
|
|
128
125
|
Before closing out a section always:
|
|
@@ -134,3 +131,20 @@ Before closing out a section always:
|
|
|
134
131
|
|
|
135
132
|
If you can't check an item off against the DOM, re-read the DOM (with `disableCodeConnect: true` if the node
|
|
136
133
|
is CodeConnect-mapped) before committing the value.
|
|
134
|
+
|
|
135
|
+
## Verifier loop (run before declaring done)
|
|
136
|
+
|
|
137
|
+
Skip if the user opted out in [Step 0](#step-0-ask-the-user-whether-to-run-the-verifier).
|
|
138
|
+
|
|
139
|
+
Spawn a **new** subagent (via your harness's subagent mechanism — e.g. Claude's `Agent` tool with
|
|
140
|
+
`subagent_type: general-purpose`, Codex's equivalent) pointed at
|
|
141
|
+
[agents/figma-verifier.md](./agents/figma-verifier.md). Never reuse a subagent across iterations. Pass in the
|
|
142
|
+
prompt:
|
|
143
|
+
|
|
144
|
+
- Figma `fileKey` and entry `nodeId`
|
|
145
|
+
- Implementation file paths you wrote or edited
|
|
146
|
+
- Dev-server command and URL (check `package.json`)
|
|
147
|
+
|
|
148
|
+
If the verifier reports clean, done. Otherwise fix the cited issues — each fix justified by Figma DOM or
|
|
149
|
+
screenshot — and re-run with a fresh subagent. Stop after clean, 3 iterations, or out-of-scope issues (missing
|
|
150
|
+
tokens, designer clarification — surface these instead of fudging).
|
|
@@ -329,7 +329,7 @@ After reading the minimum set, read any further files that apply to your specifi
|
|
|
329
329
|
| **Testing (read if you have to implement tests)** | `doc/testing.md` |
|
|
330
330
|
| **Migrating from older versions** | `doc/migration-guide.md` |
|
|
331
331
|
| **Optimizing bundle size with lottie** | `doc/lottie.md` |
|
|
332
|
-
| **Implementing a Figma design via Figma MCP** | `doc/figma-mcp.md`
|
|
332
|
+
| **Implementing a Figma design via Figma MCP** | `doc/llms/figma-mcp.md` |
|
|
333
333
|
|
|
334
334
|
## Docs reference
|
|
335
335
|
|
package/doc/patterns.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Critical rules
|
|
4
4
|
|
|
5
|
-
See [Critical Rules in `llms.md`](./llms.md#critical-rules) — the single source of truth. These rules
|
|
6
|
-
throughout this document.
|
|
5
|
+
See [Critical Rules in `llms.md`](./llms/llms.md#critical-rules) — the single source of truth. These rules
|
|
6
|
+
apply throughout this document.
|
|
7
7
|
|
|
8
8
|
## Page layout composition
|
|
9
9
|
|