@telefonica/mistica 14.42.0 → 14.42.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/css/mistica.css +1 -1
- package/dist/dialog.js +66 -65
- package/dist/feedback.css-mistica.js +14 -8
- package/dist/feedback.css.d.ts +2 -0
- package/dist/feedback.js +43 -36
- package/dist/package-version.js +1 -1
- package/dist/text.css-mistica.js +7 -7
- package/dist/text.css.d.ts +0 -1
- package/dist/text.js +24 -24
- package/dist-es/dialog.js +126 -125
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/feedback.js +72 -65
- package/dist-es/package-version.js +1 -1
- package/dist-es/style.css +1 -1
- package/dist-es/text.css-mistica.js +3 -3
- package/dist-es/text.js +32 -32
- package/package.json +1 -1
package/dist-es/feedback.js
CHANGED
|
@@ -79,43 +79,44 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
81
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
82
|
-
import * as
|
|
83
|
-
import { useTheme as
|
|
82
|
+
import * as v from "react";
|
|
83
|
+
import { useTheme as F, useWindowHeight as Q, useScreenSize as H, useIsomorphicLayoutEffect as Y } from "./hooks.js";
|
|
84
84
|
import { tabletOrSmaller as Z } from "./media-queries.css-mistica.js";
|
|
85
85
|
import ee from "./button-fixed-footer-layout.js";
|
|
86
86
|
import oe from "./overscroll-color-context.js";
|
|
87
|
-
import { O2_CLASSIC_SKIN as
|
|
87
|
+
import { O2_CLASSIC_SKIN as V, VIVO_SKIN as $, VIVO_NEW_SKIN as w } from "./skins/constants.js";
|
|
88
88
|
import E from "./icons/icon-success.js";
|
|
89
89
|
import _ from "./icons/icon-success-vivo.js";
|
|
90
90
|
import re from "./icons/icon-error.js";
|
|
91
91
|
import te from "./icons/icon-info.js";
|
|
92
92
|
import { isWebViewBridgeAvailable as ce, requestVibration as ne } from "@tef-novum/webview-bridge";
|
|
93
93
|
import { isRunningAcceptanceTest as ie } from "./utils/platform.js";
|
|
94
|
-
import { Text2 as
|
|
94
|
+
import { Text2 as ae, Text6 as se, Text3 as de } from "./text.js";
|
|
95
95
|
import b from "./box.js";
|
|
96
96
|
import { InternalBoxed as le } from "./boxed.js";
|
|
97
97
|
import me from "./responsive-layout.js";
|
|
98
|
-
import
|
|
99
|
-
import
|
|
98
|
+
import p from "./stack.js";
|
|
99
|
+
import u from "classnames";
|
|
100
100
|
import ue from "./button-group.js";
|
|
101
|
-
import { vars as
|
|
102
|
-
import {
|
|
101
|
+
import { vars as s } from "./skins/skin-contract.css-mistica.js";
|
|
102
|
+
import { feedbackScreenInverse as pe, container as be, innerContainer as fe, innerContainerWithButtons as he, backgroundBrand as ke, iconContainer as ge, feedbackData as Se, feedbackTextAppearFast as ve, feedbackTextAppearMedium as z, feedbackTextAppearSlow as Fe, desktopContainer as xe, desktopContent as Ie, desktopImage as Ne } from "./feedback.css-mistica.js";
|
|
103
103
|
import D from "./icons/icon-success-vivo-new.js";
|
|
104
|
-
|
|
104
|
+
import { ThemeVariant as Be } from "./theme-variant-context.js";
|
|
105
|
+
const R = (r)=>!ie(r), W = (param)=>{
|
|
105
106
|
let { primaryButton: r, secondaryButton: o } = param;
|
|
106
107
|
return !!r || !!o;
|
|
107
|
-
},
|
|
108
|
+
}, Te = (param)=>{
|
|
108
109
|
let { isInverse: r } = param;
|
|
109
110
|
const o = `@media ${Z} {
|
|
110
|
-
body {background:${r ?
|
|
111
|
+
body {background:${r ? s.colors.backgroundBrand : s.colors.background}}
|
|
111
112
|
}`;
|
|
112
113
|
return /* @__PURE__ */ e("style", {
|
|
113
114
|
children: o
|
|
114
115
|
});
|
|
115
116
|
}, O = (r)=>{
|
|
116
117
|
ce() && ne(r).catch(()=>{});
|
|
117
|
-
},
|
|
118
|
-
|
|
118
|
+
}, L = (r)=>{
|
|
119
|
+
v.useEffect(()=>{
|
|
119
120
|
let o;
|
|
120
121
|
return r === "success" && (o = setTimeout(()=>O("success"), 700)), r === "error" && (o = setTimeout(()=>O("error"), 1e3)), ()=>{
|
|
121
122
|
clearTimeout(o);
|
|
@@ -125,40 +126,40 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
125
126
|
]);
|
|
126
127
|
}, q = (param, n)=>{
|
|
127
128
|
let { icon: r, title: o, description: t, extra: c } = param;
|
|
128
|
-
const i = t && Array.isArray(t) ? /* @__PURE__ */ e(
|
|
129
|
+
const i = t && Array.isArray(t) ? /* @__PURE__ */ e(p, {
|
|
129
130
|
space: 16,
|
|
130
131
|
children: t.map((d, m)=>/* @__PURE__ */ e("p", {
|
|
131
132
|
children: d
|
|
132
133
|
}, m))
|
|
133
134
|
}) : t;
|
|
134
|
-
return /* @__PURE__ */ l(
|
|
135
|
+
return /* @__PURE__ */ l(p, {
|
|
135
136
|
space: 24,
|
|
136
137
|
children: [
|
|
137
138
|
/* @__PURE__ */ e("div", {
|
|
138
|
-
className:
|
|
139
|
+
className: ge,
|
|
139
140
|
children: r
|
|
140
141
|
}),
|
|
141
|
-
/* @__PURE__ */ l(
|
|
142
|
+
/* @__PURE__ */ l(p, {
|
|
142
143
|
space: 16,
|
|
143
|
-
className:
|
|
144
|
+
className: u(Se),
|
|
144
145
|
children: [
|
|
145
146
|
/* @__PURE__ */ e("div", {
|
|
146
|
-
className:
|
|
147
|
-
children: /* @__PURE__ */ e(
|
|
147
|
+
className: u(n && ve),
|
|
148
|
+
children: /* @__PURE__ */ e(se, {
|
|
148
149
|
as: "h1",
|
|
149
150
|
children: o
|
|
150
151
|
})
|
|
151
152
|
}),
|
|
152
153
|
i && /* @__PURE__ */ e("div", {
|
|
153
|
-
className:
|
|
154
|
+
className: u(n && z),
|
|
154
155
|
children: i && /* @__PURE__ */ e(de, {
|
|
155
156
|
regular: !0,
|
|
156
|
-
color:
|
|
157
|
+
color: s.colors.textSecondary,
|
|
157
158
|
children: i
|
|
158
159
|
})
|
|
159
160
|
}),
|
|
160
161
|
c && /* @__PURE__ */ e("div", {
|
|
161
|
-
className:
|
|
162
|
+
className: u(n && (i ? Fe : z)),
|
|
162
163
|
children: c
|
|
163
164
|
})
|
|
164
165
|
]
|
|
@@ -166,8 +167,8 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
166
167
|
]
|
|
167
168
|
});
|
|
168
169
|
}, K = (r, o)=>{
|
|
169
|
-
const t =
|
|
170
|
-
return /* @__PURE__ */ l(
|
|
170
|
+
const t = W(o);
|
|
171
|
+
return /* @__PURE__ */ l(p, {
|
|
171
172
|
space: {
|
|
172
173
|
desktop: 40,
|
|
173
174
|
mobile: 24
|
|
@@ -180,15 +181,15 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
180
181
|
}, j = (param)=>{
|
|
181
182
|
let { isInverse: r, body: o, imageFit: t, imageUrl: c, dataAttributes: n } = param;
|
|
182
183
|
return /* @__PURE__ */ e(le, {
|
|
183
|
-
borderRadius:
|
|
184
|
+
borderRadius: s.borderRadii.legacyDisplay,
|
|
184
185
|
desktopOnly: !0,
|
|
185
186
|
isInverse: r,
|
|
186
187
|
dataAttributes: n,
|
|
187
188
|
children: /* @__PURE__ */ l("div", {
|
|
188
|
-
className:
|
|
189
|
+
className: xe,
|
|
189
190
|
children: [
|
|
190
191
|
/* @__PURE__ */ e("div", {
|
|
191
|
-
className:
|
|
192
|
+
className: Ie,
|
|
192
193
|
children: /* @__PURE__ */ e(b, {
|
|
193
194
|
padding: {
|
|
194
195
|
desktop: 64,
|
|
@@ -199,7 +200,7 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
199
200
|
})
|
|
200
201
|
}),
|
|
201
202
|
c && /* @__PURE__ */ e("div", {
|
|
202
|
-
className:
|
|
203
|
+
className: Ne,
|
|
203
204
|
style: {
|
|
204
205
|
backgroundImage: `url(${c})`,
|
|
205
206
|
backgroundPosition: t === "fit" ? "bottom right" : "center right",
|
|
@@ -213,9 +214,9 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
213
214
|
})
|
|
214
215
|
});
|
|
215
216
|
}, x = (param)=>{
|
|
216
|
-
let { title: r, description: o, children: t, extra: c, primaryButton: n, secondaryButton: i, link: d, hapticFeedback: m, icon: f, animateText:
|
|
217
|
-
|
|
218
|
-
const { platformOverrides: M, isDarkMode: N, skinName: B } =
|
|
217
|
+
let { title: r, description: o, children: t, extra: c, primaryButton: n, secondaryButton: i, link: d, hapticFeedback: m, icon: f, animateText: h = !1, isInverse: a = !1, unstable_inlineInDesktop: k, imageUrl: I, imageFit: g, dataAttributes: S } = param;
|
|
218
|
+
L(m);
|
|
219
|
+
const { platformOverrides: M, isDarkMode: N, skinName: B } = F(), G = Q(), { isTabletOrSmaller: P } = H(), [U, X] = v.useState(typeof self < "u"), [T, J] = v.useState(0), y = U ? "100vh" : `${G - T}px`, A = W({
|
|
219
220
|
primaryButton: n,
|
|
220
221
|
secondaryButton: i,
|
|
221
222
|
link: d
|
|
@@ -223,13 +224,13 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
223
224
|
Y(()=>{
|
|
224
225
|
X(!1);
|
|
225
226
|
}, []);
|
|
226
|
-
const
|
|
227
|
+
const C = q({
|
|
227
228
|
icon: f,
|
|
228
229
|
title: r,
|
|
229
230
|
description: o,
|
|
230
231
|
extra: c !== null && c !== void 0 ? c : t
|
|
231
|
-
},
|
|
232
|
-
return !P &&
|
|
232
|
+
}, h && R(M));
|
|
233
|
+
return !P && k ? K(C, {
|
|
233
234
|
primaryButton: n,
|
|
234
235
|
secondaryButton: i,
|
|
235
236
|
link: d
|
|
@@ -237,8 +238,12 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
237
238
|
style: {
|
|
238
239
|
position: "relative"
|
|
239
240
|
},
|
|
241
|
+
className: a ? pe : void 0,
|
|
240
242
|
children: [
|
|
241
|
-
|
|
243
|
+
a && /* @__PURE__ */ e(Be, {
|
|
244
|
+
isInverse: !0,
|
|
245
|
+
children: /* @__PURE__ */ e(oe, {})
|
|
246
|
+
}),
|
|
242
247
|
/* @__PURE__ */ e(me, {
|
|
243
248
|
children: /* @__PURE__ */ e(b, {
|
|
244
249
|
paddingTop: {
|
|
@@ -246,20 +251,22 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
246
251
|
mobile: 0
|
|
247
252
|
},
|
|
248
253
|
children: j({
|
|
249
|
-
isInverse:
|
|
254
|
+
isInverse: a,
|
|
250
255
|
body: /* @__PURE__ */ e(ee, {
|
|
251
256
|
isFooterVisible: A,
|
|
252
257
|
button: n,
|
|
253
258
|
secondaryButton: i,
|
|
254
259
|
link: d,
|
|
255
|
-
footerBgColor:
|
|
256
|
-
containerBgColor:
|
|
260
|
+
footerBgColor: a && !N ? s.colors.backgroundFeedbackBottom : void 0,
|
|
261
|
+
containerBgColor: a && !N ? s.colors.backgroundFeedbackBottom : void 0,
|
|
257
262
|
onChangeFooterHeight: J,
|
|
258
263
|
children: /* @__PURE__ */ e("div", {
|
|
259
|
-
className:
|
|
264
|
+
className: be,
|
|
260
265
|
children: /* @__PURE__ */ e("div", {
|
|
261
|
-
className:
|
|
262
|
-
|
|
266
|
+
className: u(fe, {
|
|
267
|
+
[he]: n || i || d
|
|
268
|
+
}),
|
|
269
|
+
children: C
|
|
263
270
|
})
|
|
264
271
|
})
|
|
265
272
|
}),
|
|
@@ -269,29 +276,29 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
269
276
|
})
|
|
270
277
|
})
|
|
271
278
|
}),
|
|
272
|
-
B ===
|
|
279
|
+
B === V && /* @__PURE__ */ e("div", {
|
|
273
280
|
style: {
|
|
274
281
|
position: "absolute",
|
|
275
|
-
bottom:
|
|
282
|
+
bottom: T,
|
|
276
283
|
top: 0,
|
|
277
284
|
left: 0,
|
|
278
285
|
right: 0,
|
|
279
286
|
// This extra height is a workaround to make sure the background div is displayed *under* the fixed footer.
|
|
280
287
|
// Otherwise in some devices (Galaxy S20+) the background and the fixed footer are rendered with some distance between them
|
|
281
|
-
height: A ? `calc(${
|
|
282
|
-
background:
|
|
288
|
+
height: A ? `calc(${y} + 1px)` : `calc(${y})`,
|
|
289
|
+
background: a ? s.colors.backgroundBrand : s.colors.background
|
|
283
290
|
}
|
|
284
291
|
}),
|
|
285
|
-
B !==
|
|
286
|
-
isInverse:
|
|
292
|
+
B !== V && /* @__PURE__ */ e(Te, {
|
|
293
|
+
isInverse: a
|
|
287
294
|
})
|
|
288
295
|
]
|
|
289
296
|
});
|
|
290
|
-
},
|
|
297
|
+
}, Je = (_param)=>{
|
|
291
298
|
var { dataAttributes: r } = _param, o = _object_without_properties(_param, [
|
|
292
299
|
"dataAttributes"
|
|
293
300
|
]);
|
|
294
|
-
const { isTabletOrSmaller: t } = H(), { skinName: c } =
|
|
301
|
+
const { isTabletOrSmaller: t } = H(), { skinName: c } = F();
|
|
295
302
|
return /* @__PURE__ */ e(x, _object_spread_props(_object_spread({}, o), {
|
|
296
303
|
isInverse: !o.unstable_inlineInDesktop || t,
|
|
297
304
|
hapticFeedback: "success",
|
|
@@ -309,7 +316,7 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
309
316
|
"component-name": "SuccessFeedbackScreen"
|
|
310
317
|
}, r)
|
|
311
318
|
}));
|
|
312
|
-
},
|
|
319
|
+
}, Qe = (_param)=>{
|
|
313
320
|
var { children: r, errorReference: o, dataAttributes: t } = _param, c = _object_without_properties(_param, [
|
|
314
321
|
"children",
|
|
315
322
|
"errorReference",
|
|
@@ -324,19 +331,19 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
324
331
|
dataAttributes: _object_spread({
|
|
325
332
|
"component-name": "ErrorFeedbackScreen"
|
|
326
333
|
}, t),
|
|
327
|
-
extra: /* @__PURE__ */ l(
|
|
334
|
+
extra: /* @__PURE__ */ l(p, {
|
|
328
335
|
space: 16,
|
|
329
336
|
children: [
|
|
330
337
|
r,
|
|
331
|
-
o && /* @__PURE__ */ e(
|
|
332
|
-
color:
|
|
338
|
+
o && /* @__PURE__ */ e(ae, {
|
|
339
|
+
color: s.colors.textSecondary,
|
|
333
340
|
regular: !0,
|
|
334
341
|
children: o
|
|
335
342
|
})
|
|
336
343
|
]
|
|
337
344
|
})
|
|
338
345
|
}));
|
|
339
|
-
},
|
|
346
|
+
}, Ye = (_param)=>{
|
|
340
347
|
var { dataAttributes: r, Icon: o = te } = _param, t = _object_without_properties(_param, [
|
|
341
348
|
"dataAttributes",
|
|
342
349
|
"Icon"
|
|
@@ -349,13 +356,13 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
349
356
|
size: "100%"
|
|
350
357
|
})
|
|
351
358
|
}, t));
|
|
352
|
-
},
|
|
353
|
-
let { title: r, description: o, children: t, extra: c, primaryButton: n, secondaryButton: i, link: d, imageUrl: m, imageFit: f, dataAttributes:
|
|
354
|
-
|
|
355
|
-
const { skinName:
|
|
356
|
-
icon:
|
|
359
|
+
}, Ze = (param)=>{
|
|
360
|
+
let { title: r, description: o, children: t, extra: c, primaryButton: n, secondaryButton: i, link: d, imageUrl: m, imageFit: f, dataAttributes: h } = param;
|
|
361
|
+
L("success");
|
|
362
|
+
const { skinName: a, platformOverrides: k } = F(), g = q({
|
|
363
|
+
icon: a === $ ? /* @__PURE__ */ e(_, {
|
|
357
364
|
size: "100%"
|
|
358
|
-
}) :
|
|
365
|
+
}) : a === w ? /* @__PURE__ */ e(D, {
|
|
359
366
|
size: "100%"
|
|
360
367
|
}) : /* @__PURE__ */ e(E, {
|
|
361
368
|
size: "100%"
|
|
@@ -363,7 +370,7 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
363
370
|
title: r,
|
|
364
371
|
description: o,
|
|
365
372
|
extra: c !== null && c !== void 0 ? c : t
|
|
366
|
-
}, R(
|
|
373
|
+
}, R(k)), S = K(g, {
|
|
367
374
|
primaryButton: n,
|
|
368
375
|
secondaryButton: i,
|
|
369
376
|
link: d
|
|
@@ -371,7 +378,7 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
371
378
|
return j({
|
|
372
379
|
isInverse: !0,
|
|
373
380
|
body: /* @__PURE__ */ e("div", {
|
|
374
|
-
className:
|
|
381
|
+
className: ke,
|
|
375
382
|
children: /* @__PURE__ */ e(b, {
|
|
376
383
|
paddingX: {
|
|
377
384
|
mobile: 16,
|
|
@@ -392,7 +399,7 @@ const R = (r)=>!ie(r), L = (param)=>{
|
|
|
392
399
|
imageUrl: m,
|
|
393
400
|
dataAttributes: _object_spread({
|
|
394
401
|
"component-name": "SuccessFeedback"
|
|
395
|
-
},
|
|
402
|
+
}, h)
|
|
396
403
|
});
|
|
397
404
|
};
|
|
398
|
-
export {
|
|
405
|
+
export { Qe as ErrorFeedbackScreen, x as FeedbackScreen, Ye as InfoFeedbackScreen, Ze as SuccessFeedback, Je as SuccessFeedbackScreen };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o = "14.42.
|
|
1
|
+
const o = "14.42.1";
|
|
2
2
|
export { o as PACKAGE_VERSION };
|