@telefonica/mistica 16.0.0 → 16.1.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 (152) hide show
  1. package/README.md +11 -9
  2. package/css/mistica.css +1 -1
  3. package/dist/box.d.ts +1 -0
  4. package/dist/box.js +12 -12
  5. package/dist/card.d.ts +14 -2
  6. package/dist/card.js +210 -206
  7. package/dist/credit-card-expiration-field.d.ts +1 -1
  8. package/dist/credit-card-expiration-field.js +53 -52
  9. package/dist/credit-card-number-field.d.ts +1 -1
  10. package/dist/credit-card-number-field.js +47 -45
  11. package/dist/cvv-field.d.ts +1 -1
  12. package/dist/cvv-field.js +38 -37
  13. package/dist/date-field.d.ts +1 -1
  14. package/dist/date-field.js +15 -13
  15. package/dist/date-time-field.d.ts +1 -1
  16. package/dist/date-time-field.js +13 -11
  17. package/dist/decimal-field.d.ts +1 -1
  18. package/dist/decimal-field.js +39 -38
  19. package/dist/email-field.d.ts +1 -1
  20. package/dist/email-field.js +21 -19
  21. package/dist/form-context.d.ts +7 -2
  22. package/dist/form-context.js +69 -62
  23. package/dist/form.d.ts +2 -1
  24. package/dist/form.js +94 -80
  25. package/dist/iban-field.d.ts +1 -1
  26. package/dist/iban-field.js +32 -30
  27. package/dist/index.d.ts +12 -3
  28. package/dist/index.js +19 -8
  29. package/dist/inline.d.ts +2 -1
  30. package/dist/inline.js +16 -15
  31. package/dist/integer-field.d.ts +1 -1
  32. package/dist/integer-field.js +30 -30
  33. package/dist/month-field.d.ts +1 -1
  34. package/dist/month-field.js +15 -13
  35. package/dist/package-version.js +1 -1
  36. package/dist/password-field.d.ts +1 -1
  37. package/dist/password-field.js +24 -22
  38. package/dist/phone-number-field.d.ts +4 -1
  39. package/dist/phone-number-field.js +84 -52
  40. package/dist/pin-field.js +21 -20
  41. package/dist/radio-button.d.ts +1 -0
  42. package/dist/radio-button.js +42 -41
  43. package/dist/rating.css-mistica.js +44 -0
  44. package/dist/rating.css.d.ts +11 -0
  45. package/dist/rating.css.ts.vanilla.css-mistica.js +11 -0
  46. package/dist/rating.d.ts +37 -0
  47. package/dist/rating.js +320 -0
  48. package/dist/search-field.d.ts +1 -0
  49. package/dist/search-field.js +18 -16
  50. package/dist/select.js +36 -33
  51. package/dist/sheet-action-row.css-mistica.js +13 -0
  52. package/dist/sheet-action-row.css.d.ts +1 -0
  53. package/dist/sheet-actions-list.d.ts +26 -0
  54. package/dist/sheet-actions-list.js +147 -0
  55. package/dist/sheet-actions.d.ts +23 -0
  56. package/dist/sheet-actions.js +175 -0
  57. package/dist/{sheet.css-mistica.js → sheet-common.css-mistica.js} +15 -21
  58. package/dist/{sheet.css.d.ts → sheet-common.css.d.ts} +0 -2
  59. package/dist/sheet-common.css.ts.vanilla.css-mistica.js +11 -0
  60. package/dist/sheet-common.d.ts +24 -0
  61. package/dist/sheet-common.js +429 -0
  62. package/dist/sheet-info.css-mistica.js +12 -0
  63. package/dist/sheet-info.css.d.ts +1 -0
  64. package/dist/sheet-info.d.ts +28 -0
  65. package/dist/sheet-info.js +156 -0
  66. package/dist/sheet-native.d.ts +2 -0
  67. package/dist/sheet-native.js +173 -0
  68. package/dist/sheet-radio-list.d.ts +22 -0
  69. package/dist/sheet-radio-list.js +143 -0
  70. package/dist/sheet-root.d.ts +4 -85
  71. package/dist/sheet-root.js +48 -322
  72. package/dist/sheet-types.d.ts +88 -0
  73. package/dist/sheet-web.d.ts +8 -0
  74. package/dist/sheet-web.js +183 -0
  75. package/dist/slider.js +40 -39
  76. package/dist/switch-component.js +18 -17
  77. package/dist/text-field-base.d.ts +3 -1
  78. package/dist/text-field-base.js +74 -66
  79. package/dist/text-field-components.css-mistica.js +14 -14
  80. package/dist/text-field-components.css.d.ts +2 -2
  81. package/dist/text-field-components.js +49 -39
  82. package/dist/text-field.d.ts +1 -0
  83. package/dist/text-field.js +24 -22
  84. package/dist/text-tokens.d.ts +14 -0
  85. package/dist/text-tokens.js +145 -89
  86. package/dist/theme-context-provider.js +6 -5
  87. package/dist/theme.d.ts +2 -0
  88. package/dist/utils/credit-card.d.ts +2 -2
  89. package/dist/utils/credit-card.js +1 -1
  90. package/dist/vivinho-loading-animation/in-lottie.json.js +544 -612
  91. package/dist/vivinho-loading-animation/out-lottie.json.js +828 -896
  92. package/dist/vivinho-loading-animation/pulse-lottie.json.js +798 -866
  93. package/dist/vivinho-loading-animation/wave-lottie.json.js +4303 -4409
  94. package/dist-es/box.js +18 -18
  95. package/dist-es/card.js +305 -301
  96. package/dist-es/credit-card-expiration-field.js +57 -56
  97. package/dist-es/credit-card-number-field.js +74 -72
  98. package/dist-es/cvv-field.js +82 -81
  99. package/dist-es/date-field.js +29 -27
  100. package/dist-es/date-time-field.js +29 -27
  101. package/dist-es/decimal-field.js +46 -45
  102. package/dist-es/email-field.js +26 -24
  103. package/dist-es/form-context.js +70 -63
  104. package/dist-es/form.js +102 -88
  105. package/dist-es/iban-field.js +35 -33
  106. package/dist-es/index.js +1822 -1817
  107. package/dist-es/inline.js +26 -25
  108. package/dist-es/integer-field.js +31 -31
  109. package/dist-es/month-field.js +28 -26
  110. package/dist-es/package-version.js +1 -1
  111. package/dist-es/password-field.js +37 -35
  112. package/dist-es/phone-number-field.js +92 -60
  113. package/dist-es/pin-field.js +32 -31
  114. package/dist-es/radio-button.js +42 -41
  115. package/dist-es/rating.css-mistica.js +6 -0
  116. package/dist-es/rating.css.ts.vanilla.css-mistica.js +2 -0
  117. package/dist-es/rating.js +257 -0
  118. package/dist-es/search-field.js +33 -31
  119. package/dist-es/select.js +49 -46
  120. package/dist-es/sheet-action-row.css-mistica.js +4 -0
  121. package/dist-es/sheet-actions-list.js +92 -0
  122. package/dist-es/sheet-actions.js +125 -0
  123. package/dist-es/sheet-common.css-mistica.js +4 -0
  124. package/dist-es/sheet-common.css.ts.vanilla.css-mistica.js +2 -0
  125. package/dist-es/sheet-common.js +366 -0
  126. package/dist-es/sheet-info.css-mistica.js +3 -0
  127. package/dist-es/sheet-info.js +101 -0
  128. package/dist-es/sheet-native.js +164 -0
  129. package/dist-es/sheet-radio-list.js +88 -0
  130. package/dist-es/sheet-root.js +50 -319
  131. package/dist-es/sheet-web.js +128 -0
  132. package/dist-es/slider.js +49 -48
  133. package/dist-es/style.css +1 -1
  134. package/dist-es/switch-component.js +27 -26
  135. package/dist-es/text-field-base.js +108 -100
  136. package/dist-es/text-field-components.css-mistica.js +2 -2
  137. package/dist-es/text-field-components.js +70 -60
  138. package/dist-es/text-field.js +33 -31
  139. package/dist-es/text-tokens.js +80 -45
  140. package/dist-es/theme-context-provider.js +20 -19
  141. package/dist-es/utils/credit-card.js +1 -1
  142. package/dist-es/vivinho-loading-animation/in-lottie.json.js +534 -599
  143. package/dist-es/vivinho-loading-animation/out-lottie.json.js +821 -886
  144. package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +790 -855
  145. package/dist-es/vivinho-loading-animation/wave-lottie.json.js +4297 -4400
  146. package/package.json +4 -3
  147. package/dist/sheet.d.ts +0 -107
  148. package/dist/sheet.js +0 -642
  149. package/dist-es/sheet.css-mistica.js +0 -4
  150. package/dist-es/sheet.js +0 -567
  151. /package/dist/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
  152. /package/dist-es/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return Y;
9
+ return Z;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -145,12 +145,13 @@ function _object_without_properties_loose(source, excluded) {
145
145
  }
146
146
  return target;
147
147
  }
148
- const H = /*#__PURE__*/ _react.forwardRef((_param, x)=>{
149
- var { disabled: m, error: u, helperText: d, name: p, optional: n, validate: S, onChange: e, onChangeValue: t, onBlur: I, value: f, defaultValue: R, dataAttributes: F } = _param, b = _object_without_properties(_param, [
148
+ const J = /*#__PURE__*/ _react.forwardRef((_param, P)=>{
149
+ var { disabled: m, error: u, helperText: d, name: p, label: n, optional: S, validate: I, onChange: e, onChangeValue: t, onBlur: R, value: f, defaultValue: F, dataAttributes: b } = _param, x = _object_without_properties(_param, [
150
150
  "disabled",
151
151
  "error",
152
152
  "helperText",
153
153
  "name",
154
+ "label",
154
155
  "optional",
155
156
  "validate",
156
157
  "onChange",
@@ -160,44 +161,45 @@ const H = /*#__PURE__*/ _react.forwardRef((_param, x)=>{
160
161
  "defaultValue",
161
162
  "dataAttributes"
162
163
  ]);
163
- const { texts: P, t: h } = (0, _hooks.useTheme)(), o = _react.useRef(), [v, y] = _react.useState(R || ""), s = typeof f < "u", l = s ? f : v, i = _react.useCallback((c, A)=>{
164
- s || y(c), t == null || t(c, A);
164
+ const { texts: h, t: v } = (0, _hooks.useTheme)(), o = _react.useRef(), [y, k] = _react.useState(F || ""), s = typeof f < "u", l = s ? f : y, i = _react.useCallback((c, B)=>{
165
+ s || k(c), t == null || t(c, B);
165
166
  }, [
166
167
  s,
167
168
  t
168
- ]), k = _react.useCallback(()=>{
169
+ ]), z = _react.useCallback(()=>{
169
170
  i("", ""), o.current && (e == null || e((0, _dom.createChangeEvent)(o.current, "")), o.current.focus());
170
171
  }, [
171
172
  i,
172
173
  e
173
- ]), z = (0, _formcontext.useFieldProps)({
174
+ ]), A = (0, _formcontext.useFieldProps)({
174
175
  name: p,
176
+ label: n,
175
177
  value: l,
176
178
  defaultValue: void 0,
177
179
  processValue: (c)=>c,
178
180
  helperText: d,
179
- optional: n,
181
+ optional: S,
180
182
  error: u,
181
183
  disabled: m,
182
- onBlur: I,
183
- validate: S,
184
+ onBlur: R,
185
+ validate: I,
184
186
  onChange: e,
185
187
  onChangeValue: i
186
188
  });
187
189
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({
188
- ref: (0, _common.combineRefs)(o, x),
190
+ ref: (0, _common.combineRefs)(o, P),
189
191
  startIcon: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconsearchregular.default, {
190
192
  size: _iconbuttoncssmistica.iconSize.default
191
193
  }),
192
194
  endIcon: l ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.FieldEndIcon, {
193
195
  Icon: _iconcloseregular.default,
194
- "aria-label": P.formSearchClear || h(_texttokens.formSearchClear),
195
- onPress: k
196
+ "aria-label": h.formSearchClear || v(_texttokens.formSearchClear),
197
+ onPress: z
196
198
  }) : void 0
197
- }, b, z), {
199
+ }, x, A), {
198
200
  type: "search",
199
201
  dataAttributes: _object_spread({
200
202
  "component-name": "SearchField"
201
- }, F)
203
+ }, b)
202
204
  }));
203
- }), Y = H;
205
+ }), Z = J;
package/dist/select.js CHANGED
@@ -126,9 +126,9 @@ function _object_spread_props(target, source) {
126
126
  return target;
127
127
  }
128
128
  const ot = (param)=>{
129
- let { id: ue, label: m, helperText: de, value: fe, defaultValue: pe, onChangeValue: C, name: i, fullWidth: P, options: u, optional: D, disabled: me, error: he, onBlur: M, autoFocus: z = !1, native: Se } = param;
129
+ let { id: ue, label: u, helperText: de, value: fe, defaultValue: pe, onChangeValue: C, name: i, fullWidth: P, options: d, optional: D, disabled: me, error: he, onBlur: M, autoFocus: z = !1, native: Se } = param;
130
130
  var ne;
131
- const h = _react.useRef(null), d = _react.useRef(null), S = _react.useRef(null), v = _react.useRef(null), R = _react.useRef(/* @__PURE__ */ new Map()), [ve, ge] = _react.useState(!0), [g, Te] = _react.useState(pe), [H, j] = _react.useState(!1), [K, U] = _react.useState(!1), [X, O] = _react.useState(!1), [a, F] = _react.useState({}), [T, W] = _react.useState(), G = _react.useRef(null), Ie = _react.useId(), L = ue || Ie, { rawValues: Ee, setRawValue: Z, setValue: $, formStatus: we, formErrors: J, setFormError: xe, register: B } = (0, _formcontext.useForm)(), { platformOverrides: Q } = (0, _hooks.useTheme)(), Oe = Se || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || (0, _platform.isAndroid)(Q) || (0, _platform.isIos)(Q), I = me || we === "sending", A = he || !!J[i], Y = J[i] || de, l = fe !== null && fe !== void 0 ? fe : Ee[i], ee = (e)=>{
131
+ const h = _react.useRef(null), f = _react.useRef(null), S = _react.useRef(null), v = _react.useRef(null), R = _react.useRef(/* @__PURE__ */ new Map()), [ve, ge] = _react.useState(!0), [g, Te] = _react.useState(pe), [H, j] = _react.useState(!1), [K, U] = _react.useState(!1), [X, O] = _react.useState(!1), [a, F] = _react.useState({}), [T, W] = _react.useState(), G = _react.useRef(null), Ie = _react.useId(), L = ue || Ie, { rawValues: Ee, setRawValue: Z, setValue: $, formStatus: we, formErrors: J, setFormError: xe, register: B } = (0, _formcontext.useForm)(), { platformOverrides: Q } = (0, _hooks.useTheme)(), Oe = Se || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || (0, _platform.isAndroid)(Q) || (0, _platform.isIos)(Q), I = me || we === "sending", A = he || !!J[i], Y = J[i] || de, l = fe !== null && fe !== void 0 ? fe : Ee[i], ee = (e)=>{
132
132
  C == null || C(e), xe({
133
133
  name: i,
134
134
  error: ""
@@ -142,28 +142,28 @@ const ot = (param)=>{
142
142
  }, E = (e)=>{
143
143
  if (e) {
144
144
  if (S != null && S.current) {
145
- const o = S.current.getBoundingClientRect(), f = o.top, x = o.width, y = o.left, Ve = o.height, b = f + Ve, V = Math.min(u.length, 8) * 48 + 16;
146
- if (b + V + 12 > window.innerHeight) {
147
- const _e = window.innerHeight - b;
148
- if (f > _e) {
149
- const ke = f - V;
145
+ const o = S.current.getBoundingClientRect(), p = o.top, x = o.width, y = o.left, Ve = o.height, N = p + Ve, V = Math.min(d.length, 8) * 48 + 16;
146
+ if (N + V + 12 > window.innerHeight) {
147
+ const _e = window.innerHeight - N;
148
+ if (p > _e) {
149
+ const ke = p - V;
150
150
  F({
151
151
  minWidth: x,
152
152
  left: y,
153
153
  top: Math.max(ke, 12),
154
- maxHeight: Math.min(f - 12, V),
154
+ maxHeight: Math.min(p - 12, V),
155
155
  transformOrigin: "center bottom"
156
156
  });
157
157
  } else F({
158
158
  minWidth: x,
159
- top: b,
159
+ top: N,
160
160
  left: y,
161
- maxHeight: window.innerHeight - b - 12,
161
+ maxHeight: window.innerHeight - N - 12,
162
162
  transformOrigin: "center top"
163
163
  });
164
164
  } else F({
165
165
  minWidth: x,
166
- top: b,
166
+ top: N,
167
167
  left: y,
168
168
  maxHeight: V,
169
169
  transformOrigin: "center top"
@@ -187,7 +187,7 @@ const ot = (param)=>{
187
187
  }
188
188
  o && o.top + o.height / 2 <= t.top && (c == null || c.scrollIntoView(!1));
189
189
  }
190
- }, be = d.current, Ne = h.current;
190
+ }, Ne = f.current, be = h.current;
191
191
  _react.useEffect(()=>{
192
192
  Z({
193
193
  name: i,
@@ -203,22 +203,25 @@ const ot = (param)=>{
203
203
  l
204
204
  ]), _react.useEffect(()=>(B(i, {
205
205
  input: h.current,
206
- focusableElement: d.current
206
+ focusableElement: f.current,
207
+ label: u
207
208
  }), ()=>{
208
209
  B(i, {
209
210
  input: null,
210
- focusableElement: null
211
+ focusableElement: null,
212
+ label: ""
211
213
  });
212
214
  }), [
213
215
  i,
214
216
  B,
215
- d,
217
+ f,
216
218
  h,
219
+ Ne,
217
220
  be,
218
- Ne
221
+ u
219
222
  ]), _react.useEffect(()=>{
220
223
  const e = (s)=>{
221
- var f;
224
+ var p;
222
225
  const o = {
223
226
  [_keys.UP]: -1,
224
227
  [_keys.DOWN]: 1
@@ -226,10 +229,10 @@ const ot = (param)=>{
226
229
  if (o) {
227
230
  (0, _dom.cancelEvent)(s);
228
231
  var _ref;
229
- const x = (_ref = (f = u[u.findIndex((param)=>{
232
+ const x = (_ref = (p = d[d.findIndex((param)=>{
230
233
  let { value: y } = param;
231
234
  return y === T;
232
- }) + o]) == null ? void 0 : f.value) !== null && _ref !== void 0 ? _ref : T;
235
+ }) + o]) == null ? void 0 : p.value) !== null && _ref !== void 0 ? _ref : T;
233
236
  W(x), ye(x);
234
237
  }
235
238
  }, t = (s)=>{
@@ -242,7 +245,7 @@ const ot = (param)=>{
242
245
  break;
243
246
  case _keys.ENTER:
244
247
  case _keys.SPACE:
245
- (0, _dom.cancelEvent)(s), u.findIndex((param)=>{
248
+ (0, _dom.cancelEvent)(s), d.findIndex((param)=>{
246
249
  let { value: c } = param;
247
250
  return c === T;
248
251
  }) !== -1 && T !== g && q(T), E(!1);
@@ -254,7 +257,7 @@ const ot = (param)=>{
254
257
  document.removeEventListener("keydown", t, !1);
255
258
  };
256
259
  }), _react.useEffect(()=>{
257
- z && d.current && d.current.focus();
260
+ z && f.current && f.current.focus();
258
261
  }, [
259
262
  z
260
263
  ]), _react.useEffect(()=>{
@@ -262,7 +265,7 @@ const ot = (param)=>{
262
265
  }, []);
263
266
  const Re = (e)=>{
264
267
  var t;
265
- return e ? (t = u.find((param)=>{
268
+ return e ? (t = d.find((param)=>{
266
269
  let { value: s } = param;
267
270
  return s === e;
268
271
  })) == null ? void 0 : t.text : "";
@@ -289,15 +292,15 @@ const ot = (param)=>{
289
292
  fieldRef: S,
290
293
  fullWidth: P,
291
294
  children: [
292
- m && /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.Label, {
295
+ u && /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.Label, {
293
296
  error: A,
294
297
  forId: L,
295
298
  inputState: X ? "focused" : (w !== null && w !== void 0 ? w : (ne = h.current) == null ? void 0 : ne.value) ? "filled" : "default",
296
299
  optional: D,
297
- children: m
300
+ children: u
298
301
  }),
299
302
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("select", {
300
- className: (0, _classnames.default)(_selectcssmistica.selectVariants[I ? "disabled" : "default"], m ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel),
303
+ className: (0, _classnames.default)(_selectcssmistica.selectVariants[I ? "disabled" : "default"], u ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel),
301
304
  id: L,
302
305
  "aria-invalid": !!A,
303
306
  value: w,
@@ -313,7 +316,7 @@ const ot = (param)=>{
313
316
  ref: (e)=>{
314
317
  [
315
318
  h,
316
- d
319
+ f
317
320
  ].forEach((t)=>{
318
321
  t.current = e;
319
322
  });
@@ -326,7 +329,7 @@ const ot = (param)=>{
326
329
  color: w ? void 0 : "transparent"
327
330
  },
328
331
  children: [
329
- !w && u.every((param)=>{
332
+ !w && d.every((param)=>{
330
333
  let { value: e } = param;
331
334
  return !!e;
332
335
  }) && // If no "empty" option exists, insert a dummy empty option. Once an option is selected,
@@ -341,9 +344,9 @@ const ot = (param)=>{
341
344
  display: "none"
342
345
  },
343
346
  "aria-label": "",
344
- children: m
347
+ children: u
345
348
  }),
346
- u.map((param)=>{
349
+ d.map((param)=>{
347
350
  let { value: e, text: t } = param;
348
351
  return(// Similar issue in another lib: https://github.com/chakra-ui/chakra-ui/issues/417#issue-566611352
349
352
  /* @__PURE__ */ (0, _jsxruntime.jsx)("option", {
@@ -373,7 +376,7 @@ const ot = (param)=>{
373
376
  className: _selectcssmistica.selectContainerVariants[P ? "fullWidth" : "default"],
374
377
  role: "button",
375
378
  "aria-haspopup": "listbox",
376
- ref: d
379
+ ref: f
377
380
  }, !I && Ae), {
378
381
  children: [
379
382
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, {
@@ -388,7 +391,7 @@ const ot = (param)=>{
388
391
  })
389
392
  }),
390
393
  focus: X,
391
- label: m,
394
+ label: u,
392
395
  value: w,
393
396
  shrinkLabel: !!(l || g),
394
397
  name: i,
@@ -401,7 +404,7 @@ const ot = (param)=>{
401
404
  fieldRef: S
402
405
  }),
403
406
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
404
- className: (0, _classnames.default)(_selectcssmistica.selectTextVariants[I ? "disabled" : "default"], m ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel),
407
+ className: (0, _classnames.default)(_selectcssmistica.selectTextVariants[I ? "disabled" : "default"], u ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel),
405
408
  children: Re(w)
406
409
  })
407
410
  ]
@@ -424,7 +427,7 @@ const ot = (param)=>{
424
427
  className: (0, _classnames.default)(_selectcssmistica.optionsContainer, K ? _selectcssmistica.optionsAnimationsVariants.show : _selectcssmistica.optionsAnimationsVariants.hide),
425
428
  role: "listbox",
426
429
  ref: v,
427
- children: u.map((param)=>{
430
+ children: d.map((param)=>{
428
431
  let { value: e, text: t } = param;
429
432
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("li", {
430
433
  role: "option",
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "sheetActionRow", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _;
9
+ }
10
+ });
11
+ require("./sprinkles.css.ts.vanilla.css-mistica.js");
12
+ require("./sheet-action-row.css.ts.vanilla.css-mistica.js");
13
+ var _ = "_4k81wx1 _1y2v1nf7s _1y2v1nf91 _1y2v1nfaa _1y2v1nfbj _1y2v1nfhk _1y2v1nfjx _1y2v1nfhz";
@@ -0,0 +1 @@
1
+ export declare const sheetActionRow: string;
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import type { ExclusifyUnion } from './utils/utility-types';
3
+ import type { DataAttributes, IconProps } from './utils/types';
4
+ type ActionsListSheetProps = {
5
+ title?: string;
6
+ subtitle?: string;
7
+ description?: string | ReadonlyArray<string>;
8
+ items: ReadonlyArray<{
9
+ id: string;
10
+ title: string;
11
+ /** "normal" by default */
12
+ style?: 'normal' | 'destructive';
13
+ icon?: ExclusifyUnion<{
14
+ /** @deprecated - use url instead */
15
+ Icon: React.ComponentType<IconProps>;
16
+ } | {
17
+ url: string;
18
+ urlDark?: string;
19
+ }>;
20
+ }>;
21
+ onClose?: () => void;
22
+ onSelect?: (id: string) => void;
23
+ dataAttributes?: DataAttributes;
24
+ };
25
+ declare const ActionsListSheet: React.ForwardRefExoticComponent<ActionsListSheetProps & React.RefAttributes<HTMLDivElement>>;
26
+ export default ActionsListSheet;
@@ -0,0 +1,147 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function() {
9
+ return C;
10
+ }
11
+ });
12
+ const _jsxruntime = require("react/jsx-runtime");
13
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
14
+ const _sheetcommon = /*#__PURE__*/ _interop_require_wildcard(require("./sheet-common.js"));
15
+ const _hooks = require("./hooks.js");
16
+ const _box = /*#__PURE__*/ _interop_require_default(require("./box.js"));
17
+ const _text = require("./text.js");
18
+ const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
19
+ const _sheetactionrowcssmistica = require("./sheet-action-row.css-mistica.js");
20
+ const _image = /*#__PURE__*/ _interop_require_default(require("./image.js"));
21
+ const _negativebox = /*#__PURE__*/ _interop_require_default(require("./negative-box.js"));
22
+ const _touchable = /*#__PURE__*/ _interop_require_default(require("./touchable.js"));
23
+ function _interop_require_default(obj) {
24
+ return obj && obj.__esModule ? obj : {
25
+ default: obj
26
+ };
27
+ }
28
+ function _getRequireWildcardCache(nodeInterop) {
29
+ if (typeof WeakMap !== "function") return null;
30
+ var cacheBabelInterop = new WeakMap();
31
+ var cacheNodeInterop = new WeakMap();
32
+ return (_getRequireWildcardCache = function(nodeInterop) {
33
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
34
+ })(nodeInterop);
35
+ }
36
+ function _interop_require_wildcard(obj, nodeInterop) {
37
+ if (!nodeInterop && obj && obj.__esModule) {
38
+ return obj;
39
+ }
40
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
41
+ return {
42
+ default: obj
43
+ };
44
+ }
45
+ var cache = _getRequireWildcardCache(nodeInterop);
46
+ if (cache && cache.has(obj)) {
47
+ return cache.get(obj);
48
+ }
49
+ var newObj = {
50
+ __proto__: null
51
+ };
52
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
53
+ for(var key in obj){
54
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
55
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
56
+ if (desc && (desc.get || desc.set)) {
57
+ Object.defineProperty(newObj, key, desc);
58
+ } else {
59
+ newObj[key] = obj[key];
60
+ }
61
+ }
62
+ }
63
+ newObj.default = obj;
64
+ if (cache) {
65
+ cache.set(obj, newObj);
66
+ }
67
+ return newObj;
68
+ }
69
+ function _define_property(obj, key, value) {
70
+ if (key in obj) {
71
+ Object.defineProperty(obj, key, {
72
+ value: value,
73
+ enumerable: true,
74
+ configurable: true,
75
+ writable: true
76
+ });
77
+ } else {
78
+ obj[key] = value;
79
+ }
80
+ return obj;
81
+ }
82
+ function _object_spread(target) {
83
+ for(var i = 1; i < arguments.length; i++){
84
+ var source = arguments[i] != null ? arguments[i] : {};
85
+ var ownKeys = Object.keys(source);
86
+ if (typeof Object.getOwnPropertySymbols === "function") {
87
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
88
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
89
+ }));
90
+ }
91
+ ownKeys.forEach(function(key) {
92
+ _define_property(target, key, source[key]);
93
+ });
94
+ }
95
+ return target;
96
+ }
97
+ const b = /*#__PURE__*/ _react.forwardRef((param, d)=>{
98
+ let { title: m, subtitle: a, description: c, items: h, onClose: l, onSelect: e, dataAttributes: n } = param;
99
+ const { isDarkMode: p } = (0, _hooks.useTheme)();
100
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_sheetcommon.default, {
101
+ onClose: l,
102
+ ref: d,
103
+ dataAttributes: _object_spread({
104
+ "component-name": "ActionsListSheet"
105
+ }, n),
106
+ children: (param)=>{
107
+ let { closeModal: u, modalTitleId: f } = param;
108
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_sheetcommon.SheetBody, {
109
+ title: m,
110
+ subtitle: a,
111
+ description: c,
112
+ modalTitleId: f,
113
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_negativebox.default, {
114
+ children: h.map((param)=>{
115
+ let { id: i, style: s, title: x, icon: t } = param;
116
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.default, {
117
+ onPress: ()=>{
118
+ e == null || e(i), u();
119
+ },
120
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
121
+ className: _sheetactionrowcssmistica.sheetActionRow,
122
+ children: [
123
+ t && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
124
+ paddingRight: 16,
125
+ children: t.Icon ? /* @__PURE__ */ (0, _jsxruntime.jsx)(t.Icon, {
126
+ size: 24,
127
+ color: s === "destructive" ? _skincontractcssmistica.vars.colors.textLinkDanger : _skincontractcssmistica.vars.colors.neutralHigh
128
+ }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.default, {
129
+ circular: !0,
130
+ src: p && t.urlDark ? t.urlDark : t.url,
131
+ width: 40
132
+ })
133
+ }),
134
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
135
+ regular: !0,
136
+ color: s === "destructive" ? _skincontractcssmistica.vars.colors.textLinkDanger : _skincontractcssmistica.vars.colors.textPrimary,
137
+ children: x
138
+ })
139
+ ]
140
+ })
141
+ }, i);
142
+ })
143
+ })
144
+ });
145
+ }
146
+ });
147
+ }), C = b;
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import type { DataAttributes, TrackingEvent } from './utils/types';
3
+ type PressedButton = 'PRIMARY' | 'SECONDARY' | 'LINK';
4
+ type ButtonProps = {
5
+ text: string;
6
+ trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
7
+ trackEvent?: boolean;
8
+ };
9
+ type ActionsSheetProps = {
10
+ title?: string;
11
+ subtitle?: string;
12
+ description?: string | ReadonlyArray<string>;
13
+ button: ButtonProps;
14
+ secondaryButton?: ButtonProps;
15
+ buttonLink?: ButtonProps & {
16
+ withChevron?: boolean;
17
+ };
18
+ onClose?: () => void;
19
+ onPressButton?: (pressedButton: PressedButton) => void;
20
+ dataAttributes?: DataAttributes;
21
+ };
22
+ declare const ActionsSheet: React.ForwardRefExoticComponent<ActionsSheetProps & React.RefAttributes<HTMLDivElement>>;
23
+ export default ActionsSheet;