@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
@@ -80,21 +80,22 @@ function _object_without_properties_loose(source, excluded) {
80
80
  }
81
81
  import { jsx as a } from "react/jsx-runtime";
82
82
  import * as r from "react";
83
- import { useFieldProps as B } from "./form-context.js";
84
- import { TextFieldBaseAutosuggest as E, FieldEndIcon as T } from "./text-field-base.js";
85
- import j from "./generated/mistica-icons/icon-search-regular.js";
86
- import V from "./generated/mistica-icons/icon-close-regular.js";
87
- import { useTheme as $ } from "./hooks.js";
88
- import { createChangeEvent as q } from "./utils/dom.js";
89
- import { combineRefs as w } from "./utils/common.js";
90
- import { iconSize as D } from "./icon-button.css-mistica.js";
91
- import { formSearchClear as G } from "./text-tokens.js";
92
- const H = /*#__PURE__*/ r.forwardRef((_param, x)=>{
93
- 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, [
83
+ import { useFieldProps as E } from "./form-context.js";
84
+ import { TextFieldBaseAutosuggest as T, FieldEndIcon as j } from "./text-field-base.js";
85
+ import V from "./generated/mistica-icons/icon-search-regular.js";
86
+ import $ from "./generated/mistica-icons/icon-close-regular.js";
87
+ import { useTheme as q } from "./hooks.js";
88
+ import { createChangeEvent as w } from "./utils/dom.js";
89
+ import { combineRefs as D } from "./utils/common.js";
90
+ import { iconSize as G } from "./icon-button.css-mistica.js";
91
+ import { formSearchClear as H } from "./text-tokens.js";
92
+ const J = /*#__PURE__*/ r.forwardRef((_param, P)=>{
93
+ 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, [
94
94
  "disabled",
95
95
  "error",
96
96
  "helperText",
97
97
  "name",
98
+ "label",
98
99
  "optional",
99
100
  "validate",
100
101
  "onChange",
@@ -104,45 +105,46 @@ const H = /*#__PURE__*/ r.forwardRef((_param, x)=>{
104
105
  "defaultValue",
105
106
  "dataAttributes"
106
107
  ]);
107
- const { texts: P, t: h } = $(), o = r.useRef(), [v, y] = r.useState(R || ""), s = typeof f < "u", l = s ? f : v, i = r.useCallback((c, A)=>{
108
- s || y(c), t == null || t(c, A);
108
+ const { texts: h, t: v } = q(), o = r.useRef(), [y, k] = r.useState(F || ""), s = typeof f < "u", l = s ? f : y, i = r.useCallback((c, B)=>{
109
+ s || k(c), t == null || t(c, B);
109
110
  }, [
110
111
  s,
111
112
  t
112
- ]), k = r.useCallback(()=>{
113
- i("", ""), o.current && (e == null || e(q(o.current, "")), o.current.focus());
113
+ ]), z = r.useCallback(()=>{
114
+ i("", ""), o.current && (e == null || e(w(o.current, "")), o.current.focus());
114
115
  }, [
115
116
  i,
116
117
  e
117
- ]), z = B({
118
+ ]), A = E({
118
119
  name: p,
120
+ label: n,
119
121
  value: l,
120
122
  defaultValue: void 0,
121
123
  processValue: (c)=>c,
122
124
  helperText: d,
123
- optional: n,
125
+ optional: S,
124
126
  error: u,
125
127
  disabled: m,
126
- onBlur: I,
127
- validate: S,
128
+ onBlur: R,
129
+ validate: I,
128
130
  onChange: e,
129
131
  onChangeValue: i
130
132
  });
131
- return /* @__PURE__ */ a(E, _object_spread_props(_object_spread({
132
- ref: w(o, x),
133
- startIcon: /* @__PURE__ */ a(j, {
134
- size: D.default
133
+ return /* @__PURE__ */ a(T, _object_spread_props(_object_spread({
134
+ ref: D(o, P),
135
+ startIcon: /* @__PURE__ */ a(V, {
136
+ size: G.default
135
137
  }),
136
- endIcon: l ? /* @__PURE__ */ a(T, {
137
- Icon: V,
138
- "aria-label": P.formSearchClear || h(G),
139
- onPress: k
138
+ endIcon: l ? /* @__PURE__ */ a(j, {
139
+ Icon: $,
140
+ "aria-label": h.formSearchClear || v(H),
141
+ onPress: z
140
142
  }) : void 0
141
- }, b, z), {
143
+ }, x, A), {
142
144
  type: "search",
143
145
  dataAttributes: _object_spread({
144
146
  "component-name": "SearchField"
145
- }, F)
147
+ }, b)
146
148
  }));
147
- }), Y = H;
148
- export { Y as default };
149
+ }), Z = J;
150
+ export { Z as default };
package/dist-es/select.js CHANGED
@@ -62,17 +62,17 @@ import oe from "./generated/mistica-icons/icon-chevron-down-regular.js";
62
62
  import { TextFieldBaseAutosuggest as $e } from "./text-field-base.js";
63
63
  import Be from "./overlay.js";
64
64
  import { isAndroid as qe, isIos as ze } from "./utils/platform.js";
65
- import { cancelEvent as p } from "./utils/dom.js";
65
+ import { cancelEvent as m } from "./utils/dom.js";
66
66
  import { Text3 as je } from "./text.js";
67
- import { selectVariants as Ke, arrowDown as Ue, iconContainer as ie, selectContainerVariants as Xe, selectTextVariants as Je, vars as N, optionsContainer as Qe, optionsAnimationsVariants as ce, menuItem as Ye, menuItemSelected as et } from "./select.css-mistica.js";
67
+ import { selectVariants as Ke, arrowDown as Ue, iconContainer as ie, selectContainerVariants as Xe, selectTextVariants as Je, vars as b, optionsContainer as Qe, optionsAnimationsVariants as ce, menuItem as Ye, menuItemSelected as et } from "./select.css-mistica.js";
68
68
  import { inputWithLabel as ae, inputWithoutLabel as le } from "./text-field-base.css-mistica.js";
69
69
  import { Portal as tt } from "./portal.js";
70
70
  import { pxToRem as nt, applyCssVars as rt } from "./utils/css.js";
71
71
  import { ThemeVariant as st } from "./theme-variant-context.js";
72
72
  const ot = (param)=>{
73
- 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;
73
+ 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;
74
74
  var ne;
75
- const h = n.useRef(null), d = n.useRef(null), S = n.useRef(null), v = n.useRef(null), R = n.useRef(/* @__PURE__ */ new Map()), [ve, ge] = n.useState(!0), [g, Te] = n.useState(pe), [H, j] = n.useState(!1), [K, U] = n.useState(!1), [X, O] = n.useState(!1), [a, F] = n.useState({}), [T, W] = n.useState(), G = n.useRef(null), Ie = n.useId(), L = ue || Ie, { rawValues: Ee, setRawValue: Z, setValue: $, formStatus: we, formErrors: J, setFormError: xe, register: B } = Pe(), { platformOverrides: Q } = De(), Oe = Se || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || qe(Q) || ze(Q), I = me || we === "sending", A = he || !!J[i], Y = J[i] || de, l = fe !== null && fe !== void 0 ? fe : Ee[i], ee = (e)=>{
75
+ const h = n.useRef(null), f = n.useRef(null), S = n.useRef(null), v = n.useRef(null), R = n.useRef(/* @__PURE__ */ new Map()), [ve, ge] = n.useState(!0), [g, Te] = n.useState(pe), [H, j] = n.useState(!1), [K, U] = n.useState(!1), [X, O] = n.useState(!1), [a, F] = n.useState({}), [T, W] = n.useState(), G = n.useRef(null), Ie = n.useId(), L = ue || Ie, { rawValues: Ee, setRawValue: Z, setValue: $, formStatus: we, formErrors: J, setFormError: xe, register: B } = Pe(), { platformOverrides: Q } = De(), Oe = Se || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || qe(Q) || ze(Q), I = me || we === "sending", A = he || !!J[i], Y = J[i] || de, l = fe !== null && fe !== void 0 ? fe : Ee[i], ee = (e)=>{
76
76
  C == null || C(e), xe({
77
77
  name: i,
78
78
  error: ""
@@ -86,28 +86,28 @@ const ot = (param)=>{
86
86
  }, E = (e)=>{
87
87
  if (e) {
88
88
  if (S != null && S.current) {
89
- 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;
90
- if (b + V + 12 > window.innerHeight) {
91
- const _e = window.innerHeight - b;
92
- if (f > _e) {
93
- const ke = f - V;
89
+ 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;
90
+ if (N + V + 12 > window.innerHeight) {
91
+ const _e = window.innerHeight - N;
92
+ if (p > _e) {
93
+ const ke = p - V;
94
94
  F({
95
95
  minWidth: x,
96
96
  left: y,
97
97
  top: Math.max(ke, 12),
98
- maxHeight: Math.min(f - 12, V),
98
+ maxHeight: Math.min(p - 12, V),
99
99
  transformOrigin: "center bottom"
100
100
  });
101
101
  } else F({
102
102
  minWidth: x,
103
- top: b,
103
+ top: N,
104
104
  left: y,
105
- maxHeight: window.innerHeight - b - 12,
105
+ maxHeight: window.innerHeight - N - 12,
106
106
  transformOrigin: "center top"
107
107
  });
108
108
  } else F({
109
109
  minWidth: x,
110
- top: b,
110
+ top: N,
111
111
  left: y,
112
112
  maxHeight: V,
113
113
  transformOrigin: "center top"
@@ -131,7 +131,7 @@ const ot = (param)=>{
131
131
  }
132
132
  o && o.top + o.height / 2 <= t.top && (c == null || c.scrollIntoView(!1));
133
133
  }
134
- }, be = d.current, Ne = h.current;
134
+ }, Ne = f.current, be = h.current;
135
135
  n.useEffect(()=>{
136
136
  Z({
137
137
  name: i,
@@ -147,46 +147,49 @@ const ot = (param)=>{
147
147
  l
148
148
  ]), n.useEffect(()=>(B(i, {
149
149
  input: h.current,
150
- focusableElement: d.current
150
+ focusableElement: f.current,
151
+ label: u
151
152
  }), ()=>{
152
153
  B(i, {
153
154
  input: null,
154
- focusableElement: null
155
+ focusableElement: null,
156
+ label: ""
155
157
  });
156
158
  }), [
157
159
  i,
158
160
  B,
159
- d,
161
+ f,
160
162
  h,
163
+ Ne,
161
164
  be,
162
- Ne
165
+ u
163
166
  ]), n.useEffect(()=>{
164
167
  const e = (s)=>{
165
- var f;
168
+ var p;
166
169
  const o = {
167
170
  [Fe]: -1,
168
171
  [We]: 1
169
172
  }[s.key];
170
173
  if (o) {
171
- p(s);
174
+ m(s);
172
175
  var _ref;
173
- const x = (_ref = (f = u[u.findIndex((param)=>{
176
+ const x = (_ref = (p = d[d.findIndex((param)=>{
174
177
  let { value: y } = param;
175
178
  return y === T;
176
- }) + o]) == null ? void 0 : f.value) !== null && _ref !== void 0 ? _ref : T;
179
+ }) + o]) == null ? void 0 : p.value) !== null && _ref !== void 0 ? _ref : T;
177
180
  W(x), ye(x);
178
181
  }
179
182
  }, t = (s)=>{
180
183
  if (H) switch(s.key){
181
184
  case He:
182
- p(s);
185
+ m(s);
183
186
  break;
184
187
  case Me:
185
188
  E(!1);
186
189
  break;
187
190
  case se:
188
191
  case re:
189
- p(s), u.findIndex((param)=>{
192
+ m(s), d.findIndex((param)=>{
190
193
  let { value: c } = param;
191
194
  return c === T;
192
195
  }) !== -1 && T !== g && q(T), E(!1);
@@ -198,7 +201,7 @@ const ot = (param)=>{
198
201
  document.removeEventListener("keydown", t, !1);
199
202
  };
200
203
  }), n.useEffect(()=>{
201
- z && d.current && d.current.focus();
204
+ z && f.current && f.current.focus();
202
205
  }, [
203
206
  z
204
207
  ]), n.useEffect(()=>{
@@ -206,7 +209,7 @@ const ot = (param)=>{
206
209
  }, []);
207
210
  const Re = (e)=>{
208
211
  var t;
209
- return e ? (t = u.find((param)=>{
212
+ return e ? (t = d.find((param)=>{
210
213
  let { value: s } = param;
211
214
  return s === e;
212
215
  })) == null ? void 0 : t.text : "";
@@ -218,7 +221,7 @@ const ot = (param)=>{
218
221
  E(!0), O(!0);
219
222
  },
220
223
  onKeyDown: (e)=>{
221
- !H && (e.key === re || e.key === se) && (p(e), E(!0));
224
+ !H && (e.key === re || e.key === se) && (m(e), E(!0));
222
225
  }
223
226
  }, te = nt(20), w = g !== null && g !== void 0 ? g : l;
224
227
  var _a_transformOrigin;
@@ -233,15 +236,15 @@ const ot = (param)=>{
233
236
  fieldRef: S,
234
237
  fullWidth: P,
235
238
  children: [
236
- m && /* @__PURE__ */ r(Ze, {
239
+ u && /* @__PURE__ */ r(Ze, {
237
240
  error: A,
238
241
  forId: L,
239
242
  inputState: X ? "focused" : (w !== null && w !== void 0 ? w : (ne = h.current) == null ? void 0 : ne.value) ? "filled" : "default",
240
243
  optional: D,
241
- children: m
244
+ children: u
242
245
  }),
243
246
  /* @__PURE__ */ _("select", {
244
- className: k(Ke[I ? "disabled" : "default"], m ? ae : le),
247
+ className: k(Ke[I ? "disabled" : "default"], u ? ae : le),
245
248
  id: L,
246
249
  "aria-invalid": !!A,
247
250
  value: w,
@@ -257,7 +260,7 @@ const ot = (param)=>{
257
260
  ref: (e)=>{
258
261
  [
259
262
  h,
260
- d
263
+ f
261
264
  ].forEach((t)=>{
262
265
  t.current = e;
263
266
  });
@@ -270,7 +273,7 @@ const ot = (param)=>{
270
273
  color: w ? void 0 : "transparent"
271
274
  },
272
275
  children: [
273
- !w && u.every((param)=>{
276
+ !w && d.every((param)=>{
274
277
  let { value: e } = param;
275
278
  return !!e;
276
279
  }) && // If no "empty" option exists, insert a dummy empty option. Once an option is selected,
@@ -285,9 +288,9 @@ const ot = (param)=>{
285
288
  display: "none"
286
289
  },
287
290
  "aria-label": "",
288
- children: m
291
+ children: u
289
292
  }),
290
- u.map((param)=>{
293
+ d.map((param)=>{
291
294
  let { value: e, text: t } = param;
292
295
  return(// Set color: 'initial' to avoid wrong text color in some browsers when using dark mode.
293
296
  // Similar issue in another lib: https://github.com/chakra-ui/chakra-ui/issues/417#issue-566611352
@@ -318,7 +321,7 @@ const ot = (param)=>{
318
321
  className: Xe[P ? "fullWidth" : "default"],
319
322
  role: "button",
320
323
  "aria-haspopup": "listbox",
321
- ref: d
324
+ ref: f
322
325
  }, !I && Ae), {
323
326
  children: [
324
327
  /* @__PURE__ */ r($e, {
@@ -333,7 +336,7 @@ const ot = (param)=>{
333
336
  })
334
337
  }),
335
338
  focus: X,
336
- label: m,
339
+ label: u,
337
340
  value: w,
338
341
  shrinkLabel: !!(l || g),
339
342
  name: i,
@@ -346,30 +349,30 @@ const ot = (param)=>{
346
349
  fieldRef: S
347
350
  }),
348
351
  /* @__PURE__ */ r("div", {
349
- className: k(Je[I ? "disabled" : "default"], m ? ae : le),
352
+ className: k(Je[I ? "disabled" : "default"], u ? ae : le),
350
353
  children: Re(w)
351
354
  })
352
355
  ]
353
356
  })),
354
357
  H && /* @__PURE__ */ r(Be, {
355
358
  onPress: (e)=>{
356
- E(!1), p(e);
359
+ E(!1), m(e);
357
360
  },
358
361
  disableScroll: !0,
359
362
  children: /* @__PURE__ */ r(tt, {
360
363
  children: /* @__PURE__ */ r("ul", {
361
364
  style: rt({
362
- [N.top]: a.top ? `${a.top}px` : "",
363
- [N.left]: a.left ? `${a.left}px` : "",
364
- [N.maxHeight]: a.maxHeight ? `${a.maxHeight}px` : "",
365
- [N.minWidth]: a.minWidth ? `${a.minWidth}px` : "",
366
- [N.transformOrigin]: (_a_transformOrigin = a.transformOrigin) !== null && _a_transformOrigin !== void 0 ? _a_transformOrigin : ""
365
+ [b.top]: a.top ? `${a.top}px` : "",
366
+ [b.left]: a.left ? `${a.left}px` : "",
367
+ [b.maxHeight]: a.maxHeight ? `${a.maxHeight}px` : "",
368
+ [b.minWidth]: a.minWidth ? `${a.minWidth}px` : "",
369
+ [b.transformOrigin]: (_a_transformOrigin = a.transformOrigin) !== null && _a_transformOrigin !== void 0 ? _a_transformOrigin : ""
367
370
  }),
368
- onPointerDown: p,
371
+ onPointerDown: m,
369
372
  className: k(Qe, K ? ce.show : ce.hide),
370
373
  role: "listbox",
371
374
  ref: v,
372
- children: u.map((param)=>{
375
+ children: d.map((param)=>{
373
376
  let { value: e, text: t } = param;
374
377
  return /* @__PURE__ */ r("li", {
375
378
  role: "option",
@@ -378,7 +381,7 @@ const ot = (param)=>{
378
381
  className: k(Ye, {
379
382
  [et]: e === T || e === (g !== null && g !== void 0 ? g : l)
380
383
  }),
381
- onPointerDown: p,
384
+ onPointerDown: m,
382
385
  onClick: ()=>q(e),
383
386
  ref: (s)=>{
384
387
  s ? R.current.set(e, s) : R.current.delete(e);
@@ -0,0 +1,4 @@
1
+ import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
+ import "./sheet-action-row.css.ts.vanilla.css-mistica.js";
3
+ var _ = "_4k81wx1 _1y2v1nf7s _1y2v1nf91 _1y2v1nfaa _1y2v1nfbj _1y2v1nfhk _1y2v1nfjx _1y2v1nfhz";
4
+ export { _ as sheetActionRow };
@@ -0,0 +1,92 @@
1
+ "use client";
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ import { jsx as r, jsxs as g } from "react/jsx-runtime";
31
+ import * as k from "react";
32
+ import v, { SheetBody as A } from "./sheet-common.js";
33
+ import { useTheme as D } from "./hooks.js";
34
+ import L from "./box.js";
35
+ import { Text3 as R } from "./text.js";
36
+ import { vars as o } from "./skins/skin-contract.css-mistica.js";
37
+ import { sheetActionRow as w } from "./sheet-action-row.css-mistica.js";
38
+ import B from "./image.js";
39
+ import I from "./negative-box.js";
40
+ import T from "./touchable.js";
41
+ const b = /*#__PURE__*/ k.forwardRef((param, d)=>{
42
+ let { title: m, subtitle: a, description: c, items: h, onClose: l, onSelect: e, dataAttributes: n } = param;
43
+ const { isDarkMode: p } = D();
44
+ return /* @__PURE__ */ r(v, {
45
+ onClose: l,
46
+ ref: d,
47
+ dataAttributes: _object_spread({
48
+ "component-name": "ActionsListSheet"
49
+ }, n),
50
+ children: (param)=>{
51
+ let { closeModal: u, modalTitleId: f } = param;
52
+ return /* @__PURE__ */ r(A, {
53
+ title: m,
54
+ subtitle: a,
55
+ description: c,
56
+ modalTitleId: f,
57
+ children: /* @__PURE__ */ r(I, {
58
+ children: h.map((param)=>{
59
+ let { id: i, style: s, title: x, icon: t } = param;
60
+ return /* @__PURE__ */ r(T, {
61
+ onPress: ()=>{
62
+ e == null || e(i), u();
63
+ },
64
+ children: /* @__PURE__ */ g("div", {
65
+ className: w,
66
+ children: [
67
+ t && /* @__PURE__ */ r(L, {
68
+ paddingRight: 16,
69
+ children: t.Icon ? /* @__PURE__ */ r(t.Icon, {
70
+ size: 24,
71
+ color: s === "destructive" ? o.colors.textLinkDanger : o.colors.neutralHigh
72
+ }) : /* @__PURE__ */ r(B, {
73
+ circular: !0,
74
+ src: p && t.urlDark ? t.urlDark : t.url,
75
+ width: 40
76
+ })
77
+ }),
78
+ /* @__PURE__ */ r(R, {
79
+ regular: !0,
80
+ color: s === "destructive" ? o.colors.textLinkDanger : o.colors.textPrimary,
81
+ children: x
82
+ })
83
+ ]
84
+ })
85
+ }, i);
86
+ })
87
+ })
88
+ });
89
+ }
90
+ });
91
+ }), C = b;
92
+ export { C as default };
@@ -0,0 +1,125 @@
1
+ "use client";
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
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
+ function _object_without_properties(source, excluded) {
55
+ if (source == null) return {};
56
+ var target = _object_without_properties_loose(source, excluded);
57
+ var key, i;
58
+ if (Object.getOwnPropertySymbols) {
59
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
60
+ for(i = 0; i < sourceSymbolKeys.length; i++){
61
+ key = sourceSymbolKeys[i];
62
+ if (excluded.indexOf(key) >= 0) continue;
63
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
64
+ target[key] = source[key];
65
+ }
66
+ }
67
+ return target;
68
+ }
69
+ function _object_without_properties_loose(source, excluded) {
70
+ if (source == null) return {};
71
+ var target = {};
72
+ var sourceKeys = Object.keys(source);
73
+ var key, i;
74
+ for(i = 0; i < sourceKeys.length; i++){
75
+ key = sourceKeys[i];
76
+ if (excluded.indexOf(key) >= 0) continue;
77
+ target[key] = source[key];
78
+ }
79
+ return target;
80
+ }
81
+ import { jsx as r } from "react/jsx-runtime";
82
+ import * as A from "react";
83
+ import R, { SheetBody as u } from "./sheet-common.js";
84
+ import { ButtonPrimary as l, ButtonSecondary as y, ButtonLink as P } from "./button.js";
85
+ const v = /*#__PURE__*/ A.forwardRef((param, S)=>{
86
+ let { title: c, subtitle: s, description: d, button: f, secondaryButton: m, buttonLink: a, onClose: h, dataAttributes: p, onPressButton: o } = param;
87
+ const n = (e, t)=>()=>{
88
+ o == null || o(t), e();
89
+ }, i = (_param)=>{
90
+ var { text: e } = _param, t = _object_without_properties(_param, [
91
+ "text"
92
+ ]);
93
+ return _object_spread({
94
+ children: e
95
+ }, t);
96
+ };
97
+ return /* @__PURE__ */ r(R, {
98
+ onClose: h,
99
+ ref: S,
100
+ dataAttributes: _object_spread({
101
+ "component-name": "ActionsSheet"
102
+ }, p),
103
+ children: (param)=>{
104
+ let { modalTitleId: e, closeModal: t } = param;
105
+ return /* @__PURE__ */ r(u, {
106
+ title: c,
107
+ subtitle: s,
108
+ description: d,
109
+ modalTitleId: e,
110
+ button: /* @__PURE__ */ r(l, _object_spread_props(_object_spread({}, i(f)), {
111
+ onPress: n(t, "PRIMARY")
112
+ })),
113
+ secondaryButton: m ? /* @__PURE__ */ r(y, _object_spread_props(_object_spread({}, i(m)), {
114
+ onPress: n(t, "SECONDARY")
115
+ })) : void 0,
116
+ link: a ? /* @__PURE__ */ r(P, _object_spread_props(_object_spread({
117
+ small: !0
118
+ }, i(a)), {
119
+ onPress: n(t, "LINK")
120
+ })) : void 0
121
+ });
122
+ }
123
+ });
124
+ }), Y = v;
125
+ export { Y as default };
@@ -0,0 +1,4 @@
1
+ import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
+ import "./sheet-common.css.ts.vanilla.css-mistica.js";
3
+ var f = "pidemf6 _1y2v1nf3p", y = "pidemf4 _1y2v1nfhg _1y2v1nfl6 _1y2v1nfll _1y2v1nfm0", _ = "pidemf9 _1y2v1nf81 _1y2v1nfhk _1y2v1nfhq", e = "pidemfo", r = "_1y2v1nfkq _1y2v1nfi6 _1y2v1nfhk _1y2v1nfhq", i = "pidemfl", a = "pidemf7", t = "_1y2v1nf4y _1y2v1nfig _1y2v1nfir _1y2v1nfk4", h = "pidemfc _1y2v1nf7m _1y2v1nf8v _1y2v1nfhf _1y2v1nfkr _1y2v1nfj1 _1y2v1nfi7 _1y2v1nfhk _1y2v1nfht", l = "pidemff _1y2v1nf7y _1y2v1nf97 _1y2v1nfag _1y2v1nfbp _1y2v1nfhf _1y2v1nfkr _1y2v1nfll", o = "pidemfk _1y2v1nfhg _1y2v1nf41 _1y2v1nfkr _1y2v1nfl6 _1y2v1nfll _1y2v1nfm0", m = "_1y2v1nfhi _1y2v1nfm0 _1y2v1nf3p", p = "_1y2v1nfhi _1y2v1nfkr _1y2v1nf3p", d = 400;
4
+ export { f as Sheet, y as SheetContainer, _ as SheetContent, e as bodyContent, r as children, i as closingOverlay, a as closingSheet, t as handle, h as handleContainer, l as modalCloseButton, o as overlay, m as stickyButtons, p as stickyTitle, d as transitionDuration };
@@ -0,0 +1,2 @@
1
+ const s = "";
2
+ export { s as default };