@telefonica/mistica 14.48.0 → 15.0.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.d.ts +1 -6
- package/dist/button.d.ts +0 -4
- package/dist/button.js +1 -1
- package/dist/cvv-field.js +30 -29
- package/dist/feedback.js +61 -79
- package/dist/icon-button.d.ts +0 -1
- package/dist/icons/icon-error.js +5 -5
- package/dist/icons/icon-info.js +5 -5
- package/dist/icons/icon-success.js +6 -7
- package/dist/image.js +36 -32
- package/dist/index.d.ts +3 -12
- package/dist/index.js +0 -20
- package/dist/list.d.ts +0 -4
- package/dist/logo.js +0 -1
- package/dist/package-version.js +1 -1
- package/dist/popover.d.ts +0 -4
- package/dist/popover.js +10 -11
- package/dist/select.d.ts +1 -0
- package/dist/select.js +65 -65
- package/dist/skins/blau.js +1 -1
- package/dist/skins/constants.d.ts +0 -2
- package/dist/skins/constants.js +6 -12
- package/dist/skins/movistar.js +1 -1
- package/dist/skins/o2.js +1 -1
- package/dist/skins/telefonica.js +1 -1
- package/dist/skins/tu.js +1 -1
- package/dist/skins/types/index.d.ts +1 -1
- package/dist/skins/utils.js +4 -7
- package/dist/skins/vivo-new.js +1 -1
- package/dist/skins/vivo.js +1 -1
- package/dist/slider.d.ts +0 -8
- package/dist/slider.js +95 -97
- package/dist/tag.js +34 -39
- package/dist/tooltip.d.ts +0 -16
- package/dist/tooltip.js +78 -79
- package/dist-es/button.js +1 -1
- package/dist-es/cvv-field.js +55 -54
- package/dist-es/feedback.js +102 -120
- package/dist-es/icons/icon-error.js +6 -6
- package/dist-es/icons/icon-info.js +6 -6
- package/dist-es/icons/icon-success.js +9 -10
- package/dist-es/image.js +38 -34
- package/dist-es/index.js +1767 -1769
- package/dist-es/logo.js +0 -1
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +27 -28
- package/dist-es/select.js +97 -97
- package/dist-es/skins/blau.js +1 -1
- package/dist-es/skins/constants.js +2 -2
- package/dist-es/skins/movistar.js +1 -1
- package/dist-es/skins/o2.js +1 -1
- package/dist-es/skins/telefonica.js +1 -1
- package/dist-es/skins/tu.js +1 -1
- package/dist-es/skins/utils.js +17 -20
- package/dist-es/skins/vivo-new.js +1 -1
- package/dist-es/skins/vivo.js +1 -1
- package/dist-es/slider.js +117 -119
- package/dist-es/style.css +1 -1
- package/dist-es/tag.js +52 -57
- package/dist-es/tooltip.js +83 -84
- package/package.json +1 -1
- package/dist/skins/movistar-legacy.d.ts +0 -47
- package/dist/skins/movistar-legacy.js +0 -392
- package/dist/skins/o2-classic.d.ts +0 -56
- package/dist/skins/o2-classic.js +0 -324
- package/dist-es/skins/movistar-legacy.js +0 -375
- package/dist-es/skins/o2-classic.js +0 -307
package/dist/tooltip.js
CHANGED
|
@@ -165,89 +165,89 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
165
165
|
}
|
|
166
166
|
const lt = (t)=>({
|
|
167
167
|
border: `1px solid ${t ? _skincontractcssmistica.vars.colors.backgroundContainer : _skincontractcssmistica.vars.colors.border}`
|
|
168
|
-
}), ct = 496, Yt = 300, Gt = 500, Kt = 100, p = 20,
|
|
168
|
+
}), ct = 496, Yt = 300, Gt = 500, Kt = 100, p = 20, I = 6, N = I + p / 2 + 1, Ut = (t)=>{
|
|
169
169
|
switch(t){
|
|
170
170
|
case "left":
|
|
171
|
-
return `translateX(-${
|
|
171
|
+
return `translateX(-${I}px)`;
|
|
172
172
|
case "right":
|
|
173
|
-
return `translateX(${
|
|
173
|
+
return `translateX(${I}px)`;
|
|
174
174
|
case "top":
|
|
175
|
-
return `translateY(-${
|
|
175
|
+
return `translateY(-${I}px)`;
|
|
176
176
|
case "bottom":
|
|
177
|
-
return `translateY(${
|
|
177
|
+
return `translateY(${I}px)`;
|
|
178
178
|
default:
|
|
179
179
|
return "";
|
|
180
180
|
}
|
|
181
181
|
}, pt = (t)=>{
|
|
182
|
-
const
|
|
182
|
+
const h = parseFloat(getComputedStyle(t, null).paddingLeft) + parseFloat(getComputedStyle(t, null).paddingRight), v = parseFloat(getComputedStyle(t, null).paddingTop) + parseFloat(getComputedStyle(t, null).paddingBottom), d = t.offsetWidth - h, m = t.offsetHeight - v;
|
|
183
183
|
return {
|
|
184
184
|
width: d,
|
|
185
|
-
height:
|
|
185
|
+
height: m
|
|
186
186
|
};
|
|
187
|
-
}, ft = (t,
|
|
188
|
-
if (!t || !
|
|
189
|
-
const { top:
|
|
190
|
-
if (!(!
|
|
187
|
+
}, ft = (t, h, v, d, m)=>{
|
|
188
|
+
if (!t || !h) return;
|
|
189
|
+
const { top: x, bottom: w, left: B, right: W } = t, o = d - w, O = m - W, R = x, a = B, { width: X, height: V } = pt(h), _ = X + N, T = V + N, b = _ <= Math.max(a, O), M = T <= Math.max(o, R);
|
|
190
|
+
if (!(!M && !b)) switch(v){
|
|
191
191
|
case "left":
|
|
192
|
-
return
|
|
192
|
+
return b ? _ <= a ? "left" : "right" : o > R ? "bottom" : "top";
|
|
193
193
|
case "right":
|
|
194
|
-
return
|
|
194
|
+
return b ? _ <= O ? "right" : "left" : o > R ? "bottom" : "top";
|
|
195
195
|
case "top":
|
|
196
|
-
return
|
|
196
|
+
return M ? T <= R ? "top" : "bottom" : a > O ? "left" : "right";
|
|
197
197
|
case "bottom":
|
|
198
|
-
return
|
|
198
|
+
return M ? T <= o ? "bottom" : "top" : a > O ? "left" : "right";
|
|
199
199
|
default:
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
202
|
}, jt = (param)=>{
|
|
203
|
-
let { content: t, target:
|
|
204
|
-
const { texts:
|
|
205
|
-
q(!1), K(!1),
|
|
203
|
+
let { content: t, target: h, width: v, position: d = "top", dataAttributes: m, delay: x = !0, centerContent: w, open: B, onClose: W, hasPointerInteractionOnly: o = !1, trackingEvent: O } = param;
|
|
204
|
+
const { texts: R } = (0, _hooks.useTheme)(), a = (0, _hooks.useAriaId)(), { openTooltipId: X } = (0, _tooltipcontextprovider.useTooltipState)(), { openTooltip: V, closeTooltip: _ } = (0, _tooltipcontextprovider.useSetTooltipState)(), [T, b] = _react.useState(), [M, z] = _react.useState(), P = _react.useRef(null), Y = _react.useRef(null), [C, dt] = _react.useState(null), u = (0, _environment.isTouchableDevice)(), G = x ? Gt : 0, [et, K] = _react.useState(!1), [U, y] = _react.useState(!1), j = B !== void 0, [ot, q] = _react.useState(!1), E = j ? B : a === X, Z = (0, _themevariantcontext.useIsInverseVariant)(), f = (0, _hooks.useBoundingRect)(P, E), H = (0, _hooks.useBoundingRect)(Y, E, !0), l = (0, _hooks.useWindowSize)(), S = _react.useCallback(()=>{
|
|
205
|
+
q(!1), K(!1), y(!1);
|
|
206
206
|
}, []);
|
|
207
207
|
_react.useEffect(()=>{
|
|
208
|
-
|
|
208
|
+
E || S();
|
|
209
209
|
}, [
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
E,
|
|
211
|
+
S
|
|
212
212
|
]), _react.useEffect(()=>{
|
|
213
|
-
if (!
|
|
214
|
-
const s = ft(f,
|
|
213
|
+
if (!C || !E) return;
|
|
214
|
+
const s = ft(f, C, d, l.height, l.width);
|
|
215
215
|
if (!s || !f) {
|
|
216
|
-
|
|
216
|
+
b(void 0), z(void 0), S();
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
let r, e;
|
|
220
220
|
var _parseInt;
|
|
221
|
-
const { left: c, right:
|
|
221
|
+
const { left: c, right: k, top: L, bottom: A } = f, { width: $, height: F } = pt(C), rt = l.width - $, st = l.height - F, g = (_parseInt = parseInt((0, _dom.getCssVarValue)(_skincontractcssmistica.vars.borderRadii.popup))) !== null && _parseInt !== void 0 ? _parseInt : 8;
|
|
222
222
|
switch(s){
|
|
223
223
|
case "top":
|
|
224
224
|
r = {
|
|
225
|
-
left: Math.max(0, Math.min(rt, (c +
|
|
226
|
-
top:
|
|
227
|
-
padding: `0px 0px ${
|
|
225
|
+
left: Math.max(0, Math.min(rt, (c + k - $) / 2)),
|
|
226
|
+
top: L - F - p / 2,
|
|
227
|
+
padding: `0px 0px ${N}px 0px`
|
|
228
228
|
}, e = {
|
|
229
|
-
left: Math.max(g, Math.min(l.width - g - p, (c +
|
|
229
|
+
left: Math.max(g, Math.min(l.width - g - p, (c + k - p) / 2)),
|
|
230
230
|
top: "100%"
|
|
231
231
|
};
|
|
232
232
|
break;
|
|
233
233
|
case "bottom":
|
|
234
234
|
r = {
|
|
235
|
-
left: Math.max(0, Math.min(rt, (c +
|
|
236
|
-
top:
|
|
237
|
-
padding: `${
|
|
235
|
+
left: Math.max(0, Math.min(rt, (c + k - $) / 2)),
|
|
236
|
+
top: A - I,
|
|
237
|
+
padding: `${N}px 0px 0px 0px`
|
|
238
238
|
}, e = {
|
|
239
|
-
left: Math.max(g, Math.min(l.width - g - p, (c +
|
|
239
|
+
left: Math.max(g, Math.min(l.width - g - p, (c + k - p) / 2)),
|
|
240
240
|
bottom: "100%",
|
|
241
241
|
transform: "rotate(180deg)"
|
|
242
242
|
};
|
|
243
243
|
break;
|
|
244
244
|
case "left":
|
|
245
245
|
r = {
|
|
246
|
-
left: c -
|
|
247
|
-
top: Math.max(0, Math.min(st, (
|
|
248
|
-
padding: `0px ${
|
|
246
|
+
left: c - $ - p / 2,
|
|
247
|
+
top: Math.max(0, Math.min(st, (L + A - F) / 2)),
|
|
248
|
+
padding: `0px ${N}px 0px 0px`
|
|
249
249
|
}, e = {
|
|
250
|
-
top: Math.max(g, Math.min(l.height - g - p, (
|
|
250
|
+
top: Math.max(g, Math.min(l.height - g - p, (L + A - p) / 2)),
|
|
251
251
|
left: "100%",
|
|
252
252
|
transform: "rotate(-90deg)",
|
|
253
253
|
transformOrigin: "bottom"
|
|
@@ -256,66 +256,66 @@ const lt = (t)=>({
|
|
|
256
256
|
case "right":
|
|
257
257
|
default:
|
|
258
258
|
r = {
|
|
259
|
-
left:
|
|
260
|
-
top: Math.max(0, Math.min(st, (
|
|
261
|
-
padding: `0px 0px 0px ${
|
|
259
|
+
left: k - I,
|
|
260
|
+
top: Math.max(0, Math.min(st, (L + A - F) / 2)),
|
|
261
|
+
padding: `0px 0px 0px ${N}px`
|
|
262
262
|
}, e = {
|
|
263
|
-
top: Math.max(g, Math.min(l.height - g - p, (
|
|
263
|
+
top: Math.max(g, Math.min(l.height - g - p, (L + A - p) / 2)),
|
|
264
264
|
right: "100%",
|
|
265
265
|
transform: "rotate(90deg)",
|
|
266
266
|
transformOrigin: "bottom"
|
|
267
267
|
};
|
|
268
268
|
break;
|
|
269
269
|
}
|
|
270
|
-
typeof e.top == "number" && (e.top -= r.top, e.top = `${e.top /
|
|
270
|
+
typeof e.top == "number" && (e.top -= r.top, e.top = `${e.top / F * 100}%`), typeof e.left == "number" && (e.left -= r.left, e.left = `${e.left / $ * 100}%`), (0, _helpers.isEqual)(r, T) || b(r), (0, _helpers.isEqual)(e, M) || z(e);
|
|
271
271
|
}, [
|
|
272
|
-
|
|
272
|
+
C,
|
|
273
273
|
f,
|
|
274
274
|
H,
|
|
275
|
-
|
|
275
|
+
E,
|
|
276
276
|
d,
|
|
277
277
|
l,
|
|
278
278
|
T,
|
|
279
|
-
|
|
279
|
+
M,
|
|
280
280
|
Z,
|
|
281
|
-
|
|
281
|
+
u,
|
|
282
282
|
a,
|
|
283
|
-
|
|
283
|
+
S
|
|
284
284
|
]);
|
|
285
285
|
const J = _react.useRef(!1);
|
|
286
286
|
_react.useEffect(()=>{
|
|
287
287
|
const s = (c)=>{
|
|
288
288
|
switch(c.key){
|
|
289
289
|
case _keys.ESC:
|
|
290
|
-
o ||
|
|
290
|
+
o || S();
|
|
291
291
|
break;
|
|
292
292
|
case _keys.TAB:
|
|
293
293
|
J.current = !0;
|
|
294
294
|
break;
|
|
295
295
|
}
|
|
296
296
|
}, r = ()=>J.current = !1, e = (c)=>{
|
|
297
|
-
!o &&
|
|
297
|
+
!o && u && f && (c.clientX < f.left || c.clientX > f.right || c.clientY < f.top || c.clientY > f.bottom) && S();
|
|
298
298
|
};
|
|
299
299
|
return document.addEventListener("keydown", s, !1), document.addEventListener("keyup", r, !1), document.addEventListener("click", e, !1), ()=>{
|
|
300
300
|
document.removeEventListener("keydown", s, !1), document.removeEventListener("keyup", r, !1), document.removeEventListener("click", e, !1);
|
|
301
301
|
};
|
|
302
302
|
}, [
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
u,
|
|
304
|
+
S,
|
|
305
305
|
f,
|
|
306
306
|
o
|
|
307
307
|
]), _react.useEffect(()=>{
|
|
308
|
-
j || (U || et || ot ? V(a) :
|
|
308
|
+
j || (U || et || ot ? V(a) : _(a));
|
|
309
309
|
}, [
|
|
310
310
|
U,
|
|
311
311
|
et,
|
|
312
312
|
ot,
|
|
313
313
|
a,
|
|
314
314
|
V,
|
|
315
|
-
|
|
315
|
+
_,
|
|
316
316
|
j
|
|
317
317
|
]);
|
|
318
|
-
const mt = ft(f,
|
|
318
|
+
const mt = ft(f, C, d, l.height, l.width), ut = w !== void 0 ? w : (H == null ? void 0 : H.width) === _tooltipcssmistica.CONTENT_MIN_WIDTH;
|
|
319
319
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
320
320
|
children: [
|
|
321
321
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
@@ -324,33 +324,33 @@ const lt = (t)=>({
|
|
|
324
324
|
r && r !== P.current && (P.current = r);
|
|
325
325
|
},
|
|
326
326
|
onMouseOver: ()=>{
|
|
327
|
-
!
|
|
327
|
+
!u && !o && y(!0);
|
|
328
328
|
},
|
|
329
329
|
onMouseLeave: ()=>{
|
|
330
|
-
!
|
|
330
|
+
!u && !o && y(!1);
|
|
331
331
|
},
|
|
332
332
|
onClick: ()=>{
|
|
333
|
-
(
|
|
333
|
+
(u || o) && y(o ? !U : !0);
|
|
334
334
|
},
|
|
335
335
|
onFocus: ()=>{
|
|
336
336
|
J.current && !o && q(!0);
|
|
337
337
|
},
|
|
338
338
|
onBlur: ()=>{
|
|
339
|
-
!
|
|
339
|
+
!u && !o && q(!1);
|
|
340
340
|
},
|
|
341
341
|
"aria-describedby": a,
|
|
342
|
-
children:
|
|
342
|
+
children: h
|
|
343
343
|
}),
|
|
344
344
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
|
|
345
345
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_reacttransitiongroup.Transition, {
|
|
346
|
-
in:
|
|
346
|
+
in: E,
|
|
347
347
|
nodeRef: Y,
|
|
348
348
|
timeout: (0, _platform.isRunningAcceptanceTest)() ? 0 : {
|
|
349
349
|
enter: Yt + G,
|
|
350
350
|
exit: Kt
|
|
351
351
|
},
|
|
352
352
|
onExited: ()=>{
|
|
353
|
-
|
|
353
|
+
b(void 0), z(void 0);
|
|
354
354
|
},
|
|
355
355
|
mountOnEnter: !0,
|
|
356
356
|
unmountOnExit: !0,
|
|
@@ -366,7 +366,7 @@ const lt = (t)=>({
|
|
|
366
366
|
position: "fixed",
|
|
367
367
|
visibility: T ? "visible" : "hidden"
|
|
368
368
|
}
|
|
369
|
-
},
|
|
369
|
+
}, m), {
|
|
370
370
|
role: "tooltip",
|
|
371
371
|
"aria-label": a,
|
|
372
372
|
tabIndex: -1,
|
|
@@ -380,10 +380,10 @@ const lt = (t)=>({
|
|
|
380
380
|
}),
|
|
381
381
|
ref: (0, _common.combineRefs)(dt, Y),
|
|
382
382
|
onMouseEnter: ()=>{
|
|
383
|
-
!
|
|
383
|
+
!u && s === "entered" && !o && K(!0);
|
|
384
384
|
},
|
|
385
385
|
onMouseLeave: ()=>{
|
|
386
|
-
!
|
|
386
|
+
!u && !o && K(!1);
|
|
387
387
|
},
|
|
388
388
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
389
389
|
className: _tooltipcssmistica.tooltip,
|
|
@@ -405,10 +405,10 @@ const lt = (t)=>({
|
|
|
405
405
|
className: _tooltipcssmistica.closeButtonIcon,
|
|
406
406
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.InternalIconButton, {
|
|
407
407
|
onPress: ()=>{
|
|
408
|
-
|
|
408
|
+
y(!1), W();
|
|
409
409
|
},
|
|
410
|
-
trackingEvent:
|
|
411
|
-
"aria-label":
|
|
410
|
+
trackingEvent: O,
|
|
411
|
+
"aria-label": R.modalClose,
|
|
412
412
|
Icon: _iconcloseregular.default,
|
|
413
413
|
hasInteractiveAreaBleed: !0,
|
|
414
414
|
small: !0
|
|
@@ -419,7 +419,7 @@ const lt = (t)=>({
|
|
|
419
419
|
}),
|
|
420
420
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
421
421
|
className: _tooltipcssmistica.arrowContainer,
|
|
422
|
-
style:
|
|
422
|
+
style: M,
|
|
423
423
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
424
424
|
className: (0, _classnames.default)(_tooltipcssmistica.arrow),
|
|
425
425
|
style: lt(Z)
|
|
@@ -434,9 +434,8 @@ const lt = (t)=>({
|
|
|
434
434
|
]
|
|
435
435
|
});
|
|
436
436
|
}, qt = (_param)=>{
|
|
437
|
-
var { centerContent: t,
|
|
437
|
+
var { centerContent: t, extra: h, children: v, dataAttributes: d, title: m, description: x } = _param, w = _object_without_properties(_param, [
|
|
438
438
|
"centerContent",
|
|
439
|
-
"textCenter",
|
|
440
439
|
"extra",
|
|
441
440
|
"children",
|
|
442
441
|
"dataAttributes",
|
|
@@ -447,25 +446,25 @@ const lt = (t)=>({
|
|
|
447
446
|
content: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, {
|
|
448
447
|
className: _tooltipcssmistica.content,
|
|
449
448
|
children: [
|
|
450
|
-
(
|
|
449
|
+
(m || x) && /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
|
|
451
450
|
space: 4,
|
|
452
451
|
children: [
|
|
453
|
-
|
|
452
|
+
m && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
|
|
454
453
|
medium: !0,
|
|
455
|
-
children:
|
|
454
|
+
children: m
|
|
456
455
|
}),
|
|
457
|
-
|
|
456
|
+
x && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
|
|
458
457
|
regular: !0,
|
|
459
|
-
children:
|
|
458
|
+
children: x
|
|
460
459
|
})
|
|
461
460
|
]
|
|
462
461
|
}),
|
|
463
|
-
|
|
462
|
+
h !== null && h !== void 0 ? h : v
|
|
464
463
|
]
|
|
465
464
|
}),
|
|
466
|
-
centerContent: t
|
|
465
|
+
centerContent: t,
|
|
467
466
|
dataAttributes: _object_spread({
|
|
468
467
|
"component-name": "Tooltip"
|
|
469
|
-
},
|
|
470
|
-
},
|
|
468
|
+
}, d)
|
|
469
|
+
}, w));
|
|
471
470
|
}, ge = qt;
|
package/dist-es/button.js
CHANGED
|
@@ -353,7 +353,7 @@ const x = (param)=>{
|
|
|
353
353
|
/**
|
|
354
354
|
* Setting bleed classes with style to override the margin:0 set by the Touchable component.
|
|
355
355
|
* If we set it using className, it may not work depending on the order in which the styles are applied.
|
|
356
|
-
*/ style: _object_spread({}, t.bleedLeft
|
|
356
|
+
*/ style: _object_spread({}, t.bleedLeft ? {
|
|
357
357
|
marginLeft: -A
|
|
358
358
|
} : void 0, t.bleedRight ? {
|
|
359
359
|
marginRight: -A
|
package/dist-es/cvv-field.js
CHANGED
|
@@ -78,35 +78,35 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
78
78
|
}
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
|
-
import { jsx as r, Fragment as
|
|
82
|
-
import * as
|
|
81
|
+
import { jsx as r, Fragment as O, jsxs as f } from "react/jsx-runtime";
|
|
82
|
+
import * as R from "react";
|
|
83
83
|
import { useTheme as F } from "./hooks.js";
|
|
84
84
|
import H from "./icons/icon-cvv-visa-mc.js";
|
|
85
85
|
import k from "./icons/icon-cvv-amex.js";
|
|
86
86
|
import D from "./popover.js";
|
|
87
|
-
import
|
|
88
|
-
import q from "./
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import
|
|
92
|
-
import
|
|
93
|
-
import Q from "./
|
|
94
|
-
import U from "./
|
|
95
|
-
import W from "./divider.js";
|
|
87
|
+
import N from "./generated/mistica-icons/icon-information-regular.js";
|
|
88
|
+
import { useForm as q, useFieldProps as G } from "./form-context.js";
|
|
89
|
+
import { TextFieldBaseAutosuggest as J } from "./text-field-base.js";
|
|
90
|
+
import { IntegerInput as K } from "./integer-field.js";
|
|
91
|
+
import I from "./inline.js";
|
|
92
|
+
import P from "./stack.js";
|
|
93
|
+
import Q from "./box.js";
|
|
94
|
+
import U from "./divider.js";
|
|
96
95
|
import T from "./text.js";
|
|
97
|
-
import { vars as
|
|
98
|
-
import { pxToRem as
|
|
99
|
-
import { iconButtonSize as
|
|
96
|
+
import { vars as W } from "./skins/skin-contract.css-mistica.js";
|
|
97
|
+
import { pxToRem as X } from "./utils/css.js";
|
|
98
|
+
import { iconButtonSize as m } from "./text-field-base.css-mistica.js";
|
|
99
|
+
import Y from "./touchable.js";
|
|
100
100
|
const Z = (param)=>{
|
|
101
101
|
let { acceptedCards: e } = param;
|
|
102
102
|
const { texts: i } = F();
|
|
103
|
-
return /* @__PURE__ */ r(
|
|
104
|
-
children: /* @__PURE__ */ r(
|
|
103
|
+
return /* @__PURE__ */ r(O, {
|
|
104
|
+
children: /* @__PURE__ */ r(Q, {
|
|
105
105
|
padding: 8,
|
|
106
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ f(P, {
|
|
107
107
|
space: 8,
|
|
108
108
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ f(I, {
|
|
110
110
|
space: 16,
|
|
111
111
|
alignItems: "center",
|
|
112
112
|
children: [
|
|
@@ -119,8 +119,8 @@ const Z = (param)=>{
|
|
|
119
119
|
})
|
|
120
120
|
]
|
|
121
121
|
}),
|
|
122
|
-
/* @__PURE__ */ r(
|
|
123
|
-
(e == null ? void 0 : e.americanExpress) && /* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ r(U, {}),
|
|
123
|
+
(e == null ? void 0 : e.americanExpress) && /* @__PURE__ */ f(I, {
|
|
124
124
|
space: 16,
|
|
125
125
|
alignItems: "center",
|
|
126
126
|
children: [
|
|
@@ -138,11 +138,11 @@ const Z = (param)=>{
|
|
|
138
138
|
})
|
|
139
139
|
});
|
|
140
140
|
}, _ = (_param)=>{
|
|
141
|
-
var { disabled: e, error: i, helperText:
|
|
141
|
+
var { disabled: e, error: i, helperText: M, name: l, optional: d, validate: c, onChange: V, onChangeValue: y, onBlur: z, acceptedCards: B = {
|
|
142
142
|
americanExpress: !0,
|
|
143
143
|
visa: !0,
|
|
144
144
|
masterCard: !0
|
|
145
|
-
}, maxLength:
|
|
145
|
+
}, maxLength: p = 4, value: E, autoComplete: $ = "cc-csc", defaultValue: j, dataAttributes: A } = _param, S = _object_without_properties(_param, [
|
|
146
146
|
"disabled",
|
|
147
147
|
"error",
|
|
148
148
|
"helperText",
|
|
@@ -159,69 +159,70 @@ const Z = (param)=>{
|
|
|
159
159
|
"defaultValue",
|
|
160
160
|
"dataAttributes"
|
|
161
161
|
]);
|
|
162
|
-
const { texts: n } = F(), { setFormError:
|
|
163
|
-
name:
|
|
162
|
+
const { texts: n } = F(), { setFormError: b, jumpToNext: w } = q(), [a, u] = R.useState(!1), v = (o, s)=>o ? o.length !== p ? n.formCreditCardCvvError : c == null ? void 0 : c(o, s) : d ? "" : n.formFieldErrorIsMandatory, C = (o)=>o, h = G({
|
|
163
|
+
name: l,
|
|
164
164
|
value: E,
|
|
165
165
|
defaultValue: j,
|
|
166
166
|
processValue: C,
|
|
167
|
-
helperText:
|
|
168
|
-
optional:
|
|
167
|
+
helperText: M,
|
|
168
|
+
optional: d,
|
|
169
169
|
error: i,
|
|
170
170
|
disabled: e,
|
|
171
|
-
onBlur:
|
|
171
|
+
onBlur: z,
|
|
172
172
|
validate: v,
|
|
173
|
-
onChange:
|
|
174
|
-
onChangeValue:
|
|
175
|
-
}), t =
|
|
176
|
-
return /* @__PURE__ */ r(
|
|
177
|
-
maxLength:
|
|
173
|
+
onChange: V,
|
|
174
|
+
onChangeValue: y
|
|
175
|
+
}), t = X(16);
|
|
176
|
+
return /* @__PURE__ */ r(J, _object_spread_props(_object_spread({}, S, h), {
|
|
177
|
+
maxLength: p,
|
|
178
178
|
onChange: (o)=>{
|
|
179
|
-
|
|
180
|
-
const s = o.currentTarget.value,
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
name:
|
|
185
|
-
error:
|
|
186
|
-
}) :
|
|
179
|
+
h.onChange(o);
|
|
180
|
+
const s = o.currentTarget.value, g = C(s);
|
|
181
|
+
if (g.length === p) {
|
|
182
|
+
const x = v(g, s);
|
|
183
|
+
x ? b({
|
|
184
|
+
name: l,
|
|
185
|
+
error: x
|
|
186
|
+
}) : w(l);
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
189
|
endIcon: /* @__PURE__ */ r(D, {
|
|
190
190
|
position: "top",
|
|
191
|
-
open:
|
|
191
|
+
open: a,
|
|
192
192
|
children: /* @__PURE__ */ r(Z, {
|
|
193
|
-
acceptedCards:
|
|
193
|
+
acceptedCards: B
|
|
194
194
|
}),
|
|
195
|
-
onClose: ()=>
|
|
195
|
+
onClose: ()=>u(!1),
|
|
196
196
|
target: /* @__PURE__ */ r("div", {
|
|
197
197
|
style: {
|
|
198
198
|
width: t,
|
|
199
199
|
height: t
|
|
200
200
|
},
|
|
201
|
-
children: /* @__PURE__ */ r(
|
|
202
|
-
size: f,
|
|
201
|
+
children: /* @__PURE__ */ r(Y, {
|
|
203
202
|
style: {
|
|
204
203
|
display: "flex",
|
|
205
204
|
alignItems: "center",
|
|
206
205
|
justifyContent: "center",
|
|
206
|
+
width: m,
|
|
207
|
+
height: m,
|
|
207
208
|
position: "relative",
|
|
208
|
-
left: `calc(-1 * (${
|
|
209
|
-
top: `calc(-1 * (${
|
|
209
|
+
left: `calc(-1 * (${m} - ${t}) / 2)`,
|
|
210
|
+
top: `calc(-1 * (${m} - ${t}) / 2)`
|
|
210
211
|
},
|
|
211
|
-
onPress: ()=>
|
|
212
|
-
"aria-label":
|
|
213
|
-
children: /* @__PURE__ */ r(
|
|
212
|
+
onPress: ()=>u(!a),
|
|
213
|
+
"aria-label": a ? n.formCreditCardCvvTooltipVisaMcButtonClose : n.formCreditCardCvvTooltipVisaMcButtonOpen,
|
|
214
|
+
children: /* @__PURE__ */ r(N, {
|
|
214
215
|
size: t,
|
|
215
|
-
color:
|
|
216
|
+
color: W.colors.neutralMedium
|
|
216
217
|
})
|
|
217
218
|
})
|
|
218
219
|
})
|
|
219
220
|
}),
|
|
220
221
|
autoComplete: $,
|
|
221
|
-
inputComponent:
|
|
222
|
+
inputComponent: K,
|
|
222
223
|
dataAttributes: _object_spread({
|
|
223
224
|
"component-name": "CvvField"
|
|
224
225
|
}, A)
|
|
225
226
|
}));
|
|
226
|
-
},
|
|
227
|
-
export {
|
|
227
|
+
}, hr = _;
|
|
228
|
+
export { hr as default };
|