@telefonica/mistica 14.41.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 (137) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/boxed.css-mistica.js +14 -5
  3. package/dist/boxed.css.d.ts +1 -0
  4. package/dist/boxed.d.ts +1 -0
  5. package/dist/boxed.js +11 -9
  6. package/dist/button-fixed-footer-layout.d.ts +1 -0
  7. package/dist/button-fixed-footer-layout.js +19 -14
  8. package/dist/button-layout.css-mistica.js +16 -13
  9. package/dist/button-layout.css.d.ts +1 -0
  10. package/dist/button-layout.js +15 -15
  11. package/dist/button.js +43 -35
  12. package/dist/carousel.d.ts +13 -0
  13. package/dist/carousel.js +325 -223
  14. package/dist/credit-card-expiration-field.js +30 -26
  15. package/dist/credit-card-number-field.css-mistica.js +7 -7
  16. package/dist/credit-card-number-field.js +59 -45
  17. package/dist/cvv-field.js +46 -41
  18. package/dist/date-field.css-mistica.js +14 -0
  19. package/dist/date-field.css.d.ts +1 -0
  20. package/dist/date-field.css.ts.vanilla.css-mistica.js +11 -0
  21. package/dist/date-field.js +41 -35
  22. package/dist/date-time-field.js +40 -34
  23. package/dist/date-time-picker.js +43 -45
  24. package/dist/decimal-field.js +26 -22
  25. package/dist/dialog-context.d.ts +24 -0
  26. package/dist/dialog-context.js +192 -0
  27. package/dist/dialog.css-mistica.js +15 -12
  28. package/dist/dialog.css.d.ts +1 -0
  29. package/dist/dialog.d.ts +14 -44
  30. package/dist/dialog.js +161 -245
  31. package/dist/double-field.css-mistica.js +3 -2
  32. package/dist/email-field.js +15 -11
  33. package/dist/feedback.css-mistica.js +18 -15
  34. package/dist/feedback.css.d.ts +5 -4
  35. package/dist/feedback.js +154 -147
  36. package/dist/fixed-footer-layout.css-mistica.js +1 -1
  37. package/dist/fixed-footer-layout.js +9 -8
  38. package/dist/iban-field.js +31 -27
  39. package/dist/icons/icon-amex.d.ts +1 -1
  40. package/dist/icons/icon-cvv-amex.d.ts +1 -1
  41. package/dist/icons/icon-cvv-visa-mc.d.ts +1 -1
  42. package/dist/icons/icon-mastercard.d.ts +1 -1
  43. package/dist/icons/icon-visa.d.ts +1 -1
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.js +16 -4
  46. package/dist/inline.css-mistica.js +9 -6
  47. package/dist/inline.css.d.ts +1 -1
  48. package/dist/inline.js +9 -9
  49. package/dist/integer-field.js +17 -13
  50. package/dist/loading-bar.css-mistica.js +4 -7
  51. package/dist/loading-bar.css.d.ts +0 -2
  52. package/dist/loading-bar.js +3 -6
  53. package/dist/month-field.js +39 -33
  54. package/dist/package-version.js +1 -1
  55. package/dist/password-field.js +46 -44
  56. package/dist/phone-number-field.js +50 -46
  57. package/dist/pin-field.css-mistica.js +12 -6
  58. package/dist/pin-field.css.d.ts +2 -0
  59. package/dist/pin-field.d.ts +3 -1
  60. package/dist/pin-field.js +129 -95
  61. package/dist/responsive-layout.css-mistica.js +10 -7
  62. package/dist/responsive-layout.css.d.ts +2 -1
  63. package/dist/responsive-layout.d.ts +1 -1
  64. package/dist/responsive-layout.js +20 -17
  65. package/dist/search-field.js +36 -35
  66. package/dist/select.css-mistica.js +16 -15
  67. package/dist/select.css.d.ts +1 -0
  68. package/dist/select.js +138 -143
  69. package/dist/text-field-base.css-mistica.js +45 -21
  70. package/dist/text-field-base.css.d.ts +30 -7
  71. package/dist/text-field-base.d.ts +11 -0
  72. package/dist/text-field-base.js +175 -140
  73. package/dist/text-field-components.css-mistica.js +13 -21
  74. package/dist/text-field-components.css.d.ts +0 -3
  75. package/dist/text-field-components.d.ts +3 -0
  76. package/dist/text-field-components.js +38 -35
  77. package/dist/text-field.js +26 -22
  78. package/dist/theme-context-provider.js +2 -2
  79. package/dist/utils/platform.js +8 -11
  80. package/dist-es/boxed.css-mistica.js +3 -2
  81. package/dist-es/boxed.js +17 -15
  82. package/dist-es/button-fixed-footer-layout.js +29 -24
  83. package/dist-es/button-layout.css-mistica.js +7 -7
  84. package/dist-es/button-layout.js +23 -23
  85. package/dist-es/button.js +65 -57
  86. package/dist-es/carousel.js +373 -280
  87. package/dist-es/credit-card-expiration-field.js +34 -30
  88. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  89. package/dist-es/credit-card-number-field.js +84 -70
  90. package/dist-es/cvv-field.js +68 -63
  91. package/dist-es/date-field.css-mistica.js +5 -0
  92. package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
  93. package/dist-es/date-field.js +46 -40
  94. package/dist-es/date-time-field.js +47 -41
  95. package/dist-es/date-time-picker.js +55 -57
  96. package/dist-es/decimal-field.js +31 -27
  97. package/dist-es/dialog-context.js +125 -0
  98. package/dist-es/dialog.css-mistica.js +3 -3
  99. package/dist-es/dialog.js +192 -262
  100. package/dist-es/double-field.css-mistica.js +3 -2
  101. package/dist-es/email-field.js +16 -12
  102. package/dist-es/feedback.css-mistica.js +2 -2
  103. package/dist-es/feedback.js +191 -184
  104. package/dist-es/fixed-footer-layout.css-mistica.js +1 -1
  105. package/dist-es/fixed-footer-layout.js +21 -20
  106. package/dist-es/iban-field.js +42 -38
  107. package/dist-es/index.js +1778 -1778
  108. package/dist-es/inline.css-mistica.js +3 -3
  109. package/dist-es/inline.js +18 -18
  110. package/dist-es/integer-field.js +21 -17
  111. package/dist-es/loading-bar.css-mistica.js +2 -2
  112. package/dist-es/loading-bar.js +10 -13
  113. package/dist-es/month-field.js +47 -41
  114. package/dist-es/package-version.js +1 -1
  115. package/dist-es/password-field.js +54 -52
  116. package/dist-es/phone-number-field.js +53 -49
  117. package/dist-es/pin-field.css-mistica.js +2 -2
  118. package/dist-es/pin-field.js +145 -111
  119. package/dist-es/responsive-layout.css-mistica.js +3 -3
  120. package/dist-es/responsive-layout.js +27 -24
  121. package/dist-es/search-field.js +45 -44
  122. package/dist-es/select.css-mistica.js +8 -7
  123. package/dist-es/select.js +167 -172
  124. package/dist-es/style.css +1 -1
  125. package/dist-es/text-field-base.css-mistica.js +2 -2
  126. package/dist-es/text-field-base.js +189 -157
  127. package/dist-es/text-field-components.css-mistica.js +3 -2
  128. package/dist-es/text-field-components.js +52 -49
  129. package/dist-es/text-field.js +31 -27
  130. package/dist-es/theme-context-provider.js +1 -1
  131. package/dist-es/utils/platform.js +6 -6
  132. package/package.json +1 -1
  133. package/dist/password-field.css-mistica.js +0 -13
  134. package/dist/password-field.css.d.ts +0 -1
  135. package/dist-es/password-field.css-mistica.js +0 -4
  136. /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
  137. /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./dialog.css.ts.vanilla.css-mistica.js";
3
- var _ = "_3dl29lb", y = "_3dl29l6", f = "_3dl29ll _1y2v1nf6w", l = "_3dl29lj _1y2v1nfh4 _1y2v1nfii", a = "_3dl29lm", d = "_3dl29l8 _1y2v1nf6q _1y2v1nf7z _1y2v1nf98 _1y2v1nfah _1y2v1nfgd _1y2v1nfjp _1y2v1nfkj", o = "_3dl29la _1y2v1nf36 _1y2v1nfj9", r = "_3dl29l5 _1y2v1nfge _1y2v1nfgi _1y2v1nfgr _1y2v1nfgx _1y2v1nfgo _1y2v1nfjp _1y2v1nfkj _1y2v1nfky _1y2v1nfk4 _1y2v1nf3h", t = {
3
+ var v = 200, y = "_3dl29lb", f = "_3dl29l6", l = "_3dl29ll _1y2v1nf6w", a = "_3dl29lj _1y2v1nfh4 _1y2v1nfii", d = "_3dl29lm", o = "_3dl29l8 _1y2v1nf6q _1y2v1nf7z _1y2v1nf98 _1y2v1nfah _1y2v1nfgd _1y2v1nfjp _1y2v1nfkj", r = "_3dl29la _1y2v1nf36 _1y2v1nfj9", t = "_3dl29l5 _1y2v1nfge _1y2v1nfgi _1y2v1nfgr _1y2v1nfgx _1y2v1nfgo _1y2v1nfjp _1y2v1nfkj _1y2v1nfky _1y2v1nfk4 _1y2v1nf3h", i = {
4
4
  dialog: "_3dl29ld _1y2v1nfgi _1y2v1nfgo _1y2v1nfgu _1y2v1nf9e _1y2v1nfan _1y2v1nf72 _1y2v1nf85",
5
5
  default: "_3dl29ld _1y2v1nfgi _1y2v1nfgo _1y2v1nfgu _1y2v1nf6w _1y2v1nf85 _1y2v1nf9e _1y2v1nfan"
6
- }, i = "_3dl29l3 _1y2v1nfgc";
7
- export { _ as closedModalContent, y as closedOpactityLayer, f as dialogActions, l as dialogContent, a as iconContainer, d as modalCloseButtonContainer, o as modalContent, r as modalOpacityLayer, t as variants, i as wrapper };
6
+ }, e = "_3dl29l3 _1y2v1nfgc";
7
+ export { v as ANIMATION_DURATION_MS, y as closedModalContent, f as closedOpactityLayer, l as dialogActions, a as dialogContent, d as iconContainer, o as modalCloseButtonContainer, r as modalContent, t as modalOpacityLayer, i as variants, e as wrapper };
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 v = {
5
+ var t = {
5
6
  default: "skrulh1 _1y2v1nfgi _1y2v1nfgn _1y2v1nfh5",
6
7
  fullWidth: "skrulh2 _1y2v1nfgi _1y2v1nfgn _1y2v1nfh5"
7
8
  };
8
- export { v 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 "./feedback.css.ts.vanilla.css-mistica.js";
3
- var r = "gx6h6a3 _1y2v1nfgi _1y2v1nfhm _1y2v1nfh5", n = "_1y2v1nfja _1y2v1nfgi _1y2v1nfgu", v = "gx6h6a1", t = "gx6h6ab", h = "gx6h6a6", g = "gx6h6a8 gx6h6a7", i = "gx6h6a9 gx6h6a7", f = "gx6h6aa gx6h6a7", p = "_1y2v1nfhh _1y2v1nfhx", x = "gx6h6a4";
4
- export { r as container, n as desktopContainer, v as desktopContent, t as feedbackData, h as feedbackDataAppear, g as feedbackDataAppearActiveFast, i as feedbackDataAppearActiveMedium, f as feedbackDataAppearActiveSlow, p as iconContainer, x 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 };