@telefonica/mistica 14.23.0 → 14.24.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/header.js +24 -24
- package/dist/icons/icon-success-vivo-new.js +3 -3
- package/dist/package-version.js +1 -1
- package/dist/sheet-root.d.ts +1 -1
- package/dist/sheet-root.js +84 -78
- package/dist/sheet.d.ts +5 -5
- package/dist/sheet.js +101 -90
- package/dist/snackbar.js +64 -61
- package/dist-es/header.js +24 -24
- package/dist-es/icons/icon-success-vivo-new.js +3 -3
- package/dist-es/package-version.js +1 -1
- package/dist-es/sheet-root.js +87 -81
- package/dist-es/sheet.js +136 -125
- package/dist-es/snackbar.js +70 -67
- package/dist-es/style.css +1 -1
- package/package.json +1 -1
package/dist/sheet.js
CHANGED
|
@@ -177,35 +177,35 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
177
177
|
}
|
|
178
178
|
return target;
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const C = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>{
|
|
181
181
|
let { closeModal: t } = param;
|
|
182
|
-
const [i,
|
|
183
|
-
f.current = !0, p.current = 0,
|
|
182
|
+
const [i, a] = _react.useState(0), f = _react.useRef(!1), p = _react.useRef(0), o = _react.useRef(0), s = _react.useRef(0), u = _react.useRef(0), { isDesktopOrBigger: m } = (0, _hooks.useScreenSize)(), r = _react.useCallback((h)=>{
|
|
183
|
+
f.current = !0, p.current = 0, o.current = Date.now(), s.current = C(h);
|
|
184
184
|
}, []), c = _react.useCallback(()=>{
|
|
185
|
-
f.current = !1,
|
|
185
|
+
f.current = !1, a(0);
|
|
186
186
|
}, []);
|
|
187
187
|
return _react.useEffect(()=>{
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
188
|
+
if (m) return;
|
|
189
|
+
const h = (l)=>{
|
|
190
190
|
if (f.current) {
|
|
191
191
|
if (p.current < 3) {
|
|
192
192
|
p.current++;
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
u.current = C(l), a(u.current - s.current);
|
|
196
196
|
}
|
|
197
|
-
},
|
|
197
|
+
}, d = ()=>{
|
|
198
198
|
if (!f.current) return;
|
|
199
|
-
const l = Date.now() -
|
|
200
|
-
f.current = !1,
|
|
199
|
+
const l = Date.now() - o.current, g = u.current - s.current, v = g / l;
|
|
200
|
+
f.current = !1, a(0), g > 50 && (u.current > window.innerHeight * 0.75 || v > 0.5) && t();
|
|
201
201
|
};
|
|
202
|
-
return document.addEventListener("touchmove",
|
|
203
|
-
document.removeEventListener("touchmove",
|
|
202
|
+
return document.addEventListener("touchmove", h), document.addEventListener("touchend", d), document.addEventListener("mousemove", h), document.addEventListener("mouseup", d), ()=>{
|
|
203
|
+
document.removeEventListener("touchmove", h), document.removeEventListener("touchend", d), document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", d);
|
|
204
204
|
};
|
|
205
205
|
}, [
|
|
206
206
|
t,
|
|
207
|
-
|
|
208
|
-
]),
|
|
207
|
+
m
|
|
208
|
+
]), m ? {} : {
|
|
209
209
|
onTouchStart: r,
|
|
210
210
|
onMouseDown: r,
|
|
211
211
|
style: i ? {
|
|
@@ -249,53 +249,53 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
249
249
|
transitionEnd: "closed"
|
|
250
250
|
}
|
|
251
251
|
}, we = (t, i)=>be[t][i] || t, b = /*#__PURE__*/ _react.forwardRef((param, f)=>{
|
|
252
|
-
let { onClose: t , children: i , dataAttributes:
|
|
253
|
-
const { texts: p } = (0, _hooks.useTheme)(), [
|
|
254
|
-
|
|
252
|
+
let { onClose: t , children: i , dataAttributes: a } = param;
|
|
253
|
+
const { texts: p } = (0, _hooks.useTheme)(), [o, s] = _react.useReducer(we, "closed"), u = _react.useRef(!1), m = (0, _hooks.useAriaId)(), r = _react.useCallback((v)=>{
|
|
254
|
+
v.target === v.currentTarget && s("transitionEnd");
|
|
255
255
|
}, []), c = ()=>{
|
|
256
|
-
|
|
256
|
+
o === "open" && s("close");
|
|
257
257
|
};
|
|
258
258
|
_react.useEffect(()=>{
|
|
259
|
-
if (
|
|
260
|
-
const
|
|
259
|
+
if (o === "opening" || o === "closing") {
|
|
260
|
+
const v = setTimeout(()=>{
|
|
261
261
|
s("transitionEnd");
|
|
262
262
|
}, _sheetcssmistica.transitionDuration);
|
|
263
|
-
return ()=>clearTimeout(
|
|
263
|
+
return ()=>clearTimeout(v);
|
|
264
264
|
}
|
|
265
265
|
}, [
|
|
266
|
-
|
|
266
|
+
o
|
|
267
267
|
]), _react.useEffect(()=>{
|
|
268
|
-
|
|
268
|
+
o === "closed" ? u.current ? t == null || t() : s("open") : u.current = !0;
|
|
269
269
|
}, [
|
|
270
|
-
|
|
270
|
+
o,
|
|
271
271
|
t
|
|
272
272
|
]);
|
|
273
273
|
const _Se = Se({
|
|
274
274
|
closeModal: c
|
|
275
|
-
}), { onScroll:
|
|
275
|
+
}), { onScroll: h , overlayStyle: d } = _Se, l = _object_without_properties(_Se, [
|
|
276
276
|
"onScroll",
|
|
277
277
|
"overlayStyle"
|
|
278
278
|
]);
|
|
279
279
|
(0, _modalcontextprovider.useSetModalStateEffect)();
|
|
280
280
|
const g = Ee();
|
|
281
|
-
return
|
|
281
|
+
return o === "closed" ? null : /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
|
|
282
282
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_focustrap.default, {
|
|
283
283
|
children: [
|
|
284
284
|
g,
|
|
285
285
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
286
286
|
className: (0, _classnames.default)(_sheetcssmistica.overlay, {
|
|
287
|
-
[_sheetcssmistica.closingOverlay]:
|
|
287
|
+
[_sheetcssmistica.closingOverlay]: o === "closing"
|
|
288
288
|
}),
|
|
289
|
-
style:
|
|
289
|
+
style: d,
|
|
290
290
|
onClick: c
|
|
291
291
|
}),
|
|
292
292
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
293
293
|
className: (0, _classnames.default)(_sheetcssmistica.SheetContainer, {
|
|
294
|
-
[_sheetcssmistica.closingSheet]:
|
|
294
|
+
[_sheetcssmistica.closingSheet]: o === "closing"
|
|
295
295
|
}),
|
|
296
296
|
onTransitionEnd: r,
|
|
297
297
|
onAnimationEnd: r
|
|
298
|
-
}, l, (0, _dom.getPrefixedDataAttributes)(
|
|
298
|
+
}, l, (0, _dom.getPrefixedDataAttributes)(a, "Sheet")), {
|
|
299
299
|
ref: f,
|
|
300
300
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
301
301
|
className: _sheetcssmistica.Sheet,
|
|
@@ -312,12 +312,12 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
312
312
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("section", {
|
|
313
313
|
role: "dialog",
|
|
314
314
|
"aria-modal": "true",
|
|
315
|
-
"aria-labelledby":
|
|
316
|
-
onScroll:
|
|
315
|
+
"aria-labelledby": m,
|
|
316
|
+
onScroll: h,
|
|
317
317
|
className: _sheetcssmistica.children,
|
|
318
318
|
children: typeof i == "function" ? i({
|
|
319
319
|
closeModal: c,
|
|
320
|
-
modalTitleId:
|
|
320
|
+
modalTitleId: m
|
|
321
321
|
}) : i
|
|
322
322
|
})
|
|
323
323
|
]
|
|
@@ -343,22 +343,22 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
343
343
|
})
|
|
344
344
|
});
|
|
345
345
|
}), k = (param)=>{
|
|
346
|
-
let { title: t , subtitle: i , description:
|
|
347
|
-
const
|
|
346
|
+
let { title: t , subtitle: i , description: a , modalTitleId: f , button: p , secondaryButton: o , link: s , children: u } = param;
|
|
347
|
+
const m = _react.useRef(null), r = _react.useRef(null), c = _react.useRef(null);
|
|
348
348
|
_react.useEffect(()=>{
|
|
349
349
|
r.current && (c.current = (0, _dom.getScrollableParentElement)(r.current));
|
|
350
350
|
}, []);
|
|
351
|
-
const
|
|
351
|
+
const h = !(0, _hooks.useIsInViewport)(m, !0, {
|
|
352
352
|
root: c.current
|
|
353
|
-
}),
|
|
353
|
+
}), d = !(0, _hooks.useIsInViewport)(r, !0, {
|
|
354
354
|
rootMargin: "1px",
|
|
355
355
|
// bottomScrollSignal div has 0px height so we need a 1px margin to trigger the intersection observer
|
|
356
356
|
root: c.current
|
|
357
|
-
}), l = !!p || !!
|
|
357
|
+
}), l = !!p || !!o || !!s;
|
|
358
358
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
359
359
|
children: [
|
|
360
360
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
361
|
-
ref:
|
|
361
|
+
ref: m
|
|
362
362
|
}),
|
|
363
363
|
/* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
364
364
|
className: _sheetcssmistica.stickyTitle,
|
|
@@ -383,7 +383,7 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
383
383
|
desktop: 40
|
|
384
384
|
}
|
|
385
385
|
}),
|
|
386
|
-
|
|
386
|
+
h && /* @__PURE__ */ (0, _jsxruntime.jsx)(_divider.default, {})
|
|
387
387
|
]
|
|
388
388
|
}),
|
|
389
389
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
@@ -397,7 +397,7 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
397
397
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
|
|
398
398
|
space: 8,
|
|
399
399
|
children: [
|
|
400
|
-
i ||
|
|
400
|
+
i || a ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
|
|
401
401
|
space: {
|
|
402
402
|
mobile: 8,
|
|
403
403
|
desktop: 16
|
|
@@ -408,15 +408,26 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
408
408
|
regular: !0,
|
|
409
409
|
children: i
|
|
410
410
|
}),
|
|
411
|
-
|
|
411
|
+
a && (Array.isArray(a) ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
|
|
412
|
+
as: "div",
|
|
413
|
+
regular: !0,
|
|
414
|
+
color: _skincontractcssmistica.vars.colors.textSecondary,
|
|
415
|
+
children: a.map((g, v)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("p", {
|
|
416
|
+
style: {
|
|
417
|
+
margin: 0,
|
|
418
|
+
marginBottom: v < a.length - 1 ? "1em" : void 0
|
|
419
|
+
},
|
|
420
|
+
children: g
|
|
421
|
+
}, v))
|
|
422
|
+
}) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
|
|
412
423
|
as: "p",
|
|
413
424
|
regular: !0,
|
|
414
425
|
color: _skincontractcssmistica.vars.colors.textSecondary,
|
|
415
|
-
children:
|
|
416
|
-
})
|
|
426
|
+
children: a
|
|
427
|
+
}))
|
|
417
428
|
]
|
|
418
429
|
}) : null,
|
|
419
|
-
|
|
430
|
+
u
|
|
420
431
|
]
|
|
421
432
|
})
|
|
422
433
|
})
|
|
@@ -425,7 +436,7 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
425
436
|
l && /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
426
437
|
className: _sheetcssmistica.stickyButtons,
|
|
427
438
|
children: [
|
|
428
|
-
|
|
439
|
+
d && /* @__PURE__ */ (0, _jsxruntime.jsx)(_divider.default, {}),
|
|
429
440
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
|
|
430
441
|
paddingY: {
|
|
431
442
|
mobile: 16,
|
|
@@ -437,7 +448,7 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
437
448
|
link: s,
|
|
438
449
|
children: [
|
|
439
450
|
p,
|
|
440
|
-
|
|
451
|
+
o
|
|
441
452
|
]
|
|
442
453
|
})
|
|
443
454
|
})
|
|
@@ -450,36 +461,36 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
450
461
|
]
|
|
451
462
|
});
|
|
452
463
|
}, Qe = /*#__PURE__*/ _react.forwardRef((param, r)=>{
|
|
453
|
-
let { title: t , subtitle: i , description:
|
|
454
|
-
const [c,
|
|
464
|
+
let { title: t , subtitle: i , description: a , items: f , selectedId: p , onClose: o , onSelect: s , button: u , dataAttributes: m } = param;
|
|
465
|
+
const [c, h] = _react.useState(p), d = _react.useRef(!1), { isDesktopOrBigger: l } = (0, _hooks.useScreenSize)(), { texts: g } = (0, _hooks.useTheme)();
|
|
455
466
|
var _ref, _R_title;
|
|
456
467
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
|
|
457
|
-
onClose:
|
|
468
|
+
onClose: o,
|
|
458
469
|
ref: r,
|
|
459
|
-
dataAttributes: _object_spread_props(_object_spread({},
|
|
470
|
+
dataAttributes: _object_spread_props(_object_spread({}, m), {
|
|
460
471
|
"component-name": "RadioListSheet"
|
|
461
472
|
}),
|
|
462
473
|
children: (param)=>/* @__PURE__ */ {
|
|
463
|
-
let { closeModal:
|
|
474
|
+
let { closeModal: v , modalTitleId: L } = param;
|
|
464
475
|
return (0, _jsxruntime.jsx)(k, {
|
|
465
476
|
title: t,
|
|
466
477
|
subtitle: i,
|
|
467
|
-
description:
|
|
468
|
-
modalTitleId:
|
|
478
|
+
description: a,
|
|
479
|
+
modalTitleId: L,
|
|
469
480
|
button: l ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_button.ButtonPrimary, {
|
|
470
481
|
onPress: ()=>{
|
|
471
|
-
|
|
482
|
+
d.current && (s == null || s(c !== null && c !== void 0 ? c : "")), v();
|
|
472
483
|
},
|
|
473
|
-
children: (_ref =
|
|
484
|
+
children: (_ref = u == null ? void 0 : u.text) !== null && _ref !== void 0 ? _ref : g.sheetConfirmButton
|
|
474
485
|
}) : void 0,
|
|
475
486
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_negativebox.default, {
|
|
476
487
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_radiobutton.RadioGroup, {
|
|
477
|
-
"aria-labelledby":
|
|
488
|
+
"aria-labelledby": L,
|
|
478
489
|
name: "sheetselection",
|
|
479
490
|
value: c,
|
|
480
491
|
onChange: (R)=>{
|
|
481
|
-
|
|
482
|
-
|
|
492
|
+
h(R), d.current = !0, !l && (s == null || s(R), setTimeout(()=>{
|
|
493
|
+
v();
|
|
483
494
|
}, 200));
|
|
484
495
|
},
|
|
485
496
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_list.RowList, {
|
|
@@ -495,12 +506,12 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
495
506
|
});
|
|
496
507
|
}
|
|
497
508
|
});
|
|
498
|
-
}), Ue = /*#__PURE__*/ _react.forwardRef((param,
|
|
499
|
-
let { title: t , subtitle: i , description:
|
|
500
|
-
const { isDarkMode:
|
|
509
|
+
}), Ue = /*#__PURE__*/ _react.forwardRef((param, u)=>{
|
|
510
|
+
let { title: t , subtitle: i , description: a , items: f , onClose: p , onSelect: o , dataAttributes: s } = param;
|
|
511
|
+
const { isDarkMode: m } = (0, _hooks.useTheme)();
|
|
501
512
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
|
|
502
513
|
onClose: p,
|
|
503
|
-
ref:
|
|
514
|
+
ref: u,
|
|
504
515
|
dataAttributes: _object_spread_props(_object_spread({}, s), {
|
|
505
516
|
"component-name": "ActionsListSheet"
|
|
506
517
|
}),
|
|
@@ -509,14 +520,14 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
509
520
|
return (0, _jsxruntime.jsx)(k, {
|
|
510
521
|
title: t,
|
|
511
522
|
subtitle: i,
|
|
512
|
-
description:
|
|
523
|
+
description: a,
|
|
513
524
|
modalTitleId: c,
|
|
514
525
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_negativebox.default, {
|
|
515
526
|
children: f.map((param)=>/* @__PURE__ */ {
|
|
516
|
-
let { id:
|
|
527
|
+
let { id: h , style: d , title: l , icon: g } = param;
|
|
517
528
|
return (0, _jsxruntime.jsx)(_touchable.default, {
|
|
518
529
|
onPress: ()=>{
|
|
519
|
-
|
|
530
|
+
o == null || o(h), r();
|
|
520
531
|
},
|
|
521
532
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
522
533
|
className: _sheetcssmistica.sheetActionRow,
|
|
@@ -525,42 +536,42 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
525
536
|
paddingRight: 16,
|
|
526
537
|
children: g.Icon ? /* @__PURE__ */ (0, _jsxruntime.jsx)(g.Icon, {
|
|
527
538
|
size: 24,
|
|
528
|
-
color:
|
|
539
|
+
color: d === "destructive" ? _skincontractcssmistica.vars.colors.textLinkDanger : _skincontractcssmistica.vars.colors.neutralHigh
|
|
529
540
|
}) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.default, {
|
|
530
541
|
circular: !0,
|
|
531
|
-
src:
|
|
542
|
+
src: m && g.urlDark ? g.urlDark : g.url,
|
|
532
543
|
width: 40
|
|
533
544
|
})
|
|
534
545
|
}),
|
|
535
546
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
|
|
536
547
|
regular: !0,
|
|
537
|
-
color:
|
|
548
|
+
color: d === "destructive" ? _skincontractcssmistica.vars.colors.textLinkDanger : _skincontractcssmistica.vars.colors.textPrimary,
|
|
538
549
|
children: l
|
|
539
550
|
})
|
|
540
551
|
]
|
|
541
552
|
})
|
|
542
|
-
},
|
|
553
|
+
}, h);
|
|
543
554
|
})
|
|
544
555
|
})
|
|
545
556
|
});
|
|
546
557
|
}
|
|
547
558
|
});
|
|
548
559
|
}), We = /*#__PURE__*/ _react.forwardRef((param, s)=>{
|
|
549
|
-
let { title: t , subtitle: i , description:
|
|
550
|
-
const { isDarkMode:
|
|
560
|
+
let { title: t , subtitle: i , description: a , items: f , onClose: p , dataAttributes: o } = param;
|
|
561
|
+
const { isDarkMode: u } = (0, _hooks.useTheme)();
|
|
551
562
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
|
|
552
563
|
onClose: p,
|
|
553
564
|
ref: s,
|
|
554
|
-
dataAttributes: _object_spread_props(_object_spread({},
|
|
565
|
+
dataAttributes: _object_spread_props(_object_spread({}, o), {
|
|
555
566
|
"component-name": "InfoSheet"
|
|
556
567
|
}),
|
|
557
568
|
children: (param)=>/* @__PURE__ */ {
|
|
558
|
-
let { modalTitleId:
|
|
569
|
+
let { modalTitleId: m } = param;
|
|
559
570
|
return (0, _jsxruntime.jsx)(k, {
|
|
560
571
|
title: t,
|
|
561
572
|
subtitle: i,
|
|
562
|
-
description:
|
|
563
|
-
modalTitleId:
|
|
573
|
+
description: a,
|
|
574
|
+
modalTitleId: m,
|
|
564
575
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
|
|
565
576
|
paddingBottom: 16,
|
|
566
577
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_stack.default, {
|
|
@@ -577,7 +588,7 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
577
588
|
}) : r.icon.Icon ? /* @__PURE__ */ (0, _jsxruntime.jsx)(r.icon.Icon, {
|
|
578
589
|
size: r.icon.type === "small" ? 16 : 24
|
|
579
590
|
}) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.default, {
|
|
580
|
-
src:
|
|
591
|
+
src: u && r.icon.urlDark ? r.icon.urlDark : r.icon.url,
|
|
581
592
|
width: r.icon.type === "small" ? 16 : 24,
|
|
582
593
|
height: r.icon.type === "small" ? 16 : 24
|
|
583
594
|
})
|
|
@@ -604,37 +615,37 @@ const A = (t)=>"touches" in t ? t.touches[0].clientY : t.clientY, Se = (param)=>
|
|
|
604
615
|
}
|
|
605
616
|
});
|
|
606
617
|
}), Xe = /*#__PURE__*/ _react.forwardRef((param, r)=>{
|
|
607
|
-
let { title: t , subtitle: i , description:
|
|
608
|
-
const c = (
|
|
609
|
-
|
|
610
|
-
},
|
|
611
|
-
var { text:
|
|
618
|
+
let { title: t , subtitle: i , description: a , button: f , secondaryButton: p , buttonLink: o , onClose: s , dataAttributes: u , onPressButton: m } = param;
|
|
619
|
+
const c = (d, l)=>()=>{
|
|
620
|
+
m == null || m(l), d();
|
|
621
|
+
}, h = (_param)=>{
|
|
622
|
+
var { text: d } = _param, l = _object_without_properties(_param, [
|
|
612
623
|
"text"
|
|
613
624
|
]);
|
|
614
625
|
return _object_spread({
|
|
615
|
-
children:
|
|
626
|
+
children: d
|
|
616
627
|
}, l);
|
|
617
628
|
};
|
|
618
629
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(b, {
|
|
619
630
|
onClose: s,
|
|
620
631
|
ref: r,
|
|
621
|
-
dataAttributes: _object_spread_props(_object_spread({},
|
|
632
|
+
dataAttributes: _object_spread_props(_object_spread({}, u), {
|
|
622
633
|
"component-name": "ActionsSheet"
|
|
623
634
|
}),
|
|
624
635
|
children: (param)=>/* @__PURE__ */ {
|
|
625
|
-
let { modalTitleId:
|
|
636
|
+
let { modalTitleId: d , closeModal: l } = param;
|
|
626
637
|
return (0, _jsxruntime.jsx)(k, {
|
|
627
638
|
title: t,
|
|
628
639
|
subtitle: i,
|
|
629
|
-
description:
|
|
630
|
-
modalTitleId:
|
|
631
|
-
button: /* @__PURE__ */ (0, _jsxruntime.jsx)(_button.ButtonPrimary, _object_spread_props(_object_spread({},
|
|
640
|
+
description: a,
|
|
641
|
+
modalTitleId: d,
|
|
642
|
+
button: /* @__PURE__ */ (0, _jsxruntime.jsx)(_button.ButtonPrimary, _object_spread_props(_object_spread({}, h(f)), {
|
|
632
643
|
onPress: c(l, "PRIMARY")
|
|
633
644
|
})),
|
|
634
|
-
secondaryButton: p ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_button.ButtonSecondary, _object_spread_props(_object_spread({},
|
|
645
|
+
secondaryButton: p ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_button.ButtonSecondary, _object_spread_props(_object_spread({}, h(p)), {
|
|
635
646
|
onPress: c(l, "SECONDARY")
|
|
636
647
|
})) : void 0,
|
|
637
|
-
link:
|
|
648
|
+
link: o ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_button.ButtonLink, _object_spread_props(_object_spread({}, h(o)), {
|
|
638
649
|
onPress: c(l, "LINK")
|
|
639
650
|
})) : void 0
|
|
640
651
|
});
|
package/dist/snackbar.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return re;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -19,6 +19,7 @@ const _snackbarcssmistica = require("./snackbar.css-mistica.js");
|
|
|
19
19
|
const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
|
|
20
20
|
const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
|
|
21
21
|
const _dom = require("./utils/dom.js");
|
|
22
|
+
const _portal = require("./portal.js");
|
|
22
23
|
function _interop_require_default(obj) {
|
|
23
24
|
return obj && obj.__esModule ? obj : {
|
|
24
25
|
default: obj
|
|
@@ -116,94 +117,96 @@ function _object_spread_props(target, source) {
|
|
|
116
117
|
return target;
|
|
117
118
|
}
|
|
118
119
|
const z = (param)=>{
|
|
119
|
-
let { message: a , buttonText: e , duration:
|
|
120
|
-
const [
|
|
120
|
+
let { message: a , buttonText: e , duration: t = e ? 1e4 : 5e3 , onClose: n = ()=>{} , type: o = "INFORMATIVE" , dataAttributes: c } = param;
|
|
121
|
+
const [i, u] = _react.useState(!1), { width: d , ref: h } = (0, _hooks.useElementDimensions)(), { isDesktopOrBigger: I } = (0, _hooks.useScreenSize)(), m = d > (I ? 160 : 128), f = _react.useCallback(()=>{
|
|
121
122
|
u(!1), setTimeout(()=>{
|
|
122
|
-
|
|
123
|
+
n();
|
|
123
124
|
}, _snackbarcssmistica.TRANSITION_TIME_IN_MS);
|
|
124
125
|
}, [
|
|
125
|
-
|
|
126
|
+
n
|
|
126
127
|
]);
|
|
127
128
|
return _react.useEffect(()=>{
|
|
128
129
|
const g = setTimeout(()=>{
|
|
129
130
|
u(!0);
|
|
130
|
-
}, 50), b = setTimeout(f,
|
|
131
|
+
}, 50), b = setTimeout(f, t);
|
|
131
132
|
return ()=>{
|
|
132
133
|
clearTimeout(g), clearTimeout(b);
|
|
133
134
|
};
|
|
134
135
|
}, [
|
|
135
136
|
f,
|
|
136
|
-
|
|
137
|
-
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
e && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
159
|
-
className: (0, _classnames.default)(_snackbarcssmistica.button, n === "CRITICAL" ? _snackbarcssmistica.buttonCritical : _snackbarcssmistica.buttonInfo, {
|
|
160
|
-
[_snackbarcssmistica.longButton]: m
|
|
137
|
+
t
|
|
138
|
+
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
|
|
139
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
140
|
+
className: (0, _classnames.default)(_snackbarcssmistica.snackbar, {
|
|
141
|
+
[_snackbarcssmistica.snackbarOpen]: i
|
|
142
|
+
}),
|
|
143
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
144
|
+
role: "alert",
|
|
145
|
+
className: (0, _classnames.default)(_snackbarcssmistica.wrapper, o === "CRITICAL" ? _snackbarcssmistica.wrapperCritical : _snackbarcssmistica.wrapperInfo, {
|
|
146
|
+
[_snackbarcssmistica.wrapperOpen]: i
|
|
147
|
+
})
|
|
148
|
+
}, (0, _dom.getPrefixedDataAttributes)(c, "SnackBar")), {
|
|
149
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
150
|
+
className: (0, _classnames.default)(_snackbarcssmistica.content, (0, _sprinklescssmistica.sprinkles)({
|
|
151
|
+
flexDirection: m ? "column" : "row",
|
|
152
|
+
alignItems: m ? void 0 : "center"
|
|
153
|
+
})),
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
|
|
156
|
+
regular: !0,
|
|
157
|
+
color: _skincontractcssmistica.vars.colors.textPrimaryInverse,
|
|
158
|
+
children: a
|
|
161
159
|
}),
|
|
162
|
-
|
|
163
|
-
className: (0,
|
|
164
|
-
|
|
165
|
-
padding: 0,
|
|
166
|
-
background: "transparent",
|
|
167
|
-
color: "inherit"
|
|
160
|
+
e && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
161
|
+
className: (0, _classnames.default)(_snackbarcssmistica.button, o === "CRITICAL" ? _snackbarcssmistica.buttonCritical : _snackbarcssmistica.buttonInfo, {
|
|
162
|
+
[_snackbarcssmistica.longButton]: m
|
|
168
163
|
}),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
165
|
+
className: (0, _sprinklescssmistica.sprinkles)({
|
|
166
|
+
border: "none",
|
|
167
|
+
padding: 0,
|
|
168
|
+
background: "transparent",
|
|
169
|
+
color: "inherit"
|
|
170
|
+
}),
|
|
171
|
+
style: {
|
|
172
|
+
lineHeight: "inherit",
|
|
173
|
+
fontWeight: "inherit"
|
|
174
|
+
},
|
|
175
|
+
ref: h,
|
|
176
|
+
onPress: f,
|
|
177
|
+
children: e
|
|
178
|
+
})
|
|
176
179
|
})
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
})
|
|
180
|
-
})
|
|
180
|
+
]
|
|
181
|
+
})
|
|
182
|
+
}))
|
|
183
|
+
})
|
|
181
184
|
});
|
|
182
185
|
}, H = (param)=>{
|
|
183
|
-
let { message: a , buttonText: e , duration:
|
|
184
|
-
const c = (0, _webviewbridge.isWebViewBridgeAvailable)(),
|
|
186
|
+
let { message: a , buttonText: e , duration: t = e ? 1e4 : 5e3 , onClose: n = ()=>{} , type: o = "INFORMATIVE" } = param;
|
|
187
|
+
const c = (0, _webviewbridge.isWebViewBridgeAvailable)(), i = _react.useRef(n);
|
|
185
188
|
return _react.useEffect(()=>{
|
|
186
|
-
|
|
189
|
+
i.current = n;
|
|
187
190
|
}, [
|
|
188
|
-
|
|
191
|
+
n
|
|
189
192
|
]), _react.useEffect(()=>{
|
|
190
193
|
c && (0, _webviewbridge.nativeMessage)({
|
|
191
194
|
message: a,
|
|
192
|
-
duration:
|
|
195
|
+
duration: t,
|
|
193
196
|
buttonText: e,
|
|
194
|
-
type:
|
|
195
|
-
}).then(
|
|
197
|
+
type: o
|
|
198
|
+
}).then(i.current);
|
|
196
199
|
}, [
|
|
197
200
|
e,
|
|
198
|
-
|
|
201
|
+
t,
|
|
199
202
|
a,
|
|
200
203
|
c,
|
|
201
|
-
|
|
204
|
+
o
|
|
202
205
|
]), c ? null : /* @__PURE__ */ (0, _jsxruntime.jsx)(z, {
|
|
203
206
|
message: a,
|
|
204
|
-
duration:
|
|
207
|
+
duration: t,
|
|
205
208
|
buttonText: e,
|
|
206
|
-
type:
|
|
207
|
-
onClose:
|
|
209
|
+
type: o,
|
|
210
|
+
onClose: i.current
|
|
208
211
|
});
|
|
209
|
-
},
|
|
212
|
+
}, re = H;
|