@telefonica/mistica 14.1.0 → 14.2.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/dialog.js +17 -17
- package/dist/feedback.js +15 -15
- package/dist/generated/mistica-icons/icon-meatball-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-meatball-filled.js +108 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/package-version.js +1 -1
- package/dist/select.js +53 -51
- package/dist/skins/movistar.d.ts +1 -1
- package/dist/skins/movistar.js +10 -10
- package/dist/utils/animation.js +12 -12
- package/dist/utils/platform.d.ts +0 -1
- package/dist/utils/platform.js +8 -12
- package/dist-es/dialog.js +32 -32
- package/dist-es/feedback.js +32 -32
- package/dist-es/generated/mistica-icons/icon-meatball-filled.js +101 -0
- package/dist-es/index.js +675 -674
- package/dist-es/package-version.js +1 -1
- package/dist-es/select.js +87 -85
- package/dist-es/skins/movistar.js +10 -10
- package/dist-es/style.css +1 -1
- package/dist-es/utils/animation.js +10 -10
- package/dist-es/utils/platform.js +4 -7
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o = "14.
|
|
1
|
+
const o = "14.2.0";
|
|
2
2
|
export { o as PACKAGE_VERSION };
|
package/dist-es/select.js
CHANGED
|
@@ -50,26 +50,26 @@ function _objectSpreadProps(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
import * as
|
|
54
|
-
import
|
|
55
|
-
import { useForm as
|
|
56
|
-
import { useAriaId as
|
|
57
|
-
import { TAB as
|
|
58
|
-
import { FieldContainer as
|
|
53
|
+
import * as s from "react";
|
|
54
|
+
import se from "classnames";
|
|
55
|
+
import { useForm as ve } from "./form-context.js";
|
|
56
|
+
import { useAriaId as Ae, useTheme as Re } from "./hooks.js";
|
|
57
|
+
import { TAB as be, ESC as _e, ENTER as oe, SPACE as re, UP as ke, DOWN as Ve } from "./utils/key-codes.js";
|
|
58
|
+
import { FieldContainer as De, HelperText as Me, Label as He } from "./text-field-components.js";
|
|
59
59
|
import ie from "./generated/mistica-icons/icon-chevron-down-regular.js";
|
|
60
|
-
import { TextFieldBaseAutosuggest as
|
|
61
|
-
import
|
|
62
|
-
import { isAndroid as
|
|
60
|
+
import { TextFieldBaseAutosuggest as Fe } from "./text-field-base.js";
|
|
61
|
+
import Pe from "./overlay.js";
|
|
62
|
+
import { isAndroid as Ge, isIos as Ze } from "./utils/platform.js";
|
|
63
63
|
import { cancelEvent as m } from "./utils/dom.js";
|
|
64
|
-
import { Text3 as
|
|
65
|
-
import { selectVariants as
|
|
66
|
-
import { assignInlineVars as
|
|
67
|
-
import { jsxs as
|
|
68
|
-
const
|
|
69
|
-
let { id: le , label: h , helperText: ae , value:
|
|
64
|
+
import { Text3 as We } from "./text.js";
|
|
65
|
+
import { selectVariants as Be, arrowDown as Le, selectContainerVariants as $e, selectTextVariants as qe, vars as C, optionsContainer as je, optionsAnimationsVariants as ce, menuItem as ze, menuItemSelected as Ke } from "./select.css-mistica.js";
|
|
66
|
+
import { assignInlineVars as Ue } from "@vanilla-extract/dynamic";
|
|
67
|
+
import { jsxs as _, jsx as a, Fragment as Xe } from "./_virtual/jsx-runtime.js";
|
|
68
|
+
const ft = (param)=>{
|
|
69
|
+
let { id: le , label: h , helperText: ae , value: k , onChangeValue: V , name: i , fullWidth: D , options: d , optional: M , disabled: ue , error: de , onBlur: H , autoFocus: q = !1 , native: fe } = param;
|
|
70
70
|
var ee, te, ne;
|
|
71
|
-
const g =
|
|
72
|
-
V == null || V(e),
|
|
71
|
+
const g = s.useRef(null), f = s.useRef(null), S = s.useRef(null), T = s.useRef(null), N = s.useRef(/* @__PURE__ */ new Map()), [pe, me] = s.useState(!0), [c, he] = s.useState(), [F, j] = s.useState(!1), [z, K] = s.useState(!1), [U, y] = s.useState(!1), [u, P] = s.useState({}), [I, G] = s.useState(), Z = s.useRef(null), W = Ae(le), { rawValues: ge , setRawValue: B , setValue: L , formStatus: Se , formErrors: X , setFormError: Te , register: $ } = ve(), { platformOverrides: J } = Re(), Ie = fe || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || Ge(J) || Ze(J), E = ue || Se === "sending", v = de || !!X[i], Q = X[i] || ae, o = k != null ? k : ge[i], A = (e)=>{
|
|
72
|
+
V == null || V(e), Te({
|
|
73
73
|
name: i,
|
|
74
74
|
error: ""
|
|
75
75
|
}), B({
|
|
@@ -79,19 +79,19 @@ const ut = (param)=>{
|
|
|
79
79
|
name: i,
|
|
80
80
|
value: e
|
|
81
81
|
});
|
|
82
|
-
},
|
|
82
|
+
}, x = (e)=>{
|
|
83
83
|
if (e) {
|
|
84
|
-
if (
|
|
85
|
-
const { top:
|
|
86
|
-
if (p +
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
84
|
+
if (S != null && S.current) {
|
|
85
|
+
const { top: r , width: w , left: O , height: R } = S.current.getBoundingClientRect(), p = r + R, b = Math.min(d.length, 8) * 48 + 16;
|
|
86
|
+
if (p + b + 12 > window.innerHeight) {
|
|
87
|
+
const Ce = window.innerHeight - p;
|
|
88
|
+
if (r > Ce) {
|
|
89
|
+
const Ne = r - b;
|
|
90
90
|
P({
|
|
91
91
|
minWidth: w,
|
|
92
92
|
left: O,
|
|
93
|
-
top: Math.max(
|
|
94
|
-
maxHeight: Math.min(
|
|
93
|
+
top: Math.max(Ne, 12),
|
|
94
|
+
maxHeight: Math.min(r - 12, b),
|
|
95
95
|
transformOrigin: "center bottom"
|
|
96
96
|
});
|
|
97
97
|
} else P({
|
|
@@ -105,30 +105,30 @@ const ut = (param)=>{
|
|
|
105
105
|
minWidth: w,
|
|
106
106
|
top: p,
|
|
107
107
|
left: O,
|
|
108
|
-
maxHeight:
|
|
108
|
+
maxHeight: b,
|
|
109
109
|
transformOrigin: "center top"
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
j(!0), requestAnimationFrame(()=>{
|
|
113
|
-
Z.current &&
|
|
113
|
+
Z.current && T.current && "scrollTop" in T.current && (T.current.scrollTop = Z.current), K(!0);
|
|
114
114
|
}), G(c != null ? c : o);
|
|
115
115
|
} else K(!1), j(!1), G(void 0);
|
|
116
116
|
}, Y = (e)=>{
|
|
117
117
|
var t;
|
|
118
|
-
Z.current = (t =
|
|
119
|
-
},
|
|
118
|
+
Z.current = (t = T.current) == null ? void 0 : t.scrollTop, x(!1), A && typeof e == "string" && A(e), typeof o > "u" && he(e);
|
|
119
|
+
}, Ee = (e)=>{
|
|
120
120
|
var n;
|
|
121
|
-
const t = (n =
|
|
121
|
+
const t = (n = T.current) == null ? void 0 : n.getBoundingClientRect();
|
|
122
122
|
if (t && e && N.current.has(e)) {
|
|
123
|
-
const l = N.current.get(e),
|
|
124
|
-
if (
|
|
123
|
+
const l = N.current.get(e), r = l == null ? void 0 : l.getBoundingClientRect();
|
|
124
|
+
if (r && r.top + r.height / 2 >= t.top + t.height) {
|
|
125
125
|
l == null || l.scrollIntoView();
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
|
|
128
|
+
r && r.top + r.height / 2 <= t.top && (l == null || l.scrollIntoView(!1));
|
|
129
129
|
}
|
|
130
|
-
}, xe = f.current,
|
|
131
|
-
|
|
130
|
+
}, xe = f.current, we = g.current;
|
|
131
|
+
s.useEffect(()=>{
|
|
132
132
|
B({
|
|
133
133
|
name: i,
|
|
134
134
|
value: o
|
|
@@ -141,7 +141,7 @@ const ut = (param)=>{
|
|
|
141
141
|
B,
|
|
142
142
|
L,
|
|
143
143
|
o
|
|
144
|
-
]),
|
|
144
|
+
]), s.useEffect(()=>($(i, {
|
|
145
145
|
input: g.current,
|
|
146
146
|
focusableElement: f.current
|
|
147
147
|
}), ()=>{
|
|
@@ -155,78 +155,80 @@ const ut = (param)=>{
|
|
|
155
155
|
f,
|
|
156
156
|
g,
|
|
157
157
|
xe,
|
|
158
|
-
|
|
159
|
-
]),
|
|
158
|
+
we
|
|
159
|
+
]), s.useEffect(()=>{
|
|
160
160
|
const e = (n)=>{
|
|
161
161
|
var w, O;
|
|
162
|
-
const
|
|
163
|
-
[
|
|
164
|
-
[
|
|
162
|
+
const r = {
|
|
163
|
+
[ke]: -1,
|
|
164
|
+
[Ve]: 1
|
|
165
165
|
}[n.keyCode];
|
|
166
|
-
if (
|
|
166
|
+
if (r) {
|
|
167
167
|
m(n);
|
|
168
|
-
const
|
|
168
|
+
const R = (O = (w = d[d.findIndex((param)=>{
|
|
169
169
|
let { value: p } = param;
|
|
170
|
-
return p ===
|
|
171
|
-
}) +
|
|
172
|
-
G(
|
|
170
|
+
return p === I;
|
|
171
|
+
}) + r]) == null ? void 0 : w.value) != null ? O : I;
|
|
172
|
+
G(R), Ee(R);
|
|
173
173
|
}
|
|
174
174
|
}, t = (n)=>{
|
|
175
|
-
F && (n.keyCode ===
|
|
175
|
+
F && (n.keyCode === be && m(n), n.keyCode === _e && x(!1), (n.keyCode === oe || n.keyCode === re) && (m(n), d.findIndex((param)=>{
|
|
176
176
|
let { value: l } = param;
|
|
177
|
-
return l ===
|
|
178
|
-
}) !== -1 &&
|
|
177
|
+
return l === I;
|
|
178
|
+
}) !== -1 && I !== c && Y(I), x(!1))), z && e(n);
|
|
179
179
|
};
|
|
180
180
|
return document.addEventListener("keydown", t, !1), ()=>{
|
|
181
181
|
document.removeEventListener("keydown", t, !1);
|
|
182
182
|
};
|
|
183
|
-
}),
|
|
183
|
+
}), s.useEffect(()=>{
|
|
184
184
|
q && f.current && f.current.focus();
|
|
185
185
|
}, [
|
|
186
186
|
q
|
|
187
|
-
])
|
|
188
|
-
|
|
187
|
+
]), s.useEffect(()=>{
|
|
188
|
+
me(!1);
|
|
189
|
+
}, []);
|
|
190
|
+
const Oe = (e)=>{
|
|
189
191
|
var t;
|
|
190
192
|
return e ? (t = d.find((param)=>{
|
|
191
193
|
let { value: n } = param;
|
|
192
194
|
return n === e;
|
|
193
195
|
})) == null ? void 0 : t.text : "";
|
|
194
|
-
},
|
|
196
|
+
}, ye = {
|
|
195
197
|
tabIndex: 0,
|
|
196
198
|
onFocus: ()=>y(!0),
|
|
197
199
|
onBlur: ()=>y(!1),
|
|
198
200
|
onClick: ()=>{
|
|
199
|
-
|
|
201
|
+
x(!0), y(!0);
|
|
200
202
|
},
|
|
201
203
|
onKeyDown: (e)=>{
|
|
202
|
-
!F && (e.keyCode ===
|
|
204
|
+
!F && (e.keyCode === re || e.keyCode === oe) && (m(e), x(!0));
|
|
203
205
|
}
|
|
204
206
|
};
|
|
205
|
-
return
|
|
207
|
+
return Ie || pe ? /* @__PURE__ */ _(De, {
|
|
206
208
|
disabled: E,
|
|
207
|
-
helperText: /* @__PURE__ */ a(
|
|
208
|
-
error:
|
|
209
|
+
helperText: /* @__PURE__ */ a(Me, {
|
|
210
|
+
error: v,
|
|
209
211
|
leftText: Q
|
|
210
212
|
}),
|
|
211
|
-
fieldRef:
|
|
213
|
+
fieldRef: S,
|
|
212
214
|
fullWidth: D,
|
|
213
215
|
children: [
|
|
214
|
-
h && /* @__PURE__ */ a(
|
|
215
|
-
error:
|
|
216
|
+
h && /* @__PURE__ */ a(He, {
|
|
217
|
+
error: v,
|
|
216
218
|
forId: W,
|
|
217
219
|
inputState: U ? "focused" : ((te = o != null ? o : c) != null ? te : (ee = g.current) == null ? void 0 : ee.value) ? "filled" : "default",
|
|
218
220
|
optional: M,
|
|
219
221
|
children: h
|
|
220
222
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
className:
|
|
223
|
+
/* @__PURE__ */ _("select", {
|
|
224
|
+
className: Be[E ? "disabled" : "default"],
|
|
223
225
|
id: W,
|
|
224
|
-
"aria-invalid": !!
|
|
226
|
+
"aria-invalid": !!v,
|
|
225
227
|
value: o,
|
|
226
228
|
required: !M,
|
|
227
229
|
disabled: E,
|
|
228
230
|
onChange: (e)=>{
|
|
229
|
-
|
|
231
|
+
A && A(e.target.value);
|
|
230
232
|
},
|
|
231
233
|
onFocus: ()=>y(!0),
|
|
232
234
|
onBlur: (e)=>{
|
|
@@ -265,23 +267,23 @@ const ut = (param)=>{
|
|
|
265
267
|
]
|
|
266
268
|
}),
|
|
267
269
|
/* @__PURE__ */ a("div", {
|
|
268
|
-
className:
|
|
270
|
+
className: Le,
|
|
269
271
|
"aria-hidden": !0,
|
|
270
272
|
children: /* @__PURE__ */ a(ie, {
|
|
271
273
|
size: 20
|
|
272
274
|
})
|
|
273
275
|
})
|
|
274
276
|
]
|
|
275
|
-
}) : /* @__PURE__ */
|
|
277
|
+
}) : /* @__PURE__ */ _(Xe, {
|
|
276
278
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
className:
|
|
279
|
+
/* @__PURE__ */ _("div", _objectSpreadProps(_objectSpread({
|
|
280
|
+
className: $e[D ? "fullWidth" : "default"],
|
|
279
281
|
role: "button",
|
|
280
282
|
"aria-haspopup": "listbox",
|
|
281
283
|
ref: f
|
|
282
|
-
}, !E &&
|
|
284
|
+
}, !E && ye), {
|
|
283
285
|
children: [
|
|
284
|
-
/* @__PURE__ */ a(
|
|
286
|
+
/* @__PURE__ */ a(Fe, {
|
|
285
287
|
style: {
|
|
286
288
|
visibility: "hidden"
|
|
287
289
|
},
|
|
@@ -298,26 +300,26 @@ const ut = (param)=>{
|
|
|
298
300
|
required: !M,
|
|
299
301
|
disabled: E,
|
|
300
302
|
id: W,
|
|
301
|
-
error:
|
|
303
|
+
error: v,
|
|
302
304
|
inputRef: g,
|
|
303
|
-
fieldRef:
|
|
305
|
+
fieldRef: S
|
|
304
306
|
}),
|
|
305
307
|
/* @__PURE__ */ a("div", {
|
|
306
|
-
className:
|
|
308
|
+
className: qe[E ? "disabled" : "default"],
|
|
307
309
|
style: {
|
|
308
310
|
top: h ? 27 : 17
|
|
309
311
|
},
|
|
310
|
-
children:
|
|
312
|
+
children: Oe(o != null ? o : c)
|
|
311
313
|
})
|
|
312
314
|
]
|
|
313
315
|
})),
|
|
314
|
-
F && /* @__PURE__ */ a(
|
|
316
|
+
F && /* @__PURE__ */ a(Pe, {
|
|
315
317
|
onPress: (e)=>{
|
|
316
|
-
|
|
318
|
+
x(!1), m(e);
|
|
317
319
|
},
|
|
318
320
|
disableScroll: !0,
|
|
319
321
|
children: /* @__PURE__ */ a("ul", {
|
|
320
|
-
style:
|
|
322
|
+
style: Ue({
|
|
321
323
|
[C.top]: u.top ? `${u.top}px` : "",
|
|
322
324
|
[C.left]: u.left ? `${u.left}px` : "",
|
|
323
325
|
[C.maxHeight]: u.maxHeight ? `${u.maxHeight}px` : "",
|
|
@@ -325,24 +327,24 @@ const ut = (param)=>{
|
|
|
325
327
|
[C.transformOrigin]: (ne = u.transformOrigin) != null ? ne : ""
|
|
326
328
|
}),
|
|
327
329
|
onPointerDown: m,
|
|
328
|
-
className:
|
|
330
|
+
className: se(je, z ? ce.show : ce.hide),
|
|
329
331
|
role: "listbox",
|
|
330
|
-
ref:
|
|
332
|
+
ref: T,
|
|
331
333
|
children: d.map((param)=>/* @__PURE__ */ {
|
|
332
334
|
let { value: e , text: t } = param;
|
|
333
335
|
return a("li", {
|
|
334
336
|
role: "option",
|
|
335
337
|
"aria-selected": e === (c != null ? c : o),
|
|
336
338
|
"data-value": e,
|
|
337
|
-
className:
|
|
338
|
-
[
|
|
339
|
+
className: se(ze, {
|
|
340
|
+
[Ke]: e === I || e === (c != null ? c : o)
|
|
339
341
|
}),
|
|
340
342
|
onPointerDown: m,
|
|
341
343
|
onClick: ()=>Y(e),
|
|
342
344
|
ref: (n)=>{
|
|
343
345
|
n ? N.current.set(e, n) : N.current.delete(e);
|
|
344
346
|
},
|
|
345
|
-
children: /* @__PURE__ */ a(
|
|
347
|
+
children: /* @__PURE__ */ a(We, {
|
|
346
348
|
regular: !0,
|
|
347
349
|
children: t
|
|
348
350
|
})
|
|
@@ -353,4 +355,4 @@ const ut = (param)=>{
|
|
|
353
355
|
]
|
|
354
356
|
});
|
|
355
357
|
};
|
|
356
|
-
export {
|
|
358
|
+
export { ft as default };
|
|
@@ -42,7 +42,7 @@ const e = {
|
|
|
42
42
|
movistarProminentBlueLight50: "#85939C",
|
|
43
43
|
movistarProminentBlueLight70: "#546874",
|
|
44
44
|
darkModeBlack: "#061824",
|
|
45
|
-
darkModeGrey: "#
|
|
45
|
+
darkModeGrey: "#081F2E",
|
|
46
46
|
darkModeGrey2: "#EAEBEE",
|
|
47
47
|
darkModeGrey3: "#CED4D7",
|
|
48
48
|
darkModeGrey4: "#85939C",
|
|
@@ -153,12 +153,12 @@ const e = {
|
|
|
153
153
|
backgroundBrand: e.darkModeBlack,
|
|
154
154
|
backgroundBrandSecondary: e.darkModeBlack,
|
|
155
155
|
backgroundOverlay: r(e.darkModeGrey, 0.8),
|
|
156
|
-
backgroundSkeleton: e.
|
|
157
|
-
backgroundSkeletonInverse: e.
|
|
156
|
+
backgroundSkeleton: e.movistarBlueDark,
|
|
157
|
+
backgroundSkeletonInverse: e.movistarBlueDark,
|
|
158
158
|
navigationBarBackground: e.darkModeBlack,
|
|
159
159
|
backgroundAlternative: e.darkModeGrey,
|
|
160
160
|
backgroundFeedbackBottom: e.darkModeBlack,
|
|
161
|
-
skeletonWave: e.
|
|
161
|
+
skeletonWave: e.darkModeGrey6,
|
|
162
162
|
borderHigh: e.darkModeGrey4,
|
|
163
163
|
borderLow: e.darkModeBlack,
|
|
164
164
|
border: e.darkModeGrey,
|
|
@@ -200,7 +200,7 @@ const e = {
|
|
|
200
200
|
inverse: e.darkModeGrey2,
|
|
201
201
|
neutralHigh: e.darkModeGrey2,
|
|
202
202
|
neutralMedium: e.darkModeGrey5,
|
|
203
|
-
neutralLow: e.
|
|
203
|
+
neutralLow: e.movistarBlueDark,
|
|
204
204
|
textPrimary: e.darkModeGrey2,
|
|
205
205
|
textPrimaryInverse: e.darkModeGrey2,
|
|
206
206
|
textSecondary: e.darkModeGrey4,
|
|
@@ -211,11 +211,11 @@ const e = {
|
|
|
211
211
|
textNavigationSearchBarText: e.darkModeGrey2,
|
|
212
212
|
textAppBar: e.darkModeGrey5,
|
|
213
213
|
textAppBarSelected: e.darkModeGrey2,
|
|
214
|
-
successLow: e.
|
|
215
|
-
warningLow: e.
|
|
216
|
-
errorLow: e.
|
|
217
|
-
promoLow: e.
|
|
218
|
-
brandLow: e.
|
|
214
|
+
successLow: e.movistarBlueDark,
|
|
215
|
+
warningLow: e.movistarBlueDark,
|
|
216
|
+
errorLow: e.movistarBlueDark,
|
|
217
|
+
promoLow: e.movistarBlueDark,
|
|
218
|
+
brandLow: e.movistarBlueDark,
|
|
219
219
|
successHigh: e.movistarGreen40,
|
|
220
220
|
warningHigh: e.egg40,
|
|
221
221
|
errorHigh: e.pepper40,
|