@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
package/dist/theme.d.ts CHANGED
@@ -69,7 +69,7 @@ type LinkComponent = React.ComponentType<{
69
69
  onKeyDown?: React.KeyboardEventHandler<HTMLAnchorElement>;
70
70
  children: React.ReactNode;
71
71
  }>;
72
- export declare const AnchorLink: LinkComponent;
72
+ export declare const getMisticaLinkComponent: (Link?: ThemeConfig['Link']) => LinkComponent;
73
73
  export type ColorScheme = 'dark' | 'light' | 'auto';
74
74
  export type EventFormat = 'universal-analytics' | 'google-analytics-4';
75
75
  export type ThemeConfig = Readonly<{
@@ -92,7 +92,10 @@ export type ThemeConfig = Readonly<{
92
92
  dimensions?: Readonly<{
93
93
  headerMobileHeight: number | 'mistica';
94
94
  }>;
95
- Link?: LinkComponent;
95
+ Link?: LinkComponent | {
96
+ type: 'ReactRouter5' | 'ReactRouter6' | 'Next12' | 'Next13';
97
+ Component: React.ComponentType<any>;
98
+ };
96
99
  useHrefDecorator?: () => (href: string) => string;
97
100
  useId?: () => string;
98
101
  enableTabFocus?: boolean;
package/dist/theme.js CHANGED
@@ -9,20 +9,20 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- AnchorLink: function() {
13
- return u;
14
- },
15
12
  NAVBAR_HEIGHT_DESKTOP: function() {
16
- return s;
13
+ return C;
17
14
  },
18
15
  NAVBAR_HEIGHT_MOBILE: function() {
19
- return d;
16
+ return c;
20
17
  },
21
18
  dimensions: function() {
22
- return m;
19
+ return E;
20
+ },
21
+ getMisticaLinkComponent: function() {
22
+ return h;
23
23
  },
24
24
  getTexts: function() {
25
- return C;
25
+ return b;
26
26
  }
27
27
  });
28
28
  const _jsxruntime = require("react/jsx-runtime");
@@ -105,7 +105,7 @@ function _object_without_properties_loose(source, excluded) {
105
105
  }
106
106
  return target;
107
107
  }
108
- const t = {
108
+ const l = {
109
109
  expirationDatePlaceholder: "MM/AA",
110
110
  togglePasswordVisibilityLabel: "Mostrar u ocultar contrase\xf1a",
111
111
  loading: "Cargando",
@@ -136,7 +136,7 @@ const t = {
136
136
  clearButton: "Borrar",
137
137
  carouselNextButton: "siguiente",
138
138
  carouselPrevButton: "anterior"
139
- }, o = {
139
+ }, n = {
140
140
  expirationDatePlaceholder: "MM/YY",
141
141
  togglePasswordVisibilityLabel: "Toggle password visibility",
142
142
  loading: "Loading",
@@ -167,7 +167,7 @@ const t = {
167
167
  clearButton: "Clear",
168
168
  carouselNextButton: "next",
169
169
  carouselPrevButton: "previous"
170
- }, n = {
170
+ }, d = {
171
171
  expirationDatePlaceholder: "MM/JJ",
172
172
  togglePasswordVisibilityLabel: "Passwort un-/sichtbar machen",
173
173
  loading: "Wird gespeichert",
@@ -198,7 +198,7 @@ const t = {
198
198
  clearButton: "L\xf6schen",
199
199
  carouselNextButton: "n\xe4chste",
200
200
  carouselPrevButton: "vorherige"
201
- }, l = {
201
+ }, s = {
202
202
  expirationDatePlaceholder: "MM/AA",
203
203
  togglePasswordVisibilityLabel: "Mostrar ou ocultar senha",
204
204
  loading: "Carregando",
@@ -229,31 +229,80 @@ const t = {
229
229
  clearButton: "Apagar",
230
230
  carouselNextButton: "pr\xf3ximo",
231
231
  carouselPrevButton: "anterior"
232
- }, C = (r)=>{
232
+ }, b = (r)=>{
233
233
  switch(r.toLocaleLowerCase().split(/[-_]/)[0]){
234
234
  case "es":
235
- return t;
236
- case "pt":
237
235
  return l;
236
+ case "pt":
237
+ return s;
238
238
  case "de":
239
- return n;
239
+ return d;
240
240
  case "en":
241
- return o;
241
+ return n;
242
242
  default:
243
- return process.env.NODE_ENV !== "production" && console.error(`Invalid locale: ${r}`), o;
243
+ return process.env.NODE_ENV !== "production" && console.error(`Invalid locale: ${r}`), n;
244
244
  }
245
- }, d = 56, s = 80, m = {
246
- headerMobileHeight: d,
247
- headerDesktopHeight: s
248
- }, u = (_param)=>/* @__PURE__ */ {
249
- var { to: r , innerRef: e } = _param, a = _object_without_properties(_param, [
245
+ }, c = 56, C = 80, E = {
246
+ headerMobileHeight: c,
247
+ headerDesktopHeight: C
248
+ }, m = (_param)=>/* @__PURE__ */ {
249
+ var { to: r , innerRef: e } = _param, o = _object_without_properties(_param, [
250
250
  "to",
251
251
  "innerRef"
252
252
  ]);
253
253
  return (0, _jsxruntime.jsx)("a", _object_spread_props(_object_spread({
254
254
  ref: e,
255
255
  href: typeof r == "string" ? r : r == null ? void 0 : r.pathname
256
- }, a), {
257
- children: a.children
256
+ }, o), {
257
+ children: o.children
258
258
  }));
259
+ }, u = (r)=>r, f = (r)=>(_param)=>/* @__PURE__ */ {
260
+ var { innerRef: e } = _param, o = _object_without_properties(_param, [
261
+ "innerRef"
262
+ ]);
263
+ return (0, _jsxruntime.jsx)(r, _object_spread({
264
+ ref: e
265
+ }, o));
266
+ }, v = (r)=>(_param)=>/* @__PURE__ */ {
267
+ var { to: e , innerRef: o , children: t } = _param, i = _object_without_properties(_param, [
268
+ "to",
269
+ "innerRef",
270
+ "children"
271
+ ]);
272
+ return (0, _jsxruntime.jsx)(r, {
273
+ href: e,
274
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("a", _object_spread_props(_object_spread({
275
+ ref: o
276
+ }, i), {
277
+ children: t
278
+ }))
279
+ });
280
+ }, p = (r)=>(_param)=>/* @__PURE__ */ {
281
+ var { to: e , innerRef: o , children: t } = _param, i = _object_without_properties(_param, [
282
+ "to",
283
+ "innerRef",
284
+ "children"
285
+ ]);
286
+ return (0, _jsxruntime.jsx)(r, _object_spread_props(_object_spread({
287
+ href: e,
288
+ ref: o
289
+ }, i), {
290
+ children: t
291
+ }));
292
+ }, h = (r)=>{
293
+ if (!r) return m;
294
+ if (typeof r == "function" || r.$$typeof) return r;
295
+ switch(r.type){
296
+ case "ReactRouter5":
297
+ return u(r.Component);
298
+ case "ReactRouter6":
299
+ return f(r.Component);
300
+ case "Next12":
301
+ return v(r.Component);
302
+ case "Next13":
303
+ return p(r.Component);
304
+ default:
305
+ const e = r.type;
306
+ throw new Error(`Invalid Link type: ${e}`);
307
+ }
259
308
  };
package/dist/video.d.ts CHANGED
@@ -37,5 +37,11 @@ export type VideoProps = {
37
37
  preload?: 'none' | 'metadata' | 'auto';
38
38
  dataAttributes?: DataAttributes;
39
39
  };
40
- declare const Video: React.ForwardRefExoticComponent<VideoProps & React.RefAttributes<HTMLVideoElement>>;
40
+ export interface VideoElement extends HTMLDivElement {
41
+ play: () => Promise<void>;
42
+ pause: () => void;
43
+ load: () => void;
44
+ setCurrentTime: (time: number) => void;
45
+ }
46
+ declare const Video: React.ForwardRefExoticComponent<VideoProps & React.RefAttributes<VideoElement>>;
41
47
  export default Video;
package/dist/video.js CHANGED
@@ -10,22 +10,20 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  RATIO: function() {
13
- return M;
13
+ return K;
14
14
  },
15
15
  default: function() {
16
- return ne;
16
+ return re;
17
17
  }
18
18
  });
19
19
  const _jsxruntime = require("react/jsx-runtime");
20
20
  const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
21
21
  const _image = require("./image.js");
22
22
  const _aspectratiosupport = require("./utils/aspect-ratio-support.js");
23
- const _common = require("./utils/common.js");
24
23
  const _dom = require("./utils/dom.js");
25
24
  const _platform = require("./utils/platform.js");
26
25
  const _videocssmistica = require("./video.css-mistica.js");
27
26
  const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
28
- const _hooks = require("./hooks.js");
29
27
  function _getRequireWildcardCache(nodeInterop) {
30
28
  if (typeof WeakMap !== "function") return null;
31
29
  var cacheBabelInterop = new WeakMap();
@@ -144,14 +142,18 @@ function _object_without_properties_loose(source, excluded) {
144
142
  }
145
143
  return target;
146
144
  }
147
- const K = {
145
+ const q = {
148
146
  loading: {
149
147
  play: "playing",
150
148
  pause: "paused",
151
149
  fail: "error",
152
150
  finishLoad: "loaded"
153
151
  },
154
- loaded: {
152
+ /**
153
+ * This state represents the scenario when video.load() finishes, but the video isn't played yet. Some browsers don't actually load
154
+ * the video until someone plays it. In this case, we need to show the poster, because we may not have the first frame to display it.
155
+ * https://stackoverflow.com/questions/10235919/the-canplay-canplaythrough-events-for-an-html5-video-are-not-called-on-firefox/26430919#26430919
156
+ */ loaded: {
155
157
  play: "playing",
156
158
  pause: "paused",
157
159
  reset: "loading"
@@ -167,12 +169,12 @@ const K = {
167
169
  error: {
168
170
  reset: "loading"
169
171
  }
170
- }, L = (t, l)=>K[t][l] || t, M = {
172
+ }, D = (r, u)=>q[r][u] || r, K = {
171
173
  "1:1": 1,
172
174
  "16:9": 16 / 9,
173
175
  "4:3": 4 / 3
174
- }, W = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC", _ = /*#__PURE__*/ _react.forwardRef((_param, F)=>{
175
- var { src: t , poster: l , autoPlay: u = "when-loaded" , muted: C = !0 , loop: E = !0 , preload: S = "none" , loadingTimeout: y = 1e4 , onLoad: h , onError: c , onPause: f , onPlay: m , aspectRatio: A = "1:1" , dataAttributes: T } = _param, i = _object_without_properties(_param, [
176
+ }, _ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC", z = /*#__PURE__*/ _react.forwardRef((_param, A)=>{
177
+ var { src: r , poster: u , autoPlay: p = "when-loaded" , muted: x = !0 , loop: N = !0 , preload: k = "none" , loadingTimeout: T = 1e4 , onLoad: y , onError: h , onPause: R , onPlay: w , aspectRatio: c = "1:1" , dataAttributes: B } = _param, n = _object_without_properties(_param, [
176
178
  "src",
177
179
  "poster",
178
180
  "autoPlay",
@@ -187,104 +189,142 @@ const K = {
187
189
  "aspectRatio",
188
190
  "dataAttributes"
189
191
  ]);
190
- const [r, s] = _react.useReducer(L, "loading"), g = _react.useRef(null), b = _react.useRef(), w = (0, _image.useMediaBorderRadius)(), p = typeof A == "number" ? A : M[A], R = _react.useCallback(()=>{
191
- r === "loading" && (s("fail"), c == null || c());
192
+ const [a, l] = _react.useReducer(D, "loading"), s = _react.useRef(null), C = _react.useRef(), f = _react.useRef(null), b = (0, _image.useMediaBorderRadius)(), m = typeof c == "number" ? c : K[c], v = _react.useCallback(()=>{
193
+ a === "loading" && (l("fail"), h == null || h());
192
194
  }, [
193
- c,
194
- r
195
+ h,
196
+ a
195
197
  ]);
196
198
  _react.useEffect(()=>{
197
199
  var e;
198
- if (b.current !== t) {
199
- b.current = t;
200
- const n = setTimeout(R, y);
201
- return (e = g.current) == null || e.load(), ()=>{
202
- clearTimeout(n);
200
+ if (C.current !== r) {
201
+ C.current = r;
202
+ const t = setTimeout(v, T);
203
+ return l("reset"), (e = s.current) == null || e.load(), ()=>{
204
+ clearTimeout(t);
203
205
  };
204
206
  }
205
207
  }, [
206
- t,
207
- y,
208
- R
208
+ r,
209
+ T,
210
+ v
209
211
  ]);
210
- const v = ()=>{
211
- h == null || h();
212
- const e = g.current, n = u && !(0, _platform.isRunningAcceptanceTest)();
213
- s("finishLoad"), e && n && e.paused && e.play();
214
- }, x = (Array.isArray(t) ? t : [
215
- t
212
+ const I = ()=>{
213
+ y == null || y();
214
+ const e = s.current, t = p && !(0, _platform.isRunningAcceptanceTest)();
215
+ l("finishLoad"), e && t && e.paused && e.play();
216
+ }, U = (Array.isArray(r) ? r : [
217
+ r
216
218
  ]).map((e)=>typeof e == "string" ? {
217
219
  src: e
218
- } : e), a = r === "error" || r === "loading" || r === "loaded", { ref: I , width: N , height: k } = (0, _hooks.useElementDimensions)(), B = /* @__PURE__ */ (0, _jsxruntime.jsx)("video", _object_spread_props(_object_spread({
219
- ref: (0, _common.combineRefs)(F, g),
220
+ } : e), g = a === "error" || a === "loading" || a === "loaded", j = /* @__PURE__ */ (0, _jsxruntime.jsx)("video", _object_spread_props(_object_spread({
221
+ ref: s,
220
222
  playsInline: !0,
221
223
  disablePictureInPicture: !0,
222
224
  disableRemotePlayback: !0,
223
- muted: C,
224
- loop: E,
225
+ muted: x,
226
+ loop: N,
225
227
  className: _videocssmistica.video,
226
- preload: S,
227
- onLoadStart: ()=>{
228
- s("reset");
229
- },
230
- onError: R,
228
+ preload: k,
229
+ onError: v,
231
230
  onPause: ()=>{
232
- f == null || f(), s("pause");
231
+ R == null || R(), l("pause");
233
232
  },
234
- onPlay: ()=>{
235
- m == null || m(), s("play");
233
+ onTimeUpdate: ()=>{
234
+ var e;
235
+ a !== "playing" && ((e = s.current) == null ? void 0 : e.currentTime) !== 0 && (w == null || w(), l("play"));
236
236
  },
237
237
  onCanPlay: ()=>{
238
- u === "streaming" && v();
238
+ p === "streaming" && I();
239
239
  },
240
240
  onCanPlayThrough: ()=>{
241
- u !== "streaming" && v();
241
+ p !== "streaming" && I();
242
242
  },
243
- poster: W
244
- }, (0, _dom.getPrefixedDataAttributes)(T)), {
243
+ poster: _
244
+ }, (0, _dom.getPrefixedDataAttributes)(B)), {
245
245
  style: {
246
246
  // For some reason adding this style with classnames doesn't add the border radius in safari
247
- borderRadius: w ? _skincontractcssmistica.vars.borderRadii.container : 0,
248
- visibility: a ? "hidden" : "visible",
249
- position: a || p !== 0 ? "absolute" : "static",
250
- width: a ? N : "100%",
251
- height: a ? k : "100%"
252
- },
253
- children: x.map((param, U)=>/* @__PURE__ */ {
254
- let { src: e , type: n } = param;
255
- return (0, _jsxruntime.jsx)("source", {
256
- src: e,
257
- type: n
258
- }, U);
259
- })
260
- })), j = !!(p !== 0 || i.width && i.height), G = l ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.ImageContent, {
261
- ref: I,
262
- aspectRatio: A,
263
- width: i.width,
264
- height: i.height,
265
- src: l
266
- }) : j ? /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
267
- style: {
268
- position: "absolute",
247
+ borderRadius: b ? _skincontractcssmistica.vars.borderRadii.container : 0,
248
+ visibility: g ? "hidden" : "visible",
249
+ position: g || m !== 0 ? "absolute" : "static",
269
250
  width: "100%",
270
251
  height: "100%"
271
252
  },
272
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.ImageError, {
273
- ref: I,
274
- noBorderRadius: !w,
275
- withIcon: r === "error"
253
+ children: U.map((param, i)=>/* @__PURE__ */ {
254
+ let { src: e , type: t } = param;
255
+ return (0, _jsxruntime.jsx)("source", {
256
+ src: e,
257
+ type: t
258
+ }, i);
276
259
  })
277
- }) : void 0;
260
+ })), E = !!(m !== 0 || n.width && n.height), F = a === "error", G = _react.useMemo(()=>u ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.ImageContent, {
261
+ aspectRatio: c,
262
+ width: n.width,
263
+ height: n.height,
264
+ src: u
265
+ }) : E ? /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
266
+ style: {
267
+ position: "absolute",
268
+ width: "100%",
269
+ height: "100%"
270
+ },
271
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.ImageError, {
272
+ noBorderRadius: !b,
273
+ withIcon: F
274
+ })
275
+ }) : void 0, [
276
+ c,
277
+ n.height,
278
+ n.width,
279
+ b,
280
+ F,
281
+ u,
282
+ E
283
+ ]);
278
284
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_aspectratiosupport.AspectRatioElement, {
279
285
  style: {
280
286
  position: "relative"
281
287
  },
282
- aspectRatio: p,
283
- width: i.width,
284
- height: i.height,
288
+ aspectRatio: m,
289
+ width: n.width,
290
+ height: n.height,
285
291
  children: [
286
- B,
287
- a && G
292
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
293
+ style: {
294
+ position: "absolute",
295
+ width: "100%",
296
+ height: "100%"
297
+ },
298
+ ref: (e)=>{
299
+ const t = e || null;
300
+ t && (t.play = ()=>{
301
+ var i;
302
+ return ((i = s.current) == null ? void 0 : i.play()) || Promise.resolve();
303
+ }, t.pause = ()=>{
304
+ var i;
305
+ return (i = s.current) == null ? void 0 : i.pause();
306
+ }, t.load = ()=>{
307
+ var i;
308
+ (i = f.current) != null && i.style && (f.current.style.width = "100%", f.current.style.height = "100%"), setTimeout(()=>{
309
+ var S;
310
+ l("reset"), (S = s.current) == null || S.load();
311
+ }, 100);
312
+ }, t.setCurrentTime = (i)=>{
313
+ s.current && (s.current.currentTime = i);
314
+ }), typeof A == "function" ? A(t) : A && (A.current = t);
315
+ }
316
+ }),
317
+ j,
318
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
319
+ ref: f,
320
+ style: {
321
+ position: m !== 0 ? "absolute" : "static",
322
+ width: g ? "100%" : 0,
323
+ height: g ? "100%" : 0,
324
+ overflow: "hidden"
325
+ },
326
+ children: G
327
+ })
288
328
  ]
289
329
  });
290
- }), ne = _;
330
+ }), re = z;
@@ -1,8 +1,8 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./checkbox.css.ts.vanilla.css-mistica.js";
3
3
  var n = {
4
- ios: "_1rz9b15 _1rz9b14 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30",
5
- rest: "_1rz9b16 _1rz9b14 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30",
6
- checked: "_1rz9b17 _1rz9b14 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30"
7
- }, r = "_1rz9b19 _1y2v1nf66", f = "_1rz9b1a", y = "_1rz9b11 _1y2v1nf67", b = "_1rz9b12", a = "_1rz9b1b";
4
+ ios: "_1rz9b16 _1rz9b15 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30",
5
+ rest: "_1rz9b17 _1rz9b15 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30",
6
+ checked: "_1rz9b18 _1rz9b15 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30"
7
+ }, r = "_1rz9b1a _1y2v1nf66", f = "_1rz9b1b", y = "_1rz9b12 _1rz9b11 _1y2v1nf67", b = "_1rz9b13 _1rz9b11 _1y2v1nf67", a = "_1rz9b1c";
8
8
  export { n as boxVariant, r as check, f as checkChecked, y as checkboxContainer, b as checkboxContainerDisabled, a as disabled };
@@ -52,18 +52,18 @@ function _object_spread_props(target, source) {
52
52
  }
53
53
  import { jsx as a, jsxs as w } from "react/jsx-runtime";
54
54
  import * as I from "react";
55
- import { SPACE as N } from "./utils/key-codes.js";
56
- import { useControlProps as A } from "./form-context.js";
57
- import D from "./inline.js";
55
+ import { SPACE as A } from "./utils/key-codes.js";
56
+ import { useControlProps as D } from "./form-context.js";
57
+ import L from "./inline.js";
58
58
  import { Text3 as m } from "./text.js";
59
- import { useAriaId as L, useTheme as P } from "./hooks.js";
59
+ import { useAriaId as N, useTheme as P } from "./hooks.js";
60
60
  import n from "classnames";
61
61
  import { getPrefixedDataAttributes as S } from "./utils/dom.js";
62
- import { checkboxContainer as E, checkboxContainerDisabled as V, disabled as k, check as f, checkChecked as u, boxVariant as j } from "./checkbox.css-mistica.js";
63
- import { vars as v } from "./skins/skin-contract.css-mistica.js";
62
+ import { checkboxContainerDisabled as E, checkboxContainer as V, disabled as v, check as f, checkChecked as u, boxVariant as j } from "./checkbox.css-mistica.js";
63
+ import { vars as k } from "./skins/skin-contract.css-mistica.js";
64
64
  const z = (param)=>{
65
65
  let { isChecked: e , disabled: o } = param;
66
- const { isIos: l } = P(), c = l ? /* @__PURE__ */ a("svg", {
66
+ const { isIos: l } = P(), r = l ? /* @__PURE__ */ a("svg", {
67
67
  viewBox: "0 0 10 8",
68
68
  width: "10",
69
69
  height: "8",
@@ -72,7 +72,7 @@ const z = (param)=>{
72
72
  }),
73
73
  children: /* @__PURE__ */ a("path", {
74
74
  d: "M2.659 7.724c.33.366.92.368 1.254.005L9.79 1.336A.782.782 0 009.719.202a.858.858 0 00-1.178.069l-5.236 5.72-1.841-2.038a.857.857 0 00-1.177-.078.782.782 0 00-.082 1.133l2.454 2.716z",
75
- fill: v.colors.inverse
75
+ fill: k.colors.inverse
76
76
  })
77
77
  }) : /* @__PURE__ */ a("svg", {
78
78
  viewBox: "0 0 14 10",
@@ -83,17 +83,17 @@ const z = (param)=>{
83
83
  }),
84
84
  children: /* @__PURE__ */ a("path", {
85
85
  d: "M5 10L0 5.192l1.4-1.346L5 7.308 12.6 0 14 1.346z",
86
- fill: v.colors.inverse
86
+ fill: k.colors.inverse
87
87
  })
88
88
  });
89
89
  return /* @__PURE__ */ a("div", {
90
90
  className: n(j[e ? "checked" : l ? "ios" : "rest"], {
91
- [k]: o
91
+ [v]: o
92
92
  }),
93
- children: c
93
+ children: r
94
94
  });
95
95
  }, B = (e)=>{
96
- const o = L(e["aria-labelledby"]), l = e["aria-label"], c = l || e["aria-labelledby"], { defaultValue: x , value: t , onChange: s , focusableRef: C , disabled: i } = A({
96
+ const o = N(e["aria-labelledby"]), l = e["aria-label"], r = l || e["aria-labelledby"], { defaultValue: x , value: t , onChange: s , focusableRef: C , disabled: i } = D({
97
97
  name: e.name,
98
98
  value: e.checked,
99
99
  defaultValue: e.defaultChecked,
@@ -101,8 +101,8 @@ const z = (param)=>{
101
101
  disabled: e.disabled
102
102
  }), [d, g] = I.useState(!!x), h = ()=>{
103
103
  t === void 0 ? (g(!d), s(!d)) : s(!t);
104
- }, y = (r)=>{
105
- r.keyCode === N && (r.preventDefault(), r.stopPropagation(), h());
104
+ }, y = (c)=>{
105
+ c.keyCode === A && (c.preventDefault(), c.stopPropagation(), h());
106
106
  }, b = /* @__PURE__ */ a(z, {
107
107
  disabled: i,
108
108
  isChecked: t !== null && t !== void 0 ? t : d
@@ -114,10 +114,12 @@ const z = (param)=>{
114
114
  role: "checkbox",
115
115
  "aria-checked": t !== null && t !== void 0 ? t : d,
116
116
  onKeyDown: i ? void 0 : y,
117
- onClick: i ? void 0 : h,
117
+ onClick: (c)=>{
118
+ c.stopPropagation(), i || h();
119
+ },
118
120
  tabIndex: i ? void 0 : 0,
119
121
  ref: C,
120
- className: E,
122
+ className: i ? E : V,
121
123
  "aria-label": l,
122
124
  "aria-labelledby": l ? void 0 : o,
123
125
  "aria-disabled": i
@@ -127,9 +129,8 @@ const z = (param)=>{
127
129
  labelId: o,
128
130
  checked: t !== null && t !== void 0 ? t : d,
129
131
  disabled: !!i
130
- }) : /* @__PURE__ */ w(D, {
132
+ }) : /* @__PURE__ */ w(L, {
131
133
  space: 16,
132
- className: i ? V : "",
133
134
  children: [
134
135
  /* @__PURE__ */ a(m, {
135
136
  regular: !0,
@@ -146,9 +147,9 @@ const z = (param)=>{
146
147
  regular: !0,
147
148
  as: "div",
148
149
  id: o,
149
- role: c ? "presentation" : void 0,
150
+ role: r ? "presentation" : void 0,
150
151
  children: /* @__PURE__ */ a("span", {
151
- className: i ? k : "",
152
+ className: i ? v : "",
152
153
  children: e.children
153
154
  })
154
155
  })