@telefonica/mistica 16.62.0-beta.1 → 16.62.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/css/mistica.css +1 -1
- package/dist/accordion.css-mistica.js +16 -16
- package/dist/align.css-mistica.js +2 -2
- package/dist/autocomplete.css-mistica.js +6 -6
- package/dist/avatar.css-mistica.js +3 -3
- package/dist/badge.css-mistica.js +7 -7
- package/dist/box.css-mistica.js +15 -15
- package/dist/boxed.css-mistica.js +31 -31
- package/dist/button-group.css-mistica.js +10 -10
- package/dist/button-layout.css-mistica.js +21 -21
- package/dist/button.css-mistica.js +51 -51
- package/dist/callout.css-mistica.js +16 -16
- package/dist/card-internal.css-mistica.js +38 -38
- package/dist/carousel.css-mistica.js +18 -18
- package/dist/checkbox.css-mistica.js +21 -21
- package/dist/chip.css-mistica.js +30 -30
- package/dist/circle.css-mistica.js +2 -2
- package/dist/community/advanced-data-card.css-mistica.js +26 -26
- package/dist/community/ai-card.css-mistica.js +48 -0
- package/dist/community/ai-card.css.d.ts +13 -0
- package/dist/community/ai-card.d.ts +19 -0
- package/dist/community/ai-card.js +312 -0
- package/dist/community/blocks.css-mistica.js +3 -3
- package/dist/community/example-component.css-mistica.js +2 -2
- package/dist/community/index.d.ts +1 -0
- package/dist/community/index.js +4 -0
- package/dist/counter.css-mistica.js +12 -12
- package/dist/cover-hero.css-mistica.js +16 -16
- package/dist/credit-card-number-field.css-mistica.js +6 -6
- package/dist/date-field.css-mistica.js +1 -1
- package/dist/date-time-picker.css-mistica.js +2 -2
- package/dist/dialog.css-mistica.js +15 -15
- package/dist/divider.css-mistica.js +5 -5
- package/dist/double-field.css-mistica.js +4 -4
- package/dist/drawer.css-mistica.js +15 -15
- package/dist/empty-state-card.css-mistica.js +4 -4
- package/dist/empty-state.css-mistica.js +14 -14
- package/dist/fade-in.css-mistica.js +1 -1
- package/dist/feedback.css-mistica.js +14 -14
- package/dist/file-upload.css-mistica.js +14 -14
- package/dist/fixed-footer-layout.css-mistica.js +12 -12
- package/dist/form.css-mistica.js +2 -2
- package/dist/generated/mistica-icons/icon-artificial-intelligence-filled.js +7 -7
- package/dist/generated/mistica-icons/icon-artificial-intelligence-light.js +9 -9
- package/dist/generated/mistica-icons/icon-artificial-intelligence-regular.js +12 -12
- package/dist/grid-layout.css-mistica.js +9 -9
- package/dist/grid.css-mistica.js +147 -147
- package/dist/header.css-mistica.js +5 -5
- package/dist/hero.css-mistica.js +11 -11
- package/dist/horizontal-scroll.css-mistica.js +3 -3
- package/dist/icon-button.css-mistica.js +66 -66
- package/dist/icons/icon-chevron.css-mistica.js +6 -6
- package/dist/icons/icon-error.css-mistica.js +3 -3
- package/dist/image.css-mistica.js +11 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/inline.css-mistica.js +16 -16
- package/dist/list.css-mistica.js +15 -15
- package/dist/loading-bar.css-mistica.js +5 -5
- package/dist/loading-screen.css-mistica.js +15 -15
- package/dist/logo.css-mistica.js +9 -9
- package/dist/menu.css-mistica.js +27 -24
- package/dist/menu.css.d.ts +1 -0
- package/dist/menu.d.ts +2 -1
- package/dist/menu.js +139 -132
- package/dist/mosaic.css-mistica.js +3 -3
- package/dist/navigation-bar.css-mistica.js +45 -45
- package/dist/navigation-breadcrumbs.css-mistica.js +5 -5
- package/dist/package-version.js +2 -2
- package/dist/pin-field.css-mistica.js +10 -10
- package/dist/popover.css-mistica.js +2 -2
- package/dist/progress-bar.css-mistica.js +12 -12
- package/dist/radio-button.css-mistica.js +33 -33
- package/dist/rating.css-mistica.js +12 -12
- package/dist/responsive-layout.css-mistica.js +20 -20
- package/dist/screen-reader-only.css-mistica.js +2 -2
- package/dist/select.css-mistica.js +29 -29
- package/dist/sheet-action-row.css-mistica.js +2 -2
- package/dist/sheet-common.css-mistica.js +16 -16
- package/dist/sheet-info.css-mistica.js +4 -4
- package/dist/skeletons.css-mistica.js +12 -12
- package/dist/skins/skin-contract.css-mistica.js +686 -686
- package/dist/skip-link.css-mistica.js +3 -3
- package/dist/slider.css-mistica.js +28 -28
- package/dist/snackbar.css-mistica.js +16 -16
- package/dist/spinner.css-mistica.js +5 -5
- package/dist/square.css-mistica.js +2 -2
- package/dist/stack.css-mistica.js +9 -9
- package/dist/stacking-group.css-mistica.js +2 -2
- package/dist/stepper.css-mistica.js +16 -16
- package/dist/switch-component.css-mistica.js +53 -53
- package/dist/table.css-mistica.js +24 -24
- package/dist/tabs.css-mistica.js +30 -30
- package/dist/tag.css-mistica.js +5 -5
- package/dist/text-field-base.css-mistica.js +30 -30
- package/dist/text-field-components.css-mistica.js +19 -19
- package/dist/text-link.css-mistica.js +10 -10
- package/dist/text.css-mistica.js +13 -13
- package/dist/theme-context.css-mistica.js +2 -2
- package/dist/timeline.css-mistica.js +18 -18
- package/dist/timer.css-mistica.js +13 -13
- package/dist/tooltip.css-mistica.js +12 -12
- package/dist/touchable.css-mistica.js +5 -5
- package/dist/utils/aspect-ratio-support.css-mistica.js +7 -7
- package/dist/video.css-mistica.js +2 -2
- package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +3 -3
- package/dist-es/accordion.css-mistica.js +7 -7
- package/dist-es/align.css-mistica.js +2 -2
- package/dist-es/autocomplete.css-mistica.js +2 -2
- package/dist-es/avatar.css-mistica.js +2 -2
- package/dist-es/badge.css-mistica.js +2 -2
- package/dist-es/box.css-mistica.js +15 -15
- package/dist-es/boxed.css-mistica.js +25 -25
- package/dist-es/button-group.css-mistica.js +2 -2
- package/dist-es/button-layout.css-mistica.js +16 -16
- package/dist-es/button.css-mistica.js +38 -38
- package/dist-es/callout.css-mistica.js +12 -12
- package/dist-es/card-internal.css-mistica.js +20 -20
- package/dist-es/carousel.css-mistica.js +10 -10
- package/dist-es/checkbox.css-mistica.js +14 -14
- package/dist-es/chip.css-mistica.js +17 -17
- package/dist-es/circle.css-mistica.js +2 -2
- package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
- package/dist-es/community/ai-card.css-mistica.js +4 -0
- package/dist-es/community/ai-card.js +257 -0
- package/dist-es/community/blocks.css-mistica.js +2 -2
- package/dist-es/community/example-component.css-mistica.js +2 -2
- package/dist-es/community/index.js +5 -4
- package/dist-es/counter.css-mistica.js +2 -2
- package/dist-es/cover-hero.css-mistica.js +4 -4
- package/dist-es/credit-card-number-field.css-mistica.js +4 -4
- package/dist-es/date-field.css-mistica.js +1 -1
- package/dist-es/date-time-picker.css-mistica.js +2 -2
- package/dist-es/dialog.css-mistica.js +5 -5
- package/dist-es/divider.css-mistica.js +5 -5
- package/dist-es/double-field.css-mistica.js +4 -4
- package/dist-es/drawer.css-mistica.js +2 -2
- package/dist-es/empty-state-card.css-mistica.js +2 -2
- package/dist-es/empty-state.css-mistica.js +7 -7
- package/dist-es/fade-in.css-mistica.js +1 -1
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/file-upload.css-mistica.js +8 -8
- package/dist-es/fixed-footer-layout.css-mistica.js +4 -4
- package/dist-es/form.css-mistica.js +2 -2
- package/dist-es/generated/mistica-icons/icon-artificial-intelligence-filled.js +12 -12
- package/dist-es/generated/mistica-icons/icon-artificial-intelligence-light.js +15 -15
- package/dist-es/generated/mistica-icons/icon-artificial-intelligence-regular.js +17 -17
- package/dist-es/grid-layout.css-mistica.js +4 -4
- package/dist-es/grid.css-mistica.js +127 -127
- package/dist-es/header.css-mistica.js +2 -2
- package/dist-es/hero.css-mistica.js +4 -4
- package/dist-es/horizontal-scroll.css-mistica.js +2 -2
- package/dist-es/icon-button.css-mistica.js +56 -56
- package/dist-es/icons/icon-chevron.css-mistica.js +4 -4
- package/dist-es/icons/icon-error.css-mistica.js +2 -2
- package/dist-es/image.css-mistica.js +4 -4
- package/dist-es/index.js +2183 -2182
- package/dist-es/inline.css-mistica.js +10 -10
- package/dist-es/list.css-mistica.js +2 -2
- package/dist-es/loading-bar.css-mistica.js +2 -2
- package/dist-es/loading-screen.css-mistica.js +5 -5
- package/dist-es/logo.css-mistica.js +7 -7
- package/dist-es/menu.css-mistica.js +15 -15
- package/dist-es/menu.js +186 -179
- package/dist-es/mosaic.css-mistica.js +2 -2
- package/dist-es/navigation-bar.css-mistica.js +20 -20
- package/dist-es/navigation-breadcrumbs.css-mistica.js +2 -2
- package/dist-es/package-version.js +2 -2
- package/dist-es/pin-field.css-mistica.js +2 -2
- package/dist-es/popover.css-mistica.js +2 -2
- package/dist-es/progress-bar.css-mistica.js +8 -8
- package/dist-es/radio-button.css-mistica.js +25 -25
- package/dist-es/rating.css-mistica.js +4 -4
- package/dist-es/responsive-layout.css-mistica.js +7 -7
- package/dist-es/screen-reader-only.css-mistica.js +2 -2
- package/dist-es/select.css-mistica.js +20 -20
- package/dist-es/sheet-action-row.css-mistica.js +2 -2
- package/dist-es/sheet-common.css-mistica.js +2 -2
- package/dist-es/sheet-info.css-mistica.js +2 -2
- package/dist-es/skeletons.css-mistica.js +8 -8
- package/dist-es/skins/skin-contract.css-mistica.js +686 -686
- package/dist-es/skip-link.css-mistica.js +2 -2
- package/dist-es/slider.css-mistica.js +20 -20
- package/dist-es/snackbar.css-mistica.js +5 -5
- package/dist-es/spinner.css-mistica.js +2 -2
- package/dist-es/square.css-mistica.js +2 -2
- package/dist-es/stack.css-mistica.js +7 -7
- package/dist-es/stacking-group.css-mistica.js +2 -2
- package/dist-es/stepper.css-mistica.js +4 -4
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.css-mistica.js +41 -41
- package/dist-es/table.css-mistica.js +11 -11
- package/dist-es/tabs.css-mistica.js +21 -21
- package/dist-es/tag.css-mistica.js +2 -2
- package/dist-es/text-field-base.css-mistica.js +17 -17
- package/dist-es/text-field-components.css-mistica.js +4 -4
- package/dist-es/text-link.css-mistica.js +9 -9
- package/dist-es/text.css-mistica.js +8 -8
- package/dist-es/theme-context.css-mistica.js +2 -2
- package/dist-es/timeline.css-mistica.js +11 -11
- package/dist-es/timer.css-mistica.js +7 -7
- package/dist-es/tooltip.css-mistica.js +3 -3
- package/dist-es/touchable.css-mistica.js +2 -2
- package/dist-es/utils/aspect-ratio-support.css-mistica.js +4 -4
- package/dist-es/video.css-mistica.js +2 -2
- package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +2 -2
- package/doc/components.md +0 -19
- package/doc/layout.md +1 -20
- package/doc/llms.md +0 -7
- package/doc/patterns.md +17 -6
- package/package.json +1 -1
- package/src/community/__stories__/ai-card-story.tsx +101 -0
- package/src/community/ai-card.css.ts +135 -0
- package/src/community/ai-card.tsx +231 -0
- package/src/community/index.tsx +1 -0
- package/src/index.tsx +1 -0
- package/src/menu.css.ts +6 -0
- package/src/menu.tsx +19 -8
- package/src/package-version.tsx +1 -1
- package/doc/figma-mcp.md +0 -136
package/doc/figma-mcp.md
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# Figma MCP
|
|
2
|
-
|
|
3
|
-
Mandatory reading whenever you are implementing UI from Figma through the Figma MCP or when the user provides
|
|
4
|
-
a `figma.com/...` URL. This file only covers the translation layer — the rest of the Mistica docs
|
|
5
|
-
(`patterns.md`, `components.md`, `layout.md`, `design-tokens.md`) still apply.
|
|
6
|
-
|
|
7
|
-
## Prime directive: read the DOM verbatim
|
|
8
|
-
|
|
9
|
-
The Figma MCP response gives you two things:
|
|
10
|
-
|
|
11
|
-
- a **screenshot** that shows what the design should look like
|
|
12
|
-
- a **DOM** that shows what the designer specified
|
|
13
|
-
|
|
14
|
-
Use the DOM as the source of truth for every numeric and structural decision. The screenshot only validates
|
|
15
|
-
that your implementation matches the designer's intent.
|
|
16
|
-
|
|
17
|
-
**If you cannot point at a line in the DOM to justify a value, do not write that value.** Do not pick "nearby
|
|
18
|
-
nicer" numbers.
|
|
19
|
-
|
|
20
|
-
## Mapping Figma flex to Mistica layout primitives
|
|
21
|
-
|
|
22
|
-
| Figma | Mistica |
|
|
23
|
-
| --------------------------------------- | --------------------------------------------------- |
|
|
24
|
-
| `flex gap-[Npx]` (vertical, `flex-col`) | `Stack space={N}` |
|
|
25
|
-
| `flex gap-[Npx]` (horizontal) | `Inline space={N}` |
|
|
26
|
-
| `justify-between` | `Inline space="between"` |
|
|
27
|
-
| `justify-around` | `Inline space="around"` |
|
|
28
|
-
| `justify-evenly` | `Inline space="evenly"` |
|
|
29
|
-
| `items-center` | `alignItems="center"` on `Inline` |
|
|
30
|
-
| `flex-wrap` | `wrap` on `Inline` |
|
|
31
|
-
| `p-[Npx]` / `px-[Npx]` / `py-[Npx]` | `Box padding={N}` / `paddingX={N}` / `paddingY={N}` |
|
|
32
|
-
| `rounded-[var(--radii/container,...)]` | `Boxed` (or `skinVars.borderRadii.container`) |
|
|
33
|
-
| `bg-[var(--background...)]` | `ResponsiveLayout variant` or `Boxed variant` |
|
|
34
|
-
|
|
35
|
-
Each spacing primitive has its own allowed scale. Figma values outside the scale must be rounded to the
|
|
36
|
-
nearest allowed value and noted — never silently apply arbitrary CSS.
|
|
37
|
-
|
|
38
|
-
## Don't snap Figma values to Mistica's rhythm
|
|
39
|
-
|
|
40
|
-
Mistica's 16 / 24 / 32 vertical-rhythm guidance in `patterns.md` and `layout.md` is for **greenfield
|
|
41
|
-
composition** — UI you are designing yourself. It is not a reason to override explicit Figma values. When the
|
|
42
|
-
DOM specifies a spacing, use it literally.
|
|
43
|
-
|
|
44
|
-
## Tokens over literal values
|
|
45
|
-
|
|
46
|
-
The MCP output often contains hex colors (`#262423`), CSS custom properties
|
|
47
|
-
(`var(--backgroundalternative,#fefaf5)`), and raw border-radius values
|
|
48
|
-
(`rounded-[var(--radii/container,16px)]`). These must be translated:
|
|
49
|
-
|
|
50
|
-
- Colors → `skinVars.colors.*` (or `skinVars.rawColors.*` with `applyAlpha`)
|
|
51
|
-
- Border radii → `skinVars.borderRadii.*`, or a Mistica component that handles it (`Boxed`, cards)
|
|
52
|
-
- Spacing tokens → `skinVars.spacing.*` where applicable
|
|
53
|
-
|
|
54
|
-
Never keep a hex literal or a `var(--...)` reference in app code. If the right token doesn't exist, the design
|
|
55
|
-
is ahead of the skin — flag it and extend the skin instead of hardcoding.
|
|
56
|
-
|
|
57
|
-
## Fonts
|
|
58
|
-
|
|
59
|
-
Ignore per-node `font-[family-name:var(--fontfamily/fontfamily,'Movistar_Sans:Medium',...)]` and
|
|
60
|
-
`font-['On_Air:Regular',...]` classes. Font family is set **once globally** under `ThemeContextProvider` via
|
|
61
|
-
`GlobalStyles` — the active skin's font (see `fonts.md`) is the source of truth. Per-node font families in the
|
|
62
|
-
MCP output are leaked style from the Figma file, not designer intent.
|
|
63
|
-
|
|
64
|
-
Font weight is handled by the Mistica text components (`Text1`-`Text10` and `Title1`-`Title4`). Map Figma's
|
|
65
|
-
`font-weight/text5` to the matching component (e.g. `Text5`), not to a CSS `font-weight`.
|
|
66
|
-
|
|
67
|
-
## `CodeConnectSnippet` wrappers: gather before you choose
|
|
68
|
-
|
|
69
|
-
MCP responses wrap mapped components in `<CodeConnectSnippet>`. **The snippet is never authoritative.** It's a
|
|
70
|
-
hint about which Mistica component the designer used — not a source of truth for any specific prop value.
|
|
71
|
-
Individual values inside it may happen to be correct, may be stale placeholders, or may look right but map to
|
|
72
|
-
the wrong semantic slot. You cannot tell reliably from the snippet alone which is which, so don't try.
|
|
73
|
-
|
|
74
|
-
Don't classify snippet values into "trustworthy" and "untrustworthy". The classification is itself where
|
|
75
|
-
mistakes come from. Instead: for every composite component, gather all available information first, then pick
|
|
76
|
-
props from the combined picture.
|
|
77
|
-
|
|
78
|
-
### How to gather
|
|
79
|
-
|
|
80
|
-
For any CodeConnect-wrapped **composite component** — one with multiple content slots (`headline`, `pretitle`,
|
|
81
|
-
`title`, `subtitle`, `description`, `extra`, `slot`, `buttonPrimary`, `buttonSecondary`, `buttonLink`,
|
|
82
|
-
`asset`, etc.) — re-fetch the node with Code Connect disabled before mapping props:
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
get_design_context({
|
|
86
|
-
nodeId: "<the collapsed node id>",
|
|
87
|
-
fileKey: "<same fileKey>",
|
|
88
|
-
disableCodeConnect: true,
|
|
89
|
-
excludeScreenshot: true // optional, saves tokens if you already have one
|
|
90
|
-
})
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
That returns the real child tree: the actual text nodes, their font-size tokens, the actual image aspect
|
|
94
|
-
ratio, Tag instances with their `type` (e.g. the `--tagbackgroundinfo` CSS variable tells you `type="info"`),
|
|
95
|
-
child slots that correspond to `extra` / `slot` / `headline`, sibling buttons, etc.
|
|
96
|
-
|
|
97
|
-
Use `get_metadata` on the same node when you also need to understand which children are component instances
|
|
98
|
-
vs. raw nodes.
|
|
99
|
-
|
|
100
|
-
### Rule of thumb
|
|
101
|
-
|
|
102
|
-
Every prop value you write — text, enum, aspect ratio, boolean — should be something you picked after reading
|
|
103
|
-
the real (non-CodeConnect) DOM, not something you copied from the snippet. If you can't say which node in the
|
|
104
|
-
drilled-in DOM justifies the value, gather more before committing it.
|
|
105
|
-
|
|
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
|
-
## Verification checklist
|
|
127
|
-
|
|
128
|
-
Before closing out a section always:
|
|
129
|
-
|
|
130
|
-
- [ ] Double check every native html element or style attribute to see if there is a Mistica alternative. If
|
|
131
|
-
so, always use Mistica.
|
|
132
|
-
- [ ] Double check every composite component on the page was fetched with: `disableCodeConnect: true` before
|
|
133
|
-
writing props — regardless of whether the stub looked filled in or not.
|
|
134
|
-
|
|
135
|
-
If you can't check an item off against the DOM, re-read the DOM (with `disableCodeConnect: true` if the node
|
|
136
|
-
is CodeConnect-mapped) before committing the value.
|