@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.
- package/css/mistica.css +1 -1
- package/dist/button.css-mistica.js +61 -52
- package/dist/button.css.d.ts +33 -17
- package/dist/button.d.ts +9 -46
- package/dist/button.js +188 -237
- package/dist/callout.d.ts +1 -0
- package/dist/callout.js +10 -10
- package/dist/card.d.ts +6 -1
- package/dist/card.js +375 -365
- package/dist/chip.d.ts +1 -0
- package/dist/chip.js +15 -15
- package/dist/dialog.d.ts +1 -0
- package/dist/dialog.js +18 -17
- package/dist/feedback.js +58 -52
- package/dist/inline.css-mistica.js +11 -8
- package/dist/inline.css.d.ts +1 -0
- package/dist/inline.js +12 -12
- package/dist/logo-blau.d.ts +4 -0
- package/dist/logo-blau.js +74 -0
- package/dist/logo-common.d.ts +9 -0
- package/dist/logo-common.js +21 -0
- package/dist/logo-movistar.d.ts +4 -0
- package/dist/logo-movistar.js +99 -0
- package/dist/logo-o2-new.d.ts +4 -0
- package/dist/logo-o2-new.js +29 -0
- package/dist/logo-o2.d.ts +4 -0
- package/dist/logo-o2.js +29 -0
- package/dist/logo-telefonica.d.ts +4 -0
- package/dist/logo-telefonica.js +197 -0
- package/dist/logo-tu.d.ts +4 -0
- package/dist/logo-tu.js +28 -0
- package/dist/logo-vivo.d.ts +4 -0
- package/dist/logo-vivo.js +81 -0
- package/dist/logo.d.ts +10 -10
- package/dist/logo.js +174 -534
- package/dist/navigation-bar.d.ts +7 -0
- package/dist/navigation-bar.js +99 -91
- package/dist/package-version.js +1 -1
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +9 -7
- package/dist/snackbar-context.js +23 -22
- package/dist/snackbar.d.ts +1 -0
- package/dist/snackbar.js +51 -47
- package/dist/text.d.ts +1 -0
- package/dist/text.js +133 -109
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +110 -110
- package/dist-es/button.css-mistica.js +36 -18
- package/dist-es/button.js +219 -268
- package/dist-es/callout.js +38 -38
- package/dist-es/card.js +492 -482
- package/dist-es/chip.js +25 -25
- package/dist-es/dialog.js +22 -21
- package/dist-es/feedback.js +96 -89
- package/dist-es/inline.css-mistica.js +3 -3
- package/dist-es/inline.js +23 -23
- package/dist-es/logo-blau.js +65 -0
- package/dist-es/logo-common.js +12 -0
- package/dist-es/logo-movistar.js +90 -0
- package/dist-es/logo-o2-new.js +20 -0
- package/dist-es/logo-o2.js +20 -0
- package/dist-es/logo-telefonica.js +188 -0
- package/dist-es/logo-tu.js +19 -0
- package/dist-es/logo-vivo.js +72 -0
- package/dist-es/logo.js +132 -533
- package/dist-es/navigation-bar.js +163 -155
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +26 -24
- package/dist-es/snackbar-context.js +25 -24
- package/dist-es/snackbar.js +81 -77
- package/dist-es/style.css +1 -1
- package/dist-es/text.js +143 -119
- package/dist-es/tooltip.js +149 -149
- 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
|
|
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 [
|
|
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
|
-
|
|
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
|
-
|
|
69
|
+
t,
|
|
70
70
|
r
|
|
71
71
|
]);
|
|
72
|
-
const
|
|
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 =
|
|
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
|
-
},
|
|
79
|
-
snackbars:
|
|
78
|
+
}, S = e.useMemo(()=>({
|
|
79
|
+
snackbars: t,
|
|
80
80
|
setSnackbars: n
|
|
81
81
|
}), [
|
|
82
|
-
|
|
83
|
-
]),
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
value:
|
|
82
|
+
t
|
|
83
|
+
]), s = t[0];
|
|
84
|
+
return /* @__PURE__ */ m(k.Provider, {
|
|
85
|
+
value: S,
|
|
86
86
|
children: [
|
|
87
87
|
l,
|
|
88
|
-
!!
|
|
88
|
+
!!s && /* @__PURE__ */ f(e.Suspense, {
|
|
89
89
|
fallback: null,
|
|
90
90
|
children: /* @__PURE__ */ f(p, {
|
|
91
91
|
ref: o,
|
|
92
|
-
message:
|
|
93
|
-
buttonText:
|
|
94
|
-
buttonAccessibilityLabel:
|
|
95
|
-
duration:
|
|
96
|
-
type:
|
|
97
|
-
withDismiss:
|
|
98
|
-
|
|
99
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
116
|
+
t
|
|
116
117
|
]),
|
|
117
118
|
snackbars: l
|
|
118
119
|
};
|
package/dist-es/snackbar.js
CHANGED
|
@@ -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
|
|
54
|
+
import { jsx as r, jsxs as D } from "react/jsx-runtime";
|
|
55
55
|
import * as e from "react";
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import { isWebViewBridgeAvailable as
|
|
59
|
-
import { useTheme as
|
|
60
|
-
import { Text2 as
|
|
61
|
-
import { TRANSITION_TIME_IN_MS as
|
|
62
|
-
import { sprinkles as
|
|
63
|
-
import { vars as
|
|
64
|
-
import { getPrefixedDataAttributes as
|
|
65
|
-
import { Portal as
|
|
66
|
-
import
|
|
67
|
-
const
|
|
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
|
-
],
|
|
73
|
-
let { message: m, buttonText: n, buttonAccessibilityLabel: u, duration: t, onClose: o, type:
|
|
74
|
-
const { texts:
|
|
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
|
-
|
|
76
|
+
h.current = o;
|
|
77
77
|
}, [
|
|
78
78
|
o
|
|
79
79
|
]);
|
|
80
|
-
const f = e.useCallback((
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
(
|
|
84
|
-
}, process.env.NODE_ENV === "test" ? 0 :
|
|
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(
|
|
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
|
|
92
|
-
|
|
93
|
-
}, 50),
|
|
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(
|
|
97
|
+
clearTimeout(k), clearTimeout(S);
|
|
98
98
|
};
|
|
99
99
|
}, [
|
|
100
100
|
f,
|
|
101
101
|
t
|
|
102
|
-
]), /* @__PURE__ */ r(
|
|
103
|
-
className:
|
|
102
|
+
]), /* @__PURE__ */ r(Q, {
|
|
103
|
+
className: L,
|
|
104
104
|
children: /* @__PURE__ */ r("div", {
|
|
105
|
-
ref:
|
|
106
|
-
className:
|
|
107
|
-
[
|
|
105
|
+
ref: B,
|
|
106
|
+
className: N(V, {
|
|
107
|
+
[z]: a
|
|
108
108
|
}),
|
|
109
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ D("div", _object_spread_props(_object_spread({
|
|
110
110
|
role: "alert",
|
|
111
|
-
className:
|
|
112
|
-
[
|
|
111
|
+
className: N(F, c === "CRITICAL" ? H : j, {
|
|
112
|
+
[X]: a
|
|
113
113
|
})
|
|
114
|
-
},
|
|
114
|
+
}, K(R, "SnackBar")), {
|
|
115
115
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
className:
|
|
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:
|
|
121
|
+
style: E && !l ? {
|
|
122
122
|
paddingRight: 32
|
|
123
123
|
} : void 0,
|
|
124
124
|
children: [
|
|
125
125
|
/* @__PURE__ */ r("div", {
|
|
126
|
-
style:
|
|
126
|
+
style: E && l ? {
|
|
127
127
|
paddingRight: 32
|
|
128
128
|
} : void 0,
|
|
129
|
-
children: /* @__PURE__ */ r(
|
|
129
|
+
children: /* @__PURE__ */ r(W, {
|
|
130
130
|
regular: !0,
|
|
131
|
-
color:
|
|
131
|
+
color: O.colors.textPrimaryInverse,
|
|
132
132
|
children: m
|
|
133
133
|
})
|
|
134
134
|
}),
|
|
135
135
|
n && /* @__PURE__ */ r("div", {
|
|
136
|
-
className:
|
|
137
|
-
[
|
|
136
|
+
className: N($, {
|
|
137
|
+
[q]: l
|
|
138
138
|
}),
|
|
139
|
-
children: /* @__PURE__ */ r(
|
|
140
|
-
className:
|
|
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:
|
|
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(
|
|
154
|
+
children: /* @__PURE__ */ r(y, {
|
|
155
155
|
medium: !0,
|
|
156
156
|
forceMobileSizes: !0,
|
|
157
157
|
truncate: !0,
|
|
158
|
-
color:
|
|
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
|
-
|
|
165
|
+
E ? /* @__PURE__ */ r(C, {
|
|
166
166
|
onPress: ()=>{
|
|
167
167
|
f({
|
|
168
168
|
action: "DISMISS"
|
|
169
169
|
});
|
|
170
170
|
},
|
|
171
|
-
"aria-label":
|
|
172
|
-
className:
|
|
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:
|
|
180
|
-
children: /* @__PURE__ */ r(
|
|
181
|
-
color:
|
|
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
|
-
}),
|
|
191
|
-
let { message: m, buttonText: n, buttonAccessibilityLabel: u, duration: t, onClose: o = ()=>{}, type:
|
|
192
|
-
const
|
|
193
|
-
t = Math.max(t !== null && t !== void 0 ? t :
|
|
194
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
217
|
+
I.current = !1;
|
|
217
218
|
}));
|
|
218
219
|
}, [
|
|
219
220
|
u,
|
|
221
|
+
d,
|
|
220
222
|
n,
|
|
221
223
|
t,
|
|
222
224
|
m,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
]),
|
|
227
|
-
ref:
|
|
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
|
-
|
|
234
|
+
closeButtonLabel: d,
|
|
235
|
+
type: c,
|
|
233
236
|
onClose: s.current,
|
|
234
|
-
withDismiss:
|
|
237
|
+
withDismiss: p,
|
|
238
|
+
dataAttributes: R
|
|
235
239
|
});
|
|
236
|
-
}),
|
|
237
|
-
export {
|
|
240
|
+
}), Se = oe;
|
|
241
|
+
export { Se as default };
|