@telefonica/mistica 14.28.1 → 14.30.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.
Files changed (59) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.d.ts +3 -0
  3. package/dist/accordion.js +71 -70
  4. package/dist/button-layout.css-mistica.js +11 -19
  5. package/dist/button-layout.css.d.ts +1 -5
  6. package/dist/button-layout.js +19 -90
  7. package/dist/button.css-mistica.js +18 -21
  8. package/dist/card.d.ts +17 -7
  9. package/dist/card.js +275 -267
  10. package/dist/community/advanced-data-card.d.ts +1 -1
  11. package/dist/counter.css-mistica.js +48 -0
  12. package/dist/counter.css.d.ts +11 -0
  13. package/dist/counter.css.ts.vanilla.css-mistica.js +11 -0
  14. package/dist/counter.d.ts +19 -0
  15. package/dist/counter.js +240 -0
  16. package/dist/generated/mistica-icons/icon-add-more-filled.js +1 -1
  17. package/dist/generated/mistica-icons/icon-add-more-light.js +1 -1
  18. package/dist/generated/mistica-icons/icon-add-more-regular.js +2 -2
  19. package/dist/generated/mistica-icons/icon-subtract-filled.d.ts +4 -0
  20. package/dist/generated/mistica-icons/icon-subtract-light.js +21 -10
  21. package/dist/generated/mistica-icons/icon-subtract-regular.js +29 -8
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +7 -0
  24. package/dist/list.d.ts +3 -0
  25. package/dist/list.js +92 -92
  26. package/dist/loading-bar.js +5 -4
  27. package/dist/menu.js +11 -10
  28. package/dist/navigation-bar.js +27 -26
  29. package/dist/package-version.js +1 -1
  30. package/dist/snackbar.css-mistica.js +16 -13
  31. package/dist/snackbar.css.d.ts +3 -2
  32. package/dist/snackbar.d.ts +5 -1
  33. package/dist/snackbar.js +119 -64
  34. package/dist/theme.d.ts +6 -0
  35. package/dist/theme.js +52 -28
  36. package/dist-es/accordion.js +79 -78
  37. package/dist-es/button-layout.css-mistica.js +4 -6
  38. package/dist-es/button-layout.js +27 -98
  39. package/dist-es/button.css-mistica.js +3 -3
  40. package/dist-es/card.js +343 -338
  41. package/dist-es/counter.css-mistica.js +4 -0
  42. package/dist-es/counter.css.ts.vanilla.css-mistica.js +2 -0
  43. package/dist-es/counter.js +187 -0
  44. package/dist-es/generated/mistica-icons/icon-add-more-filled.js +1 -1
  45. package/dist-es/generated/mistica-icons/icon-add-more-light.js +1 -1
  46. package/dist-es/generated/mistica-icons/icon-add-more-regular.js +2 -2
  47. package/dist-es/generated/mistica-icons/icon-subtract-light.js +24 -13
  48. package/dist-es/generated/mistica-icons/icon-subtract-regular.js +33 -12
  49. package/dist-es/index.js +1765 -1764
  50. package/dist-es/list.js +125 -125
  51. package/dist-es/loading-bar.js +12 -11
  52. package/dist-es/menu.js +9 -8
  53. package/dist-es/navigation-bar.js +26 -25
  54. package/dist-es/package-version.js +1 -1
  55. package/dist-es/snackbar.css-mistica.js +5 -2
  56. package/dist-es/snackbar.js +140 -85
  57. package/dist-es/style.css +1 -1
  58. package/dist-es/theme.js +56 -32
  59. package/package.json +1 -1
@@ -100,20 +100,21 @@ import de from "./grid-layout.js";
100
100
  import { useSetModalState as me } from "./modal-context-provider.js";
101
101
  import { Logo as j } from "./logo.js";
102
102
  import { vars as H } from "./skins/skin-contract.css-mistica.js";
103
- import { logoContainer as P, spacer as T, burgerMenu as ue, burgerMenuTransition as pe, spacerLarge as he, iconButtonVariants as ge, lineHeightFix as W, textWrapperVariants as F, burgerIconContainer as Ne, iconCloseOpen as fe, iconCloseHidden as ve, iconMenuHidden as Be, iconMenuOpen as be, topFixed as Me, topFixedBottomRow as Ae, navigationBarContent as Te, navigationBarContentRight as Ie, section as Ce, selectedSectionVariantes as Se, navbarBorderColorVariants as C } from "./navigation-bar.css-mistica.js";
103
+ import { logoContainer as P, spacer as T, burgerMenu as ue, burgerMenuTransition as pe, spacerLarge as he, iconButtonVariants as ge, lineHeightFix as W, textWrapperVariants as F, burgerIconContainer as fe, iconCloseOpen as Ne, iconCloseHidden as ve, iconMenuHidden as Be, iconMenuOpen as be, topFixed as Me, topFixedBottomRow as Ae, navigationBarContent as Te, navigationBarContentRight as Ie, section as Ce, selectedSectionVariantes as Se, navbarBorderColorVariants as C } from "./navigation-bar.css-mistica.js";
104
104
  import { sprinkles as $ } from "./sprinkles.css-mistica.js";
105
105
  import { getPrefixedDataAttributes as Oe } from "./utils/dom.js";
106
106
  import Re from "./stack.js";
107
107
  import xe from "./box.js";
108
- const _e = (param)=>/* @__PURE__ */ {
108
+ import { isRunningAcceptanceTest as _e } from "./utils/platform.js";
109
+ const ke = (param)=>/* @__PURE__ */ {
109
110
  let { isOpen: n } = param;
110
111
  return i("div", {
111
- className: Ne,
112
+ className: fe,
112
113
  role: "presentation",
113
114
  "data-component-name": "BurgerMenuIcon",
114
115
  children: [
115
116
  /* @__PURE__ */ e("div", {
116
- className: n ? fe : ve,
117
+ className: n ? Ne : ve,
117
118
  children: /* @__PURE__ */ e(te, {})
118
119
  }),
119
120
  /* @__PURE__ */ e("div", {
@@ -122,7 +123,7 @@ const _e = (param)=>/* @__PURE__ */ {
122
123
  })
123
124
  ]
124
125
  });
125
- }, ke = 300, N = (param)=>{
126
+ }, Ee = 300, f = (param)=>{
126
127
  let { children: n , topFixed: o , withBorder: t , isMenuOpen: r , isInverse: a , dataAttributes: c , isBottomRow: d = !1 } = param;
127
128
  const { isDarkMode: s } = O();
128
129
  return /* @__PURE__ */ e("header", _object_spread_props(_object_spread({
@@ -140,7 +141,7 @@ const _e = (param)=>/* @__PURE__ */ {
140
141
  }, Oe(c)), {
141
142
  children: n
142
143
  }));
143
- }, Ee = 136, Ge = 24, f = (param)=>{
144
+ }, Ge = 136, ye = 24, N = (param)=>{
144
145
  let { right: n , children: o } = param;
145
146
  const { isTabletOrSmaller: t } = R();
146
147
  return /* @__PURE__ */ i("div", {
@@ -150,13 +151,13 @@ const _e = (param)=>/* @__PURE__ */ {
150
151
  n && /* @__PURE__ */ e("div", {
151
152
  className: Ie,
152
153
  style: {
153
- marginLeft: t ? Ge : Ee
154
+ marginLeft: t ? ye : Ge
154
155
  },
155
156
  children: n
156
157
  })
157
158
  ]
158
159
  });
159
- }, sn = (param)=>{
160
+ }, dn = (param)=>{
160
161
  let { sections: n , selectedIndex: o , right: t , isInverse: r = !1 , topFixed: a = !0 , withBorder: c = !0 , burgerMenuExtra: d , logo: s , large: p = !1 } = param;
161
162
  const { texts: h , isDarkMode: q } = O(), [l, x] = S.useState(!1), [_, v] = S.useState("closed"), k = ne(), J = q ? 1 : 0.2, { isTabletOrSmaller: E } = R(), G = me();
162
163
  if (s = s !== null && s !== void 0 ? s : /* @__PURE__ */ e(j, {
@@ -179,7 +180,7 @@ const _e = (param)=>/* @__PURE__ */ {
179
180
  children: [
180
181
  /* @__PURE__ */ e(A, {
181
182
  isInverse: r,
182
- children: /* @__PURE__ */ e(N, {
183
+ children: /* @__PURE__ */ e(f, {
183
184
  topFixed: a,
184
185
  withBorder: c,
185
186
  isMenuOpen: l,
@@ -188,7 +189,7 @@ const _e = (param)=>/* @__PURE__ */ {
188
189
  "component-name": "MainNavigationBar"
189
190
  },
190
191
  children: /* @__PURE__ */ e(m, {
191
- children: /* @__PURE__ */ e(f, {
192
+ children: /* @__PURE__ */ e(N, {
192
193
  right: t,
193
194
  children: /* @__PURE__ */ i(u, {
194
195
  space: 24,
@@ -200,7 +201,7 @@ const _e = (param)=>/* @__PURE__ */ {
200
201
  "aria-expanded": l,
201
202
  "aria-controls": k,
202
203
  onPress: l ? b : I,
203
- children: /* @__PURE__ */ e(_e, {
204
+ children: /* @__PURE__ */ e(ke, {
204
205
  isOpen: l
205
206
  })
206
207
  }),
@@ -237,7 +238,7 @@ const _e = (param)=>/* @__PURE__ */ {
237
238
  v("closed");
238
239
  },
239
240
  in: l,
240
- timeout: ke,
241
+ timeout: _e() ? 0 : Ee,
241
242
  unmountOnExit: !0,
242
243
  children: (K)=>/* @__PURE__ */ e(L, {
243
244
  children: /* @__PURE__ */ e("nav", {
@@ -296,7 +297,7 @@ const _e = (param)=>/* @__PURE__ */ {
296
297
  return /* @__PURE__ */ i(A, {
297
298
  isInverse: r,
298
299
  children: [
299
- /* @__PURE__ */ e(N, {
300
+ /* @__PURE__ */ e(f, {
300
301
  topFixed: a,
301
302
  withBorder: c && !B,
302
303
  isMenuOpen: l,
@@ -305,7 +306,7 @@ const _e = (param)=>/* @__PURE__ */ {
305
306
  "component-name": "MainNavigationBar"
306
307
  },
307
308
  children: /* @__PURE__ */ e(m, {
308
- children: /* @__PURE__ */ e(f, {
309
+ children: /* @__PURE__ */ e(N, {
309
310
  right: t,
310
311
  children: /* @__PURE__ */ i(u, {
311
312
  space: 48,
@@ -321,7 +322,7 @@ const _e = (param)=>/* @__PURE__ */ {
321
322
  })
322
323
  })
323
324
  }),
324
- B && /* @__PURE__ */ e(N, {
325
+ B && /* @__PURE__ */ e(f, {
325
326
  topFixed: a,
326
327
  withBorder: c,
327
328
  isBottomRow: !0,
@@ -331,7 +332,7 @@ const _e = (param)=>/* @__PURE__ */ {
331
332
  "component-name": "MainNavigationBar"
332
333
  },
333
334
  children: /* @__PURE__ */ e(m, {
334
- children: /* @__PURE__ */ e(f, {
335
+ children: /* @__PURE__ */ e(N, {
335
336
  children: y()
336
337
  })
337
338
  })
@@ -341,9 +342,9 @@ const _e = (param)=>/* @__PURE__ */ {
341
342
  })
342
343
  ]
343
344
  });
344
- }, ln = (param)=>{
345
+ }, mn = (param)=>{
345
346
  let { onBack: n , title: o , right: t , isInverse: r = !1 , topFixed: a = !0 , paddingX: c = 0 , withBorder: d = !0 } = param;
346
- const { texts: s } = O(), p = /* @__PURE__ */ e(f, {
347
+ const { texts: s } = O(), p = /* @__PURE__ */ e(N, {
347
348
  right: t,
348
349
  children: /* @__PURE__ */ i(u, {
349
350
  space: 24,
@@ -368,7 +369,7 @@ const _e = (param)=>/* @__PURE__ */ {
368
369
  return /* @__PURE__ */ i(A, {
369
370
  isInverse: r,
370
371
  children: [
371
- /* @__PURE__ */ e(N, {
372
+ /* @__PURE__ */ e(f, {
372
373
  topFixed: a,
373
374
  withBorder: d,
374
375
  isInverse: r,
@@ -392,7 +393,7 @@ const _e = (param)=>/* @__PURE__ */ {
392
393
  })
393
394
  ]
394
395
  });
395
- }, dn = (param)=>{
396
+ }, un = (param)=>{
396
397
  let { logo: n , right: o , isInverse: t = !1 , topFixed: r = !0 , withBorder: a = !0 } = param;
397
398
  const { isTabletOrSmaller: c } = R();
398
399
  return n = n !== null && n !== void 0 ? n : /* @__PURE__ */ e(j, {
@@ -400,7 +401,7 @@ const _e = (param)=>/* @__PURE__ */ {
400
401
  }), /* @__PURE__ */ i(A, {
401
402
  isInverse: t,
402
403
  children: [
403
- /* @__PURE__ */ e(N, {
404
+ /* @__PURE__ */ e(f, {
404
405
  topFixed: r,
405
406
  withBorder: a,
406
407
  isInverse: t,
@@ -410,7 +411,7 @@ const _e = (param)=>/* @__PURE__ */ {
410
411
  children: /* @__PURE__ */ e(m, {
411
412
  children: /* @__PURE__ */ e(de, {
412
413
  template: "10",
413
- children: /* @__PURE__ */ e(f, {
414
+ children: /* @__PURE__ */ e(N, {
414
415
  right: o,
415
416
  children: n
416
417
  })
@@ -422,7 +423,7 @@ const _e = (param)=>/* @__PURE__ */ {
422
423
  })
423
424
  ]
424
425
  });
425
- }, mn = (param)=>/* @__PURE__ */ {
426
+ }, pn = (param)=>/* @__PURE__ */ {
426
427
  let { children: n } = param;
427
428
  return e("div", {
428
429
  className: W,
@@ -433,7 +434,7 @@ const _e = (param)=>/* @__PURE__ */ {
433
434
  children: n
434
435
  })
435
436
  });
436
- }, un = (_param)=>{
437
+ }, hn = (_param)=>{
437
438
  var { children: n } = _param, o = _object_without_properties(_param, [
438
439
  "children"
439
440
  ]);
@@ -458,4 +459,4 @@ const _e = (param)=>/* @__PURE__ */ {
458
459
  })
459
460
  }));
460
461
  };
461
- export { dn as FunnelNavigationBar, sn as MainNavigationBar, ln as NavigationBar, un as NavigationBarAction, mn as NavigationBarActionGroup };
462
+ export { un as FunnelNavigationBar, dn as MainNavigationBar, mn as NavigationBar, hn as NavigationBarAction, pn as NavigationBarActionGroup };
@@ -1,2 +1,2 @@
1
- const o = "14.28.1";
1
+ const o = "14.30.0";
2
2
  export { o as PACKAGE_VERSION };
@@ -1,4 +1,7 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./snackbar.css.ts.vanilla.css-mistica.js";
3
- var n = 300, b = "o7bjb09", v = "_1y2v1nf1x", o = "_1y2v1nf2a", t = "_1y2v1nfb6 _1y2v1nfbi", f = "o7bjb0a", _ = "o7bjb01 _1y2v1nfbt _1y2v1nfb6 _1y2v1nfbf", p = "o7bjb02", y = "o7bjb04 _1y2v1nfb2 _1y2v1nfdz", e = "_1y2v1nf4g", i = "_1y2v1nf4h", j = "o7bjb07";
4
- export { n as TRANSITION_TIME_IN_MS, b as button, v as buttonCritical, o as buttonInfo, t as content, f as longButton, _ as snackbar, p as snackbarOpen, y as wrapper, e as wrapperCritical, i as wrapperInfo, j as wrapperOpen };
3
+ var b = 300, f = "o7bjb0a", _ = "_1y2v1nfb6 _1y2v1nfbi", r = {
4
+ centered: "o7bjb0e _1y2v1nfb6 _1y2v1nfb1 _1y2v1nfbl _1y2v1nfbf _1y2v1nff9",
5
+ topRight: "_1y2v1nfb6 _1y2v1nfb1 _1y2v1nfbl _1y2v1nfbf _1y2v1nff9 _1y2v1nfef"
6
+ }, y = "o7bjb0h _1y2v1nfc3 _1y2v1nfcj _1y2v1nfb6 _1y2v1nfbl _1y2v1nfbf _1y2v1nfdp", a = "o7bjb0b", o = "o7bjb01 _1y2v1nfbt _1y2v1nfb6 _1y2v1nfbf", t = "o7bjb02", p = "o7bjb04 _1y2v1nfb2 _1y2v1nfdz", e = "_1y2v1nf4g", i = "_1y2v1nf4h", j = "o7bjb07";
7
+ export { b as TRANSITION_TIME_IN_MS, f as button, _ as content, r as dismissButton, y as dismissIcon, a as longButton, o as snackbar, t as snackbarOpen, p as wrapper, e as wrapperCritical, i as wrapperInfo, j as wrapperOpen };
@@ -50,110 +50,165 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import { jsx as r, jsxs as N } from "react/jsx-runtime";
54
- import * as s from "react";
55
- import { BaseTouchable as T } from "./touchable.js";
56
- import l from "classnames";
57
- import { isWebViewBridgeAvailable as k, nativeMessage as v } from "@tef-novum/webview-bridge";
58
- import { useElementDimensions as R, useScreenSize as S } from "./hooks.js";
59
- import { Text2 as B } from "./text.js";
60
- import { TRANSITION_TIME_IN_MS as C, snackbar as O, snackbarOpen as w, wrapper as A, wrapperCritical as E, wrapperInfo as M, wrapperOpen as W, content as D, button as L, buttonCritical as V, buttonInfo as _, longButton as j } from "./snackbar.css-mistica.js";
61
- import { sprinkles as p } from "./sprinkles.css-mistica.js";
62
- import { vars as x } from "./skins/skin-contract.css-mistica.js";
63
- import { getPrefixedDataAttributes as F } from "./utils/dom.js";
64
- import { Portal as P } from "./portal.js";
65
- const z = (param)=>{
66
- let { message: a , buttonText: e , duration: t = e ? 1e4 : 5e3 , onClose: n = ()=>{} , type: o = "INFORMATIVE" , dataAttributes: c } = param;
67
- const [i, u] = s.useState(!1), { width: d , ref: h } = R(), { isDesktopOrBigger: I } = S(), m = d > (I ? 160 : 128), f = s.useCallback(()=>{
68
- u(!1), setTimeout(()=>{
69
- n();
70
- }, C);
53
+ import { jsx as t, jsxs as S } from "react/jsx-runtime";
54
+ import * as a from "react";
55
+ import { BaseTouchable as b } from "./touchable.js";
56
+ import p from "classnames";
57
+ import { isWebViewBridgeAvailable as R, nativeMessage as k } from "@tef-novum/webview-bridge";
58
+ import { useTheme as E, useElementDimensions as D, useScreenSize as M } from "./hooks.js";
59
+ import { Text2 as U, Text3 as A } from "./text.js";
60
+ import { TRANSITION_TIME_IN_MS as _, snackbar as x, snackbarOpen as y, wrapper as L, wrapperCritical as w, wrapperInfo as W, wrapperOpen as P, content as z, button as C, longButton as j, dismissButton as F, dismissIcon as H } from "./snackbar.css-mistica.js";
61
+ import { sprinkles as g } from "./sprinkles.css-mistica.js";
62
+ import { vars as I } from "./skins/skin-contract.css-mistica.js";
63
+ import { getPrefixedDataAttributes as V } from "./utils/dom.js";
64
+ import { Portal as X } from "./portal.js";
65
+ import Y from "./generated/mistica-icons/icon-close-regular.js";
66
+ import $ from "./icon-button.js";
67
+ const q = 5e3, G = 1e4, J = (param)=>{
68
+ let { message: l , buttonText: o , duration: r , onClose: n , type: c , withDismiss: m = !1 , dataAttributes: f } = param;
69
+ const { texts: d } = E(), [i, e] = a.useState(!1), { width: N , ref: v } = D(), { isDesktopOrBigger: B } = M(), s = N > (B ? 160 : 128), T = r === 1 / 0 && !o || m, u = a.useCallback((h)=>{
70
+ e(!1), setTimeout(()=>{
71
+ n == null || n(h);
72
+ }, _);
71
73
  }, [
72
74
  n
73
75
  ]);
74
- return s.useEffect(()=>{
75
- const g = setTimeout(()=>{
76
- u(!0);
77
- }, 50), b = setTimeout(f, t);
76
+ return a.useEffect(()=>{
77
+ const h = setTimeout(()=>{
78
+ e(!0);
79
+ }, 50), O = setTimeout(()=>{
80
+ u({
81
+ action: "TIMEOUT"
82
+ });
83
+ }, r);
78
84
  return ()=>{
79
- clearTimeout(g), clearTimeout(b);
85
+ clearTimeout(h), clearTimeout(O);
80
86
  };
81
87
  }, [
82
- f,
83
- t
84
- ]), /* @__PURE__ */ r(P, {
85
- children: /* @__PURE__ */ r("div", {
86
- className: l(O, {
87
- [w]: i
88
+ u,
89
+ r
90
+ ]), /* @__PURE__ */ t(X, {
91
+ children: /* @__PURE__ */ t("div", {
92
+ className: p(x, {
93
+ [y]: i
88
94
  }),
89
- children: /* @__PURE__ */ r("div", _object_spread_props(_object_spread({
95
+ children: /* @__PURE__ */ S("div", _object_spread_props(_object_spread({
90
96
  role: "alert",
91
- className: l(A, o === "CRITICAL" ? E : M, {
92
- [W]: i
97
+ className: p(L, c === "CRITICAL" ? w : W, {
98
+ [P]: i
93
99
  })
94
- }, F(c, "SnackBar")), {
95
- children: /* @__PURE__ */ N("div", {
96
- className: l(D, p({
97
- flexDirection: m ? "column" : "row",
98
- alignItems: m ? void 0 : "center"
99
- })),
100
- children: [
101
- /* @__PURE__ */ r(B, {
102
- regular: !0,
103
- color: x.colors.textPrimaryInverse,
104
- children: a
105
- }),
106
- e && /* @__PURE__ */ r("div", {
107
- className: l(L, o === "CRITICAL" ? V : _, {
108
- [j]: m
100
+ }, V(f, "SnackBar")), {
101
+ children: [
102
+ /* @__PURE__ */ S("div", {
103
+ className: p(z, g({
104
+ flexDirection: s ? "column" : "row",
105
+ alignItems: s ? void 0 : "center"
106
+ })),
107
+ style: T && !s ? {
108
+ paddingRight: 32
109
+ } : void 0,
110
+ children: [
111
+ /* @__PURE__ */ t("div", {
112
+ style: T && s ? {
113
+ paddingRight: 32
114
+ } : void 0,
115
+ children: /* @__PURE__ */ t(U, {
116
+ regular: !0,
117
+ color: I.colors.textPrimaryInverse,
118
+ children: l
119
+ })
109
120
  }),
110
- children: /* @__PURE__ */ r(T, {
111
- className: p({
112
- border: "none",
113
- padding: 0,
114
- background: "transparent",
115
- color: "inherit"
121
+ o && /* @__PURE__ */ t("div", {
122
+ className: p(C, {
123
+ [j]: s
116
124
  }),
117
- style: {
118
- lineHeight: "inherit",
119
- fontWeight: "inherit"
120
- },
121
- ref: h,
122
- onPress: f,
123
- children: e
125
+ children: /* @__PURE__ */ t(b, {
126
+ className: g({
127
+ paddingY: 4,
128
+ paddingX: 8,
129
+ border: "none",
130
+ padding: 0,
131
+ background: "transparent"
132
+ }),
133
+ ref: v,
134
+ onPress: ()=>{
135
+ u({
136
+ action: "BUTTON"
137
+ });
138
+ },
139
+ children: /* @__PURE__ */ t(A, {
140
+ medium: !0,
141
+ forceMobileSizes: !0,
142
+ truncate: !0,
143
+ color: c === "CRITICAL" ? I.colors.textPrimaryInverse : I.colors.textLinkSnackbar,
144
+ children: o
145
+ })
146
+ })
147
+ })
148
+ ]
149
+ }),
150
+ T ? /* @__PURE__ */ t($, {
151
+ size: 32,
152
+ onPress: ()=>{
153
+ u({
154
+ action: "DISMISS"
155
+ });
156
+ },
157
+ "aria-label": d.closeButtonLabel,
158
+ className: F[s ? "topRight" : "centered"],
159
+ style: {
160
+ display: "flex"
161
+ },
162
+ children: /* @__PURE__ */ t("div", {
163
+ className: H,
164
+ children: /* @__PURE__ */ t(Y, {
165
+ color: I.colors.inverse,
166
+ size: 20
124
167
  })
125
168
  })
126
- ]
127
- })
169
+ }) : null
170
+ ]
128
171
  }))
129
172
  })
130
173
  });
131
- }, H = (param)=>{
132
- let { message: a , buttonText: e , duration: t = e ? 1e4 : 5e3 , onClose: n = ()=>{} , type: o = "INFORMATIVE" } = param;
133
- const c = k(), i = s.useRef(n);
134
- return s.useEffect(()=>{
174
+ }, K = (param)=>{
175
+ let { message: l , buttonText: o , duration: r , onClose: n = ()=>{} , type: c = "INFORMATIVE" , withDismiss: m } = param;
176
+ const f = o ? G : q;
177
+ r = Math.max(r !== null && r !== void 0 ? r : f, f);
178
+ const d = R(), i = a.useRef(n);
179
+ return a.useEffect(()=>{
135
180
  i.current = n;
136
181
  }, [
137
182
  n
138
- ]), s.useEffect(()=>{
139
- c && v({
140
- message: a,
141
- duration: t,
142
- buttonText: e,
143
- type: o
144
- }).then(i.current);
183
+ ]), a.useEffect(()=>{
184
+ d && k({
185
+ message: l,
186
+ // @ts-expect-error duration can be 'PERSISTENT' in new webview-bridge lib versions, and old apps will ignore it
187
+ duration: r === 1 / 0 ? "PERSISTENT" : void 0,
188
+ buttonText: o,
189
+ type: c,
190
+ withDismiss: m
191
+ }).then((e)=>{
192
+ !e || typeof e != "object" || !("action" in e) || typeof e.action != "string" || e.action !== "DISMISS" && e.action !== "TIMEOUT" && e.action !== "BUTTON" ? i.current({
193
+ action: "DISMISS"
194
+ }) : i.current({
195
+ action: e.action
196
+ });
197
+ });
145
198
  }, [
146
- e,
147
- t,
148
- a,
199
+ o,
200
+ r,
201
+ l,
202
+ d,
149
203
  c,
150
- o
151
- ]), c ? null : /* @__PURE__ */ r(z, {
152
- message: a,
153
- duration: t,
154
- buttonText: e,
155
- type: o,
156
- onClose: i.current
204
+ m
205
+ ]), d ? null : /* @__PURE__ */ t(J, {
206
+ message: l,
207
+ duration: r,
208
+ buttonText: o,
209
+ type: c,
210
+ onClose: i.current,
211
+ withDismiss: m
157
212
  });
158
- }, re = H;
159
- export { re as default };
213
+ }, fe = K;
214
+ export { fe as default };