@telefonica/mistica 14.40.0 → 14.42.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 (259) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +7 -7
  3. package/dist/avatar.css-mistica.js +1 -1
  4. package/dist/badge.css-mistica.js +3 -3
  5. package/dist/boxed.css-mistica.js +14 -5
  6. package/dist/boxed.css.d.ts +1 -0
  7. package/dist/boxed.d.ts +1 -0
  8. package/dist/boxed.js +11 -9
  9. package/dist/button-fixed-footer-layout.d.ts +1 -0
  10. package/dist/button-fixed-footer-layout.js +19 -14
  11. package/dist/button-group.css-mistica.js +1 -1
  12. package/dist/button-layout.css-mistica.js +17 -14
  13. package/dist/button-layout.css.d.ts +1 -0
  14. package/dist/button-layout.js +15 -15
  15. package/dist/button.css-mistica.js +30 -30
  16. package/dist/button.js +43 -35
  17. package/dist/callout.css-mistica.js +1 -1
  18. package/dist/card.css-mistica.js +15 -15
  19. package/dist/carousel.css-mistica.js +20 -20
  20. package/dist/carousel.d.ts +13 -0
  21. package/dist/carousel.js +325 -223
  22. package/dist/checkbox.css-mistica.js +10 -10
  23. package/dist/chip.css-mistica.js +4 -4
  24. package/dist/circle.css-mistica.js +2 -2
  25. package/dist/community/advanced-data-card.css-mistica.js +14 -14
  26. package/dist/community/blocks.css-mistica.js +3 -3
  27. package/dist/counter.css-mistica.js +7 -7
  28. package/dist/credit-card-expiration-field.js +30 -26
  29. package/dist/credit-card-number-field.css-mistica.js +7 -7
  30. package/dist/credit-card-number-field.js +59 -45
  31. package/dist/cvv-field.js +46 -41
  32. package/dist/date-field.css-mistica.js +14 -0
  33. package/dist/date-field.css.d.ts +1 -0
  34. package/dist/date-field.css.ts.vanilla.css-mistica.js +11 -0
  35. package/dist/date-field.js +41 -35
  36. package/dist/date-time-field.js +40 -34
  37. package/dist/date-time-picker.js +43 -45
  38. package/dist/decimal-field.js +26 -22
  39. package/dist/dialog-context.d.ts +24 -0
  40. package/dist/dialog-context.js +192 -0
  41. package/dist/dialog.css-mistica.js +17 -14
  42. package/dist/dialog.css.d.ts +1 -0
  43. package/dist/dialog.d.ts +14 -44
  44. package/dist/dialog.js +161 -245
  45. package/dist/double-field.css-mistica.js +5 -4
  46. package/dist/email-field.js +15 -11
  47. package/dist/empty-state-card.css-mistica.js +1 -1
  48. package/dist/empty-state.css-mistica.js +4 -4
  49. package/dist/feedback.css-mistica.js +17 -14
  50. package/dist/feedback.css.d.ts +5 -4
  51. package/dist/feedback.js +154 -147
  52. package/dist/fixed-footer-layout.css-mistica.js +2 -2
  53. package/dist/fixed-footer-layout.js +9 -8
  54. package/dist/header.css-mistica.js +3 -3
  55. package/dist/hero.css-mistica.js +4 -4
  56. package/dist/highlighted-card.css-mistica.js +7 -7
  57. package/dist/hooks.js +61 -52
  58. package/dist/horizontal-scroll.css-mistica.js +2 -2
  59. package/dist/iban-field.js +31 -27
  60. package/dist/icon-button.css-mistica.js +1 -1
  61. package/dist/icons/icon-amex.d.ts +1 -1
  62. package/dist/icons/icon-cvv-amex.d.ts +1 -1
  63. package/dist/icons/icon-cvv-visa-mc.d.ts +1 -1
  64. package/dist/icons/icon-mastercard.d.ts +1 -1
  65. package/dist/icons/icon-visa.d.ts +1 -1
  66. package/dist/image.css-mistica.js +3 -3
  67. package/dist/index.d.ts +2 -2
  68. package/dist/index.js +16 -4
  69. package/dist/inline.css-mistica.js +9 -6
  70. package/dist/inline.css.d.ts +1 -1
  71. package/dist/inline.js +9 -9
  72. package/dist/integer-field.js +17 -13
  73. package/dist/list.css-mistica.js +15 -15
  74. package/dist/loading-bar.css-mistica.js +4 -7
  75. package/dist/loading-bar.css.d.ts +0 -2
  76. package/dist/loading-bar.js +3 -6
  77. package/dist/loading-screen.css-mistica.js +6 -6
  78. package/dist/maybe-dismissable.css-mistica.js +1 -1
  79. package/dist/menu.css-mistica.js +3 -3
  80. package/dist/month-field.js +39 -33
  81. package/dist/navigation-bar.css-mistica.js +22 -22
  82. package/dist/navigation-breadcrumbs.css-mistica.js +5 -5
  83. package/dist/package-version.js +1 -1
  84. package/dist/password-field.js +46 -44
  85. package/dist/phone-number-field.js +50 -46
  86. package/dist/pin-field.css-mistica.js +12 -6
  87. package/dist/pin-field.css.d.ts +2 -0
  88. package/dist/pin-field.d.ts +3 -1
  89. package/dist/pin-field.js +129 -95
  90. package/dist/popover.css-mistica.js +5 -5
  91. package/dist/progress-bar.css-mistica.js +4 -4
  92. package/dist/radio-button.css-mistica.js +8 -8
  93. package/dist/responsive-layout.css-mistica.js +12 -9
  94. package/dist/responsive-layout.css.d.ts +2 -1
  95. package/dist/responsive-layout.d.ts +1 -1
  96. package/dist/responsive-layout.js +20 -17
  97. package/dist/screen-reader-only.css-mistica.js +2 -2
  98. package/dist/search-field.js +36 -35
  99. package/dist/select.css-mistica.js +16 -15
  100. package/dist/select.css.d.ts +1 -0
  101. package/dist/select.js +138 -143
  102. package/dist/sheet.css-mistica.js +13 -13
  103. package/dist/sheet.js +110 -128
  104. package/dist/skeletons.css-mistica.js +5 -5
  105. package/dist/skins/blau.js +2 -0
  106. package/dist/skins/movistar-legacy.js +2 -0
  107. package/dist/skins/movistar.js +2 -0
  108. package/dist/skins/o2-classic.js +1 -0
  109. package/dist/skins/o2.js +2 -0
  110. package/dist/skins/skin-contract.css-mistica.js +184 -182
  111. package/dist/skins/skin-contract.css.d.ts +2 -0
  112. package/dist/skins/telefonica.js +2 -0
  113. package/dist/skins/types/colors.d.ts +1 -0
  114. package/dist/skins/vivo-new.js +9 -7
  115. package/dist/skins/vivo.js +2 -0
  116. package/dist/slider.css-mistica.js +4 -4
  117. package/dist/slider.js +32 -32
  118. package/dist/snackbar.css-mistica.js +14 -14
  119. package/dist/spinner.css-mistica.js +1 -1
  120. package/dist/sprinkles.css-mistica.js +778 -772
  121. package/dist/stacking-group.css-mistica.js +2 -2
  122. package/dist/stepper.css-mistica.js +10 -10
  123. package/dist/switch-component.css-mistica.js +20 -20
  124. package/dist/tabs.css-mistica.js +10 -10
  125. package/dist/tag.css-mistica.js +1 -1
  126. package/dist/text-field-base.css-mistica.js +45 -21
  127. package/dist/text-field-base.css.d.ts +30 -7
  128. package/dist/text-field-base.d.ts +11 -0
  129. package/dist/text-field-base.js +175 -140
  130. package/dist/text-field-components.css-mistica.js +13 -21
  131. package/dist/text-field-components.css.d.ts +0 -3
  132. package/dist/text-field-components.d.ts +3 -0
  133. package/dist/text-field-components.js +38 -35
  134. package/dist/text-field.js +26 -22
  135. package/dist/text-link.css-mistica.js +3 -3
  136. package/dist/theme-context-provider.js +2 -2
  137. package/dist/tooltip.css-mistica.js +4 -4
  138. package/dist/touchable.css-mistica.js +3 -3
  139. package/dist/utils/aspect-ratio-support.css-mistica.js +3 -3
  140. package/dist/utils/platform.js +8 -11
  141. package/dist/video.css-mistica.js +2 -2
  142. package/dist-es/accordion.css-mistica.js +3 -3
  143. package/dist-es/avatar.css-mistica.js +1 -1
  144. package/dist-es/badge.css-mistica.js +2 -2
  145. package/dist-es/boxed.css-mistica.js +3 -2
  146. package/dist-es/boxed.js +17 -15
  147. package/dist-es/button-fixed-footer-layout.js +29 -24
  148. package/dist-es/button-group.css-mistica.js +1 -1
  149. package/dist-es/button-layout.css-mistica.js +7 -7
  150. package/dist-es/button-layout.js +23 -23
  151. package/dist-es/button.css-mistica.js +18 -18
  152. package/dist-es/button.js +65 -57
  153. package/dist-es/callout.css-mistica.js +1 -1
  154. package/dist-es/card.css-mistica.js +2 -2
  155. package/dist-es/carousel.css-mistica.js +2 -2
  156. package/dist-es/carousel.js +373 -280
  157. package/dist-es/checkbox.css-mistica.js +6 -6
  158. package/dist-es/chip.css-mistica.js +4 -4
  159. package/dist-es/circle.css-mistica.js +2 -2
  160. package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
  161. package/dist-es/community/blocks.css-mistica.js +2 -2
  162. package/dist-es/counter.css-mistica.js +2 -2
  163. package/dist-es/credit-card-expiration-field.js +34 -30
  164. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  165. package/dist-es/credit-card-number-field.js +84 -70
  166. package/dist-es/cvv-field.js +68 -63
  167. package/dist-es/date-field.css-mistica.js +5 -0
  168. package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
  169. package/dist-es/date-field.js +46 -40
  170. package/dist-es/date-time-field.js +47 -41
  171. package/dist-es/date-time-picker.js +55 -57
  172. package/dist-es/decimal-field.js +31 -27
  173. package/dist-es/dialog-context.js +125 -0
  174. package/dist-es/dialog.css-mistica.js +5 -5
  175. package/dist-es/dialog.js +192 -262
  176. package/dist-es/double-field.css-mistica.js +5 -4
  177. package/dist-es/email-field.js +16 -12
  178. package/dist-es/empty-state-card.css-mistica.js +1 -1
  179. package/dist-es/empty-state.css-mistica.js +3 -3
  180. package/dist-es/feedback.css-mistica.js +2 -2
  181. package/dist-es/feedback.js +191 -184
  182. package/dist-es/fixed-footer-layout.css-mistica.js +2 -2
  183. package/dist-es/fixed-footer-layout.js +21 -20
  184. package/dist-es/header.css-mistica.js +2 -2
  185. package/dist-es/hero.css-mistica.js +2 -2
  186. package/dist-es/highlighted-card.css-mistica.js +5 -5
  187. package/dist-es/hooks.js +60 -51
  188. package/dist-es/horizontal-scroll.css-mistica.js +2 -2
  189. package/dist-es/iban-field.js +42 -38
  190. package/dist-es/icon-button.css-mistica.js +1 -1
  191. package/dist-es/image.css-mistica.js +2 -2
  192. package/dist-es/index.js +1778 -1778
  193. package/dist-es/inline.css-mistica.js +3 -3
  194. package/dist-es/inline.js +18 -18
  195. package/dist-es/integer-field.js +21 -17
  196. package/dist-es/list.css-mistica.js +2 -2
  197. package/dist-es/loading-bar.css-mistica.js +2 -2
  198. package/dist-es/loading-bar.js +10 -13
  199. package/dist-es/loading-screen.css-mistica.js +2 -2
  200. package/dist-es/maybe-dismissable.css-mistica.js +1 -1
  201. package/dist-es/menu.css-mistica.js +2 -2
  202. package/dist-es/month-field.js +47 -41
  203. package/dist-es/navigation-bar.css-mistica.js +11 -11
  204. package/dist-es/navigation-breadcrumbs.css-mistica.js +2 -2
  205. package/dist-es/package-version.js +1 -1
  206. package/dist-es/password-field.js +54 -52
  207. package/dist-es/phone-number-field.js +53 -49
  208. package/dist-es/pin-field.css-mistica.js +2 -2
  209. package/dist-es/pin-field.js +145 -111
  210. package/dist-es/popover.css-mistica.js +2 -2
  211. package/dist-es/progress-bar.css-mistica.js +2 -2
  212. package/dist-es/radio-button.css-mistica.js +5 -5
  213. package/dist-es/responsive-layout.css-mistica.js +5 -5
  214. package/dist-es/responsive-layout.js +27 -24
  215. package/dist-es/screen-reader-only.css-mistica.js +2 -2
  216. package/dist-es/search-field.js +45 -44
  217. package/dist-es/select.css-mistica.js +11 -10
  218. package/dist-es/select.js +167 -172
  219. package/dist-es/sheet.css-mistica.js +2 -2
  220. package/dist-es/sheet.js +188 -206
  221. package/dist-es/skeletons.css-mistica.js +2 -2
  222. package/dist-es/skins/blau.js +2 -0
  223. package/dist-es/skins/movistar-legacy.js +2 -0
  224. package/dist-es/skins/movistar.js +2 -0
  225. package/dist-es/skins/o2-classic.js +1 -0
  226. package/dist-es/skins/o2.js +2 -0
  227. package/dist-es/skins/skin-contract.css-mistica.js +184 -182
  228. package/dist-es/skins/telefonica.js +2 -0
  229. package/dist-es/skins/vivo-new.js +9 -7
  230. package/dist-es/skins/vivo.js +2 -0
  231. package/dist-es/slider.css-mistica.js +2 -2
  232. package/dist-es/slider.js +36 -36
  233. package/dist-es/snackbar.css-mistica.js +5 -5
  234. package/dist-es/spinner.css-mistica.js +1 -1
  235. package/dist-es/sprinkles.css-mistica.js +778 -772
  236. package/dist-es/stacking-group.css-mistica.js +2 -2
  237. package/dist-es/stepper.css-mistica.js +2 -2
  238. package/dist-es/style.css +1 -1
  239. package/dist-es/switch-component.css-mistica.js +17 -17
  240. package/dist-es/tabs.css-mistica.js +8 -8
  241. package/dist-es/tag.css-mistica.js +1 -1
  242. package/dist-es/text-field-base.css-mistica.js +2 -2
  243. package/dist-es/text-field-base.js +189 -157
  244. package/dist-es/text-field-components.css-mistica.js +3 -2
  245. package/dist-es/text-field-components.js +52 -49
  246. package/dist-es/text-field.js +31 -27
  247. package/dist-es/text-link.css-mistica.js +3 -3
  248. package/dist-es/theme-context-provider.js +1 -1
  249. package/dist-es/tooltip.css-mistica.js +2 -2
  250. package/dist-es/touchable.css-mistica.js +2 -2
  251. package/dist-es/utils/aspect-ratio-support.css-mistica.js +3 -3
  252. package/dist-es/utils/platform.js +6 -6
  253. package/dist-es/video.css-mistica.js +2 -2
  254. package/package.json +2 -2
  255. package/dist/password-field.css-mistica.js +0 -13
  256. package/dist/password-field.css.d.ts +0 -1
  257. package/dist-es/password-field.css-mistica.js +0 -4
  258. /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
  259. /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
package/dist-es/dialog.js CHANGED
@@ -78,323 +78,253 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as o, jsxs as w, Fragment as A } from "react/jsx-runtime";
82
- import * as s from "react";
83
- import k from "classnames";
84
- import { ButtonDanger as D, ButtonPrimary as R, ButtonSecondary as S } from "./button.js";
85
- import { Portal as L } from "./portal.js";
86
- import W from "./focus-trap.js";
87
- import I from "./generated/mistica-icons/icon-close-regular.js";
88
- import O from "./icon-button.js";
89
- import { isWebViewBridgeAvailable as H, nativeConfirm as M, nativeAlert as F } from "@tef-novum/webview-bridge";
90
- import V from "./theme-context.js";
91
- import { useTheme as N } from "./hooks.js";
92
- import j from "./button-layout.js";
93
- import { Text5 as K, Text4 as T, Text3 as _ } from "./text.js";
94
- import { ESC as z } from "./utils/keys.js";
95
- import B from "./box.js";
96
- import { isRunningAcceptanceTest as U } from "./utils/platform.js";
97
- import { useSetModalStateEffect as q } from "./modal-context-provider.js";
98
- import G from "./stack.js";
99
- import { wrapper as J, modalOpacityLayer as Q, closedOpactityLayer as X, modalContent as Y, closedModalContent as Z, modalCloseButtonContainer as $, variants as ee, iconContainer as te, dialogContent as oe, dialogActions as ne } from "./dialog.css-mistica.js";
100
- import { vars as P } from "./skins/skin-contract.css-mistica.js";
101
- const y = (e)=>process.env.NODE_ENV !== "test" && !U(e), ae = (e)=>{
102
- const { texts: t } = N(), { className: i, title: n, message: c, icon: l, extra: a, cancelText: r = t.dialogCancelButton, acceptText: d = t.dialogAcceptButton, onCancel: h, onAccept: g, showCancel: b = !1, destructive: u = !1 } = e, v = !!e.forceWeb, m = {
103
- onPress: g || (()=>{}),
81
+ import { jsx as e, jsxs as B, Fragment as M } from "react/jsx-runtime";
82
+ import * as t from "react";
83
+ import D from "classnames";
84
+ import { ButtonDanger as W, ButtonPrimary as _, ButtonSecondary as j } from "./button.js";
85
+ import { Portal as F } from "./portal.js";
86
+ import V from "./focus-trap.js";
87
+ import z from "./generated/mistica-icons/icon-close-regular.js";
88
+ import H from "./icon-button.js";
89
+ import { isWebViewBridgeAvailable as K, nativeConfirm as U, nativeAlert as q } from "@tef-novum/webview-bridge";
90
+ import { useTheme as P } from "./hooks.js";
91
+ import G from "./button-layout.js";
92
+ import { Text5 as J, Text4 as S, Text3 as Q } from "./text.js";
93
+ import { ESC as X } from "./utils/keys.js";
94
+ import E from "./box.js";
95
+ import { isRunningAcceptanceTest as Y } from "./utils/platform.js";
96
+ import { useSetModalStateEffect as Z } from "./modal-context-provider.js";
97
+ import $ from "./stack.js";
98
+ import { ANIMATION_DURATION_MS as ee, wrapper as te, modalOpacityLayer as oe, closedOpactityLayer as ne, modalContent as re, closedModalContent as ae, modalCloseButtonContainer as se, variants as ie, iconContainer as le, dialogContent as ce, dialogActions as de } from "./dialog.css-mistica.js";
99
+ import { vars as A } from "./skins/skin-contract.css-mistica.js";
100
+ const ue = ()=>process.env.NODE_ENV !== "test" && !Y(), me = (r)=>{
101
+ const { texts: s } = P(), { className: u, title: a, message: h, icon: o, extra: i, cancelText: l = s.dialogCancelButton, acceptText: c = s.dialogAcceptButton, onCancel: m, onAccept: f, destructive: y = !1 } = r, d = r.type === "dialog", g = r.type === "confirm" || d && !!m, p = {
102
+ onPress: f || (()=>{}),
103
+ children: c,
104
+ // @deprecated - testid should be removed but many webapp tests depend on this
104
105
  dataAttributes: {
105
106
  testid: "dialog-accept-button"
106
- },
107
- children: d
107
+ }
108
108
  };
109
- return /* @__PURE__ */ w("div", {
110
- className: k(ee[v ? "dialog" : "default"], i),
109
+ return /* @__PURE__ */ B("div", {
110
+ className: D(ie[d ? "dialog" : "default"], u),
111
111
  children: [
112
- l && /* @__PURE__ */ o(B, {
112
+ o && /* @__PURE__ */ e(E, {
113
113
  paddingBottom: 24,
114
- children: /* @__PURE__ */ o("div", {
115
- className: te,
116
- children: /*#__PURE__*/ s.cloneElement(l, {
114
+ children: /* @__PURE__ */ e("div", {
115
+ className: le,
116
+ children: /*#__PURE__*/ t.cloneElement(o, {
117
117
  size: "100%"
118
118
  })
119
119
  })
120
120
  }),
121
- n && /* @__PURE__ */ o(B, {
121
+ a && /* @__PURE__ */ e(E, {
122
122
  paddingBottom: 16,
123
- children: e.forceWeb ? /* @__PURE__ */ o(K, {
123
+ children: d ? /* @__PURE__ */ e(J, {
124
124
  as: "h2",
125
- children: n
126
- }) : /* @__PURE__ */ o(T, {
125
+ children: a
126
+ }) : /* @__PURE__ */ e(S, {
127
127
  regular: !0,
128
128
  as: "h2",
129
- children: n
129
+ children: a
130
130
  })
131
131
  }),
132
- e.subtitle && /* @__PURE__ */ o(B, {
132
+ r.subtitle && /* @__PURE__ */ e(E, {
133
133
  paddingBottom: 16,
134
- children: /* @__PURE__ */ o(T, {
134
+ children: /* @__PURE__ */ e(S, {
135
135
  regular: !0,
136
136
  as: "h2",
137
- children: e.subtitle
137
+ children: r.subtitle
138
138
  })
139
139
  }),
140
- /* @__PURE__ */ o("div", {
141
- className: oe,
142
- children: /* @__PURE__ */ w(G, {
140
+ /* @__PURE__ */ e("div", {
141
+ className: ce,
142
+ children: /* @__PURE__ */ B($, {
143
143
  space: 16,
144
144
  children: [
145
- /* @__PURE__ */ o(_, {
146
- color: P.colors.textSecondary,
145
+ /* @__PURE__ */ e(Q, {
146
+ color: A.colors.textSecondary,
147
147
  regular: !0,
148
- children: c
148
+ children: h
149
149
  }),
150
- a
150
+ i
151
151
  ]
152
152
  })
153
153
  }),
154
- /* @__PURE__ */ o("div", {
155
- className: ne,
156
- children: /* @__PURE__ */ w(j, {
157
- link: e.forceWeb ? e.link : void 0,
154
+ /* @__PURE__ */ e("div", {
155
+ className: de,
156
+ children: /* @__PURE__ */ B(G, {
157
+ link: d ? r.link : void 0,
158
158
  children: [
159
- u ? /* @__PURE__ */ o(D, _object_spread({
159
+ y ? /* @__PURE__ */ e(W, _object_spread({
160
160
  tabIndex: 1
161
- }, m)) : /* @__PURE__ */ o(R, _object_spread({
161
+ }, p)) : /* @__PURE__ */ e(_, _object_spread({
162
162
  tabIndex: 1
163
- }, m)),
164
- b && !!h && /* @__PURE__ */ o(S, {
163
+ }, p)),
164
+ g && /* @__PURE__ */ e(j, {
165
165
  tabIndex: 2,
166
- onPress: h,
166
+ onPress: m || (()=>{}),
167
167
  dataAttributes: {
168
168
  testid: "dialog-cancel-button"
169
169
  },
170
- children: r
170
+ children: l
171
171
  })
172
172
  ]
173
173
  })
174
174
  })
175
175
  ]
176
176
  });
177
- }, ie = (param)=>{
178
- let { showCancel: e, message: t, title: i, acceptText: n, cancelText: c, onAccept: l, onCancel: a } = param;
179
- return e ? M({
180
- message: t,
181
- title: i,
182
- cancelText: c,
183
- acceptText: n
184
- }).then((r)=>r ? l == null ? void 0 : l() : a == null ? void 0 : a()) : F({
185
- message: t,
186
- title: i,
187
- buttonText: n
188
- }).then(l);
189
- }, le = (param)=>{
190
- let { renderNative: e, onAccept: t, onCancel: i, acceptText: n, cancelText: c, showCancel: l, message: a, title: r } = param;
191
- const d = s.useRef(t).current, h = s.useRef(i).current;
192
- s.useEffect(()=>{
193
- e && ie({
194
- acceptText: n,
195
- cancelText: c,
196
- showCancel: l,
197
- message: a,
198
- title: r,
199
- onAccept: d,
200
- onCancel: h
201
- });
202
- }, [
203
- d,
204
- h,
205
- n,
206
- c,
207
- l,
208
- a,
209
- r,
210
- e
211
- ]);
212
- }, se = (e)=>(le({
213
- renderNative: !0,
214
- acceptText: e.acceptText || e.dialogAcceptButton,
215
- cancelText: e.cancelText || e.dialogCancelButton,
216
- showCancel: e.showCancel,
217
- message: e.message,
218
- title: e.title,
219
- onAccept: e.onAccept,
220
- onCancel: e.onCancel
221
- }), null), ce = (e)=>{
222
- const { platformOverrides: t } = N(), i = s.useContext(V), n = s.useRef(process.env.NODE_ENV === "test");
223
- if (!i) throw Error("To use @telefonica/mistica components you must instantiate <ThemeContextProvider> as their parent.");
224
- const c = !e.forceWeb && H(), { onAccept: l, isClosing: a, onCancel: r, onCloseTransitionEnd: d } = e, h = _object_without_properties(e, [
177
+ }, fe = (param)=>{
178
+ let { type: r, message: s, title: u, acceptText: a, cancelText: h, onAccept: o, onCancel: i, onDestroy: l } = param;
179
+ return r === "confirm" ? U({
180
+ message: s,
181
+ title: u,
182
+ cancelText: h,
183
+ acceptText: a
184
+ }).then((c)=>{
185
+ c ? o == null || o() : i == null || i(), l();
186
+ }) : q({
187
+ message: s,
188
+ title: u,
189
+ buttonText: a
190
+ }).then(()=>{
191
+ o == null || o(), l();
192
+ });
193
+ }, he = (param)=>{
194
+ let { type: r, onAccept: s, onCancel: u, onDestroy: a, acceptText: h, cancelText: o, message: i, title: l } = param;
195
+ const { texts: c } = P(), m = t.useRef({
196
+ type: r,
197
+ onAccept: s,
198
+ onCancel: u,
199
+ onDestroy: a,
200
+ acceptText: h || c.dialogAcceptButton,
201
+ cancelText: o || c.dialogCancelButton,
202
+ message: i,
203
+ title: l
204
+ });
205
+ return t.useEffect(()=>{
206
+ fe(m.current);
207
+ }, []), /* @__PURE__ */ e(M, {});
208
+ }, Ae = (r)=>{
209
+ Z();
210
+ const s = t.useRef(null), { texts: u } = P(), [a, h] = t.useState(!1), o = t.useRef(!1), i = t.useRef(!1), [l, c] = t.useState(!1), m = t.useRef(!1), f = t.useRef(!1), y = t.useRef(ue() ? ee : 0), d = r.type !== "dialog" && K(), g = r.type === "dialog", p = r.type === "alert", { onAccept: b, onCancel: R, onDestroy: I } = r, O = _object_without_properties(r, [
225
211
  "onAccept",
226
- "isClosing",
227
212
  "onCancel",
228
- "onCloseTransitionEnd"
229
- ]), g = s.useCallback(()=>{
230
- !a && n.current && l();
213
+ "onDestroy"
214
+ ]);
215
+ t.useEffect(()=>{
216
+ const n = setTimeout(()=>{
217
+ o.current || c(!0);
218
+ }, y.current);
219
+ return ()=>{
220
+ clearTimeout(n);
221
+ };
222
+ }, []);
223
+ const k = t.useCallback(()=>{
224
+ i.current || (i.current = !0, m.current ? b == null || b() : R == null || R(), I());
231
225
  }, [
232
- a,
226
+ b,
227
+ R,
228
+ I
229
+ ]), x = t.useCallback(()=>{
230
+ let n;
231
+ return !o.current && l && (o.current = !0, c(!1), h(!0), n = setTimeout(k, y.current)), ()=>{
232
+ n && clearTimeout(n);
233
+ };
234
+ }, [
235
+ k,
233
236
  l
234
- ]), b = s.useCallback(()=>{
235
- !a && n.current && r();
237
+ ]), N = t.useCallback(()=>{
238
+ m.current = !0, x();
236
239
  }, [
237
- a,
238
- r
239
- ]), u = e.showCancel ? b : g, v = s.useCallback((f)=>{
240
- e.showClose && (u(), f.stopPropagation());
240
+ x
241
+ ]), v = t.useCallback(()=>{
242
+ m.current = !1, x();
241
243
  }, [
242
- u,
243
- e.showClose
244
- ]), m = s.useCallback((f)=>{
245
- f.key === z && (u(), f.stopPropagation(), f.preventDefault());
244
+ x
245
+ ]), C = t.useCallback(()=>{
246
+ p ? N() : v();
246
247
  }, [
247
- u
248
- ]), x = s.useCallback(()=>{
249
- document.addEventListener("keydown", m);
248
+ N,
249
+ v,
250
+ p
251
+ ]), w = t.useCallback(()=>{
252
+ f.current && (f.current = !1, C());
250
253
  }, [
251
- m
254
+ C
252
255
  ]);
253
- var _i_texts_modalClose;
254
- return s.useEffect(()=>(y(t) || x(), (c || !y(t)) && e.isClosing && e.onCloseTransitionEnd && e.onCloseTransitionEnd(), ()=>{
255
- document.removeEventListener("keydown", m);
256
- }), [
257
- x,
258
- m,
259
- e,
260
- c,
261
- t
262
- ]), q(), c ? /* @__PURE__ */ o(se, _object_spread_props(_object_spread({}, e), {
263
- dialogAcceptButton: i.texts.dialogAcceptButton,
264
- dialogCancelButton: i.texts.dialogCancelButton
265
- })) : /* @__PURE__ */ o(L, {
266
- children: /* @__PURE__ */ o("div", {
267
- className: J,
268
- children: /* @__PURE__ */ o(W, {
269
- children: /* @__PURE__ */ o("div", {
270
- onClick: v,
271
- className: k(Q, {
272
- [X]: a
273
- }),
256
+ t.useEffect(()=>{
257
+ if (!d) return !f.current && !o.current && (f.current = !0, window.history.pushState(null, document.title, window.location.href)), window.addEventListener("popstate", w), ()=>{
258
+ window.removeEventListener("popstate", w), o.current && f.current && (f.current = !1, window.history.back());
259
+ };
260
+ }, [
261
+ w,
262
+ d
263
+ ]);
264
+ const T = t.useCallback((n)=>{
265
+ n.key === X && (n.stopPropagation(), n.preventDefault(), C());
266
+ }, [
267
+ C
268
+ ]);
269
+ t.useEffect(()=>{
270
+ if (!d) return document.addEventListener("keydown", T), ()=>{
271
+ document.removeEventListener("keydown", T);
272
+ };
273
+ }, [
274
+ T,
275
+ d
276
+ ]);
277
+ const L = t.useCallback((n)=>{
278
+ n.stopPropagation(), g && v();
279
+ }, [
280
+ g,
281
+ v
282
+ ]);
283
+ return d ? /* @__PURE__ */ e(he, _object_spread({}, r)) : /* @__PURE__ */ e(F, {
284
+ className: te,
285
+ children: /* @__PURE__ */ e(V, {
286
+ children: /* @__PURE__ */ e("div", {
287
+ onClick: L,
288
+ className: D(oe, {
289
+ [ne]: a
290
+ }),
291
+ "data-testid": "dialog-overlay",
292
+ "aria-hidden": a || !l,
293
+ children: /* @__PURE__ */ e("div", {
274
294
  role: "dialog",
295
+ onClick: (n)=>n.stopPropagation(),
275
296
  "data-component-name": "Dialog",
276
- children: /* @__PURE__ */ o("div", {
277
- onClick: (f)=>f.stopPropagation(),
278
- children: /* @__PURE__ */ w("div", {
279
- onTransitionEnd: a && d ? d : void 0,
280
- onAnimationEnd: ()=>{
281
- n.current = !0, x();
282
- },
283
- className: k(Y, {
284
- [Z]: a
285
- }),
286
- children: [
287
- e.showClose && /* @__PURE__ */ o("div", {
288
- className: $,
289
- children: /* @__PURE__ */ o(O, {
290
- onPress: u,
291
- "aria-label": (_i_texts_modalClose = i.texts.modalClose) !== null && _i_texts_modalClose !== void 0 ? _i_texts_modalClose : i.texts.closeButtonLabel,
292
- children: /* @__PURE__ */ o(I, {
293
- color: P.colors.neutralHigh
294
- })
297
+ children: /* @__PURE__ */ B("div", {
298
+ ref: s,
299
+ onAnimationEnd: (n)=>{
300
+ n.target === s.current && (o.current || c(!0));
301
+ },
302
+ onTransitionEnd: (n)=>{
303
+ n.target === s.current && o.current && k();
304
+ },
305
+ className: D(re, {
306
+ [ae]: a
307
+ }),
308
+ children: [
309
+ g && /* @__PURE__ */ e("div", {
310
+ className: se,
311
+ children: /* @__PURE__ */ e(H, {
312
+ onPress: C,
313
+ "aria-label": u.modalClose || u.closeButtonLabel,
314
+ children: /* @__PURE__ */ e(z, {
315
+ color: A.colors.neutralHigh
295
316
  })
296
- }),
297
- /* @__PURE__ */ o(ae, _object_spread_props(_object_spread({}, h), {
298
- onCancel: b,
299
- onAccept: g
300
- }))
301
- ]
302
- })
317
+ })
318
+ }),
319
+ /* @__PURE__ */ e(me, _object_spread_props(_object_spread({}, O), {
320
+ onCancel: v,
321
+ onAccept: N
322
+ }))
323
+ ]
303
324
  })
304
325
  })
305
326
  })
306
327
  })
307
328
  });
308
329
  };
309
- let p = null, C = 0;
310
- class Pe extends s.Component {
311
- componentDidMount() {
312
- C++, C === 1 && (p = this, window.addEventListener("popstate", this.handleBack));
313
- }
314
- componentWillUnmount() {
315
- C--, C === 0 && (p = null, window.removeEventListener("popstate", this.handleBack));
316
- }
317
- show(t) {
318
- if (this.state.dialogProps) throw Error("Tried to show a dialog on top of another dialog. This functionality is not currently supported.");
319
- window.history.pushState(null, document.title, window.location.href), this.setState({
320
- dialogProps: t,
321
- isClosing: !1
322
- });
323
- }
324
- close() {
325
- window.history.back();
326
- }
327
- createCancelHandler(t) {
328
- return ()=>{
329
- t && (this.callback = ()=>t()), this.close();
330
- };
331
- }
332
- createAcceptHandler(t) {
333
- return ()=>{
334
- t && (this.callback = ()=>t()), this.close();
335
- };
336
- }
337
- render() {
338
- const { isClosing: t, dialogProps: i } = this.state;
339
- let n = null;
340
- if (i && this.state.instanceNumber === 1) {
341
- const { onCancel: c, onAccept: l } = i, a = _object_without_properties(i, [
342
- "onCancel",
343
- "onAccept"
344
- ]);
345
- n = /* @__PURE__ */ o(ce, _object_spread({
346
- onCancel: this.createCancelHandler(c),
347
- onAccept: this.createAcceptHandler(l),
348
- isClosing: t,
349
- onCloseTransitionEnd: t ? this.handleCloseFinished : void 0
350
- }, a));
351
- }
352
- return /* @__PURE__ */ w(A, {
353
- children: [
354
- this.props.children,
355
- n
356
- ]
357
- });
358
- }
359
- constructor(){
360
- super(...arguments), this.state = {
361
- dialogProps: null,
362
- isClosing: !1,
363
- instanceNumber: C + 1
364
- }, this.callback = null, this.handleCloseFinished = ()=>{
365
- this.setState({
366
- dialogProps: null,
367
- isClosing: !1
368
- });
369
- }, this.handleBack = ()=>{
370
- var t;
371
- this.state.dialogProps && ((t = this.callback) == null || t.call(this), this.callback = null, this.setState({
372
- isClosing: !0
373
- }));
374
- };
375
- }
376
- }
377
- const E = (param)=>{
378
- let { showCancel: e, showClose: t, forceWeb: i } = param;
379
- return (n)=>{
380
- if (!p) throw Error("Tried to show a dialog but the DialogRoot component was not mounted (mount <ThemeContextProvider>)");
381
- p.show(_object_spread({
382
- showCancel: e,
383
- showClose: t,
384
- forceWeb: i
385
- }, n));
386
- };
387
- }, Ae = E({
388
- showCancel: !1,
389
- forceWeb: !1,
390
- showClose: !1
391
- }), De = E({
392
- showCancel: !0,
393
- forceWeb: !1,
394
- showClose: !1
395
- }), Re = E({
396
- showCancel: !1,
397
- forceWeb: !0,
398
- showClose: !0
399
- });
400
- export { Ae as alert, De as confirm, Pe as default, Re as dialog };
330
+ export { Ae as default };
@@ -1,8 +1,9 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
+ import "./text-field-base.css.ts.vanilla.css-mistica.js";
2
3
  import "./text-field-components.css.ts.vanilla.css-mistica.js";
3
4
  import "./double-field.css.ts.vanilla.css-mistica.js";
4
- var l = {
5
- default: "skrulh1 _1y2v1nfgg _1y2v1nfgl _1y2v1nfh3",
6
- fullWidth: "skrulh2 _1y2v1nfgg _1y2v1nfgl _1y2v1nfh3"
5
+ var t = {
6
+ default: "skrulh1 _1y2v1nfgi _1y2v1nfgn _1y2v1nfh5",
7
+ fullWidth: "skrulh2 _1y2v1nfgi _1y2v1nfgn _1y2v1nfh5"
7
8
  };
8
- export { l as variants };
9
+ export { t as variants };
@@ -78,12 +78,12 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as x } from "react/jsx-runtime";
81
+ import { jsx as A } from "react/jsx-runtime";
82
82
  import { useFieldProps as M } from "./form-context.js";
83
83
  import { useTheme as g } from "./hooks.js";
84
84
  import { TextFieldBaseAutosuggest as y } from "./text-field-base.js";
85
- const A = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, I = (_param)=>{
86
- var { disabled: o, error: i, helperText: m, name: n, optional: s, validate: r, onChange: l, onChangeValue: f, onBlur: u, value: c, autoComplete: a = "email", defaultValue: d } = _param, E = _object_without_properties(_param, [
85
+ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, T = (_param)=>{
86
+ var { disabled: o, error: i, helperText: m, name: n, optional: r, validate: t, onChange: l, onChangeValue: a, onBlur: u, value: c, autoComplete: d = "email", defaultValue: f, dataAttributes: E } = _param, p = _object_without_properties(_param, [
87
87
  "disabled",
88
88
  "error",
89
89
  "helperText",
@@ -95,26 +95,30 @@ const A = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, I = (_param)=>{
95
95
  "onBlur",
96
96
  "value",
97
97
  "autoComplete",
98
- "defaultValue"
98
+ "defaultValue",
99
+ "dataAttributes"
99
100
  ]);
100
- const { texts: t } = g(), p = M({
101
+ const { texts: s } = g(), F = M({
101
102
  name: n,
102
103
  value: c,
103
- defaultValue: d,
104
+ defaultValue: f,
104
105
  processValue: (e)=>e.trim(),
105
106
  helperText: m,
106
- optional: s,
107
+ optional: r,
107
108
  error: i,
108
109
  disabled: o,
109
110
  onBlur: u,
110
- validate: (e, F)=>e ? A.test(e) ? r == null ? void 0 : r(e, F) : t.formEmailError : s ? "" : t.formFieldErrorIsMandatory,
111
+ validate: (e, x)=>e ? I.test(e) ? t == null ? void 0 : t(e, x) : s.formEmailError : r ? "" : s.formFieldErrorIsMandatory,
111
112
  onChange: l,
112
- onChangeValue: f
113
+ onChangeValue: a
113
114
  });
114
- return /* @__PURE__ */ x(y, _object_spread_props(_object_spread({}, E, p), {
115
+ return /* @__PURE__ */ A(y, _object_spread_props(_object_spread({}, p, F), {
115
116
  type: "email",
116
117
  inputMode: "email",
117
- autoComplete: a
118
+ autoComplete: d,
119
+ dataAttributes: _object_spread({
120
+ "component-name": "EmailField"
121
+ }, E)
118
122
  }));
119
- }, L = I;
123
+ }, L = T;
120
124
  export { L as default };
@@ -1,4 +1,4 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./empty-state-card.css.ts.vanilla.css-mistica.js";
3
- var n = "_1azor6p0", o = "_1azor6p4 _1y2v1nfhf _1y2v1nfhv", v = "_1azor6p2 _1y2v1nfgi _1y2v1nfhx";
3
+ var n = "_1azor6p0", o = "_1azor6p4 _1y2v1nfhh _1y2v1nfhx", v = "_1azor6p2 _1y2v1nfgk _1y2v1nfhz";
4
4
  export { n as container, o as iconContainer, v as image };
@@ -1,9 +1,9 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./empty-state.css.ts.vanilla.css-mistica.js";
3
- var n = "_13fzrua2 _1y2v1nfgg _1y2v1nf68", v = {
3
+ var n = "_13fzrua2 _1y2v1nfgi _1y2v1nf6a", v = {
4
4
  default: "_13fzrua3",
5
5
  largeImage: "_13fzrua4"
6
- }, e = "_13fzrua9 _1y2v1nfhh _1y2v1nfhx", f = "_13fzruac", _ = "_13fzrua7 _1y2v1nfhk", o = "_13fzrua5", g = "_13fzruab _1y2v1nfgi", u = {
6
+ }, e = "_13fzrua9 _1y2v1nfhj _1y2v1nfhz", f = "_13fzruac", _ = "_13fzrua7 _1y2v1nfhm", o = "_13fzrua5", u = "_13fzruab _1y2v1nfgk", g = {
7
7
  backgroundColor: "var(--_13fzrua0)"
8
8
  };
9
- export { n as container, v as contentVariants, e as iconContainer, f as inverseBorder, _ as largeImage, o as largeImageContainer, g as smallImage, u as vars };
9
+ export { n as container, v as contentVariants, e as iconContainer, f as inverseBorder, _ as largeImage, o as largeImageContainer, u as smallImage, g as vars };
@@ -1,4 +1,4 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./feedback.css.ts.vanilla.css-mistica.js";
3
- var r = "gx6h6a3 _1y2v1nfgg _1y2v1nfhk _1y2v1nfh3", v = "_1y2v1nfj8 _1y2v1nfgg _1y2v1nfgs", n = "gx6h6a1", t = "gx6h6ab", g = "gx6h6a6", h = "gx6h6a8 gx6h6a7", f = "gx6h6a9 gx6h6a7", p = "gx6h6aa gx6h6a7", i = "_1y2v1nfhf _1y2v1nfhv", o = "gx6h6a4";
4
- export { r as container, v as desktopContainer, n as desktopContent, t as feedbackData, g as feedbackDataAppear, h as feedbackDataAppearActiveFast, f as feedbackDataAppearActiveMedium, p as feedbackDataAppearActiveSlow, i as iconContainer, o as innerContainer };
3
+ var r = "gx6h6ae", n = "gx6h6a4 _1y2v1nfgi _1y2v1nfhm _1y2v1nfh5 _1y2v1nfgo", h = "gx6h6a0", x = "gx6h6a1", g = "gx6h6a2", t = "gx6h6ad", v = "gx6h6aa gx6h6a9", o = "gx6h6ab gx6h6a9", p = "gx6h6ac gx6h6a9", d = "_1y2v1nfhh _1y2v1nfhx", f = "gx6h6a5";
4
+ export { r as backgroundBrand, n as container, h as desktopContainer, x as desktopContent, g as desktopImage, t as feedbackData, v as feedbackTextAppearFast, o as feedbackTextAppearMedium, p as feedbackTextAppearSlow, d as iconContainer, f as innerContainer };