@telefonica/mistica 14.41.0 → 14.42.1

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 (142) 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 +163 -246
  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 +23 -14
  34. package/dist/feedback.css.d.ts +7 -4
  35. package/dist/feedback.js +157 -143
  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/text.css-mistica.js +7 -7
  79. package/dist/text.css.d.ts +0 -1
  80. package/dist/text.js +24 -24
  81. package/dist/theme-context-provider.js +2 -2
  82. package/dist/utils/platform.js +8 -11
  83. package/dist-es/boxed.css-mistica.js +3 -2
  84. package/dist-es/boxed.js +17 -15
  85. package/dist-es/button-fixed-footer-layout.js +29 -24
  86. package/dist-es/button-layout.css-mistica.js +7 -7
  87. package/dist-es/button-layout.js +23 -23
  88. package/dist-es/button.js +65 -57
  89. package/dist-es/carousel.js +373 -280
  90. package/dist-es/credit-card-expiration-field.js +34 -30
  91. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  92. package/dist-es/credit-card-number-field.js +84 -70
  93. package/dist-es/cvv-field.js +68 -63
  94. package/dist-es/date-field.css-mistica.js +5 -0
  95. package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
  96. package/dist-es/date-field.js +46 -40
  97. package/dist-es/date-time-field.js +47 -41
  98. package/dist-es/date-time-picker.js +55 -57
  99. package/dist-es/decimal-field.js +31 -27
  100. package/dist-es/dialog-context.js +125 -0
  101. package/dist-es/dialog.css-mistica.js +3 -3
  102. package/dist-es/dialog.js +193 -262
  103. package/dist-es/double-field.css-mistica.js +3 -2
  104. package/dist-es/email-field.js +16 -12
  105. package/dist-es/feedback.css-mistica.js +2 -2
  106. package/dist-es/feedback.js +196 -182
  107. package/dist-es/fixed-footer-layout.css-mistica.js +1 -1
  108. package/dist-es/fixed-footer-layout.js +21 -20
  109. package/dist-es/iban-field.js +42 -38
  110. package/dist-es/index.js +1778 -1778
  111. package/dist-es/inline.css-mistica.js +3 -3
  112. package/dist-es/inline.js +18 -18
  113. package/dist-es/integer-field.js +21 -17
  114. package/dist-es/loading-bar.css-mistica.js +2 -2
  115. package/dist-es/loading-bar.js +10 -13
  116. package/dist-es/month-field.js +47 -41
  117. package/dist-es/package-version.js +1 -1
  118. package/dist-es/password-field.js +54 -52
  119. package/dist-es/phone-number-field.js +53 -49
  120. package/dist-es/pin-field.css-mistica.js +2 -2
  121. package/dist-es/pin-field.js +145 -111
  122. package/dist-es/responsive-layout.css-mistica.js +3 -3
  123. package/dist-es/responsive-layout.js +27 -24
  124. package/dist-es/search-field.js +45 -44
  125. package/dist-es/select.css-mistica.js +8 -7
  126. package/dist-es/select.js +167 -172
  127. package/dist-es/style.css +1 -1
  128. package/dist-es/text-field-base.css-mistica.js +2 -2
  129. package/dist-es/text-field-base.js +189 -157
  130. package/dist-es/text-field-components.css-mistica.js +3 -2
  131. package/dist-es/text-field-components.js +52 -49
  132. package/dist-es/text-field.js +31 -27
  133. package/dist-es/text.css-mistica.js +3 -3
  134. package/dist-es/text.js +32 -32
  135. package/dist-es/theme-context-provider.js +1 -1
  136. package/dist-es/utils/platform.js +6 -6
  137. package/package.json +1 -1
  138. package/dist/password-field.css-mistica.js +0 -13
  139. package/dist/password-field.css.d.ts +0 -1
  140. package/dist-es/password-field.css-mistica.js +0 -4
  141. /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
  142. /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
@@ -27,45 +27,69 @@ function _object_spread(target) {
27
27
  }
28
28
  return target;
29
29
  }
30
- import { jsxs as V, jsx as i } from "react/jsx-runtime";
30
+ function ownKeys(object, enumerableOnly) {
31
+ var keys = Object.keys(object);
32
+ if (Object.getOwnPropertySymbols) {
33
+ var symbols = Object.getOwnPropertySymbols(object);
34
+ if (enumerableOnly) {
35
+ symbols = symbols.filter(function(sym) {
36
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
37
+ });
38
+ }
39
+ keys.push.apply(keys, symbols);
40
+ }
41
+ return keys;
42
+ }
43
+ function _object_spread_props(target, source) {
44
+ source = source != null ? source : {};
45
+ if (Object.getOwnPropertyDescriptors) {
46
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
47
+ } else {
48
+ ownKeys(Object(source)).forEach(function(key) {
49
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
50
+ });
51
+ }
52
+ return target;
53
+ }
54
+ import { jsxs as $, jsx as n } from "react/jsx-runtime";
31
55
  import D from "classnames";
32
56
  import * as m from "react";
33
- import E from "./inline.js";
34
- import { input as L, inputWithoutLabel as W } from "./text-field-base.css-mistica.js";
35
- import { disabled as $, readOnlyField as j, focusedField as B, field as H, input as O, passwordInput as q, passwordDot as K } from "./pin-field.css-mistica.js";
57
+ import N from "./inline.js";
58
+ import { input as B } from "./text-field-base.css-mistica.js";
59
+ import { fieldContainer as E, disabled as L, readOnlyField as j, focusedField as O, field as W, input as q, passwordInput as z, pinInputLineHeight as h, passwordDot as K } from "./pin-field.css-mistica.js";
36
60
  import { useAriaId as M, useTheme as _ } from "./hooks.js";
37
- import z from "./screen-reader-only.js";
38
- import { IntegerInput as G } from "./integer-field.js";
39
- import { useFieldProps as J } from "./form-context.js";
40
- import { createChangeEvent as Q } from "./utils/dom.js";
41
- import { HelperText as U } from "./text-field-components.js";
42
- import { flushSync as X } from "react-dom";
43
- let P = !1;
44
- const Y = (param)=>{
45
- let { length: a = 6, hideCode: c = !1, readSms: d, disabled: h, readOnly: y, value: w, defaultValue: b, onChange: n, inputRef: R } = param;
61
+ import G from "./screen-reader-only.js";
62
+ import { IntegerInput as J } from "./integer-field.js";
63
+ import { useFieldProps as Q } from "./form-context.js";
64
+ import { getPrefixedDataAttributes as U, createChangeEvent as X } from "./utils/dom.js";
65
+ import { HelperText as Y } from "./text-field-components.js";
66
+ import { flushSync as Z } from "react-dom";
67
+ let T = !1;
68
+ const x = (param)=>{
69
+ let { length: l = 6, hideCode: f = !1, readSms: d, disabled: g, readOnly: y, value: F, defaultValue: b, onChange: u, inputRef: A } = param;
46
70
  var _ref;
47
- const { texts: T } = _(), [k, A] = m.useState((_ref = b == null ? void 0 : b.slice(0, a)) !== null && _ref !== void 0 ? _ref : ""), [F, v] = m.useState(void 0), l = m.useRef(Array.from({
48
- length: a
49
- }, ()=>null)).current, f = typeof w < "u", r = f ? w : k, u = m.useCallback((s)=>{
50
- if (s === r) return;
51
- f || A(s);
52
- const e = l[0];
53
- e && (n == null || n(Q(_object_spread({}, e), s)));
71
+ const { texts: C } = _(), [R, S] = m.useState((_ref = b == null ? void 0 : b.slice(0, l)) !== null && _ref !== void 0 ? _ref : ""), [w, I] = m.useState(void 0), a = m.useRef(Array.from({
72
+ length: l
73
+ }, ()=>null)).current, i = typeof F < "u", t = i ? F : R, c = m.useCallback((s)=>{
74
+ if (s === t) return;
75
+ i || S(s);
76
+ const e = a[0];
77
+ e && (u == null || u(X(_object_spread({}, e), s)));
54
78
  }, [
55
- r,
56
- l,
57
- f,
58
- n
79
+ t,
80
+ a,
81
+ i,
82
+ u
59
83
  ]);
60
84
  m.useEffect(()=>{
61
- u(r.slice(0, a));
85
+ c(t.slice(0, l));
62
86
  }, [
63
- a,
64
- r,
65
- u
87
+ l,
88
+ t,
89
+ c
66
90
  ]), m.useEffect(()=>{
67
- if (d && "OTPCredential" in window && !P) {
68
- P = !0;
91
+ if (d && "OTPCredential" in window && !T) {
92
+ T = !0;
69
93
  const s = new AbortController();
70
94
  return navigator.credentials.get({
71
95
  // @ts-expect-error: otp is not in the types yet
@@ -77,94 +101,101 @@ const Y = (param)=>{
77
101
  signal: s.signal
78
102
  }).then((e)=>{
79
103
  if (e) {
80
- const t = e.code.slice(0, a);
81
- u(t);
104
+ const r = e.code.slice(0, l);
105
+ c(r);
82
106
  }
83
107
  }).catch(()=>{}).finally(()=>{
84
- P = !1;
108
+ T = !1;
85
109
  }), ()=>{
86
- P = !1, s.abort();
110
+ T = !1, s.abort();
87
111
  };
88
112
  }
89
113
  }, [
90
- u,
91
- a,
114
+ c,
115
+ l,
92
116
  d
93
117
  ]);
94
- const N = (s)=>(e)=>{
95
- var C;
96
- const t = e.target.value;
97
- if (t === "") return;
98
- const o = r[s];
99
- let p = t;
100
- !o || o === t ? p = t : o === t[0] ? p = t.slice(1) : o === t[t.length - 1] && (p = t.slice(0, -1));
101
- let I = s, g = r;
118
+ const H = (s)=>(e)=>{
119
+ var k;
120
+ const r = e.target.value;
121
+ if (r === "") return;
122
+ const o = t[s];
123
+ let p = r;
124
+ !o || o === r ? p = r : o === r[0] ? p = r.slice(1) : o === r[r.length - 1] && (p = r.slice(0, -1));
125
+ let v = s, P = t;
102
126
  if (p.length >= 2) {
103
- const S = p.slice(0, a - s);
104
- g = r.slice(0, s) + S, I = Math.min(s + S.length, a - 1);
105
- } else g = r.slice(0, s) + p + r.slice(s + 1), I = s + 1;
106
- g !== r && (X(()=>{
107
- u(g);
108
- }), I !== s && I <= a - 1 && ((C = l[I]) == null || C.focus()));
127
+ const V = p.slice(0, l - s);
128
+ P = t.slice(0, s) + V, v = Math.min(s + V.length, l - 1);
129
+ } else P = t.slice(0, s) + p + t.slice(s + 1), v = s + 1;
130
+ P !== t && (Z(()=>{
131
+ c(P);
132
+ }), v !== s && v <= l - 1 && ((k = a[v]) == null || k.focus()));
109
133
  };
110
- return /* @__PURE__ */ i(E, {
134
+ return /* @__PURE__ */ n(N, {
111
135
  space: 8,
112
136
  children: Array.from({
113
- length: a
137
+ length: l
114
138
  }).map((s, e)=>/* @__PURE__ */ {
115
- var _r_e;
116
- return V("div", {
117
- className: y ? j : e === F ? B : H,
139
+ var _t_e;
140
+ return $("div", {
141
+ className: y ? j : e === w ? O : W,
118
142
  children: [
119
- /* @__PURE__ */ i(G, {
120
- "aria-label": T.pinFieldInputLabel.replace("1$s", String(e + 1)).replace("2$s", String(a)),
121
- type: c ? "password" : "text",
122
- tabIndex: e > r.length ? -1 : void 0,
143
+ /* @__PURE__ */ n(J, {
144
+ "aria-label": C.pinFieldInputLabel.replace("1$s", String(e + 1)).replace("2$s", String(l)),
145
+ type: f ? "password" : "text",
146
+ tabIndex: e > t.length ? -1 : void 0,
123
147
  required: !0,
124
148
  onFocus: ()=>{
125
149
  var o;
126
- const t = r.length === a ? -1 : r.length;
127
- t >= 0 && t < e ? (o = l[t]) == null || o.focus() : v(e);
150
+ const r = t.length === l ? -1 : t.length;
151
+ r >= 0 && r < e ? (o = a[r]) == null || o.focus() : I(e);
128
152
  },
129
153
  onBlur: ()=>{
130
- v(void 0);
154
+ I(void 0);
131
155
  },
132
- inputRef: (t)=>{
133
- l[e] = t, e === 0 && R(t);
156
+ inputRef: (r)=>{
157
+ a[e] = r, e === 0 && A(r);
134
158
  },
135
- className: D(L, W, O, {
136
- [q]: c
159
+ className: D(B, q, {
160
+ [z]: f
137
161
  }),
138
- disabled: h,
162
+ style: {
163
+ marginTop: `calc(${h} - 1px)`,
164
+ marginBottom: `calc(${h} - 1px)`,
165
+ lineHeight: h,
166
+ fontSize: h,
167
+ height: h
168
+ },
169
+ disabled: g,
139
170
  readOnly: y,
140
171
  autoComplete: d ? "one-time-code" : void 0,
141
- value: (_r_e = r[e]) !== null && _r_e !== void 0 ? _r_e : "",
142
- onChange: N(e),
143
- onKeyDown: (t)=>{
144
- switch(t.key){
172
+ value: (_t_e = t[e]) !== null && _t_e !== void 0 ? _t_e : "",
173
+ onChange: H(e),
174
+ onKeyDown: (r)=>{
175
+ switch(r.key){
145
176
  case "Backspace":
146
177
  case "Delete":
147
- if (t.currentTarget.value && u(r.slice(0, e) + r.slice(e + 1)), e > 0 && e >= r.length - 1) {
148
- const o = l[e - 1];
178
+ if (r.currentTarget.value && c(t.slice(0, e) + t.slice(e + 1)), e > 0 && e >= t.length - 1) {
179
+ const o = a[e - 1];
149
180
  o == null || o.focus();
150
181
  }
151
182
  break;
152
183
  case "ArrowLeft":
153
184
  if (e > 0) {
154
- const o = l[e - 1];
185
+ const o = a[e - 1];
155
186
  o && o.focus();
156
187
  }
157
188
  break;
158
189
  case "ArrowRight":
159
- if (e < a - 1) {
160
- const o = l[e + 1];
190
+ if (e < l - 1) {
191
+ const o = a[e + 1];
161
192
  o && o.focus();
162
193
  }
163
194
  break;
164
195
  }
165
196
  }
166
197
  }),
167
- c && r[e] && /* @__PURE__ */ i("div", {
198
+ f && t[e] && /* @__PURE__ */ n("div", {
168
199
  "aria-hidden": !0,
169
200
  className: K,
170
201
  children: "•"
@@ -173,48 +204,51 @@ const Y = (param)=>{
173
204
  }, e);
174
205
  })
175
206
  });
176
- }, Z = (param)=>{
177
- let { length: a = 6, hideCode: c = !1, readSms: d = !c, // by default, don't read sms if the code is hidden (password input type)
178
- disabled: h, readOnly: y, name: w, value: b, defaultValue: n, helperText: R, error: T, onChangeValue: k, onChange: A, "aria-label": F, "aria-labelledby": v } = param;
179
- const l = J({
180
- name: w,
207
+ }, ee = (param)=>{
208
+ let { length: l = 6, hideCode: f = !1, readSms: d = !f, // by default, don't read sms if the code is hidden (password input type)
209
+ disabled: g, readOnly: y, name: F, value: b, defaultValue: u, helperText: A, error: C, onChangeValue: R, onChange: S, "aria-label": w, "aria-labelledby": I, dataAttributes: a } = param;
210
+ const i = Q({
211
+ name: F,
181
212
  value: b,
182
- defaultValue: n,
183
- processValue: (r)=>r,
184
- helperText: R,
213
+ defaultValue: u,
214
+ processValue: (c)=>c,
215
+ helperText: A,
185
216
  optional: !1,
186
- error: T,
187
- disabled: h,
188
- onChangeValue: k,
189
- onChange: A
190
- }), f = M();
191
- return /* @__PURE__ */ V("div", {
217
+ error: C,
218
+ disabled: g,
219
+ onChangeValue: R,
220
+ onChange: S
221
+ }), t = M();
222
+ return /* @__PURE__ */ $("div", _object_spread_props(_object_spread({
192
223
  role: "group",
193
- "aria-labelledby": v !== null && v !== void 0 ? v : f,
194
- className: h ? $ : void 0,
224
+ "aria-labelledby": I !== null && I !== void 0 ? I : t,
225
+ className: D(E, {
226
+ [L]: g
227
+ })
228
+ }, U(a, "PinField")), {
195
229
  children: [
196
- F && !v && /* @__PURE__ */ i(z, {
197
- children: /* @__PURE__ */ i("div", {
198
- id: f,
199
- children: F
230
+ w && !I && /* @__PURE__ */ n(G, {
231
+ children: /* @__PURE__ */ n("div", {
232
+ id: t,
233
+ children: w
200
234
  })
201
235
  }),
202
- /* @__PURE__ */ i(Y, {
203
- inputRef: l.inputRef,
204
- length: a,
205
- hideCode: c,
236
+ /* @__PURE__ */ n(x, {
237
+ inputRef: i.inputRef,
238
+ length: l,
239
+ hideCode: f,
206
240
  readSms: d,
207
- value: l.value,
208
- defaultValue: l.defaultValue,
209
- disabled: l.disabled,
210
- onChange: l.onChange,
241
+ value: i.value,
242
+ defaultValue: i.defaultValue,
243
+ disabled: i.disabled,
244
+ onChange: i.onChange,
211
245
  readOnly: y
212
246
  }),
213
- /* @__PURE__ */ i(U, {
214
- error: l.error,
215
- leftText: l.helperText
247
+ /* @__PURE__ */ n(Y, {
248
+ error: i.error,
249
+ leftText: i.helperText
216
250
  })
217
251
  ]
218
- });
219
- }, pe = Z;
220
- export { pe as default };
252
+ }));
253
+ }, de = ee;
254
+ export { de as default };
@@ -1,7 +1,7 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./responsive-layout.css.ts.vanilla.css-mistica.js";
3
- var o = {
3
+ var e = {
4
4
  inverse: "_1y2v1nf3f",
5
5
  alternative: "_1y2v1nf3k"
6
- }, r = "_17lofg73", e = "_17lofg79 _1y2v1nfh5", v = "_17lofg74", t = "_17lofg77", i = "_17lofg72 _1y2v1nfh5";
7
- export { o as backgroundVariant, r as expandedResponsiveLayoutContainer, e as fullWidth, v as fullwidthContainer, t as responsiveLayout, i as responsiveLayoutContainer };
6
+ }, n = "_17lofg74", r = "_17lofg73", t = "_17lofg7a _1y2v1nfh5", v = "_17lofg75", i = "_17lofg78", f = "_17lofg72 _1y2v1nfh5";
7
+ export { e as backgroundVariant, n as expandedResponsiveLayoutContainerDesktop, r as expandedResponsiveLayoutContainerMobile, t as fullWidth, v as fullwidthContainer, i as responsiveLayout, f as responsiveLayoutContainer };
@@ -78,35 +78,38 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as t } from "react/jsx-runtime";
82
- import l from "classnames";
83
- import { getPrefixedDataAttributes as p } from "./utils/dom.js";
84
- import { fullwidthContainer as v, responsiveLayoutContainer as c, backgroundVariant as f, expandedResponsiveLayoutContainer as h, fullWidth as y, responsiveLayout as L } from "./responsive-layout.css-mistica.js";
85
- import { useThemeVariant as x, ThemeVariant as V } from "./theme-variant-context.js";
86
- const R = (param)=>{
87
- let { children: a, isInverse: n = !1, variant: i, backgroundColor: o, className: r, fullWidth: s, dataAttributes: d, shouldExpandWhenNested: u = !1 } = param;
88
- const m = x(), e = i || n && "inverse" || void 0;
89
- return /* @__PURE__ */ t(V, {
90
- variant: e !== null && e !== void 0 ? e : m,
91
- children: /* @__PURE__ */ t("div", _object_spread_props(_object_spread({
92
- className: l(s ? v : c, r, e && e !== "default" && f[e], u && !s && h),
93
- style: o ? {
94
- background: o
81
+ import { jsx as a } from "react/jsx-runtime";
82
+ import m from "classnames";
83
+ import { getPrefixedDataAttributes as v } from "./utils/dom.js";
84
+ import { fullwidthContainer as l, responsiveLayoutContainer as c, backgroundVariant as f, expandedResponsiveLayoutContainerMobile as y, expandedResponsiveLayoutContainerDesktop as L, fullWidth as x, responsiveLayout as R } from "./responsive-layout.css-mistica.js";
85
+ import { useThemeVariant as V, ThemeVariant as h } from "./theme-variant-context.js";
86
+ const b = (param)=>{
87
+ let { children: n, isInverse: o = !1, variant: r, backgroundColor: s, className: p, fullWidth: e, dataAttributes: u, shouldExpandWhenNested: i = !1 } = param;
88
+ const d = V(), t = r || o && "inverse" || void 0;
89
+ return /* @__PURE__ */ a(h, {
90
+ variant: t !== null && t !== void 0 ? t : d,
91
+ children: /* @__PURE__ */ a("div", _object_spread_props(_object_spread({
92
+ className: m(e ? l : c, p, t && t !== "default" && f[t], {
93
+ [y]: i === !0 && !e,
94
+ [L]: i && !e
95
+ }),
96
+ style: s ? {
97
+ background: s
95
98
  } : void 0
96
- }, p(d)), {
97
- children: /* @__PURE__ */ t("div", {
98
- className: s ? y : L,
99
- children: a
99
+ }, v(u)), {
100
+ children: /* @__PURE__ */ a("div", {
101
+ className: e ? x : R,
102
+ children: n
100
103
  })
101
104
  }))
102
105
  });
103
- }, N = (_param)=>{
104
- var { children: a } = _param, n = _object_without_properties(_param, [
106
+ }, C = (_param)=>{
107
+ var { children: n } = _param, o = _object_without_properties(_param, [
105
108
  "children"
106
109
  ]);
107
- return /* @__PURE__ */ t(R, _object_spread_props(_object_spread({}, n), {
110
+ return /* @__PURE__ */ a(b, _object_spread_props(_object_spread({}, o), {
108
111
  shouldExpandWhenNested: !0,
109
- children: a
112
+ children: n
110
113
  }));
111
- }, k = N;
112
- export { R as InternalResponsiveLayout, k as default };
114
+ }, j = C;
115
+ export { b as InternalResponsiveLayout, j as default };
@@ -78,18 +78,18 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as c } from "react/jsx-runtime";
81
+ import { jsx as a } from "react/jsx-runtime";
82
82
  import * as r from "react";
83
- import { useFieldProps as k } from "./form-context.js";
84
- import { TextFieldBaseAutosuggest as T } from "./text-field-base.js";
85
- import j from "./generated/mistica-icons/icon-search-regular.js";
86
- import z from "./generated/mistica-icons/icon-close-regular.js";
87
- import A from "./icon-button.js";
88
- import { useTheme as E } from "./hooks.js";
89
- import { createChangeEvent as V } from "./utils/dom.js";
90
- import { combineRefs as $ } from "./utils/common.js";
91
- const q = /*#__PURE__*/ r.forwardRef((_param, y)=>{
92
- var { disabled: m, error: u, helperText: d, name: p, optional: n, validate: R, onChange: e, onChangeValue: t, onBlur: I, value: a, defaultValue: S } = _param, x = _object_without_properties(_param, [
83
+ import { useFieldProps as A } from "./form-context.js";
84
+ import { TextFieldBaseAutosuggest as B, FieldEndIcon as E } from "./text-field-base.js";
85
+ import T from "./generated/mistica-icons/icon-search-regular.js";
86
+ import j from "./generated/mistica-icons/icon-close-regular.js";
87
+ import { useTheme as w } from "./hooks.js";
88
+ import { createChangeEvent as N } from "./utils/dom.js";
89
+ import { combineRefs as V } from "./utils/common.js";
90
+ import { iconSize as W, endIconWithShadow as $ } from "./text-field-base.css-mistica.js";
91
+ const q = /*#__PURE__*/ r.forwardRef((_param, h)=>{
92
+ var { disabled: f, error: d, helperText: u, name: n, optional: p, validate: S, onChange: e, onChangeValue: t, onBlur: I, value: l, defaultValue: R, dataAttributes: F } = _param, b = _object_without_properties(_param, [
93
93
  "disabled",
94
94
  "error",
95
95
  "helperText",
@@ -100,48 +100,49 @@ const q = /*#__PURE__*/ r.forwardRef((_param, y)=>{
100
100
  "onChangeValue",
101
101
  "onBlur",
102
102
  "value",
103
- "defaultValue"
103
+ "defaultValue",
104
+ "dataAttributes"
104
105
  ]);
105
- const b = E(), o = r.useRef(), [F, P] = r.useState(S || ""), i = typeof a < "u", f = i ? a : F, l = r.useCallback((s, B)=>{
106
- i || P(s), t == null || t(s, B);
106
+ const x = w(), o = r.useRef(), [P, v] = r.useState(R || ""), c = typeof l < "u", m = c ? l : P, i = r.useCallback((s, z)=>{
107
+ c || v(s), t == null || t(s, z);
107
108
  }, [
108
- i,
109
+ c,
109
110
  t
110
- ]), h = r.useCallback(()=>{
111
- l("", ""), o.current && (e == null || e(V(o.current, "")), o.current.focus());
111
+ ]), y = r.useCallback(()=>{
112
+ i("", ""), o.current && (e == null || e(N(o.current, "")), o.current.focus());
112
113
  }, [
113
- l,
114
+ i,
114
115
  e
115
- ]), v = k({
116
- name: p,
117
- value: f,
116
+ ]), k = A({
117
+ name: n,
118
+ value: m,
118
119
  defaultValue: void 0,
119
120
  processValue: (s)=>s,
120
- helperText: d,
121
- optional: n,
122
- error: u,
123
- disabled: m,
121
+ helperText: u,
122
+ optional: p,
123
+ error: d,
124
+ disabled: f,
124
125
  onBlur: I,
125
- validate: R,
126
+ validate: S,
126
127
  onChange: e,
127
- onChangeValue: l
128
+ onChangeValue: i
128
129
  });
129
- return /* @__PURE__ */ c(T, _object_spread_props(_object_spread({
130
- ref: $(o, y),
131
- startIcon: /* @__PURE__ */ c(j, {}),
132
- endIcon: f ? /* @__PURE__ */ c(A, {
133
- size: 48,
134
- style: {
135
- display: "flex",
136
- padding: 12,
137
- margin: -12
138
- },
139
- "aria-label": b.texts.formSearchClear,
140
- onPress: h,
141
- children: /* @__PURE__ */ c(z, {})
130
+ return /* @__PURE__ */ a(B, _object_spread_props(_object_spread({
131
+ ref: V(o, h),
132
+ startIcon: /* @__PURE__ */ a(T, {
133
+ size: W
134
+ }),
135
+ endIcon: m ? /* @__PURE__ */ a(E, {
136
+ Icon: j,
137
+ className: $,
138
+ "aria-label": x.texts.formSearchClear,
139
+ onPress: y
142
140
  }) : void 0
143
- }, x, v), {
144
- type: "search"
141
+ }, b, k), {
142
+ type: "search",
143
+ dataAttributes: _object_spread({
144
+ "component-name": "SearchField"
145
+ }, F)
145
146
  }));
146
- }), O = q;
147
- export { O as default };
147
+ }), U = q;
148
+ export { U as default };
@@ -1,22 +1,23 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
+ import "./text-field-base.css.ts.vanilla.css-mistica.js";
2
3
  import "./select.css.ts.vanilla.css-mistica.js";
3
- var n = "_1sqpivvo _1y2v1nfgd _1y2v1nfko", i = "_1sqpivvq _1y2v1nf98 _1y2v1nfah _1y2v1nf6k _1y2v1nf7t _1y2v1nf22 _1y2v1nfgi _1y2v1nfgx _1y2v1nfji _1y2v1nfhx", f = "_1y2v1nf3k", y = {
4
+ var i = "_1sqpivvo _1y2v1nfgd", f = "_1sqpivvq _1y2v1nf98 _1y2v1nfah _1y2v1nf6k _1y2v1nf7t _1y2v1nf22 _1y2v1nfgi _1y2v1nfgx _1y2v1nfji", y = "_1y2v1nf3k", a = {
4
5
  show: "_1sqpivv7",
5
6
  hide: "_1sqpivv8"
6
- }, a = "_1sqpivv6 _1y2v1nf6b _1y2v1nf7k _1y2v1nf8t _1y2v1nfa2 _1y2v1nfge _1y2v1nfj8 _1y2v1nf37", s = {
7
+ }, s = "_1sqpivv6 _1y2v1nf6b _1y2v1nf7k _1y2v1nf8t _1y2v1nfa2 _1y2v1nfge _1y2v1nfj8 _1y2v1nf37", t = {
7
8
  default: "_1sqpivvd _1sqpivvc _1y2v1nfgc _1y2v1nfji",
8
9
  fullWidth: "_1sqpivve _1sqpivvc _1y2v1nfgc _1y2v1nfji"
9
- }, t = {
10
+ }, r = {
10
11
  default: "_1sqpivvl _1sqpivvk _1y2v1nfgd _1y2v1nfjj _1y2v1nfix _1y2v1nf22",
11
12
  disabled: "_1sqpivvm _1sqpivvk _1y2v1nfgd _1y2v1nfjj _1y2v1nfix _1y2v1nf22"
12
- }, r = {
13
- default: "_1sqpivvh _1sqpivvg _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5 _1y2v1nfhm",
14
- disabled: "_1sqpivvi _1sqpivvg _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5 _1y2v1nfhm"
15
13
  }, p = {
14
+ default: "_1sqpivvh _1sqpivvg _1y2v1nf6b _1y2v1nf7k _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5",
15
+ disabled: "_1sqpivvi _1sqpivvg _1y2v1nf6b _1y2v1nf7k _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5"
16
+ }, e = {
16
17
  top: "var(--_1sqpivv0)",
17
18
  left: "var(--_1sqpivv1)",
18
19
  transformOrigin: "var(--_1sqpivv2)",
19
20
  minWidth: "var(--_1sqpivv3)",
20
21
  maxHeight: "var(--_1sqpivv4)"
21
22
  };
22
- export { n as arrowDown, i as menuItem, f as menuItemSelected, y as optionsAnimationsVariants, a as optionsContainer, s as selectContainerVariants, t as selectTextVariants, r as selectVariants, p as vars };
23
+ export { i as arrowDown, f as menuItem, y as menuItemSelected, a as optionsAnimationsVariants, s as optionsContainer, t as selectContainerVariants, r as selectTextVariants, p as selectVariants, e as vars };