@telefonica/mistica 16.64.0-beta.1 → 16.65.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 +14 -14
- package/dist/community/blocks.css-mistica.js +3 -3
- package/dist/community/cyber/example-component.css-mistica.js +11 -0
- package/dist/community/cyber/example-component.css.d.ts +1 -0
- package/dist/community/cyber/example-component.d.ts +6 -0
- package/dist/community/cyber/example-component.js +25 -0
- package/dist/community/cyber/index.d.ts +1 -0
- package/dist/community/example-component.css-mistica.js +2 -2
- package/dist/community/index.d.ts +2 -0
- package/dist/community/index.js +11 -0
- package/dist/community/skins/cyber-skin.d.ts +44 -0
- package/dist/community/skins/cyber-skin.js +633 -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/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 +9 -9
- package/dist/index.d.ts +1 -1
- package/dist/inline.css-mistica.js +18 -18
- 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/media-queries.css-mistica.js +13 -13
- package/dist/menu.css-mistica.js +25 -25
- 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/video.d.ts +16 -0
- package/dist/video.js +93 -75
- 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 -4
- package/dist-es/community/blocks.css-mistica.js +2 -2
- package/dist-es/community/cyber/example-component.css-mistica.js +2 -0
- package/dist-es/community/cyber/example-component.js +11 -0
- package/dist-es/community/example-component.css-mistica.js +2 -2
- package/dist-es/community/index.js +6 -4
- package/dist-es/community/skins/cyber-skin.js +613 -0
- 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/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/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/media-queries.css-mistica.js +3 -3
- package/dist-es/menu.css-mistica.js +15 -15
- 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/video.js +106 -88
- package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +2 -2
- package/doc/components.md +1 -1
- package/doc/figma-mcp.md +0 -35
- package/doc/layout.md +45 -1
- package/doc/patterns.md +23 -0
- package/package.json +1 -1
- package/src/community/__stories__/cyber/example-component-story.tsx +15 -0
- package/src/community/cyber/example-component.css.ts +7 -0
- package/src/community/cyber/example-component.tsx +17 -0
- package/src/community/cyber/index.tsx +1 -0
- package/src/community/index.tsx +3 -0
- package/src/community/skins/cyber-skin.tsx +628 -0
- package/src/index.tsx +1 -1
- package/src/navigation-bar.css.ts +1 -1
- package/src/package-version.tsx +1 -1
- package/src/video.tsx +36 -0
- package/doc/agents/figma-verifier.md +0 -49
package/dist-es/video.js
CHANGED
|
@@ -26,16 +26,16 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
-
import {
|
|
29
|
+
import { jsxs as P, jsx as l } from "react/jsx-runtime";
|
|
30
30
|
import * as s from "react";
|
|
31
|
-
import { ImageContent as
|
|
32
|
-
import { AspectRatioContainer as
|
|
33
|
-
import { isRunningAcceptanceTest as
|
|
34
|
-
import { video as
|
|
35
|
-
import { defaultBorderRadius as
|
|
36
|
-
import { getPrefixedDataAttributes as
|
|
37
|
-
import
|
|
38
|
-
const
|
|
31
|
+
import { ImageContent as q, ImageError as J } from "./image.js";
|
|
32
|
+
import { AspectRatioContainer as M } from "./utils/aspect-ratio-support.js";
|
|
33
|
+
import { isRunningAcceptanceTest as Q } from "./utils/platform.js";
|
|
34
|
+
import { video as X } from "./video.css-mistica.js";
|
|
35
|
+
import { defaultBorderRadius as S } from "./image.css-mistica.js";
|
|
36
|
+
import { getPrefixedDataAttributes as Y } from "./utils/dom.js";
|
|
37
|
+
import D from "classnames";
|
|
38
|
+
const K = {
|
|
39
39
|
loading: {
|
|
40
40
|
play: "playing",
|
|
41
41
|
pause: "paused",
|
|
@@ -68,14 +68,15 @@ const Y = {
|
|
|
68
68
|
play: "playing",
|
|
69
69
|
reset: "loading"
|
|
70
70
|
}
|
|
71
|
-
},
|
|
71
|
+
}, _ = (i, u)=>K[i][u] || i, $ = {
|
|
72
72
|
"1:1": 1,
|
|
73
73
|
"16:9": 16 / 9,
|
|
74
74
|
"4:3": 4 / 3
|
|
75
|
-
},
|
|
76
|
-
var { src:
|
|
75
|
+
}, z = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC", ne = /*#__PURE__*/ s.forwardRef((_param, h)=>{
|
|
76
|
+
var { src: i, poster: u, tracks: v, autoPlay: g = "when-loaded", muted: F = !0, loop: N = !0, preload: x = "none", loadingTimeout: R = 1e4, onLoad: L, onError: b, onPause: U, onPlay: j, aspectRatio: c = 0, dataAttributes: B } = _param, o = _object_without_properties(_param, [
|
|
77
77
|
"src",
|
|
78
78
|
"poster",
|
|
79
|
+
"tracks",
|
|
79
80
|
"autoPlay",
|
|
80
81
|
"muted",
|
|
81
82
|
"loop",
|
|
@@ -88,146 +89,163 @@ const Y = {
|
|
|
88
89
|
"aspectRatio",
|
|
89
90
|
"dataAttributes"
|
|
90
91
|
]);
|
|
91
|
-
const [d, n] = s.useReducer(
|
|
92
|
-
d === "loading" && (n("fail"),
|
|
92
|
+
const [d, n] = s.useReducer(_, "loading"), r = s.useRef(null), E = s.useRef(null), f = s.useRef(null), A = o.width && o.height ? void 0 : typeof c == "number" ? c : $[c], y = s.useCallback(()=>{
|
|
93
|
+
d === "loading" && (n("fail"), b === null || b === void 0 ? void 0 : b());
|
|
93
94
|
}, [
|
|
94
|
-
|
|
95
|
+
b,
|
|
95
96
|
d
|
|
96
97
|
]);
|
|
97
98
|
s.useEffect(()=>{
|
|
98
|
-
if (
|
|
99
|
-
var
|
|
99
|
+
if (E.current !== i) {
|
|
100
|
+
var _r_current;
|
|
100
101
|
let e;
|
|
101
|
-
return
|
|
102
|
+
return E.current = i, n("reset"), i ? (e = setTimeout(y, R), (_r_current = r.current) === null || _r_current === void 0 ? void 0 : _r_current.load()) : n("fail"), ()=>{
|
|
102
103
|
clearTimeout(e);
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
106
|
}, [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
i,
|
|
108
|
+
R,
|
|
109
|
+
y
|
|
109
110
|
]);
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const e =
|
|
113
|
-
n("finishLoad"), e &&
|
|
114
|
-
},
|
|
115
|
-
|
|
111
|
+
const T = ()=>{
|
|
112
|
+
if (L === null || L === void 0 ? void 0 : L(), d === "stopped") return;
|
|
113
|
+
const e = r.current, t = g && !Q();
|
|
114
|
+
n("finishLoad"), e && t && e.paused && e.play();
|
|
115
|
+
}, G = (Array.isArray(i) ? i : [
|
|
116
|
+
i
|
|
116
117
|
]).map((e)=>typeof e == "string" ? {
|
|
117
118
|
src: e
|
|
118
|
-
} : e),
|
|
119
|
+
} : e), m = [
|
|
119
120
|
"error",
|
|
120
121
|
"loading",
|
|
121
122
|
"loaded",
|
|
122
123
|
"stopped"
|
|
123
|
-
].includes(d),
|
|
124
|
-
ref:
|
|
124
|
+
].includes(d), O = /* @__PURE__ */ P("video", {
|
|
125
|
+
ref: r,
|
|
125
126
|
playsInline: !0,
|
|
126
127
|
disablePictureInPicture: !0,
|
|
127
128
|
disableRemotePlayback: !0,
|
|
128
|
-
muted:
|
|
129
|
-
loop:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
muted: F,
|
|
130
|
+
loop: N,
|
|
131
|
+
crossOrigin: (v === null || v === void 0 ? void 0 : v.length) ? "anonymous" : void 0,
|
|
132
|
+
className: D(X, S),
|
|
133
|
+
preload: x,
|
|
134
|
+
onError: y,
|
|
133
135
|
onPause: ()=>{
|
|
134
|
-
|
|
136
|
+
U === null || U === void 0 ? void 0 : U(), n("pause");
|
|
135
137
|
},
|
|
136
138
|
onTimeUpdate: ()=>{
|
|
137
|
-
var
|
|
138
|
-
d !== "playing" && ((
|
|
139
|
+
var _r_current;
|
|
140
|
+
d !== "playing" && ((_r_current = r.current) === null || _r_current === void 0 ? void 0 : _r_current.currentTime) !== 0 && (j === null || j === void 0 ? void 0 : j(), n("play"));
|
|
139
141
|
},
|
|
140
142
|
onCanPlay: ()=>{
|
|
141
|
-
|
|
143
|
+
g === "streaming" && T();
|
|
142
144
|
},
|
|
143
145
|
onCanPlayThrough: ()=>{
|
|
144
|
-
|
|
146
|
+
g !== "streaming" && T();
|
|
145
147
|
},
|
|
146
|
-
poster:
|
|
148
|
+
poster: z,
|
|
147
149
|
style: {
|
|
148
|
-
visibility:
|
|
149
|
-
position:
|
|
150
|
+
visibility: m ? "hidden" : "visible",
|
|
151
|
+
position: m || A !== 0 ? "absolute" : "static",
|
|
150
152
|
width: "100%",
|
|
151
153
|
height: "100%"
|
|
152
154
|
},
|
|
153
|
-
children:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
children: [
|
|
156
|
+
G.map((param, a)=>{
|
|
157
|
+
let { src: e, type: t } = param;
|
|
158
|
+
return /* @__PURE__ */ l("source", {
|
|
159
|
+
src: e,
|
|
160
|
+
type: t
|
|
161
|
+
}, a);
|
|
162
|
+
}),
|
|
163
|
+
v === null || v === void 0 ? void 0 : v.map((param, p)=>{
|
|
164
|
+
let { src: e, kind: t, srcLang: a, label: w, default: I } = param;
|
|
165
|
+
return /* @__PURE__ */ l("track", {
|
|
166
|
+
src: e,
|
|
167
|
+
kind: t,
|
|
168
|
+
srcLang: a,
|
|
169
|
+
label: w,
|
|
170
|
+
default: I
|
|
171
|
+
}, p);
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
}), k = !!(A !== 0 || o.width && o.height), C = d === "error", V = s.useMemo(()=>u ? /* @__PURE__ */ l(q, {
|
|
175
|
+
aspectRatio: c,
|
|
162
176
|
width: o.width,
|
|
163
177
|
height: o.height,
|
|
164
|
-
src:
|
|
165
|
-
}) :
|
|
178
|
+
src: u
|
|
179
|
+
}) : k ? /* @__PURE__ */ l("div", {
|
|
166
180
|
style: {
|
|
167
181
|
position: "absolute",
|
|
168
182
|
width: "100%",
|
|
169
183
|
height: "100%"
|
|
170
184
|
},
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
className:
|
|
173
|
-
withIcon:
|
|
185
|
+
children: /* @__PURE__ */ l(J, {
|
|
186
|
+
className: S,
|
|
187
|
+
withIcon: C
|
|
174
188
|
})
|
|
175
189
|
}) : void 0, [
|
|
176
|
-
|
|
190
|
+
c,
|
|
177
191
|
o.height,
|
|
178
192
|
o.width,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
193
|
+
C,
|
|
194
|
+
u,
|
|
195
|
+
k
|
|
182
196
|
]);
|
|
183
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ P(M, {
|
|
184
198
|
style: {
|
|
185
199
|
position: "relative"
|
|
186
200
|
},
|
|
187
201
|
aspectRatio: A,
|
|
188
202
|
width: o.width,
|
|
189
203
|
height: o.height,
|
|
190
|
-
dataAttributes:
|
|
204
|
+
dataAttributes: Y(B, "Video"),
|
|
191
205
|
children: [
|
|
192
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ l("div", {
|
|
193
207
|
style: {
|
|
194
208
|
position: "absolute",
|
|
195
209
|
width: "100%",
|
|
196
210
|
height: "100%"
|
|
197
211
|
},
|
|
198
212
|
ref: (e)=>{
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return ((
|
|
203
|
-
},
|
|
204
|
-
var
|
|
205
|
-
return (
|
|
206
|
-
},
|
|
207
|
-
var
|
|
208
|
-
((
|
|
209
|
-
var
|
|
210
|
-
n("reset"), (
|
|
213
|
+
const t = e || null;
|
|
214
|
+
t && (t.play = ()=>{
|
|
215
|
+
var _r_current;
|
|
216
|
+
return ((_r_current = r.current) === null || _r_current === void 0 ? void 0 : _r_current.play()) || Promise.resolve();
|
|
217
|
+
}, t.pause = ()=>{
|
|
218
|
+
var _r_current;
|
|
219
|
+
return (_r_current = r.current) === null || _r_current === void 0 ? void 0 : _r_current.pause();
|
|
220
|
+
}, t.load = ()=>{
|
|
221
|
+
var _f_current;
|
|
222
|
+
((_f_current = f.current) === null || _f_current === void 0 ? void 0 : _f_current.style) && (f.current.style.width = "100%", f.current.style.height = "100%"), setTimeout(()=>{
|
|
223
|
+
var _r_current;
|
|
224
|
+
n("reset"), (_r_current = r.current) === null || _r_current === void 0 ? void 0 : _r_current.load();
|
|
211
225
|
}, 100);
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
}
|
|
226
|
+
}, t.setCurrentTime = (a)=>{
|
|
227
|
+
r.current && (r.current.currentTime = a);
|
|
228
|
+
}, t.stop = ()=>{
|
|
229
|
+
r.current && (r.current.pause(), r.current.currentTime = 0, n("stop"));
|
|
230
|
+
}, t.setTrackMode = (a, w)=>{
|
|
231
|
+
var _r_current_querySelectorAll, _r_current;
|
|
232
|
+
const p = (_r_current = r.current) === null || _r_current === void 0 ? void 0 : (_r_current_querySelectorAll = _r_current.querySelectorAll("track")) === null || _r_current_querySelectorAll === void 0 ? void 0 : _r_current_querySelectorAll[a];
|
|
233
|
+
(p === null || p === void 0 ? void 0 : p.track) && (p.track.mode = w);
|
|
234
|
+
}), typeof h == "function" ? h(t) : h && (h.current = t);
|
|
217
235
|
}
|
|
218
236
|
}),
|
|
219
|
-
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
ref:
|
|
237
|
+
O,
|
|
238
|
+
/* @__PURE__ */ l("div", {
|
|
239
|
+
ref: f,
|
|
222
240
|
style: {
|
|
223
241
|
position: A !== 0 ? "absolute" : "static",
|
|
224
|
-
width:
|
|
225
|
-
height:
|
|
242
|
+
width: m ? "100%" : 0,
|
|
243
|
+
height: m ? "100%" : 0,
|
|
226
244
|
overflow: "hidden"
|
|
227
245
|
},
|
|
228
|
-
children:
|
|
246
|
+
children: V
|
|
229
247
|
})
|
|
230
248
|
]
|
|
231
249
|
});
|
|
232
250
|
});
|
|
233
|
-
export {
|
|
251
|
+
export { $ as RATIO, ne as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* empty css */ var
|
|
2
|
-
export {
|
|
1
|
+
/* empty css */ var a = "v16_65_1ezqdj90", r = "v16_65_1ezqdj91";
|
|
2
|
+
export { a as container, r as waveFadeOut };
|
package/doc/components.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Components Reference
|
|
2
2
|
|
|
3
|
-
All components are imported from `@telefonica/mistica`.
|
|
3
|
+
All components are imported from `@telefonica/mistica`. Before using any component, you should **always** read the definition .d.ts files located in `node_modules` so you have all the props and JSDoc context.
|
|
4
4
|
|
|
5
5
|
```tsx
|
|
6
6
|
import {ButtonPrimary, Stack, Text2, ...} from '@telefonica/mistica';
|
package/doc/figma-mcp.md
CHANGED
|
@@ -4,23 +4,6 @@ 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
|
-
|
|
24
7
|
## Prime directive: read the DOM verbatim
|
|
25
8
|
|
|
26
9
|
The Figma MCP response gives you two things:
|
|
@@ -151,21 +134,3 @@ Before closing out a section always:
|
|
|
151
134
|
|
|
152
135
|
If you can't check an item off against the DOM, re-read the DOM (with `disableCodeConnect: true` if the node
|
|
153
136
|
is CodeConnect-mapped) before committing the value.
|
|
154
|
-
|
|
155
|
-
## Verifier loop (run before declaring done)
|
|
156
|
-
|
|
157
|
-
Skip if the user opted out in [Step 0](#step-0-ask-the-user-whether-to-run-the-verifier).
|
|
158
|
-
|
|
159
|
-
Spawn a **new** subagent (via your harness's subagent mechanism — e.g. Claude's `Agent` tool with
|
|
160
|
-
`subagent_type: general-purpose`, Codex's equivalent) pointed at
|
|
161
|
-
[agents/figma-verifier.md](./agents/figma-verifier.md). Never reuse a subagent across iterations. Pass in the
|
|
162
|
-
prompt:
|
|
163
|
-
|
|
164
|
-
- Figma `fileKey` and entry `nodeId`
|
|
165
|
-
- Implementation file paths you wrote or edited
|
|
166
|
-
- Local assets directory
|
|
167
|
-
- Dev-server command and URL (check `package.json`)
|
|
168
|
-
|
|
169
|
-
If the verifier reports clean, done. Otherwise fix the cited issues — each fix justified by Figma DOM or
|
|
170
|
-
screenshot — and re-run with a fresh subagent. Stop after clean, 3 iterations, or out-of-scope issues (missing
|
|
171
|
-
tokens/assets, designer clarification — surface these instead of fudging).
|
package/doc/layout.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- [around](#around)
|
|
12
12
|
- [evenly](#evenly)
|
|
13
13
|
- [nesting](#nesting)
|
|
14
|
+
- [Grow](#grow)
|
|
14
15
|
- [Align](#align)
|
|
15
16
|
- [Grid / GridItem](#grid--griditem)
|
|
16
17
|
- [NegativeBox](#negativebox)
|
|
@@ -49,7 +50,7 @@ spacing. All padding props accept a numeric value or a responsive object `{mobil
|
|
|
49
50
|
|
|
50
51
|
```tsx
|
|
51
52
|
<Box paddingX={16} paddingY={32}>
|
|
52
|
-
<
|
|
53
|
+
<Text2>Example</Text2>
|
|
53
54
|
</Box>
|
|
54
55
|
```
|
|
55
56
|
|
|
@@ -57,6 +58,14 @@ spacing. All padding props accept a numeric value or a responsive object `{mobil
|
|
|
57
58
|
|
|
58
59
|
:warning: Do not use `Box` to add external spacings or distribute items, instead use `Stack` or `Inline`.
|
|
59
60
|
|
|
61
|
+
You can also use Box as a fixed width container:
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<Box width={80}>
|
|
65
|
+
<Text2>Example</Text2>
|
|
66
|
+
</Box>
|
|
67
|
+
```
|
|
68
|
+
|
|
60
69
|
## Stack
|
|
61
70
|
|
|
62
71
|
Vertically distributes its children using the given `space` separation.
|
|
@@ -159,6 +168,41 @@ with a value on the right via `space="between"`:
|
|
|
159
168
|
The outer `Inline` distributes the two groups to opposite ends; the inner `Inline` keeps the icon tightly
|
|
160
169
|
grouped with its label at a fixed gap.
|
|
161
170
|
|
|
171
|
+
### Grow
|
|
172
|
+
|
|
173
|
+
Use the `expand` prop to make one or more children of an `Inline` grow to fill the remaining horizontal space.
|
|
174
|
+
It takes the index (or an array of indexes) of the children that should grow. Indexes follow
|
|
175
|
+
`React.Children.toArray` order, so empty nodes (`null`, `false`) are skipped but rendered elements always
|
|
176
|
+
count. You don't wrap the growing child in anything — `Inline` already wraps every child in its own element:
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
<Inline space={56} alignItems="center" expand={1}>
|
|
180
|
+
<Text7>4,6</Text7>
|
|
181
|
+
<InfoRating
|
|
182
|
+
value={4}
|
|
183
|
+
icon={{
|
|
184
|
+
ActiveIcon: IconStarFilled,
|
|
185
|
+
InactiveIcon: IconStarLight,
|
|
186
|
+
color: skinVars.colors.textPrimary,
|
|
187
|
+
}}
|
|
188
|
+
/>
|
|
189
|
+
<Text3 regular>150 valoraciones</Text3>
|
|
190
|
+
</Inline>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
<Inline space={16} alignItems="center" expand={[1, 2]}>
|
|
195
|
+
<IconTruckRegular size={24} color={skinVars.colors.neutralHigh} />
|
|
196
|
+
<TextField name="firstName" label="First name" fullWidth />
|
|
197
|
+
<TextField name="lastName" label="Last name" fullWidth />
|
|
198
|
+
</Inline>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Common mistakes.** `Inline` wraps each child in its own element, so growing a child by wrapping it in a
|
|
202
|
+
`<div style={{flex: 1}}>` (or `flex-grow`) does nothing useful. Neither does `<Box style={{...}}>` — `Box` has
|
|
203
|
+
no `style` prop, so a flex or width passed that way is silently dropped and the row collapses or overflows its
|
|
204
|
+
container. Reach for `expand` (and `<Box width={N}>` for any fixed sibling) instead.
|
|
205
|
+
|
|
162
206
|
## Align
|
|
163
207
|
|
|
164
208
|
Positions its children within a container using CSS grid alignment. Useful for centering content or placing it
|
package/doc/patterns.md
CHANGED
|
@@ -97,6 +97,29 @@ Follow the 24/32/16 rule:
|
|
|
97
97
|
</Stack>
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
### DO: Fill remaining horizontal space with `Inline` `expand`
|
|
101
|
+
|
|
102
|
+
To make a row child grow into the leftover width next to a fixed-width sibling, use `Inline`'s `expand` prop
|
|
103
|
+
with the index/indexes of the children that should grow. Indexes follow `React.Children.toArray` order.
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
// ProgressBar fills remaining space
|
|
107
|
+
<Inline space={24} expand={1} alignItems="center">
|
|
108
|
+
<Icon2GFilled />
|
|
109
|
+
<ProgressBar progressPercent={30} />
|
|
110
|
+
</Inline>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### DON'T: grow children with raw flex or `style` on `Box`
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
// ❌ raw flexbox div — breaks; Inline already wraps each child in a div
|
|
117
|
+
<div style={{display: 'flex'}}>
|
|
118
|
+
<div style={{flex: 1}}>...</div>
|
|
119
|
+
<div style={{flex: '0 0 394px'}}>...</div>
|
|
120
|
+
</div>
|
|
121
|
+
```
|
|
122
|
+
|
|
100
123
|
## Color dos and don'ts
|
|
101
124
|
|
|
102
125
|
### DO: Use design tokens
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import ExampleComponent from '../../cyber/example-component';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Community/Cyber/ExampleComponent',
|
|
6
|
+
parameters: {
|
|
7
|
+
fullScreen: true,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Default: StoryComponent = () => {
|
|
12
|
+
return <ExampleComponent>Cyber example story</ExampleComponent>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
Default.storyName = 'ExampleComponent';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as styles from './example-component.css';
|
|
3
|
+
import Box from '../../box';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const ExampleComponent = (props: Props): JSX.Element => {
|
|
10
|
+
return (
|
|
11
|
+
<div className={styles.example}>
|
|
12
|
+
<Box padding={16}>{props.children}</Box>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default ExampleComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as ExampleComponent} from './example-component';
|