@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.
Files changed (148) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +12 -9
  3. package/dist/accordion.css.d.ts +1 -0
  4. package/dist/accordion.js +36 -39
  5. package/dist/align.css-mistica.js +12 -0
  6. package/dist/align.css.d.ts +1 -0
  7. package/dist/align.css.ts.vanilla.css-mistica.js +11 -0
  8. package/dist/align.d.ts +12 -0
  9. package/dist/align.js +79 -0
  10. package/dist/box.css-mistica.js +41 -0
  11. package/dist/box.css.d.ts +23 -0
  12. package/dist/box.css.ts.vanilla.css-mistica.js +11 -0
  13. package/dist/box.d.ts +4 -0
  14. package/dist/box.js +39 -31
  15. package/dist/boxed.css-mistica.js +10 -5
  16. package/dist/boxed.css.d.ts +3 -0
  17. package/dist/boxed.js +20 -24
  18. package/dist/callout.css-mistica.js +12 -4
  19. package/dist/callout.css.d.ts +1 -0
  20. package/dist/callout.js +14 -22
  21. package/dist/card.css-mistica.js +26 -23
  22. package/dist/card.css.d.ts +1 -0
  23. package/dist/card.js +17 -23
  24. package/dist/community/advanced-data-card.css-mistica.js +32 -23
  25. package/dist/community/advanced-data-card.css.d.ts +3 -0
  26. package/dist/community/advanced-data-card.js +46 -55
  27. package/dist/empty-state.css-mistica.js +11 -8
  28. package/dist/empty-state.css.d.ts +1 -0
  29. package/dist/empty-state.js +10 -13
  30. package/dist/form.css-mistica.js +12 -0
  31. package/dist/form.css.d.ts +1 -0
  32. package/dist/form.js +8 -10
  33. package/dist/grid.css-mistica.js +143 -126
  34. package/dist/grid.css.d.ts +13 -0
  35. package/dist/grid.js +35 -38
  36. package/dist/hero.css-mistica.js +14 -8
  37. package/dist/hero.css.d.ts +2 -0
  38. package/dist/hero.js +17 -25
  39. package/dist/image.js +23 -25
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.js +4 -0
  42. package/dist/inline.js +10 -11
  43. package/dist/list.css-mistica.js +12 -9
  44. package/dist/list.css.d.ts +1 -0
  45. package/dist/list.js +43 -46
  46. package/dist/loading-screen.js +16 -16
  47. package/dist/logo-blau.d.ts +1 -1
  48. package/dist/logo-blau.js +10 -10
  49. package/dist/logo-common.d.ts +1 -0
  50. package/dist/logo-movistar.d.ts +1 -1
  51. package/dist/logo-movistar.js +4 -4
  52. package/dist/logo-o2-new.d.ts +1 -1
  53. package/dist/logo-o2-new.js +5 -5
  54. package/dist/logo-o2.d.ts +1 -1
  55. package/dist/logo-o2.js +5 -5
  56. package/dist/logo-telefonica.d.ts +1 -1
  57. package/dist/logo-telefonica.js +4 -4
  58. package/dist/logo-tu.d.ts +1 -1
  59. package/dist/logo-tu.js +5 -5
  60. package/dist/logo-vivo.d.ts +1 -1
  61. package/dist/logo-vivo.js +7 -7
  62. package/dist/logo.d.ts +9 -8
  63. package/dist/logo.js +125 -102
  64. package/dist/navigation-bar.css-mistica.js +23 -20
  65. package/dist/navigation-bar.css.d.ts +1 -0
  66. package/dist/navigation-bar.js +30 -37
  67. package/dist/package-version.js +1 -1
  68. package/dist/phone-number-field.d.ts +1 -4
  69. package/dist/phone-number-field.js +52 -82
  70. package/dist/popover.d.ts +1 -0
  71. package/dist/popover.js +9 -10
  72. package/dist/sheet-common.css-mistica.js +5 -5
  73. package/dist/skeleton-base.js +10 -12
  74. package/dist/skeletons.css-mistica.js +11 -5
  75. package/dist/skeletons.css.d.ts +1 -0
  76. package/dist/snackbar.css-mistica.js +20 -14
  77. package/dist/snackbar.css.d.ts +3 -1
  78. package/dist/snackbar.js +65 -75
  79. package/dist/tag.css-mistica.js +15 -4
  80. package/dist/tag.css.d.ts +2 -0
  81. package/dist/tag.js +20 -24
  82. package/dist/text-field-base.d.ts +1 -1
  83. package/dist/text-field-components.css-mistica.js +16 -10
  84. package/dist/text-field-components.css.d.ts +1 -0
  85. package/dist/text-field-components.js +32 -35
  86. package/dist/timer.js +42 -43
  87. package/dist/tooltip.d.ts +3 -1
  88. package/dist/tooltip.js +106 -106
  89. package/dist/touchable.js +47 -42
  90. package/dist-es/accordion.css-mistica.js +3 -3
  91. package/dist-es/accordion.js +58 -61
  92. package/dist-es/align.css-mistica.js +3 -0
  93. package/dist-es/align.css.ts.vanilla.css-mistica.js +2 -0
  94. package/dist-es/align.js +70 -0
  95. package/dist-es/box.css-mistica.js +24 -0
  96. package/dist-es/box.css.ts.vanilla.css-mistica.js +2 -0
  97. package/dist-es/box.js +43 -35
  98. package/dist-es/boxed.css-mistica.js +5 -3
  99. package/dist-es/boxed.js +28 -32
  100. package/dist-es/callout.css-mistica.js +7 -2
  101. package/dist-es/callout.js +44 -52
  102. package/dist-es/card.css-mistica.js +4 -4
  103. package/dist-es/card.js +11 -17
  104. package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
  105. package/dist-es/community/advanced-data-card.js +90 -99
  106. package/dist-es/empty-state.css-mistica.js +3 -3
  107. package/dist-es/empty-state.js +19 -22
  108. package/dist-es/form.css-mistica.js +3 -0
  109. package/dist-es/form.js +12 -14
  110. package/dist-es/grid.css-mistica.js +123 -112
  111. package/dist-es/grid.js +38 -41
  112. package/dist-es/hero.css-mistica.js +2 -2
  113. package/dist-es/hero.js +36 -44
  114. package/dist-es/image.js +28 -30
  115. package/dist-es/index.js +1844 -1843
  116. package/dist-es/inline.js +19 -20
  117. package/dist-es/list.css-mistica.js +2 -2
  118. package/dist-es/list.js +75 -78
  119. package/dist-es/loading-screen.js +30 -30
  120. package/dist-es/logo-blau.js +11 -11
  121. package/dist-es/logo-movistar.js +5 -5
  122. package/dist-es/logo-o2-new.js +8 -8
  123. package/dist-es/logo-o2.js +8 -8
  124. package/dist-es/logo-telefonica.js +4 -4
  125. package/dist-es/logo-tu.js +8 -8
  126. package/dist-es/logo-vivo.js +16 -16
  127. package/dist-es/logo.js +132 -109
  128. package/dist-es/navigation-bar.css-mistica.js +11 -11
  129. package/dist-es/navigation-bar.js +80 -87
  130. package/dist-es/package-version.js +1 -1
  131. package/dist-es/phone-number-field.js +59 -89
  132. package/dist-es/popover.js +17 -18
  133. package/dist-es/sheet-common.css-mistica.js +2 -2
  134. package/dist-es/skeleton-base.js +15 -17
  135. package/dist-es/skeletons.css-mistica.js +5 -2
  136. package/dist-es/snackbar.css-mistica.js +4 -4
  137. package/dist-es/snackbar.js +93 -103
  138. package/dist-es/style.css +1 -1
  139. package/dist-es/tag.css-mistica.js +2 -2
  140. package/dist-es/tag.js +34 -38
  141. package/dist-es/text-field-components.css-mistica.js +5 -2
  142. package/dist-es/text-field-components.js +48 -51
  143. package/dist-es/timer.js +80 -81
  144. package/dist-es/tooltip.js +148 -148
  145. package/dist-es/touchable.js +55 -50
  146. package/package.json +1 -1
  147. package/dist/sprinkles.css-mistica.js +0 -2494
  148. 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 Z } from "react";
84
- import { Transition as ee } from "react-transition-group";
83
+ import { createElement as Y } from "react";
84
+ import { Transition as Z } from "react-transition-group";
85
85
  import p from "classnames";
86
- import b from "./responsive-layout.js";
86
+ import B from "./responsive-layout.js";
87
87
  import M from "./inline.js";
88
- import ne, { BaseTouchable as z } from "./touchable.js";
89
- import { Text3 as U, Text2 as re } from "./text.js";
90
- import { useTheme as S, useScreenSize as te } from "./hooks.js";
91
- import oe from "./generated/mistica-icons/icon-menu-regular.js";
92
- import ae from "./generated/mistica-icons/icon-close-regular.js";
93
- import ie from "./generated/mistica-icons/icon-chevron-left-regular.js";
94
- import { IconButton as se } from "./icon-button.js";
95
- import ce from "./negative-box.js";
96
- import { RowList as le, Row as de } from "./list.js";
97
- import { ThemeVariant as T, useIsInverseOrMediaVariant as me } from "./theme-variant-context.js";
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 ue } from "./portal.js";
100
- import pe from "./grid-layout.js";
101
- import { useSetModalState as ge } from "./modal-context-provider.js";
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 v } from "./skins/skin-contract.css-mistica.js";
104
- import { mainNavbarContent as he, burgerMenuButton as fe, logoContainer as ve, spacerLarge as Ne, spacer as A, burgerMenu as be, burgerMenuTransition as Be, lineHeightFix as $, textWrapperVariants as W, burgerIconContainer as Me, iconCloseOpen as ke, iconCloseHidden as Ie, iconMenuHidden as xe, iconMenuOpen as Ce, topFixed as Se, navigationBarContent as Te, desktopOnly as q, navigationBarContentRight as Ae, section as Oe, selectedSectionVariantes as Re, navbarBorderColorVariants as C } from "./navigation-bar.css-mistica.js";
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 ? ke : Ie,
120
- children: /* @__PURE__ */ e(ae, {})
118
+ className: n ? Ie : ke,
119
+ children: /* @__PURE__ */ e(oe, {})
121
120
  }),
122
121
  /* @__PURE__ */ e("div", {
123
- className: n ? xe : Ce,
124
- children: /* @__PURE__ */ e(oe, {})
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 } = S(), d = ()=>a === "inverse" && !c || !t ? C.noBorder : r ? C.menuOpen : C.default, m = {
131
- default: v.colors.background,
132
- inverse: v.colors.navigationBarBackground,
133
- alternative: v.colors.backgroundAlternative,
134
- media: v.colors.navigationBarBackground
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
- [Se]: o
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
- }, B = (param)=>{
145
+ }, b = (param)=>{
147
146
  let { right: n, children: o, desktopOnly: t } = param;
148
147
  return /* @__PURE__ */ i("div", {
149
- className: p(Te, {
148
+ className: p(Se, {
150
149
  [q]: t
151
150
  }),
152
151
  children: [
153
152
  o,
154
153
  n && /* @__PURE__ */ e("div", {
155
- className: Ae,
154
+ className: Te,
156
155
  children: n
157
156
  })
158
157
  ]
159
158
  });
160
- }, fn = (param)=>{
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 } = S(), [l, y] = N.useState(!1), [E, h] = N.useState("closed"), L = N.useId(), K = g ? 1 : 0.2, { isTabletOrSmaller: Q } = te(), w = ge(), X = d || /* @__PURE__ */ e(j, {
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, f)=>{
172
- var { title: I } = _param, x = _object_without_properties(_param, [
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__*/ Z(z, _object_spread_props(_object_spread({}, x), {
176
- key: f,
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"]]: f === o
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: I
182
+ children: k
184
183
  }));
185
184
  })
186
185
  })
187
- }), k = m && n.length > 0, Y = ()=>{
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(T, {
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(b, {
205
+ children: /* @__PURE__ */ i(B, {
207
206
  children: [
208
- /* @__PURE__ */ e(B, {
207
+ /* @__PURE__ */ e(b, {
209
208
  right: t,
210
209
  children: /* @__PURE__ */ i("div", {
211
- className: he,
210
+ className: ge,
212
211
  children: [
213
- G && /* @__PURE__ */ e(ne, {
214
- className: fe,
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 : Y,
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: X
225
+ children: Q
227
226
  }),
228
- !k && D()
227
+ !I && D()
229
228
  ]
230
229
  })
231
230
  }),
232
- k && /* @__PURE__ */ e(B, {
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: k ? Ne : A
239
+ className: I ? fe : T
241
240
  })
242
241
  ]
243
242
  });
244
- return Q ? /* @__PURE__ */ i(P, {
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(ue, {
250
+ G && /* @__PURE__ */ e(me, {
252
251
  children: /* @__PURE__ */ e(_, {
253
252
  disabled: F,
254
253
  group: "burger-menu-lock",
255
- children: /* @__PURE__ */ e(ee, {
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: (I)=>/* @__PURE__ */ e(P, {
270
+ children: (k)=>/* @__PURE__ */ e(P, {
272
271
  children: /* @__PURE__ */ e("nav", {
273
- className: p(be, Be[I]),
272
+ className: p(Ne, Be[k]),
274
273
  style: {
275
- boxShadow: E !== "closed" ? `6px 0 4px -4px rgba(0, 0, 0, ${K})` : "none"
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(b, {
280
+ children: /* @__PURE__ */ e(B, {
282
281
  children: /* @__PURE__ */ i(Ee, {
283
282
  space: 16,
284
283
  children: [
285
- /* @__PURE__ */ e(ce, {
286
- children: /* @__PURE__ */ e(le, {
287
- children: n.map((x, f)=>/* @__PURE__ */ e(de, _object_spread({}, x), f))
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 } = S(), g = /* @__PURE__ */ e(B, {
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(se, {
311
+ n && /* @__PURE__ */ e(ie, {
313
312
  "aria-label": m.backNavigationBar || u(Fe),
314
313
  onPress: n,
315
- Icon: ie,
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(T, {
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(b, {
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: A
348
+ className: T
352
349
  })
353
350
  ]
354
351
  });
355
- }, Nn = (param)=>{
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(T, {
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(b, {
373
- children: /* @__PURE__ */ e(pe, {
369
+ children: /* @__PURE__ */ e(B, {
370
+ children: /* @__PURE__ */ e(ue, {
374
371
  template: "10",
375
- children: /* @__PURE__ */ e(B, {
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: A
380
+ className: T
384
381
  })
385
382
  ]
386
383
  });
387
- }, bn = (param)=>{
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 = me();
399
+ const t = de();
403
400
  return /* @__PURE__ */ e(z, _object_spread_props(_object_spread({}, o), {
404
- className: p(J({
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(re, {
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 { Nn as FunnelNavigationBar, fn as MainNavigationBar, vn as NavigationBar, Bn as NavigationBarAction, bn as NavigationBarActionGroup };
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.0";
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 L } from "react/jsx-runtime";
82
- import * as n from "react";
83
- import { useRifm as A } from "rifm";
84
- import { useFieldProps as F } from "./form-context.js";
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 T } from "./hooks.js";
87
- import { createChangeEvent as k } from "./utils/dom.js";
88
- import { combineRefs as B } from "./utils/common.js";
89
- let f;
90
- const D = (o)=>o, I = (o, c)=>f.formatAsYouType(o.replace(/[^\d+*#]/g, ""), c), Z = (o)=>!!o.match(/^\+\d+$/), $ = (_param)=>{
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
- var t;
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
- h
117
- ]), C = n.useCallback(// The final replacement of "-" to "@" is to workaround a bug in rifm library
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 (s && Z(s)) {
123
- const v = s + e;
124
- t = i.current(v, u), t.startsWith(s) ? t = t.slice(s.length).trim() : t = i.current(e, u);
125
- } else t = i.current(e, u);
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
- u,
129
- s
130
- ]), r = A({
131
- format: C,
132
- value: x,
133
- // Instead of calling `handleChangeValue` here, we call it in `useEffect` below.
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 n.useEffect(()=>{
141
- g(r.value);
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: B(o, p),
150
- "data-using-libphonenumber": d
128
+ ref: $(r, c)
151
129
  }));
152
- }, j = (_param)=>{
153
- var { disabled: o, error: c, helperText: R, name: m, label: s, optional: E, validate: l, onChange: y, onChangeValue: N, onBlur: P, value: p, defaultValue: V, dataAttributes: i, /**
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
- "dataAttributes",
171
- "format",
172
- "e164"
144
+ "e164",
145
+ "dataAttributes"
173
146
  ]);
174
- const { i18n: h } = T();
175
- process.env.NODE_ENV !== "production" && b && d && console.error("[PhoneNumberField] enabling e164 is incompatible with custom formatters");
176
- const a = F({
177
- name: m,
178
- label: s,
179
- value: p,
180
- defaultValue: V,
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 C = ((_u_prefix = u.prefix) !== null && _u_prefix !== void 0 ? _u_prefix : "").replace(/[^\d]/g, "");
185
- let r = f.getRegionCodeForCountryCode(C);
186
- return (!r || r === "ZZ") && (r = h.phoneNumberFormattingRegionCode), f.formatToE164(f.parse(g, r));
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 g.replace(/[^\d]/g, "");
161
+ else return t.replace(/[^\d]/g, "");
191
162
  },
192
- helperText: R,
193
- optional: E,
194
- error: c,
195
- disabled: o,
196
- onBlur: P,
197
- validate: l,
198
- onChange: y,
199
- onChangeValue: N
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__ */ L(S, _object_spread_props(_object_spread({}, u, a), {
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
- }, i)
180
+ }, P)
211
181
  }));
212
- }, z = j;
213
- export { z as default };
182
+ }, K = W;
183
+ export { K as default };
@@ -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 d } from "./tooltip.js";
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 "./box.js";
63
- import { content as y } from "./popover.css-mistica.js";
64
- import { vars as P } from "./skins/skin-contract.css-mistica.js";
65
- import { iconContainerSize as S } from "./icon-button.css-mistica.js";
66
- const T = (_param)=>{
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(d, _object_spread({
80
- content: /* @__PURE__ */ t(g, {
81
- className: y,
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((${S.small} - 8px)`
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: P.colors.textSecondary,
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
- m !== null && m !== void 0 ? m : c
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: i,
116
- closeButtonLabel: l,
114
+ onClose: l,
115
+ closeButtonLabel: m,
117
116
  trackingEvent: s,
118
117
  dataAttributes: _object_spread({
119
118
  "component-name": "Popover"
120
119
  }, p)
121
- }, f));
122
- }, N = T;
123
- export { N as default };
120
+ }, d));
121
+ }, A = S;
122
+ export { A as default };