@telefonica/mistica 14.15.0 → 14.16.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 (86) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/card.d.ts +3 -3
  3. package/dist/checkbox.css-mistica.js +4 -4
  4. package/dist/checkbox.js +10 -9
  5. package/dist/credit-card-number-field.js +22 -19
  6. package/dist/cvv-field.js +60 -47
  7. package/dist/date-time-picker.d.ts +10 -0
  8. package/dist/date-time-picker.js +54 -35
  9. package/dist/hooks.d.ts +1 -1
  10. package/dist/icons/icon-cvv-amex.d.ts +1 -0
  11. package/dist/icons/icon-cvv-amex.js +5 -4
  12. package/dist/icons/icon-cvv-visa-mc.d.ts +1 -0
  13. package/dist/icons/icon-cvv-visa-mc.js +7 -6
  14. package/dist/index.d.ts +1 -0
  15. package/dist/list.css-mistica.js +1 -1
  16. package/dist/list.js +90 -91
  17. package/dist/package-version.js +1 -1
  18. package/dist/radio-button.css-mistica.js +12 -12
  19. package/dist/radio-button.js +34 -33
  20. package/dist/search-field.js +8 -8
  21. package/dist/select.css-mistica.js +6 -6
  22. package/dist/select.js +145 -142
  23. package/dist/skins/blau.js +10 -0
  24. package/dist/skins/defaults.js +10 -0
  25. package/dist/skins/movistar-legacy.js +10 -0
  26. package/dist/skins/movistar.js +10 -0
  27. package/dist/skins/o2.js +10 -0
  28. package/dist/skins/telefonica.js +12 -2
  29. package/dist/skins/types/index.d.ts +10 -0
  30. package/dist/skins/vivo-new.js +10 -0
  31. package/dist/skins/vivo.js +10 -0
  32. package/dist/switch-component.css-mistica.js +9 -9
  33. package/dist/switch-component.js +16 -15
  34. package/dist/tabs.js +32 -28
  35. package/dist/text-field-base.js +44 -44
  36. package/dist/theme-context-provider.js +25 -24
  37. package/dist/theme.d.ts +5 -2
  38. package/dist/theme.js +73 -24
  39. package/dist/video.d.ts +7 -1
  40. package/dist/video.js +116 -76
  41. package/dist-es/checkbox.css-mistica.js +4 -4
  42. package/dist-es/checkbox.js +21 -20
  43. package/dist-es/credit-card-number-field.js +23 -20
  44. package/dist-es/cvv-field.js +74 -61
  45. package/dist-es/date-time-picker.js +66 -47
  46. package/dist-es/icons/icon-cvv-amex.js +5 -4
  47. package/dist-es/icons/icon-cvv-visa-mc.js +9 -8
  48. package/dist-es/list.css-mistica.js +1 -1
  49. package/dist-es/list.js +114 -115
  50. package/dist-es/package-version.js +1 -1
  51. package/dist-es/radio-button.css-mistica.js +6 -6
  52. package/dist-es/radio-button.js +38 -37
  53. package/dist-es/search-field.js +7 -7
  54. package/dist-es/select.css-mistica.js +5 -5
  55. package/dist-es/select.js +173 -170
  56. package/dist-es/skins/blau.js +10 -0
  57. package/dist-es/skins/defaults.js +10 -0
  58. package/dist-es/skins/movistar-legacy.js +10 -0
  59. package/dist-es/skins/movistar.js +10 -0
  60. package/dist-es/skins/o2.js +10 -0
  61. package/dist-es/skins/telefonica.js +12 -2
  62. package/dist-es/skins/vivo-new.js +10 -0
  63. package/dist-es/skins/vivo.js +10 -0
  64. package/dist-es/style.css +1 -1
  65. package/dist-es/switch-component.css-mistica.js +7 -7
  66. package/dist-es/switch-component.js +37 -36
  67. package/dist-es/tabs.js +49 -45
  68. package/dist-es/text-field-base.js +64 -64
  69. package/dist-es/theme-context-provider.js +56 -55
  70. package/dist-es/theme.js +69 -20
  71. package/dist-es/video.js +121 -81
  72. package/package.json +2 -2
  73. package/dist/cvv-field.css-mistica.js +0 -21
  74. package/dist/cvv-field.css.d.ts +0 -2
  75. package/dist/cvv-field.css.ts.vanilla.css-mistica.js +0 -11
  76. package/dist/icons/icon-creditcard.d.ts +0 -7
  77. package/dist/icons/icon-creditcard.js +0 -33
  78. package/dist/icons/icon-info-cvv.d.ts +0 -7
  79. package/dist/icons/icon-info-cvv.js +0 -26
  80. package/dist/icons/icon-search.d.ts +0 -7
  81. package/dist/icons/icon-search.js +0 -32
  82. package/dist-es/cvv-field.css-mistica.js +0 -4
  83. package/dist-es/cvv-field.css.ts.vanilla.css-mistica.js +0 -2
  84. package/dist-es/icons/icon-creditcard.js +0 -24
  85. package/dist-es/icons/icon-info-cvv.js +0 -17
  86. package/dist-es/icons/icon-search.js +0 -23
@@ -86,40 +86,40 @@ import { Text3 as k } from "./text.js";
86
86
  import j from "./inline.js";
87
87
  import P from "classnames";
88
88
  import { useAriaId as F, useTheme as K } from "./hooks.js";
89
- import { getPrefixedDataAttributes as A } from "./utils/dom.js";
90
- import { outerCircleVariants as I, outerCircleCheckedVariants as $, disabled as N, innerCircle as H, innerCircleChecked as L, radioButton as U, radioButtonContainerDisabled as W } from "./radio-button.css-mistica.js";
91
- const D = /*#__PURE__*/ i.createContext({
89
+ import { getPrefixedDataAttributes as D } from "./utils/dom.js";
90
+ import { outerCircleVariants as I, outerCircleCheckedVariants as $, disabled as A, innerCircle as H, innerCircleChecked as L, radioButtonContainerDisabled as U, radioButton as W } from "./radio-button.css-mistica.js";
91
+ const N = /*#__PURE__*/ i.createContext({
92
92
  disabled: !1,
93
93
  selectedValue: null,
94
94
  focusableValue: null,
95
95
  select: ()=>{},
96
96
  selectNext: ()=>{},
97
97
  selectPrev: ()=>{}
98
- }), z = ()=>i.useContext(D), J = (_param)=>{
98
+ }), z = ()=>i.useContext(N), J = (_param)=>{
99
99
  var { value: e , id: s , dataAttributes: C , "aria-labelledby": R } = _param, d = _object_without_properties(_param, [
100
100
  "value",
101
101
  "id",
102
102
  "dataAttributes",
103
103
  "aria-labelledby"
104
104
  ]);
105
- const { disabled: r , selectedValue: p , focusableValue: v , select: u , selectNext: f , selectPrev: g } = z(), m = F(R), o = i.useRef(null), c = e === p, y = v === e ? 0 : -1, { isIos: h } = K(), t = (l)=>{
106
- switch(l.keyCode){
105
+ const { disabled: l , selectedValue: v , focusableValue: p , select: u , selectNext: f , selectPrev: g } = z(), m = F(R), r = i.useRef(null), c = e === v, y = p === e ? 0 : -1, { isIos: h } = K(), t = (o)=>{
106
+ switch(o.keyCode){
107
107
  case w:
108
- u(e), l.preventDefault(), l.stopPropagation();
108
+ u(e), o.preventDefault(), o.stopPropagation();
109
109
  break;
110
110
  case T:
111
111
  case E:
112
- f(), l.preventDefault(), l.stopPropagation();
112
+ f(), o.preventDefault(), o.stopPropagation();
113
113
  break;
114
114
  case q:
115
115
  case B:
116
- g(), l.preventDefault(), l.stopPropagation();
116
+ g(), o.preventDefault(), o.stopPropagation();
117
117
  break;
118
118
  }
119
119
  }, a = /* @__PURE__ */ n("div", {
120
120
  className: P(h ? I.ios : I.default, {
121
121
  [$[h ? "ios" : "default"]]: c,
122
- [N]: r
122
+ [A]: l
123
123
  }),
124
124
  children: !h && /* @__PURE__ */ n("div", {
125
125
  className: P(H, {
@@ -129,26 +129,27 @@ const D = /*#__PURE__*/ i.createContext({
129
129
  });
130
130
  return(// eslint-disable-next-line jsx-a11y/interactive-supports-focus
131
131
  /* @__PURE__ */ n("span", _object_spread_props(_object_spread({
132
- ref: o,
132
+ ref: r,
133
133
  id: s,
134
- tabIndex: r ? void 0 : y,
134
+ tabIndex: l ? void 0 : y,
135
135
  role: "radio",
136
136
  "data-value": e,
137
137
  "aria-checked": c,
138
- "aria-disabled": r,
138
+ "aria-disabled": l,
139
139
  "aria-labelledby": m,
140
- onClick: r ? void 0 : ()=>u(e),
141
- onKeyDown: r ? void 0 : t,
142
- className: U
143
- }, A(C, "RadioButton")), {
140
+ onClick: (o)=>{
141
+ o.stopPropagation(), l || u(e);
142
+ },
143
+ onKeyDown: l ? void 0 : t,
144
+ className: l ? U : W
145
+ }, D(C, "RadioButton")), {
144
146
  children: d.render ? d.render({
145
147
  controlElement: a,
146
- disabled: !!r,
148
+ disabled: !!l,
147
149
  checked: c,
148
150
  labelId: m
149
151
  }) : /* @__PURE__ */ S(j, {
150
152
  space: 16,
151
- className: r ? W : "",
152
153
  children: [
153
154
  /* @__PURE__ */ n(k, {
154
155
  regular: !0,
@@ -166,7 +167,7 @@ const D = /*#__PURE__*/ i.createContext({
166
167
  as: "div",
167
168
  id: m,
168
169
  children: /* @__PURE__ */ n("span", {
169
- className: r ? N : "",
170
+ className: l ? A : "",
170
171
  children: d.children
171
172
  })
172
173
  })
@@ -175,53 +176,53 @@ const D = /*#__PURE__*/ i.createContext({
175
176
  })));
176
177
  }, re = (e)=>{
177
178
  var _ref;
178
- const { value: s , defaultValue: C , onChange: R , focusableRef: d , disabled: r } = G({
179
+ const { value: s , defaultValue: C , onChange: R , focusableRef: d , disabled: l } = G({
179
180
  name: e.name,
180
181
  value: e.value,
181
182
  defaultValue: e.defaultValue,
182
183
  onChange: e.onChange,
183
184
  disabled: e.disabled
184
- }), p = typeof s < "u", [v, u] = i.useState((_ref = s !== null && s !== void 0 ? s : C) !== null && _ref !== void 0 ? _ref : "");
185
+ }), v = typeof s < "u", [p, u] = i.useState((_ref = s !== null && s !== void 0 ? s : C) !== null && _ref !== void 0 ? _ref : "");
185
186
  i.useEffect(()=>{
186
187
  s !== void 0 && u(s);
187
188
  }, [
188
189
  s
189
190
  ]);
190
191
  const f = (t)=>{
191
- p || u(t), R(t);
192
- }, [g, m] = i.useState(null), o = i.useRef(null), c = ()=>{
193
- if (o.current) {
194
- const t = o.current.querySelector("[role=radio][aria-checked=true]"), a = Array.from(o.current.querySelectorAll("[role=radio]"));
192
+ v || u(t), R(t);
193
+ }, [g, m] = i.useState(null), r = i.useRef(null), c = ()=>{
194
+ if (r.current) {
195
+ const t = r.current.querySelector("[role=radio][aria-checked=true]"), a = Array.from(r.current.querySelectorAll("[role=radio]"));
195
196
  if (a.length === 0) return;
196
197
  const V = ((t ? a.indexOf(t) : 0) + 1) % a.length, b = a[V], x = b.dataset.value;
197
198
  x && (b.focus(), f(x));
198
199
  }
199
200
  }, y = ()=>{
200
- if (o.current) {
201
- const t = o.current.querySelector("[role=radio][aria-checked=true]"), a = Array.from(o.current.querySelectorAll("[role=radio]"));
201
+ if (r.current) {
202
+ const t = r.current.querySelector("[role=radio][aria-checked=true]"), a = Array.from(r.current.querySelectorAll("[role=radio]"));
202
203
  if (a.length === 0) return;
203
- const l = t ? a.indexOf(t) : 0, V = (a.length + l - 1) % a.length, b = a[V], x = b.dataset.value;
204
+ const o = t ? a.indexOf(t) : 0, V = (a.length + o - 1) % a.length, b = a[V], x = b.dataset.value;
204
205
  x && (b.focus(), f(x));
205
206
  }
206
207
  };
207
208
  i.useEffect(()=>{
208
- if (o.current) {
209
- const t = o.current.querySelector("[role=radio]");
209
+ if (r.current) {
210
+ const t = r.current.querySelector("[role=radio]");
210
211
  var _t_dataset_value;
211
212
  t && m((_t_dataset_value = t.dataset.value) !== null && _t_dataset_value !== void 0 ? _t_dataset_value : null);
212
213
  }
213
214
  }, []);
214
215
  var _ref1;
215
- const h = (_ref1 = v !== null && v !== void 0 ? v : g) !== null && _ref1 !== void 0 ? _ref1 : null;
216
+ const h = (_ref1 = p !== null && p !== void 0 ? p : g) !== null && _ref1 !== void 0 ? _ref1 : null;
216
217
  return /* @__PURE__ */ n("div", _object_spread_props(_object_spread({
217
- ref: O(o, d),
218
+ ref: O(r, d),
218
219
  role: "radiogroup",
219
220
  "aria-labelledby": e["aria-labelledby"]
220
- }, A(e.dataAttributes, "RadioGroup")), {
221
- children: /* @__PURE__ */ n(D.Provider, {
221
+ }, D(e.dataAttributes, "RadioGroup")), {
222
+ children: /* @__PURE__ */ n(N.Provider, {
222
223
  value: {
223
- disabled: r,
224
- selectedValue: v !== null && v !== void 0 ? v : C,
224
+ disabled: l,
225
+ selectedValue: p !== null && p !== void 0 ? p : C,
225
226
  focusableValue: h,
226
227
  select: f,
227
228
  selectNext: c,
@@ -81,14 +81,14 @@ import { jsx as c } from "react/jsx-runtime";
81
81
  import * as r from "react";
82
82
  import { useFieldProps as k } from "./form-context.js";
83
83
  import { TextFieldBaseAutosuggest as T } from "./text-field-base.js";
84
- import j from "./icons/icon-search.js";
84
+ import j from "./generated/mistica-icons/icon-search-regular.js";
85
85
  import z from "./generated/mistica-icons/icon-close-regular.js";
86
86
  import A from "./icon-button.js";
87
87
  import { useTheme as E } from "./hooks.js";
88
88
  import { createChangeEvent as V } from "./utils/dom.js";
89
89
  import { combineRefs as $ } from "./utils/common.js";
90
90
  const q = /*#__PURE__*/ r.forwardRef((_param, y)=>{
91
- var { disabled: m , error: u , helperText: d , name: p , optional: n , validate: I , onChange: e , onChangeValue: t , onBlur: R , value: f , defaultValue: S } = _param, x = _object_without_properties(_param, [
91
+ 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, [
92
92
  "disabled",
93
93
  "error",
94
94
  "helperText",
@@ -101,7 +101,7 @@ const q = /*#__PURE__*/ r.forwardRef((_param, y)=>{
101
101
  "value",
102
102
  "defaultValue"
103
103
  ]);
104
- const b = E(), o = r.useRef(), [F, P] = r.useState(S || ""), i = typeof f < "u", a = i ? f : F, l = r.useCallback((s, B)=>{
104
+ const b = E(), o = r.useRef(), [F, P] = r.useState(S || ""), i = typeof a < "u", f = i ? a : F, l = r.useCallback((s, B)=>{
105
105
  i || P(s), t == null || t(s, B);
106
106
  }, [
107
107
  i,
@@ -113,22 +113,22 @@ const q = /*#__PURE__*/ r.forwardRef((_param, y)=>{
113
113
  e
114
114
  ]), v = k({
115
115
  name: p,
116
- value: a,
116
+ value: f,
117
117
  defaultValue: void 0,
118
118
  processValue: (s)=>s,
119
119
  helperText: d,
120
120
  optional: n,
121
121
  error: u,
122
122
  disabled: m,
123
- onBlur: R,
124
- validate: I,
123
+ onBlur: I,
124
+ validate: R,
125
125
  onChange: e,
126
126
  onChangeValue: l
127
127
  });
128
128
  return /* @__PURE__ */ c(T, _object_spread_props(_object_spread({
129
129
  ref: $(o, y),
130
130
  startIcon: /* @__PURE__ */ c(j, {}),
131
- endIcon: a ? /* @__PURE__ */ c(A, {
131
+ endIcon: f ? /* @__PURE__ */ c(A, {
132
132
  size: 48,
133
133
  style: {
134
134
  display: "flex",
@@ -1,14 +1,14 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./select.css.ts.vanilla.css-mistica.js";
3
- var n = "_1sqpivvo _1y2v1nf60 _1y2v1nfbt", f = "_1sqpivvq _1y2v1nf7q _1y2v1nf85 _1y2v1nf6u _1y2v1nf79 _1y2v1nf1w _1y2v1nf64 _1y2v1nf6j _1y2v1nfar _1y2v1nf97", a = "_1y2v1nf3e", i = {
3
+ var n = "_1sqpivvo _1y2v1nf60 _1y2v1nfbt", f = "_1sqpivvq _1y2v1nf7q _1y2v1nf85 _1y2v1nf6u _1y2v1nf79 _1y2v1nf1w _1y2v1nf64 _1y2v1nf6j _1y2v1nfar _1y2v1nf97", i = "_1y2v1nf3e", a = {
4
4
  show: "_1sqpivv7",
5
5
  hide: "_1sqpivv8"
6
- }, y = "_1sqpivv6 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf60 _1y2v1nfai _1y2v1nf31", s = {
6
+ }, y = "_1sqpivv6 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf61 _1y2v1nfai _1y2v1nf31", s = {
7
7
  default: "_1sqpivvd _1sqpivvc _1y2v1nf5z _1y2v1nfar",
8
8
  fullWidth: "_1sqpivve _1sqpivvc _1y2v1nf5z _1y2v1nfar"
9
9
  }, r = {
10
- default: "_1sqpivvl _1sqpivvk _1y2v1nf60 _1y2v1nfas _1y2v1nfa7 _1y2v1nf1w",
11
- disabled: "_1sqpivvm _1sqpivvk _1y2v1nf60 _1y2v1nfas _1y2v1nfa7 _1y2v1nf1w"
10
+ default: "_1sqpivvl _1sqpivvk _1y2v1nf60 _1y2v1nfa7 _1y2v1nf1w",
11
+ disabled: "_1sqpivvm _1sqpivvk _1y2v1nf60 _1y2v1nfa7 _1y2v1nf1w"
12
12
  }, t = {
13
13
  default: "_1sqpivvh _1sqpivvg _1y2v1nfaa _1y2v1nf1w _1y2v1nf5y _1y2v1nf8f _1y2v1nf8w",
14
14
  disabled: "_1sqpivvi _1sqpivvg _1y2v1nfaa _1y2v1nf1w _1y2v1nf5y _1y2v1nf8f _1y2v1nf8w"
@@ -19,4 +19,4 @@ var n = "_1sqpivvo _1y2v1nf60 _1y2v1nfbt", f = "_1sqpivvq _1y2v1nf7q _1y2v1nf85
19
19
  minWidth: "var(--_1sqpivv3)",
20
20
  maxHeight: "var(--_1sqpivv4)"
21
21
  };
22
- export { n as arrowDown, f as menuItem, a as menuItemSelected, i as optionsAnimationsVariants, y as optionsContainer, s as selectContainerVariants, r as selectTextVariants, t as selectVariants, p as vars };
22
+ export { n as arrowDown, f as menuItem, i as menuItemSelected, a as optionsAnimationsVariants, y as optionsContainer, s as selectContainerVariants, r as selectTextVariants, t as selectVariants, p as vars };