@telefonica/mistica 15.17.0 → 15.19.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 (74) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/button.css-mistica.js +61 -52
  3. package/dist/button.css.d.ts +33 -17
  4. package/dist/button.d.ts +9 -46
  5. package/dist/button.js +188 -237
  6. package/dist/callout.d.ts +1 -0
  7. package/dist/callout.js +10 -10
  8. package/dist/card.d.ts +6 -1
  9. package/dist/card.js +375 -365
  10. package/dist/chip.d.ts +1 -0
  11. package/dist/chip.js +15 -15
  12. package/dist/dialog.d.ts +1 -0
  13. package/dist/dialog.js +18 -17
  14. package/dist/feedback.js +58 -52
  15. package/dist/inline.css-mistica.js +11 -8
  16. package/dist/inline.css.d.ts +1 -0
  17. package/dist/inline.js +12 -12
  18. package/dist/logo-blau.d.ts +4 -0
  19. package/dist/logo-blau.js +74 -0
  20. package/dist/logo-common.d.ts +9 -0
  21. package/dist/logo-common.js +21 -0
  22. package/dist/logo-movistar.d.ts +4 -0
  23. package/dist/logo-movistar.js +99 -0
  24. package/dist/logo-o2-new.d.ts +4 -0
  25. package/dist/logo-o2-new.js +29 -0
  26. package/dist/logo-o2.d.ts +4 -0
  27. package/dist/logo-o2.js +29 -0
  28. package/dist/logo-telefonica.d.ts +4 -0
  29. package/dist/logo-telefonica.js +197 -0
  30. package/dist/logo-tu.d.ts +4 -0
  31. package/dist/logo-tu.js +28 -0
  32. package/dist/logo-vivo.d.ts +4 -0
  33. package/dist/logo-vivo.js +81 -0
  34. package/dist/logo.d.ts +10 -10
  35. package/dist/logo.js +174 -534
  36. package/dist/navigation-bar.d.ts +7 -0
  37. package/dist/navigation-bar.js +99 -91
  38. package/dist/package-version.js +1 -1
  39. package/dist/popover.d.ts +1 -0
  40. package/dist/popover.js +9 -7
  41. package/dist/snackbar-context.js +23 -22
  42. package/dist/snackbar.d.ts +1 -0
  43. package/dist/snackbar.js +51 -47
  44. package/dist/text.d.ts +1 -0
  45. package/dist/text.js +133 -109
  46. package/dist/tooltip.d.ts +1 -0
  47. package/dist/tooltip.js +110 -110
  48. package/dist-es/button.css-mistica.js +36 -18
  49. package/dist-es/button.js +219 -268
  50. package/dist-es/callout.js +38 -38
  51. package/dist-es/card.js +492 -482
  52. package/dist-es/chip.js +25 -25
  53. package/dist-es/dialog.js +22 -21
  54. package/dist-es/feedback.js +96 -89
  55. package/dist-es/inline.css-mistica.js +3 -3
  56. package/dist-es/inline.js +23 -23
  57. package/dist-es/logo-blau.js +65 -0
  58. package/dist-es/logo-common.js +12 -0
  59. package/dist-es/logo-movistar.js +90 -0
  60. package/dist-es/logo-o2-new.js +20 -0
  61. package/dist-es/logo-o2.js +20 -0
  62. package/dist-es/logo-telefonica.js +188 -0
  63. package/dist-es/logo-tu.js +19 -0
  64. package/dist-es/logo-vivo.js +72 -0
  65. package/dist-es/logo.js +132 -533
  66. package/dist-es/navigation-bar.js +163 -155
  67. package/dist-es/package-version.js +1 -1
  68. package/dist-es/popover.js +26 -24
  69. package/dist-es/snackbar-context.js +25 -24
  70. package/dist-es/snackbar.js +81 -77
  71. package/dist-es/style.css +1 -1
  72. package/dist-es/text.js +143 -119
  73. package/dist-es/tooltip.js +149 -149
  74. package/package.json +1 -1
@@ -51,7 +51,7 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsxs as d, jsx as f } from "react/jsx-runtime";
54
+ import { jsxs as m, jsx as f } from "react/jsx-runtime";
55
55
  import * as e from "react";
56
56
  import { isWebViewBridgeAvailable as C } from "@tef-novum/webview-bridge";
57
57
  const k = /*#__PURE__*/ e.createContext({
@@ -59,60 +59,61 @@ const k = /*#__PURE__*/ e.createContext({
59
59
  setSnackbars: ()=>{}
60
60
  }), p = /*#__PURE__*/ e.lazy(()=>import(/* webpackChunkName: "snackbar" */ "./snackbar.js")), R = (param)=>{
61
61
  let { children: l } = param;
62
- const [s, n] = e.useState([]), o = e.useRef(null), a = e.useRef(!1), r = C();
62
+ const [t, n] = e.useState([]), o = e.useRef(null), a = e.useRef(!1), r = C();
63
63
  e.useEffect(()=>{
64
64
  var c;
65
- s.length > 1 && !a.current && (a.current = !0, r ? n((i)=>i.slice(1)) : (c = o.current) == null || c.close({
65
+ t.length > 1 && !a.current && (a.current = !0, r ? n((i)=>i.slice(1)) : (c = o.current) == null || c.close({
66
66
  action: "CONSECUTIVE"
67
67
  }));
68
68
  }, [
69
- s,
69
+ t,
70
70
  r
71
71
  ]);
72
- const S = (param)=>{
72
+ const d = (param)=>{
73
73
  let { action: c } = param;
74
74
  var i, b;
75
- a.current = !1, n(r && c === "CONSECUTIVE" ? (u)=>u.slice(0) : (u)=>u.slice(1)), (b = (i = s[0]).onClose) == null || b.call(i, {
75
+ a.current = !1, n(r && c === "CONSECUTIVE" ? (u)=>u.slice(0) : (u)=>u.slice(1)), (b = (i = t[0]).onClose) == null || b.call(i, {
76
76
  action: c
77
77
  });
78
- }, m = e.useMemo(()=>({
79
- snackbars: s,
78
+ }, S = e.useMemo(()=>({
79
+ snackbars: t,
80
80
  setSnackbars: n
81
81
  }), [
82
- s
83
- ]), t = s[0];
84
- return /* @__PURE__ */ d(k.Provider, {
85
- value: m,
82
+ t
83
+ ]), s = t[0];
84
+ return /* @__PURE__ */ m(k.Provider, {
85
+ value: S,
86
86
  children: [
87
87
  l,
88
- !!t && /* @__PURE__ */ f(e.Suspense, {
88
+ !!s && /* @__PURE__ */ f(e.Suspense, {
89
89
  fallback: null,
90
90
  children: /* @__PURE__ */ f(p, {
91
91
  ref: o,
92
- message: t.message,
93
- buttonText: t.buttonText,
94
- buttonAccessibilityLabel: t.buttonAccessibilityLabel,
95
- duration: t.duration,
96
- type: t.type,
97
- withDismiss: t.withDismiss,
98
- onClose: S
99
- }, t.id)
92
+ message: s.message,
93
+ buttonText: s.buttonText,
94
+ buttonAccessibilityLabel: s.buttonAccessibilityLabel,
95
+ duration: s.duration,
96
+ type: s.type,
97
+ withDismiss: s.withDismiss,
98
+ dataAttributes: s.dataAttributes,
99
+ onClose: d
100
+ }, s.id)
100
101
  })
101
102
  ]
102
103
  });
103
104
  }, g = ()=>{
104
- const { snackbars: l, setSnackbars: s } = e.useContext(k);
105
+ const { snackbars: l, setSnackbars: t } = e.useContext(k);
105
106
  return {
106
107
  openSnackbar: e.useCallback((o)=>{
107
108
  const a = Date.now() + "-" + Math.random();
108
- s((r)=>[
109
+ t((r)=>[
109
110
  ...r,
110
111
  _object_spread_props(_object_spread({}, o), {
111
112
  id: a
112
113
  })
113
114
  ]);
114
115
  }, [
115
- s
116
+ t
116
117
  ]),
117
118
  snackbars: l
118
119
  };
@@ -51,134 +51,134 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsx as r, jsxs as B } from "react/jsx-runtime";
54
+ import { jsx as r, jsxs as D } from "react/jsx-runtime";
55
55
  import * as e from "react";
56
- import U, { BaseTouchable as b } from "./touchable.js";
57
- import S from "classnames";
58
- import { isWebViewBridgeAvailable as C, nativeMessage as M } from "@tef-novum/webview-bridge";
59
- import { useTheme as _, useElementDimensions as w, useScreenSize as A } from "./hooks.js";
60
- import { Text2 as x, Text3 as L } from "./text.js";
61
- import { TRANSITION_TIME_IN_MS as W, snackbarContainer as y, snackbar as P, snackbarOpen as V, wrapper as z, wrapperCritical as F, wrapperInfo as H, wrapperOpen as j, content as X, button as Y, longButton as $, dismissButton as q, dismissIcon as G } from "./snackbar.css-mistica.js";
62
- import { sprinkles as k } from "./sprinkles.css-mistica.js";
63
- import { vars as N } from "./skins/skin-contract.css-mistica.js";
64
- import { getPrefixedDataAttributes as J } from "./utils/dom.js";
65
- import { Portal as K } from "./portal.js";
66
- import Q from "./generated/mistica-icons/icon-close-regular.js";
67
- const Z = [
56
+ import C, { BaseTouchable as M } from "./touchable.js";
57
+ import N from "classnames";
58
+ import { isWebViewBridgeAvailable as _, nativeMessage as b } from "@tef-novum/webview-bridge";
59
+ import { useTheme as w, useElementDimensions as A, useScreenSize as x } from "./hooks.js";
60
+ import { Text2 as W, Text3 as y } from "./text.js";
61
+ import { TRANSITION_TIME_IN_MS as P, snackbarContainer as L, snackbar as V, snackbarOpen as z, wrapper as F, wrapperCritical as H, wrapperInfo as j, wrapperOpen as X, content as Y, button as $, longButton as q, dismissButton as G, dismissIcon as J } from "./snackbar.css-mistica.js";
62
+ import { sprinkles as U } from "./sprinkles.css-mistica.js";
63
+ import { vars as O } from "./skins/skin-contract.css-mistica.js";
64
+ import { getPrefixedDataAttributes as K } from "./utils/dom.js";
65
+ import { Portal as Q } from "./portal.js";
66
+ import Z from "./generated/mistica-icons/icon-close-regular.js";
67
+ const ee = [
68
68
  "DISMISS",
69
69
  "TIMEOUT",
70
70
  "CONSECUTIVE",
71
71
  "BUTTON"
72
- ], ee = 5e3, re = 1e4, te = /*#__PURE__*/ e.forwardRef((param, I)=>{
73
- let { message: m, buttonText: n, buttonAccessibilityLabel: u, duration: t, onClose: o, type: i, withDismiss: d = !1, dataAttributes: O } = param;
74
- const { texts: p } = _(), [s, a] = e.useState(!1), { width: R, ref: c } = w(), { isDesktopOrBigger: D } = A(), l = R > (D ? 160 : 128), E = e.useRef(null), g = t === 1 / 0 && !n || d, T = e.useRef(o);
72
+ ], re = 5e3, te = 1e4, ne = /*#__PURE__*/ e.forwardRef((param, g)=>{
73
+ let { message: m, buttonText: n, buttonAccessibilityLabel: u, closeButtonLabel: d, duration: t, onClose: o, type: c, withDismiss: p = !1, dataAttributes: R } = param;
74
+ const { texts: T } = w(), [a, s] = e.useState(!1), { width: I, ref: v } = A(), { isDesktopOrBigger: i } = x(), l = I > (i ? 160 : 128), B = e.useRef(null), E = t === 1 / 0 && !n || p, h = e.useRef(o);
75
75
  e.useEffect(()=>{
76
- T.current = o;
76
+ h.current = o;
77
77
  }, [
78
78
  o
79
79
  ]);
80
- const f = e.useCallback((v)=>{
81
- a(!1), setTimeout(()=>{
82
- var h;
83
- (h = T.current) == null || h.call(T, v);
84
- }, process.env.NODE_ENV === "test" ? 0 : W);
80
+ const f = e.useCallback((k)=>{
81
+ s(!1), setTimeout(()=>{
82
+ var S;
83
+ (S = h.current) == null || S.call(h, k);
84
+ }, process.env.NODE_ENV === "test" ? 0 : P);
85
85
  }, []);
86
- return e.useImperativeHandle(I, ()=>_object_spread_props(_object_spread({}, E), {
86
+ return e.useImperativeHandle(g, ()=>_object_spread_props(_object_spread({}, B), {
87
87
  close: f
88
88
  }), [
89
89
  f
90
90
  ]), e.useEffect(()=>{
91
- const v = setTimeout(()=>{
92
- a(!0);
93
- }, 50), h = t !== 1 / 0 ? setTimeout(()=>f({
91
+ const k = setTimeout(()=>{
92
+ s(!0);
93
+ }, 50), S = t !== 1 / 0 ? setTimeout(()=>f({
94
94
  action: "TIMEOUT"
95
95
  }), t) : void 0;
96
96
  return ()=>{
97
- clearTimeout(v), clearTimeout(h);
97
+ clearTimeout(k), clearTimeout(S);
98
98
  };
99
99
  }, [
100
100
  f,
101
101
  t
102
- ]), /* @__PURE__ */ r(K, {
103
- className: y,
102
+ ]), /* @__PURE__ */ r(Q, {
103
+ className: L,
104
104
  children: /* @__PURE__ */ r("div", {
105
- ref: E,
106
- className: S(P, {
107
- [V]: s
105
+ ref: B,
106
+ className: N(V, {
107
+ [z]: a
108
108
  }),
109
- children: /* @__PURE__ */ B("div", _object_spread_props(_object_spread({
109
+ children: /* @__PURE__ */ D("div", _object_spread_props(_object_spread({
110
110
  role: "alert",
111
- className: S(z, i === "CRITICAL" ? F : H, {
112
- [j]: s
111
+ className: N(F, c === "CRITICAL" ? H : j, {
112
+ [X]: a
113
113
  })
114
- }, J(O, "SnackBar")), {
114
+ }, K(R, "SnackBar")), {
115
115
  children: [
116
- /* @__PURE__ */ B("div", {
117
- className: S(X, k({
116
+ /* @__PURE__ */ D("div", {
117
+ className: N(Y, U({
118
118
  flexDirection: l ? "column" : "row",
119
119
  alignItems: l ? void 0 : "center"
120
120
  })),
121
- style: g && !l ? {
121
+ style: E && !l ? {
122
122
  paddingRight: 32
123
123
  } : void 0,
124
124
  children: [
125
125
  /* @__PURE__ */ r("div", {
126
- style: g && l ? {
126
+ style: E && l ? {
127
127
  paddingRight: 32
128
128
  } : void 0,
129
- children: /* @__PURE__ */ r(x, {
129
+ children: /* @__PURE__ */ r(W, {
130
130
  regular: !0,
131
- color: N.colors.textPrimaryInverse,
131
+ color: O.colors.textPrimaryInverse,
132
132
  children: m
133
133
  })
134
134
  }),
135
135
  n && /* @__PURE__ */ r("div", {
136
- className: S(Y, {
137
- [$]: l
136
+ className: N($, {
137
+ [q]: l
138
138
  }),
139
- children: /* @__PURE__ */ r(b, {
140
- className: k({
139
+ children: /* @__PURE__ */ r(M, {
140
+ className: U({
141
141
  paddingY: 4,
142
142
  paddingX: 8,
143
143
  border: "none",
144
144
  padding: 0,
145
145
  background: "transparent"
146
146
  }),
147
- ref: c,
147
+ ref: v,
148
148
  onPress: ()=>{
149
149
  f({
150
150
  action: "BUTTON"
151
151
  });
152
152
  },
153
153
  "aria-label": u,
154
- children: /* @__PURE__ */ r(L, {
154
+ children: /* @__PURE__ */ r(y, {
155
155
  medium: !0,
156
156
  forceMobileSizes: !0,
157
157
  truncate: !0,
158
- color: i === "CRITICAL" ? N.colors.textPrimaryInverse : N.colors.textLinkSnackbar,
158
+ color: c === "CRITICAL" ? O.colors.textPrimaryInverse : O.colors.textLinkSnackbar,
159
159
  children: n
160
160
  })
161
161
  })
162
162
  })
163
163
  ]
164
164
  }),
165
- g ? /* @__PURE__ */ r(U, {
165
+ E ? /* @__PURE__ */ r(C, {
166
166
  onPress: ()=>{
167
167
  f({
168
168
  action: "DISMISS"
169
169
  });
170
170
  },
171
- "aria-label": p.closeButtonLabel,
172
- className: q[l ? "topRight" : "centered"],
171
+ "aria-label": d !== null && d !== void 0 ? d : T.closeButtonLabel,
172
+ className: G[l ? "topRight" : "centered"],
173
173
  style: {
174
174
  display: "flex",
175
175
  width: 32,
176
176
  height: 32
177
177
  },
178
178
  children: /* @__PURE__ */ r("div", {
179
- className: G,
180
- children: /* @__PURE__ */ r(Q, {
181
- color: N.colors.inverse,
179
+ className: J,
180
+ children: /* @__PURE__ */ r(Z, {
181
+ color: O.colors.inverse,
182
182
  size: 20
183
183
  })
184
184
  })
@@ -187,51 +187,55 @@ const Z = [
187
187
  }))
188
188
  })
189
189
  });
190
- }), ne = /*#__PURE__*/ e.forwardRef((param, O)=>{
191
- let { message: m, buttonText: n, buttonAccessibilityLabel: u, duration: t, onClose: o = ()=>{}, type: i = "INFORMATIVE", withDismiss: d } = param;
192
- const I = n ? re : ee;
193
- t = Math.max(t !== null && t !== void 0 ? t : I, I);
194
- const p = C(), s = e.useRef(o), a = e.useRef(!1);
190
+ }), oe = /*#__PURE__*/ e.forwardRef((param, g)=>{
191
+ let { message: m, buttonText: n, buttonAccessibilityLabel: u, closeButtonLabel: d, duration: t, onClose: o = ()=>{}, type: c = "INFORMATIVE", withDismiss: p, dataAttributes: R } = param;
192
+ const T = n ? te : re;
193
+ t = Math.max(t !== null && t !== void 0 ? t : T, T);
194
+ const a = _(), s = e.useRef(o), I = e.useRef(!1);
195
195
  return e.useEffect(()=>{
196
196
  s.current = o;
197
197
  }, [
198
198
  o
199
199
  ]), e.useEffect(()=>{
200
- p && !a.current && (a.current = !0, M({
200
+ a && !I.current && (I.current = !0, b({
201
201
  message: m,
202
202
  // @ts-expect-error duration can be 'PERSISTENT' in new webview-bridge lib versions, and old apps will ignore it
203
203
  duration: t === 1 / 0 ? "PERSISTENT" : void 0,
204
204
  buttonText: n,
205
205
  buttonAccessibilityLabel: u,
206
- type: i,
207
- withDismiss: d
208
- }).then((R)=>{
209
- const c = R;
210
- c != null && c.action && Z.includes(c.action) ? s.current({
211
- action: c.action
206
+ closeButtonLabel: d,
207
+ type: c,
208
+ withDismiss: p
209
+ }).then((v)=>{
210
+ const i = v;
211
+ i != null && i.action && ee.includes(i.action) ? s.current({
212
+ action: i.action
212
213
  }) : s.current({
213
214
  action: "DISMISS"
214
215
  });
215
216
  }).finally(()=>{
216
- a.current = !1;
217
+ I.current = !1;
217
218
  }));
218
219
  }, [
219
220
  u,
221
+ d,
220
222
  n,
221
223
  t,
222
224
  m,
223
- p,
224
- i,
225
- d
226
- ]), p ? null : /* @__PURE__ */ r(te, {
227
- ref: O,
225
+ a,
226
+ c,
227
+ p
228
+ ]), a ? null : /* @__PURE__ */ r(ne, {
229
+ ref: g,
228
230
  message: m,
229
231
  duration: t,
230
232
  buttonText: n,
231
233
  buttonAccessibilityLabel: u,
232
- type: i,
234
+ closeButtonLabel: d,
235
+ type: c,
233
236
  onClose: s.current,
234
- withDismiss: d
237
+ withDismiss: p,
238
+ dataAttributes: R
235
239
  });
236
- }), he = ne;
237
- export { he as default };
240
+ }), Se = oe;
241
+ export { Se as default };