@telefonica/mistica 16.1.0 → 16.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/accordion.css-mistica.js +12 -9
- package/dist/accordion.css.d.ts +1 -0
- package/dist/accordion.js +36 -39
- package/dist/align.css-mistica.js +12 -0
- package/dist/align.css.d.ts +1 -0
- package/dist/align.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/align.d.ts +12 -0
- package/dist/align.js +79 -0
- package/dist/box.css-mistica.js +41 -0
- package/dist/box.css.d.ts +23 -0
- package/dist/box.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/box.d.ts +4 -0
- package/dist/box.js +39 -31
- package/dist/boxed.css-mistica.js +10 -5
- package/dist/boxed.css.d.ts +3 -0
- package/dist/boxed.js +20 -24
- package/dist/callout.css-mistica.js +12 -4
- package/dist/callout.css.d.ts +1 -0
- package/dist/callout.js +14 -22
- package/dist/card.css-mistica.js +26 -23
- package/dist/card.css.d.ts +1 -0
- package/dist/card.js +17 -23
- package/dist/community/advanced-data-card.css-mistica.js +32 -23
- package/dist/community/advanced-data-card.css.d.ts +3 -0
- package/dist/community/advanced-data-card.js +46 -55
- package/dist/empty-state.css-mistica.js +11 -8
- package/dist/empty-state.css.d.ts +1 -0
- package/dist/empty-state.js +10 -13
- package/dist/form.css-mistica.js +12 -0
- package/dist/form.css.d.ts +1 -0
- package/dist/form.js +8 -10
- package/dist/grid.css-mistica.js +143 -126
- package/dist/grid.css.d.ts +13 -0
- package/dist/grid.js +35 -38
- package/dist/hero.css-mistica.js +14 -8
- package/dist/hero.css.d.ts +2 -0
- package/dist/hero.js +17 -25
- package/dist/image.js +23 -25
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/inline.js +10 -11
- package/dist/list.css-mistica.js +12 -9
- package/dist/list.css.d.ts +1 -0
- package/dist/list.js +43 -46
- package/dist/loading-screen.js +16 -16
- package/dist/logo-blau.d.ts +1 -1
- package/dist/logo-blau.js +10 -10
- package/dist/logo-common.d.ts +1 -0
- package/dist/logo-movistar.d.ts +1 -1
- package/dist/logo-movistar.js +4 -4
- package/dist/logo-o2-new.d.ts +1 -1
- package/dist/logo-o2-new.js +5 -5
- package/dist/logo-o2.d.ts +1 -1
- package/dist/logo-o2.js +5 -5
- package/dist/logo-telefonica.d.ts +1 -1
- package/dist/logo-telefonica.js +4 -4
- package/dist/logo-tu.d.ts +1 -1
- package/dist/logo-tu.js +5 -5
- package/dist/logo-vivo.d.ts +1 -1
- package/dist/logo-vivo.js +7 -7
- package/dist/logo.d.ts +9 -8
- package/dist/logo.js +125 -102
- package/dist/navigation-bar.css-mistica.js +23 -20
- package/dist/navigation-bar.css.d.ts +1 -0
- package/dist/navigation-bar.js +30 -37
- package/dist/package-version.js +1 -1
- package/dist/phone-number-field.d.ts +1 -4
- package/dist/phone-number-field.js +52 -82
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +9 -10
- package/dist/sheet-common.css-mistica.js +5 -5
- package/dist/skeleton-base.js +10 -12
- package/dist/skeletons.css-mistica.js +11 -5
- package/dist/skeletons.css.d.ts +1 -0
- package/dist/snackbar.css-mistica.js +20 -14
- package/dist/snackbar.css.d.ts +3 -1
- package/dist/snackbar.js +65 -75
- package/dist/tag.css-mistica.js +15 -4
- package/dist/tag.css.d.ts +2 -0
- package/dist/tag.js +20 -24
- package/dist/text-field-base.d.ts +1 -1
- package/dist/text-field-components.css-mistica.js +16 -10
- package/dist/text-field-components.css.d.ts +1 -0
- package/dist/text-field-components.js +32 -35
- package/dist/timer.js +42 -43
- package/dist/tooltip.d.ts +3 -1
- package/dist/tooltip.js +106 -106
- package/dist/touchable.js +47 -42
- package/dist-es/accordion.css-mistica.js +3 -3
- package/dist-es/accordion.js +58 -61
- package/dist-es/align.css-mistica.js +3 -0
- package/dist-es/align.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/align.js +70 -0
- package/dist-es/box.css-mistica.js +24 -0
- package/dist-es/box.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/box.js +43 -35
- package/dist-es/boxed.css-mistica.js +5 -3
- package/dist-es/boxed.js +28 -32
- package/dist-es/callout.css-mistica.js +7 -2
- package/dist-es/callout.js +44 -52
- package/dist-es/card.css-mistica.js +4 -4
- package/dist-es/card.js +11 -17
- package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
- package/dist-es/community/advanced-data-card.js +90 -99
- package/dist-es/empty-state.css-mistica.js +3 -3
- package/dist-es/empty-state.js +19 -22
- package/dist-es/form.css-mistica.js +3 -0
- package/dist-es/form.js +12 -14
- package/dist-es/grid.css-mistica.js +123 -112
- package/dist-es/grid.js +38 -41
- package/dist-es/hero.css-mistica.js +2 -2
- package/dist-es/hero.js +36 -44
- package/dist-es/image.js +28 -30
- package/dist-es/index.js +1844 -1843
- package/dist-es/inline.js +19 -20
- package/dist-es/list.css-mistica.js +2 -2
- package/dist-es/list.js +75 -78
- package/dist-es/loading-screen.js +30 -30
- package/dist-es/logo-blau.js +11 -11
- package/dist-es/logo-movistar.js +5 -5
- package/dist-es/logo-o2-new.js +8 -8
- package/dist-es/logo-o2.js +8 -8
- package/dist-es/logo-telefonica.js +4 -4
- package/dist-es/logo-tu.js +8 -8
- package/dist-es/logo-vivo.js +16 -16
- package/dist-es/logo.js +132 -109
- package/dist-es/navigation-bar.css-mistica.js +11 -11
- package/dist-es/navigation-bar.js +80 -87
- package/dist-es/package-version.js +1 -1
- package/dist-es/phone-number-field.js +59 -89
- package/dist-es/popover.js +17 -18
- package/dist-es/sheet-common.css-mistica.js +2 -2
- package/dist-es/skeleton-base.js +15 -17
- package/dist-es/skeletons.css-mistica.js +5 -2
- package/dist-es/snackbar.css-mistica.js +4 -4
- package/dist-es/snackbar.js +93 -103
- package/dist-es/style.css +1 -1
- package/dist-es/tag.css-mistica.js +2 -2
- package/dist-es/tag.js +34 -38
- package/dist-es/text-field-components.css-mistica.js +5 -2
- package/dist-es/text-field-components.js +48 -51
- package/dist-es/timer.js +80 -81
- package/dist-es/tooltip.js +148 -148
- package/dist-es/touchable.js +55 -50
- package/package.json +1 -1
- package/dist/sprinkles.css-mistica.js +0 -2494
- package/dist-es/sprinkles.css-mistica.js +0 -2485
|
@@ -80,29 +80,28 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
80
80
|
}
|
|
81
81
|
import { jsxs as i, jsx as e, Fragment as P } from "react/jsx-runtime";
|
|
82
82
|
import * as N from "react";
|
|
83
|
-
import { createElement as
|
|
84
|
-
import { Transition as
|
|
83
|
+
import { createElement as Y } from "react";
|
|
84
|
+
import { Transition as Z } from "react-transition-group";
|
|
85
85
|
import p from "classnames";
|
|
86
|
-
import
|
|
86
|
+
import B from "./responsive-layout.js";
|
|
87
87
|
import M from "./inline.js";
|
|
88
|
-
import
|
|
89
|
-
import { Text3 as U, Text2 as
|
|
90
|
-
import { useTheme as
|
|
91
|
-
import
|
|
92
|
-
import
|
|
93
|
-
import
|
|
94
|
-
import { IconButton as
|
|
95
|
-
import
|
|
96
|
-
import { RowList as
|
|
97
|
-
import { ThemeVariant as
|
|
88
|
+
import ee, { BaseTouchable as z } from "./touchable.js";
|
|
89
|
+
import { Text3 as U, Text2 as ne } from "./text.js";
|
|
90
|
+
import { useTheme as C, useScreenSize as re } from "./hooks.js";
|
|
91
|
+
import te from "./generated/mistica-icons/icon-menu-regular.js";
|
|
92
|
+
import oe from "./generated/mistica-icons/icon-close-regular.js";
|
|
93
|
+
import ae from "./generated/mistica-icons/icon-chevron-left-regular.js";
|
|
94
|
+
import { IconButton as ie } from "./icon-button.js";
|
|
95
|
+
import se from "./negative-box.js";
|
|
96
|
+
import { RowList as ce, Row as le } from "./list.js";
|
|
97
|
+
import { ThemeVariant as S, useIsInverseOrMediaVariant as de } from "./theme-variant-context.js";
|
|
98
98
|
import _ from "./focus-trap.js";
|
|
99
|
-
import { Portal as
|
|
100
|
-
import
|
|
101
|
-
import { useSetModalState as
|
|
99
|
+
import { Portal as me } from "./portal.js";
|
|
100
|
+
import ue from "./grid-layout.js";
|
|
101
|
+
import { useSetModalState as pe } from "./modal-context-provider.js";
|
|
102
102
|
import { Logo as j } from "./logo.js";
|
|
103
|
-
import { vars as
|
|
104
|
-
import { mainNavbarContent as
|
|
105
|
-
import { sprinkles as J } from "./sprinkles.css-mistica.js";
|
|
103
|
+
import { vars as f } from "./skins/skin-contract.css-mistica.js";
|
|
104
|
+
import { mainNavbarContent as ge, burgerMenuButton as he, logoContainer as ve, spacerLarge as fe, spacer as T, burgerMenu as Ne, burgerMenuTransition as Be, lineHeightFix as $, navigationBarAction as be, textWrapperVariants as W, burgerIconContainer as Me, iconCloseOpen as Ie, iconCloseHidden as ke, iconMenuHidden as xe, iconMenuOpen as Ae, topFixed as Ce, navigationBarContent as Se, desktopOnly as q, navigationBarContentRight as Te, section as Oe, selectedSectionVariantes as Re, navbarBorderColorVariants as A } from "./navigation-bar.css-mistica.js";
|
|
106
105
|
import { getPrefixedDataAttributes as ye } from "./utils/dom.js";
|
|
107
106
|
import Ee from "./stack.js";
|
|
108
107
|
import Le from "./box.js";
|
|
@@ -116,26 +115,26 @@ const Ge = (param)=>{
|
|
|
116
115
|
"data-component-name": "BurgerMenuIcon",
|
|
117
116
|
children: [
|
|
118
117
|
/* @__PURE__ */ e("div", {
|
|
119
|
-
className: n ?
|
|
120
|
-
children: /* @__PURE__ */ e(
|
|
118
|
+
className: n ? Ie : ke,
|
|
119
|
+
children: /* @__PURE__ */ e(oe, {})
|
|
121
120
|
}),
|
|
122
121
|
/* @__PURE__ */ e("div", {
|
|
123
|
-
className: n ? xe :
|
|
124
|
-
children: /* @__PURE__ */ e(
|
|
122
|
+
className: n ? xe : Ae,
|
|
123
|
+
children: /* @__PURE__ */ e(te, {})
|
|
125
124
|
})
|
|
126
125
|
]
|
|
127
126
|
});
|
|
128
127
|
}, He = 300, O = (param)=>{
|
|
129
128
|
let { children: n, topFixed: o, withBorder: t, isMenuOpen: r, variant: a = "default", dataAttributes: s } = param;
|
|
130
|
-
const { isDarkMode: c } =
|
|
131
|
-
default:
|
|
132
|
-
inverse:
|
|
133
|
-
alternative:
|
|
134
|
-
media:
|
|
129
|
+
const { isDarkMode: c } = C(), d = ()=>a === "inverse" && !c || !t ? A.noBorder : r ? A.menuOpen : A.default, m = {
|
|
130
|
+
default: f.colors.background,
|
|
131
|
+
inverse: f.colors.navigationBarBackground,
|
|
132
|
+
alternative: f.colors.backgroundAlternative,
|
|
133
|
+
media: f.colors.navigationBarBackground
|
|
135
134
|
};
|
|
136
135
|
return /* @__PURE__ */ e("header", _object_spread_props(_object_spread({
|
|
137
136
|
className: p(d(), {
|
|
138
|
-
[
|
|
137
|
+
[Ce]: o
|
|
139
138
|
}),
|
|
140
139
|
style: {
|
|
141
140
|
background: m[a]
|
|
@@ -143,23 +142,23 @@ const Ge = (param)=>{
|
|
|
143
142
|
}, ye(s)), {
|
|
144
143
|
children: n
|
|
145
144
|
}));
|
|
146
|
-
},
|
|
145
|
+
}, b = (param)=>{
|
|
147
146
|
let { right: n, children: o, desktopOnly: t } = param;
|
|
148
147
|
return /* @__PURE__ */ i("div", {
|
|
149
|
-
className: p(
|
|
148
|
+
className: p(Se, {
|
|
150
149
|
[q]: t
|
|
151
150
|
}),
|
|
152
151
|
children: [
|
|
153
152
|
o,
|
|
154
153
|
n && /* @__PURE__ */ e("div", {
|
|
155
|
-
className:
|
|
154
|
+
className: Te,
|
|
156
155
|
children: n
|
|
157
156
|
})
|
|
158
157
|
]
|
|
159
158
|
});
|
|
160
|
-
},
|
|
159
|
+
}, hn = (param)=>{
|
|
161
160
|
let { sections: n = [], selectedIndex: o, right: t, variant: r = "default", topFixed: a = !0, withBorder: s = !0, burgerMenuExtra: c, logo: d, large: m = !1 } = param;
|
|
162
|
-
const { texts: u, isDarkMode: g, t: R } =
|
|
161
|
+
const { texts: u, isDarkMode: g, t: R } = C(), [l, y] = N.useState(!1), [E, h] = N.useState("closed"), L = N.useId(), J = g ? 1 : 0.2, { isTabletOrSmaller: K } = re(), w = pe(), Q = d || /* @__PURE__ */ e(j, {
|
|
163
162
|
size: {
|
|
164
163
|
mobile: 40,
|
|
165
164
|
desktop: 48
|
|
@@ -168,23 +167,23 @@ const Ge = (param)=>{
|
|
|
168
167
|
className: q,
|
|
169
168
|
children: /* @__PURE__ */ e(M, {
|
|
170
169
|
space: 32,
|
|
171
|
-
children: n.map((_param,
|
|
172
|
-
var { title:
|
|
170
|
+
children: n.map((_param, v)=>{
|
|
171
|
+
var { title: k } = _param, x = _object_without_properties(_param, [
|
|
173
172
|
"title"
|
|
174
173
|
]);
|
|
175
|
-
return /* @__PURE__ */ /*#__PURE__*/
|
|
176
|
-
key:
|
|
174
|
+
return /* @__PURE__ */ /*#__PURE__*/ Y(z, _object_spread_props(_object_spread({}, x), {
|
|
175
|
+
key: v,
|
|
177
176
|
className: p(Oe, {
|
|
178
|
-
[Re[r === "inverse" ? "inverse" : "default"]]:
|
|
177
|
+
[Re[r === "inverse" ? "inverse" : "default"]]: v === o
|
|
179
178
|
}, W[r === "inverse" ? "inverse" : "default"])
|
|
180
179
|
}), /* @__PURE__ */ e(U, {
|
|
181
180
|
regular: !0,
|
|
182
181
|
color: "inherit",
|
|
183
|
-
children:
|
|
182
|
+
children: k
|
|
184
183
|
}));
|
|
185
184
|
})
|
|
186
185
|
})
|
|
187
|
-
}),
|
|
186
|
+
}), I = m && n.length > 0, X = ()=>{
|
|
188
187
|
y(!0), w({
|
|
189
188
|
isModalOpen: !0
|
|
190
189
|
});
|
|
@@ -192,7 +191,7 @@ const Ge = (param)=>{
|
|
|
192
191
|
y(!1), w({
|
|
193
192
|
isModalOpen: !1
|
|
194
193
|
});
|
|
195
|
-
}, F = E !== "open", G = n.length > 1, H = /* @__PURE__ */ i(
|
|
194
|
+
}, F = E !== "open", G = n.length > 1, H = /* @__PURE__ */ i(S, {
|
|
196
195
|
variant: r,
|
|
197
196
|
children: [
|
|
198
197
|
/* @__PURE__ */ e(O, {
|
|
@@ -203,33 +202,33 @@ const Ge = (param)=>{
|
|
|
203
202
|
dataAttributes: {
|
|
204
203
|
"component-name": "MainNavigationBar"
|
|
205
204
|
},
|
|
206
|
-
children: /* @__PURE__ */ i(
|
|
205
|
+
children: /* @__PURE__ */ i(B, {
|
|
207
206
|
children: [
|
|
208
|
-
/* @__PURE__ */ e(
|
|
207
|
+
/* @__PURE__ */ e(b, {
|
|
209
208
|
right: t,
|
|
210
209
|
children: /* @__PURE__ */ i("div", {
|
|
211
|
-
className:
|
|
210
|
+
className: ge,
|
|
212
211
|
children: [
|
|
213
|
-
G && /* @__PURE__ */ e(
|
|
214
|
-
className:
|
|
212
|
+
G && /* @__PURE__ */ e(ee, {
|
|
213
|
+
className: he,
|
|
215
214
|
"aria-live": "polite",
|
|
216
215
|
"aria-label": l ? u.closeNavigationMenu || R(De) : u.openNavigationMenu || R(Ve),
|
|
217
216
|
"aria-expanded": l,
|
|
218
217
|
"aria-controls": L,
|
|
219
|
-
onPress: l ? V :
|
|
218
|
+
onPress: l ? V : X,
|
|
220
219
|
children: /* @__PURE__ */ e(Ge, {
|
|
221
220
|
isOpen: l
|
|
222
221
|
})
|
|
223
222
|
}),
|
|
224
223
|
/* @__PURE__ */ e("div", {
|
|
225
224
|
className: ve,
|
|
226
|
-
children:
|
|
225
|
+
children: Q
|
|
227
226
|
}),
|
|
228
|
-
!
|
|
227
|
+
!I && D()
|
|
229
228
|
]
|
|
230
229
|
})
|
|
231
230
|
}),
|
|
232
|
-
|
|
231
|
+
I && /* @__PURE__ */ e(b, {
|
|
233
232
|
desktopOnly: !0,
|
|
234
233
|
children: D()
|
|
235
234
|
})
|
|
@@ -237,22 +236,22 @@ const Ge = (param)=>{
|
|
|
237
236
|
})
|
|
238
237
|
}),
|
|
239
238
|
a && /* @__PURE__ */ e("div", {
|
|
240
|
-
className:
|
|
239
|
+
className: I ? fe : T
|
|
241
240
|
})
|
|
242
241
|
]
|
|
243
242
|
});
|
|
244
|
-
return
|
|
243
|
+
return K ? /* @__PURE__ */ i(P, {
|
|
245
244
|
children: [
|
|
246
245
|
/* @__PURE__ */ e(_, {
|
|
247
246
|
disabled: F,
|
|
248
247
|
group: "burger-menu-lock",
|
|
249
248
|
children: H
|
|
250
249
|
}),
|
|
251
|
-
G && /* @__PURE__ */ e(
|
|
250
|
+
G && /* @__PURE__ */ e(me, {
|
|
252
251
|
children: /* @__PURE__ */ e(_, {
|
|
253
252
|
disabled: F,
|
|
254
253
|
group: "burger-menu-lock",
|
|
255
|
-
children: /* @__PURE__ */ e(
|
|
254
|
+
children: /* @__PURE__ */ e(Z, {
|
|
256
255
|
onEntering: ()=>{
|
|
257
256
|
h("opening");
|
|
258
257
|
},
|
|
@@ -268,23 +267,23 @@ const Ge = (param)=>{
|
|
|
268
267
|
in: l,
|
|
269
268
|
timeout: we() ? 0 : He,
|
|
270
269
|
unmountOnExit: !0,
|
|
271
|
-
children: (
|
|
270
|
+
children: (k)=>/* @__PURE__ */ e(P, {
|
|
272
271
|
children: /* @__PURE__ */ e("nav", {
|
|
273
|
-
className: p(
|
|
272
|
+
className: p(Ne, Be[k]),
|
|
274
273
|
style: {
|
|
275
|
-
boxShadow: E !== "closed" ? `6px 0 4px -4px rgba(0, 0, 0, ${
|
|
274
|
+
boxShadow: E !== "closed" ? `6px 0 4px -4px rgba(0, 0, 0, ${J})` : "none"
|
|
276
275
|
},
|
|
277
276
|
id: L,
|
|
278
277
|
onClick: ()=>{
|
|
279
278
|
V();
|
|
280
279
|
},
|
|
281
|
-
children: /* @__PURE__ */ e(
|
|
280
|
+
children: /* @__PURE__ */ e(B, {
|
|
282
281
|
children: /* @__PURE__ */ i(Ee, {
|
|
283
282
|
space: 16,
|
|
284
283
|
children: [
|
|
285
|
-
/* @__PURE__ */ e(
|
|
286
|
-
children: /* @__PURE__ */ e(
|
|
287
|
-
children: n.map((x,
|
|
284
|
+
/* @__PURE__ */ e(se, {
|
|
285
|
+
children: /* @__PURE__ */ e(ce, {
|
|
286
|
+
children: n.map((x, v)=>/* @__PURE__ */ e(le, _object_spread({}, x), v))
|
|
288
287
|
})
|
|
289
288
|
}),
|
|
290
289
|
c && /* @__PURE__ */ e(Le, {
|
|
@@ -303,16 +302,16 @@ const Ge = (param)=>{
|
|
|
303
302
|
}) : H;
|
|
304
303
|
}, vn = (param)=>{
|
|
305
304
|
let { onBack: n, title: o, titleAs: t, right: r, variant: a = "default", topFixed: s = !0, paddingX: c = 0, withBorder: d = !0 } = param;
|
|
306
|
-
const { texts: m, t: u } =
|
|
305
|
+
const { texts: m, t: u } = C(), g = /* @__PURE__ */ e(b, {
|
|
307
306
|
right: r,
|
|
308
307
|
children: /* @__PURE__ */ i(M, {
|
|
309
308
|
space: 24,
|
|
310
309
|
alignItems: "center",
|
|
311
310
|
children: [
|
|
312
|
-
n && /* @__PURE__ */ e(
|
|
311
|
+
n && /* @__PURE__ */ e(ie, {
|
|
313
312
|
"aria-label": m.backNavigationBar || u(Fe),
|
|
314
313
|
onPress: n,
|
|
315
|
-
Icon:
|
|
314
|
+
Icon: ae,
|
|
316
315
|
bleedLeft: !0,
|
|
317
316
|
bleedRight: !0
|
|
318
317
|
}),
|
|
@@ -325,7 +324,7 @@ const Ge = (param)=>{
|
|
|
325
324
|
]
|
|
326
325
|
})
|
|
327
326
|
});
|
|
328
|
-
return /* @__PURE__ */ i(
|
|
327
|
+
return /* @__PURE__ */ i(S, {
|
|
329
328
|
variant: a,
|
|
330
329
|
children: [
|
|
331
330
|
/* @__PURE__ */ e(O, {
|
|
@@ -335,31 +334,29 @@ const Ge = (param)=>{
|
|
|
335
334
|
dataAttributes: {
|
|
336
335
|
"component-name": "NavigationBar"
|
|
337
336
|
},
|
|
338
|
-
children: s ? /* @__PURE__ */ e(
|
|
337
|
+
children: s ? /* @__PURE__ */ e(B, {
|
|
339
338
|
children: g
|
|
340
339
|
}) : /* @__PURE__ */ e("div", {
|
|
341
|
-
className: J({
|
|
342
|
-
width: "100%"
|
|
343
|
-
}),
|
|
344
340
|
style: {
|
|
345
|
-
padding: `0 ${c}px
|
|
341
|
+
padding: `0 ${c}px`,
|
|
342
|
+
width: "100%"
|
|
346
343
|
},
|
|
347
344
|
children: g
|
|
348
345
|
})
|
|
349
346
|
}),
|
|
350
347
|
s && /* @__PURE__ */ e("div", {
|
|
351
|
-
className:
|
|
348
|
+
className: T
|
|
352
349
|
})
|
|
353
350
|
]
|
|
354
351
|
});
|
|
355
|
-
},
|
|
352
|
+
}, fn = (param)=>{
|
|
356
353
|
let { logo: n, right: o, variant: t = "default", topFixed: r = !0, withBorder: a = !0 } = param;
|
|
357
354
|
return n = n !== null && n !== void 0 ? n : /* @__PURE__ */ e(j, {
|
|
358
355
|
size: {
|
|
359
356
|
mobile: 40,
|
|
360
357
|
desktop: 48
|
|
361
358
|
}
|
|
362
|
-
}), /* @__PURE__ */ i(
|
|
359
|
+
}), /* @__PURE__ */ i(S, {
|
|
363
360
|
variant: t,
|
|
364
361
|
children: [
|
|
365
362
|
/* @__PURE__ */ e(O, {
|
|
@@ -369,10 +366,10 @@ const Ge = (param)=>{
|
|
|
369
366
|
dataAttributes: {
|
|
370
367
|
"component-name": "FunnelNavigationBar"
|
|
371
368
|
},
|
|
372
|
-
children: /* @__PURE__ */ e(
|
|
373
|
-
children: /* @__PURE__ */ e(
|
|
369
|
+
children: /* @__PURE__ */ e(B, {
|
|
370
|
+
children: /* @__PURE__ */ e(ue, {
|
|
374
371
|
template: "10",
|
|
375
|
-
children: /* @__PURE__ */ e(
|
|
372
|
+
children: /* @__PURE__ */ e(b, {
|
|
376
373
|
right: o,
|
|
377
374
|
children: n
|
|
378
375
|
})
|
|
@@ -380,11 +377,11 @@ const Ge = (param)=>{
|
|
|
380
377
|
})
|
|
381
378
|
}),
|
|
382
379
|
r && /* @__PURE__ */ e("div", {
|
|
383
|
-
className:
|
|
380
|
+
className: T
|
|
384
381
|
})
|
|
385
382
|
]
|
|
386
383
|
});
|
|
387
|
-
},
|
|
384
|
+
}, Nn = (param)=>{
|
|
388
385
|
let { children: n } = param;
|
|
389
386
|
return /* @__PURE__ */ e("div", {
|
|
390
387
|
className: $,
|
|
@@ -399,20 +396,16 @@ const Ge = (param)=>{
|
|
|
399
396
|
var { children: n } = _param, o = _object_without_properties(_param, [
|
|
400
397
|
"children"
|
|
401
398
|
]);
|
|
402
|
-
const t =
|
|
399
|
+
const t = de();
|
|
403
400
|
return /* @__PURE__ */ e(z, _object_spread_props(_object_spread({}, o), {
|
|
404
|
-
className: p(
|
|
405
|
-
border: "none",
|
|
406
|
-
background: "transparent",
|
|
407
|
-
padding: 0
|
|
408
|
-
}), $, W[t ? "inverse" : "default"]),
|
|
401
|
+
className: p(be, $, W[t ? "inverse" : "default"]),
|
|
409
402
|
dataAttributes: {
|
|
410
403
|
"component-name": "NavigationBarAction"
|
|
411
404
|
},
|
|
412
405
|
children: /* @__PURE__ */ e(M, {
|
|
413
406
|
space: 16,
|
|
414
407
|
alignItems: "center",
|
|
415
|
-
children: N.Children.map(n, (r)=>typeof r == "string" ? /* @__PURE__ */ e(
|
|
408
|
+
children: N.Children.map(n, (r)=>typeof r == "string" ? /* @__PURE__ */ e(ne, {
|
|
416
409
|
regular: !0,
|
|
417
410
|
color: "inherit",
|
|
418
411
|
children: r
|
|
@@ -420,4 +413,4 @@ const Ge = (param)=>{
|
|
|
420
413
|
})
|
|
421
414
|
}));
|
|
422
415
|
};
|
|
423
|
-
export {
|
|
416
|
+
export { fn as FunnelNavigationBar, hn as MainNavigationBar, vn as NavigationBar, Bn as NavigationBarAction, Nn as NavigationBarActionGroup };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o = "16.
|
|
1
|
+
const o = "16.2.0";
|
|
2
2
|
export { o as PACKAGE_VERSION };
|
|
@@ -78,83 +78,57 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
78
78
|
}
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
|
-
import { jsx as
|
|
82
|
-
import * as
|
|
83
|
-
import { useRifm as
|
|
84
|
-
import {
|
|
81
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
82
|
+
import * as p from "react";
|
|
83
|
+
import { useRifm as x } from "rifm";
|
|
84
|
+
import { getRegionCodeForCountryCode as T, formatToE164 as A, parse as k, formatAsYouType as B } from "@telefonica/libphonenumber";
|
|
85
|
+
import { useFieldProps as E } from "./form-context.js";
|
|
85
86
|
import { TextFieldBaseAutosuggest as S } from "./text-field-base.js";
|
|
86
|
-
import { useTheme as
|
|
87
|
-
import { createChangeEvent as
|
|
88
|
-
import { combineRefs as
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var { inputRef: o, value: c, defaultValue: R, onChange: m, prefix: s, e164: E, format: l } = _param, y = _object_without_properties(_param, [
|
|
87
|
+
import { useTheme as N } from "./hooks.js";
|
|
88
|
+
import { createChangeEvent as Z } from "./utils/dom.js";
|
|
89
|
+
import { combineRefs as $ } from "./utils/common.js";
|
|
90
|
+
const F = (r, n)=>B(n.replace(/[^\d+*#]/g, ""), r), j = (r)=>!!r.match(/^\+\d+$/), I = (_param)=>{
|
|
91
|
+
var { inputRef: r, value: n, defaultValue: f, onChange: s, prefix: o, e164: R } = _param, d = _object_without_properties(_param, [
|
|
92
92
|
"inputRef",
|
|
93
93
|
"value",
|
|
94
94
|
"defaultValue",
|
|
95
95
|
"onChange",
|
|
96
96
|
"prefix",
|
|
97
|
-
"e164"
|
|
98
|
-
"format"
|
|
99
|
-
]);
|
|
100
|
-
const [N, P] = n.useState(R !== null && R !== void 0 ? R : ""), p = n.useRef(null), { i18n: V } = T(), i = n.useRef(l || D), [d, b] = n.useState(!1), u = V.phoneNumberFormattingRegionCode, h = typeof c < "u", x = h ? c : N, a = n.useRef(m);
|
|
101
|
-
n.useEffect(()=>{
|
|
102
|
-
a.current = m;
|
|
103
|
-
}, [
|
|
104
|
-
m
|
|
105
|
-
]), n.useEffect(()=>{
|
|
106
|
-
l ? i.current = l : import("@telefonica/libphonenumber").then((e)=>{
|
|
107
|
-
f = e, i.current = I, b(!0);
|
|
108
|
-
});
|
|
109
|
-
}, [
|
|
110
|
-
l
|
|
97
|
+
"e164"
|
|
111
98
|
]);
|
|
112
|
-
const g = n.useCallback((e)=>{
|
|
113
|
-
|
|
114
|
-
h || P(e), p.current && ((t = a.current) == null || t.call(a, k(p.current, e)));
|
|
99
|
+
const [g, h] = p.useState(f !== null && f !== void 0 ? f : ""), c = p.useRef(null), { i18n: C } = N(), i = C.phoneNumberFormattingRegionCode, l = typeof n < "u", P = l ? n : g, u = p.useCallback((e)=>{
|
|
100
|
+
l || h(e), c.current && (s == null || s(Z(c.current, e)));
|
|
115
101
|
}, [
|
|
116
|
-
|
|
117
|
-
|
|
102
|
+
l,
|
|
103
|
+
s
|
|
104
|
+
]), b = p.useCallback(// The final replacement of "-" to "@" is to workaround a bug in rifm library
|
|
118
105
|
// otherwise the cursor position is incorrectly positioned
|
|
119
106
|
// also note the "@" is replaced back to "-" in `replace` param in `useRifm`
|
|
120
107
|
(e)=>{
|
|
121
108
|
let t = "";
|
|
122
|
-
if (
|
|
123
|
-
const
|
|
124
|
-
t = i
|
|
125
|
-
} else t = i
|
|
109
|
+
if (o && j(o)) {
|
|
110
|
+
const a = o + e;
|
|
111
|
+
t = F(i, a), t.startsWith(o) ? t = t.slice(o.length).trim() : t = F(i, e);
|
|
112
|
+
} else t = F(i, e);
|
|
126
113
|
return t.replace(/-/g, "@");
|
|
127
114
|
}, [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
]),
|
|
131
|
-
format:
|
|
132
|
-
value:
|
|
133
|
-
|
|
134
|
-
// When the formatter changes (libphonenumber is lazy loaded), rifm should call `onChange`
|
|
135
|
-
// with the new formatted value but it doesn't, so we need to call it manually.
|
|
136
|
-
onChange: ()=>{},
|
|
115
|
+
i,
|
|
116
|
+
o
|
|
117
|
+
]), y = x({
|
|
118
|
+
format: b,
|
|
119
|
+
value: P,
|
|
120
|
+
onChange: u,
|
|
137
121
|
accept: /[\d\-+#*]+/g,
|
|
138
122
|
replace: (e)=>e.replace(/@/g, "-")
|
|
139
123
|
});
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
r.value,
|
|
144
|
-
g
|
|
145
|
-
]), /* @__PURE__ */ L("input", _object_spread_props(_object_spread({}, y), {
|
|
146
|
-
value: r.value,
|
|
147
|
-
onChange: r.onChange,
|
|
124
|
+
return /* @__PURE__ */ V("input", _object_spread_props(_object_spread({}, d), {
|
|
125
|
+
value: y.value,
|
|
126
|
+
onChange: y.onChange,
|
|
148
127
|
type: "tel",
|
|
149
|
-
ref:
|
|
150
|
-
"data-using-libphonenumber": d
|
|
128
|
+
ref: $(r, c)
|
|
151
129
|
}));
|
|
152
|
-
},
|
|
153
|
-
var { disabled:
|
|
154
|
-
* By default this component will use google's libphonenumber library to format numbers.
|
|
155
|
-
* The component will load libphonenumber on demand, so it won't impact the initial load time.
|
|
156
|
-
* You can opt-out of using libphonenumber by providing a custom formatter.
|
|
157
|
-
*/ format: d, /** enabling e164 is incompatible with custom formatters because this requires libphonenumber */ e164: b } = _param, u = _object_without_properties(_param, [
|
|
130
|
+
}, W = (_param)=>{
|
|
131
|
+
var { disabled: r, error: n, helperText: f, name: s, label: o, optional: R, validate: d, onChange: g, onChangeValue: h, onBlur: c, value: C, defaultValue: i, e164: l, dataAttributes: P } = _param, u = _object_without_properties(_param, [
|
|
158
132
|
"disabled",
|
|
159
133
|
"error",
|
|
160
134
|
"helperText",
|
|
@@ -167,47 +141,43 @@ const D = (o)=>o, I = (o, c)=>f.formatAsYouType(o.replace(/[^\d+*#]/g, ""), c),
|
|
|
167
141
|
"onBlur",
|
|
168
142
|
"value",
|
|
169
143
|
"defaultValue",
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"e164"
|
|
144
|
+
"e164",
|
|
145
|
+
"dataAttributes"
|
|
173
146
|
]);
|
|
174
|
-
const { i18n:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
processValue: (g)=>{
|
|
182
|
-
if (b && f && !d) try {
|
|
147
|
+
const { i18n: b } = N(), e = E({
|
|
148
|
+
name: s,
|
|
149
|
+
label: o,
|
|
150
|
+
value: C,
|
|
151
|
+
defaultValue: i,
|
|
152
|
+
processValue: (t)=>{
|
|
153
|
+
if (l) try {
|
|
183
154
|
var _u_prefix;
|
|
184
|
-
const
|
|
185
|
-
let
|
|
186
|
-
return (!
|
|
155
|
+
const a = ((_u_prefix = u.prefix) !== null && _u_prefix !== void 0 ? _u_prefix : "").replace(/[^\d]/g, "");
|
|
156
|
+
let m = T(a);
|
|
157
|
+
return (!m || m === "ZZ") && (m = b.phoneNumberFormattingRegionCode), A(k(t, m));
|
|
187
158
|
} catch (e) {
|
|
188
159
|
return "";
|
|
189
160
|
}
|
|
190
|
-
else return
|
|
161
|
+
else return t.replace(/[^\d]/g, "");
|
|
191
162
|
},
|
|
192
|
-
helperText:
|
|
193
|
-
optional:
|
|
194
|
-
error:
|
|
195
|
-
disabled:
|
|
196
|
-
onBlur:
|
|
197
|
-
validate:
|
|
198
|
-
onChange:
|
|
199
|
-
onChangeValue:
|
|
163
|
+
helperText: f,
|
|
164
|
+
optional: R,
|
|
165
|
+
error: n,
|
|
166
|
+
disabled: r,
|
|
167
|
+
onBlur: c,
|
|
168
|
+
validate: d,
|
|
169
|
+
onChange: g,
|
|
170
|
+
onChangeValue: h
|
|
200
171
|
});
|
|
201
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ V(S, _object_spread_props(_object_spread({}, u, e), {
|
|
202
173
|
type: "phone",
|
|
203
174
|
inputProps: {
|
|
204
|
-
prefix: u.prefix
|
|
205
|
-
format: d
|
|
175
|
+
prefix: u.prefix
|
|
206
176
|
},
|
|
207
|
-
inputComponent:
|
|
177
|
+
inputComponent: I,
|
|
208
178
|
dataAttributes: _object_spread({
|
|
209
179
|
"component-name": "PhoneNumberField"
|
|
210
|
-
},
|
|
180
|
+
}, P)
|
|
211
181
|
}));
|
|
212
|
-
},
|
|
213
|
-
export {
|
|
182
|
+
}, K = W;
|
|
183
|
+
export { K as default };
|
package/dist-es/popover.js
CHANGED
|
@@ -55,16 +55,15 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
55
55
|
return target;
|
|
56
56
|
}
|
|
57
57
|
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
58
|
-
import { BaseTooltip as
|
|
58
|
+
import { BaseTooltip as f } from "./tooltip.js";
|
|
59
59
|
import h from "./inline.js";
|
|
60
60
|
import u from "./stack.js";
|
|
61
61
|
import { Text3 as x, Text2 as v } from "./text.js";
|
|
62
|
-
import g from "./
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var { open: a, extra: m, children: c, onClose: i = ()=>{}, closeButtonLabel: l, dataAttributes: p, trackingEvent: s, title: o, description: e, asset: n } = _param, f = _object_without_properties(_param, [
|
|
62
|
+
import { content as g } from "./popover.css-mistica.js";
|
|
63
|
+
import { vars as y } from "./skins/skin-contract.css-mistica.js";
|
|
64
|
+
import { iconContainerSize as P } from "./icon-button.css-mistica.js";
|
|
65
|
+
const S = (_param)=>{
|
|
66
|
+
var { open: a, extra: c, children: i, onClose: l = ()=>{}, closeButtonLabel: m, dataAttributes: p, trackingEvent: s, title: o, description: e, asset: n } = _param, d = _object_without_properties(_param, [
|
|
68
67
|
"open",
|
|
69
68
|
"extra",
|
|
70
69
|
"children",
|
|
@@ -76,13 +75,13 @@ const T = (_param)=>{
|
|
|
76
75
|
"description",
|
|
77
76
|
"asset"
|
|
78
77
|
]);
|
|
79
|
-
return /* @__PURE__ */ r(
|
|
80
|
-
content: /* @__PURE__ */ t(
|
|
81
|
-
className:
|
|
78
|
+
return /* @__PURE__ */ r(f, _object_spread({
|
|
79
|
+
content: /* @__PURE__ */ t("div", {
|
|
80
|
+
className: g,
|
|
82
81
|
children: [
|
|
83
82
|
(o || e || n) && /* @__PURE__ */ r("div", {
|
|
84
83
|
style: {
|
|
85
|
-
paddingRight: `calc((${
|
|
84
|
+
paddingRight: `calc((${P.small} - 8px)`
|
|
86
85
|
},
|
|
87
86
|
children: /* @__PURE__ */ t(h, {
|
|
88
87
|
space: 16,
|
|
@@ -97,7 +96,7 @@ const T = (_param)=>{
|
|
|
97
96
|
}),
|
|
98
97
|
e && /* @__PURE__ */ r(v, {
|
|
99
98
|
regular: !0,
|
|
100
|
-
color:
|
|
99
|
+
color: y.colors.textSecondary,
|
|
101
100
|
children: e
|
|
102
101
|
})
|
|
103
102
|
]
|
|
@@ -105,19 +104,19 @@ const T = (_param)=>{
|
|
|
105
104
|
]
|
|
106
105
|
})
|
|
107
106
|
}),
|
|
108
|
-
|
|
107
|
+
c !== null && c !== void 0 ? c : i
|
|
109
108
|
]
|
|
110
109
|
}),
|
|
111
110
|
centerContent: !1,
|
|
112
111
|
open: a,
|
|
113
112
|
hasPointerInteractionOnly: !0,
|
|
114
113
|
delay: !1,
|
|
115
|
-
onClose:
|
|
116
|
-
closeButtonLabel:
|
|
114
|
+
onClose: l,
|
|
115
|
+
closeButtonLabel: m,
|
|
117
116
|
trackingEvent: s,
|
|
118
117
|
dataAttributes: _object_spread({
|
|
119
118
|
"component-name": "Popover"
|
|
120
119
|
}, p)
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
export {
|
|
120
|
+
}, d));
|
|
121
|
+
}, A = S;
|
|
122
|
+
export { A as default };
|