@telefonica/mistica 12.12.0 → 12.13.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.
package/dist/carousel.js CHANGED
@@ -10,16 +10,16 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  Carousel: function() {
13
- return lt;
13
+ return ft;
14
14
  },
15
15
  CenteredCarousel: function() {
16
- return nt;
16
+ return dt;
17
17
  },
18
18
  PageBullets: function() {
19
- return re;
19
+ return ne;
20
20
  },
21
21
  Slideshow: function() {
22
- return ct;
22
+ return ht;
23
23
  }
24
24
  });
25
25
  var _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
@@ -38,6 +38,7 @@ var _documentVisibilityJs = require("./utils/document-visibility.js");
38
38
  var _carouselCssMisticaJs = require("./carousel.css-mistica.js");
39
39
  var _dynamic = require("@vanilla-extract/dynamic");
40
40
  var _sprinklesCssMisticaJs = require("./sprinkles.css-mistica.js");
41
+ var _desktopContainerTypeContextJs = require("./desktop-container-type-context.js");
41
42
  var _jsxRuntimeJs = require("./_virtual/jsx-runtime.js");
42
43
  function _interopRequireDefault(obj) {
43
44
  return obj && obj.__esModule ? obj : {
@@ -193,14 +194,14 @@ function _unsupportedIterableToArray(o, minLen) {
193
194
  if (n === "Map" || n === "Set") return Array.from(n);
194
195
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
195
196
  }
196
- var te = function te(e, c) {
197
- var l = (0, _documentVisibilityJs.useDocumentVisibility)();
198
- return (0, _hooksJs.useIsInViewport)(c, !1) && l && !!e;
199
- }, re = function re(param) {
200
- var e = param.currentIndex, c = param.numPages, l = param.onPress;
201
- var r = (0, _themeVariantContextJs.useIsInverseVariant)(), ref = (0, _hooksJs.useScreenSize)(), d = ref.isDesktopOrBigger, g = function g(b) {
202
- var n = b === e;
203
- return r ? n ? _carouselCssMisticaJs.bulletActiveInverse : _carouselCssMisticaJs.bulletInverse : n ? _carouselCssMisticaJs.bulletActive : _carouselCssMisticaJs.bullet;
197
+ var le = function le(e, s) {
198
+ var t = (0, _documentVisibilityJs.useDocumentVisibility)();
199
+ return (0, _hooksJs.useIsInViewport)(s, !1) && t && !!e;
200
+ }, ne = function ne(param) {
201
+ var e = param.currentIndex, s = param.numPages, t = param.onPress;
202
+ var o = (0, _themeVariantContextJs.useIsInverseVariant)(), ref = (0, _hooksJs.useScreenSize)(), d = ref.isDesktopOrBigger, p = function p(v) {
203
+ var n = v === e;
204
+ return o ? n ? _carouselCssMisticaJs.bulletActiveInverse : _carouselCssMisticaJs.bulletInverse : n ? _carouselCssMisticaJs.bulletActive : _carouselCssMisticaJs.bullet;
204
205
  };
205
206
  return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_inlineJs.default, {
206
207
  space: d ? 16 : 8,
@@ -209,8 +210,8 @@ var te = function te(e, c) {
209
210
  "component-name": "PageBullets"
210
211
  },
211
212
  children: Array.from({
212
- length: c
213
- }, function(b, n) {
213
+ length: s
214
+ }, function(v, n) {
214
215
  return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
215
216
  className: (0, _sprinklesCssMisticaJs.sprinkles)({
216
217
  display: "block",
@@ -219,184 +220,200 @@ var te = function te(e, c) {
219
220
  background: "transparent"
220
221
  }),
221
222
  maybe: !0,
222
- onPress: d && l ? function() {
223
- return l(n);
223
+ onPress: d && t ? function() {
224
+ return t(n);
224
225
  } : void 0,
225
226
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
226
- className: g(n)
227
+ className: p(n)
227
228
  })
228
229
  }, n);
229
230
  })
230
231
  });
231
- }, je = function je(e) {
232
- var c = {
232
+ }, Q = function Q(e, s, t) {
233
+ return t ? typeof t == "number" ? t : t[e] || s[e] : s[e];
234
+ }, qe = function qe(e, s) {
235
+ var t = {
233
236
  mobile: 1,
234
- desktop: 3
237
+ tablet: 2,
238
+ desktop: {
239
+ small: 1,
240
+ medium: 2,
241
+ large: 3
242
+ }
243
+ };
244
+ if (!s) return _objectSpreadProps(_objectSpread({}, t), {
245
+ desktop: Q(e, t.desktop)
246
+ });
247
+ if (typeof s == "number") return {
248
+ mobile: s,
249
+ tablet: s,
250
+ desktop: s
235
251
  };
236
- return e ? typeof e == "number" ? {
237
- mobile: e,
238
- desktop: e
239
- } : _objectSpread({}, c, e) : c;
240
- }, _e = function _e(e) {
252
+ var o = Q(e, t.desktop, s.desktop);
253
+ return _objectSpreadProps(_objectSpread({}, t, s), {
254
+ desktop: o
255
+ });
256
+ }, Ye = function Ye(e) {
241
257
  return typeof e == "number" || e === void 0 ? {
242
258
  next: e,
243
259
  prev: e
244
260
  } : e;
245
- }, H = function H(e, c) {
261
+ }, X = function X(e, s) {
246
262
  if (e.length === 0) return [];
247
- var l = Math.ceil(e.length / c), r = [];
248
- for(var d = 0; d < e.length; d += l)r.push(e[d]);
249
- return r[r.length - 1] = e[e.length - l], r;
250
- }, Fe = function Fe(e, c) {
251
- var l = [];
252
- for(var r = 0; r < c.length; r++)r === 0 ? l.push(c[0]) : l.push((c[r] + c[r - 1]) / 2);
253
- for(var r1 = l.length - 1; r1 >= 0; r1--)if (e - l[r1] >= -1) return r1;
263
+ var t = Math.ceil(e.length / s), o = [];
264
+ for(var d = 0; d < e.length; d += t)o.push(e[d]);
265
+ return o[o.length - 1] = e[e.length - t], o;
266
+ }, Ge = function Ge(e, s) {
267
+ var t = [];
268
+ for(var o = 0; o < s.length; o++)o === 0 ? t.push(s[0]) : t.push((s[o] + s[o - 1]) / 2);
269
+ for(var o1 = t.length - 1; o1 >= 0; o1--)if (e - t[o1] >= -1) return o1;
254
270
  return 0;
255
- }, oe = 5e3, se = function se(param) {
256
- var e = param.items, c = param.itemStyle, l = param.itemClassName, r = param.withBullets, d = param.renderBullets, g = param.initialActiveItem, b = param.itemsPerPage, n = param.itemsToScroll, k = param.mobilePageOffset, P = param.gap, j = param.free, L = param.centered, p = param.autoplay, S = param.onPageChange, _ = param.dataAttributes;
257
- var ref = (0, _hooksJs.useTheme)(), w = ref.texts, B = ref.platformOverrides, o = je(b), u = _e(k), ref1 = (0, _hooksJs.useScreenSize)(), x = ref1.isDesktopOrBigger, h = _react.useRef(null), I = Math.floor(x ? o.desktop : o.mobile), v = Math.ceil(e.length / I), ref2 = _slicedToArray(_react.useState({
271
+ }, ce = 5e3, ie = function ie(param) {
272
+ var e = param.items, s = param.itemStyle, t = param.itemClassName, o = param.withBullets, d = param.renderBullets, p = param.initialActiveItem, v = param.itemsPerPage, n = param.itemsToScroll, E = param.mobilePageOffset, x = param.gap, _ = param.free, N = param.centered, m = param.autoplay, A = param.onPageChange, F = param.dataAttributes;
273
+ var ref = (0, _hooksJs.useTheme)(), S = ref.texts, y = ref.platformOverrides, c = (0, _desktopContainerTypeContextJs.useDesktopContainerType)(), i = qe(c || "large", v), ref1 = (0, _hooksJs.useScreenSize)(), P = ref1.isDesktopOrBigger, k = ref1.isMobile, U = k ? i.mobile : i.tablet, g = Math.max(Math.floor(P ? i.desktop : U), 1), b = Ye(E), I = _react.useRef(null), w = Math.ceil(e.length / g), ref2 = _slicedToArray(_react.useState({
258
274
  scrollLeft: 0,
259
275
  scrollRight: 0
260
- }), 2), ref3 = ref2[0], E = ref3.scrollLeft, F = ref3.scrollRight, le = ref2[1], ref4 = _slicedToArray(_react.useState([]), 2), U = ref4[0], ne = ref4[1], y = _react.useMemo(function() {
261
- return H(U, v);
276
+ }), 2), ref3 = ref2[0], H = ref3.scrollLeft, $ = ref3.scrollRight, ae = ref2[1], ref4 = _slicedToArray(_react.useState([]), 2), q = ref4[0], ue = ref4[1], T = _react.useMemo(function() {
277
+ return X(q, w);
262
278
  }, [
263
- U,
264
- v
265
- ]), T = n ? H(U, Math.ceil(e.length / n)) : y, ce = F !== 0, ie = E !== 0;
279
+ q,
280
+ w
281
+ ]), W = n ? X(q, Math.ceil(e.length / n)) : T, fe = $ !== 0, de = H !== 0;
266
282
  (0, _hooksJs.useIsomorphicLayoutEffect)(function() {
267
- if (h.current) {
268
- var s = h.current, i = function i() {
269
- var V = s.scrollWidth, A = s.clientWidth, z = Math.round(s.scrollLeft), O = Math.round(V - (z + A));
270
- le({
283
+ if (I.current) {
284
+ var l = I.current, a = function a() {
285
+ var O = l.scrollWidth, M = l.clientWidth, z = Math.round(l.scrollLeft), j = Math.round(O - (z + M));
286
+ ae({
271
287
  scrollLeft: z,
272
- scrollRight: O
288
+ scrollRight: j
273
289
  });
274
290
  }, f = function f() {
275
- var V = s.scrollWidth - s.clientWidth;
276
- ne(Array.from(s.querySelectorAll("[data-item]")).map(function(A, z) {
277
- if (z === e.length - 1) return V;
278
- var O = A.offsetLeft, ue = parseInt(getComputedStyle(A).scrollMargin), fe = L && !x ? O - A.clientWidth / 2 : O;
279
- return Math.min(fe - ue - s.offsetLeft, V);
291
+ var O = l.scrollWidth - l.clientWidth;
292
+ ue(Array.from(l.querySelectorAll("[data-item]")).map(function(M, z) {
293
+ if (z === e.length - 1) return O;
294
+ var j = M.offsetLeft, me = parseInt(getComputedStyle(M).scrollMargin), pe = N && !P ? j - M.clientWidth / 2 : j;
295
+ return Math.min(pe - me - l.offsetLeft, O);
280
296
  }));
281
297
  };
282
- i(), f(), s.addEventListener("scroll", i);
283
- var m = (0, _domJs.listenResize)(s, function() {
284
- i(), f();
298
+ a(), f(), l.addEventListener("scroll", a);
299
+ var h = (0, _domJs.listenResize)(l, function() {
300
+ a(), f();
285
301
  });
286
302
  return function() {
287
- s.removeEventListener("scroll", i), m();
303
+ l.removeEventListener("scroll", a), h();
288
304
  };
289
305
  }
290
306
  return function() {};
291
307
  }, [
292
- o.desktop,
293
- o.mobile,
294
- u.next,
295
- u.prev,
296
- v,
297
- P,
298
- L,
308
+ i.desktop,
309
+ i.tablet,
310
+ i.mobile,
311
+ b.next,
312
+ b.prev,
313
+ w,
299
314
  x,
315
+ N,
316
+ P,
300
317
  e.length
301
318
  ]);
302
- var W = _react.useCallback(function(s) {
303
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
304
- var f = h.current;
319
+ var D = _react.useCallback(function(l) {
320
+ var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
321
+ var f = I.current;
305
322
  if (f) {
306
- var m = y[s];
323
+ var h = T[l];
307
324
  f.scrollTo({
308
- left: m,
309
- behavior: i ? "smooth" : "auto"
325
+ left: h,
326
+ behavior: a ? "smooth" : "auto"
310
327
  });
311
328
  }
312
329
  }, [
313
- y
314
- ]), ae = _react.useCallback(function() {
315
- var s = h.current;
316
- if (s) {
317
- var i = s.scrollLeft, f = _toConsumableArray(T).reverse().find(function(m) {
318
- return m - i < -1;
330
+ T
331
+ ]), he = _react.useCallback(function() {
332
+ var l = I.current;
333
+ if (l) {
334
+ var a = l.scrollLeft, f = _toConsumableArray(W).reverse().find(function(h) {
335
+ return h - a < -1;
319
336
  });
320
- s.scrollTo({
337
+ l.scrollTo({
321
338
  left: f,
322
339
  behavior: "smooth"
323
340
  });
324
341
  }
325
342
  }, [
326
- T
327
- ]), $ = _react.useCallback(function() {
328
- var s = h.current;
329
- if (s) {
330
- var i = s.scrollLeft, f = T.find(function(m) {
331
- return m - i > 1;
343
+ W
344
+ ]), Y = _react.useCallback(function() {
345
+ var l = I.current;
346
+ if (l) {
347
+ var a = l.scrollLeft, f = W.find(function(h) {
348
+ return h - a > 1;
332
349
  });
333
- s.scrollTo({
350
+ l.scrollTo({
334
351
  left: f,
335
352
  behavior: "smooth"
336
353
  });
337
354
  }
338
355
  }, [
339
- T
340
- ]), Y = te(!!p, h);
356
+ W
357
+ ]), J = le(!!m, I);
341
358
  _react.useEffect(function() {
342
- g !== void 0 && W(Math.floor(g / I), !1);
359
+ p !== void 0 && D(Math.floor(p / g), !1);
343
360
  }, [
344
- g,
345
- W,
346
- I
361
+ p,
362
+ D,
363
+ g
347
364
  ]), _react.useEffect(function() {
348
- if (Y && p) {
349
- var s = typeof p == "boolean" ? oe : p.time, i = typeof p == "object" && p.loop, f = setInterval(function() {
350
- var m;
351
- F !== 0 ? $() : i && ((m = h.current) == null || m.scrollTo({
365
+ if (J && m) {
366
+ var l = typeof m == "boolean" ? ce : m.time, a = typeof m == "object" && m.loop, f = setInterval(function() {
367
+ var h;
368
+ $ !== 0 ? Y() : a && ((h = I.current) == null || h.scrollTo({
352
369
  left: 0,
353
370
  behavior: "smooth"
354
371
  }));
355
- }, s);
372
+ }, l);
356
373
  return function() {
357
374
  return clearInterval(f);
358
375
  };
359
376
  }
360
377
  }, [
361
- p,
378
+ m,
379
+ Y,
362
380
  $,
363
- F,
364
- Y
381
+ J
365
382
  ]);
366
- var N = Fe(E, y);
383
+ var C = Ge(H, T);
367
384
  _react.useEffect(function() {
368
- if (S) {
369
- var s = Math.min((N + 1) * I - 1, e.length - 1), i = [];
370
- for(var f = 0; f < I; f++){
371
- var m = s - f;
372
- m >= 0 && i.unshift(m);
385
+ if (A) {
386
+ var l = Math.min((C + 1) * g - 1, e.length - 1), a = [];
387
+ for(var f = 0; f < g; f++){
388
+ var h = l - f;
389
+ h >= 0 && a.unshift(h);
373
390
  }
374
- S({
375
- pageIndex: N,
376
- shownItemIndexes: i
391
+ A({
392
+ pageIndex: C,
393
+ shownItemIndexes: a
377
394
  });
378
395
  }
379
396
  }, [
380
- N,
397
+ C,
381
398
  e.length,
382
- I,
383
- S
399
+ g,
400
+ A
384
401
  ]);
385
- var D = null;
402
+ var V = null;
386
403
  var _obj, _obj1;
387
- return d ? D = d({
388
- numPages: v,
389
- currentIndex: N,
390
- onPress: W
391
- }) : r && (D = v > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
392
- numPages: v,
393
- currentIndex: N,
394
- onPress: W
404
+ return d ? V = d({
405
+ numPages: w,
406
+ currentIndex: C,
407
+ onPress: D
408
+ }) : o && (V = w > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(ne, {
409
+ numPages: w,
410
+ currentIndex: C,
411
+ onPress: D
395
412
  })), /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)(_stackJs.default, {
396
413
  space: 24,
397
414
  dataAttributes: _objectSpread({
398
415
  "component-name": "Carousel"
399
- }, _),
416
+ }, F),
400
417
  children: [
401
418
  /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", {
402
419
  className: _carouselCssMisticaJs.carouselContainer,
@@ -405,130 +422,131 @@ var te = function te(e, c) {
405
422
  isInverse: !1,
406
423
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
407
424
  className: _carouselCssMisticaJs.carouselPrevArrowButton,
408
- "aria-label": w.carouselPrevButton,
409
- onPress: ae,
410
- disabled: !ie,
425
+ "aria-label": S.carouselPrevButton,
426
+ onPress: he,
427
+ disabled: !de,
411
428
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronLeftRegularJs.default, {})
412
429
  })
413
430
  }),
414
431
  /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
415
- className: (0, _classnames.default)(_carouselCssMisticaJs.carousel, (_obj = {}, _defineProperty(_obj, _carouselCssMisticaJs.centeredCarousel, L), _defineProperty(_obj, _carouselCssMisticaJs.carouselWithScroll, v > 1), _obj)),
416
- style: _objectSpreadProps(_objectSpread({}, (0, _dynamic.assignInlineVars)(_objectSpread((_obj1 = {}, _defineProperty(_obj1, _carouselCssMisticaJs.vars.itemsPerPageDesktop, String(o.desktop)), _defineProperty(_obj1, _carouselCssMisticaJs.vars.itemsPerPageMobile, String(o.mobile)), _defineProperty(_obj1, _carouselCssMisticaJs.vars.mobilePageOffsetNext, u.next ? "".concat(u.next, "px") : ""), _defineProperty(_obj1, _carouselCssMisticaJs.vars.mobilePageOffsetPrev, u.prev ? "".concat(u.prev, "px") : ""), _obj1), P !== void 0 ? _defineProperty({}, _carouselCssMisticaJs.vars.gap, String(P)) : {}))), {
417
- scrollSnapType: j ? "initial" : "x mandatory"
432
+ className: (0, _classnames.default)(_carouselCssMisticaJs.carousel, (_obj = {}, _defineProperty(_obj, _carouselCssMisticaJs.centeredCarousel, N), _defineProperty(_obj, _carouselCssMisticaJs.carouselWithScroll, w > 1), _obj)),
433
+ style: _objectSpreadProps(_objectSpread({}, (0, _dynamic.assignInlineVars)(_objectSpread((_obj1 = {}, _defineProperty(_obj1, _carouselCssMisticaJs.vars.itemsPerPageDesktop, String(i.desktop)), _defineProperty(_obj1, _carouselCssMisticaJs.vars.itemsPerPageTablet, String(i.tablet)), _defineProperty(_obj1, _carouselCssMisticaJs.vars.itemsPerPageMobile, String(i.mobile)), _defineProperty(_obj1, _carouselCssMisticaJs.vars.mobilePageOffsetNext, b.next ? "".concat(b.next, "px") : ""), _defineProperty(_obj1, _carouselCssMisticaJs.vars.mobilePageOffsetPrev, b.prev ? "".concat(b.prev, "px") : ""), _obj1), x !== void 0 ? _defineProperty({}, _carouselCssMisticaJs.vars.gap, String(x)) : {}))), {
434
+ scrollSnapType: _ ? "initial" : "x mandatory"
418
435
  }),
419
- ref: h,
420
- children: e.map(function(s, i) {
436
+ ref: I,
437
+ children: e.map(function(l, a) {
421
438
  return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
422
- className: (0, _classnames.default)(_carouselCssMisticaJs.carouselItem, l),
423
- style: _objectSpreadProps(_objectSpread({}, c), {
424
- scrollSnapStop: (0, _platformJs.isAndroid)(B) ? "always" : "normal"
439
+ className: (0, _classnames.default)(_carouselCssMisticaJs.carouselItem, t),
440
+ style: _objectSpreadProps(_objectSpread({}, s), {
441
+ scrollSnapStop: (0, _platformJs.isAndroid)(y) ? "always" : "normal"
425
442
  }),
426
443
  "data-item": !0,
427
- children: s
428
- }, i);
444
+ children: l
445
+ }, a);
429
446
  })
430
447
  }),
431
448
  /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
432
449
  isInverse: !1,
433
450
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
434
451
  className: _carouselCssMisticaJs.carouselNextArrowButton,
435
- "aria-label": w.carouselNextButton,
436
- onPress: $,
437
- disabled: !ce,
452
+ "aria-label": S.carouselNextButton,
453
+ onPress: Y,
454
+ disabled: !fe,
438
455
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronRightRegularJs.default, {})
439
456
  })
440
457
  })
441
458
  ]
442
459
  }),
443
- D && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
460
+ V && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
444
461
  className: _carouselCssMisticaJs.carouselBullets,
445
- children: D
462
+ children: V
446
463
  })
447
464
  ]
448
465
  });
449
- }, lt = function lt(e) {
450
- return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(se, _objectSpread({}, e));
451
- }, nt = function nt(param) {
452
- var e = param.items, c = param.itemStyle, l = param.itemClassName, r = param.withBullets, d = param.renderBullets, g = param.initialActiveItem, b = param.onPageChange, n = param.dataAttributes;
453
- return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(se, {
466
+ }, ft = function ft(e) {
467
+ return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(ie, _objectSpread({}, e));
468
+ }, dt = function dt(param) {
469
+ var e = param.items, s = param.itemStyle, t = param.itemClassName, o = param.withBullets, d = param.renderBullets, p = param.initialActiveItem, v = param.onPageChange, n = param.dataAttributes;
470
+ return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(ie, {
454
471
  items: e,
455
- itemStyle: c,
456
- itemClassName: l,
472
+ itemStyle: s,
473
+ itemClassName: t,
457
474
  itemsPerPage: {
458
475
  mobile: 1,
476
+ tablet: 1,
459
477
  desktop: 3
460
478
  },
461
479
  centered: !0,
462
480
  itemsToScroll: 1,
463
481
  mobilePageOffset: 0,
464
482
  gap: 0,
465
- withBullets: r,
483
+ withBullets: o,
466
484
  renderBullets: d,
467
- initialActiveItem: g,
468
- onPageChange: b,
485
+ initialActiveItem: p,
486
+ onPageChange: v,
469
487
  dataAttributes: n
470
488
  });
471
- }, ct = function ct(param) {
472
- var e = param.items, c = param.withBullets, l = param.autoplay, r = param.onPageChange, d = param.dataAttributes;
473
- var ref = (0, _hooksJs.useTheme)(), g = ref.texts, b = ref.platformOverrides, n = _react.useRef(null), ref1 = _slicedToArray(_react.useState({
489
+ }, ht = function ht(param) {
490
+ var e = param.items, s = param.withBullets, t = param.autoplay, o = param.onPageChange, d = param.dataAttributes;
491
+ var ref = (0, _hooksJs.useTheme)(), p = ref.texts, v = ref.platformOverrides, n = _react.useRef(null), ref1 = _slicedToArray(_react.useState({
474
492
  scrollLeft: 0,
475
493
  scrollRight: 0
476
- }), 2), ref2 = ref1[0], k = ref2.scrollLeft, P = ref2.scrollRight, j = ref1[1], L = _react.useCallback(function() {
477
- var o = n.current;
478
- o && o.scrollBy({
479
- left: -o.clientWidth,
494
+ }), 2), ref2 = ref1[0], E = ref2.scrollLeft, x = ref2.scrollRight, _ = ref1[1], N = _react.useCallback(function() {
495
+ var c = n.current;
496
+ c && c.scrollBy({
497
+ left: -c.clientWidth,
480
498
  behavior: "smooth"
481
499
  });
482
- }, []), p = _react.useCallback(function() {
483
- var o = n.current;
484
- o && o.scrollBy({
485
- left: o.clientWidth,
500
+ }, []), m = _react.useCallback(function() {
501
+ var c = n.current;
502
+ c && c.scrollBy({
503
+ left: c.clientWidth,
486
504
  behavior: "smooth"
487
505
  });
488
- }, []), S = P !== 0, _ = k !== 0, w = n.current ? Math.floor((k + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
506
+ }, []), A = x !== 0, F = E !== 0, S = n.current ? Math.floor((E + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
489
507
  _react.useLayoutEffect(function() {
490
- var o = n.current;
491
- if (o) {
492
- var u = function u() {
493
- var h = o.scrollWidth, I = o.clientWidth, v = Math.round(o.scrollLeft), E = Math.round(h - (v + I));
494
- j({
495
- scrollLeft: v,
496
- scrollRight: E
508
+ var c = n.current;
509
+ if (c) {
510
+ var i = function i() {
511
+ var k = c.scrollWidth, U = c.clientWidth, g = Math.round(c.scrollLeft), b = Math.round(k - (g + U));
512
+ _({
513
+ scrollLeft: g,
514
+ scrollRight: b
497
515
  });
498
516
  };
499
- u(), o.addEventListener("scroll", u);
500
- var x = (0, _domJs.listenResize)(o, u);
517
+ i(), c.addEventListener("scroll", i);
518
+ var P = (0, _domJs.listenResize)(c, i);
501
519
  return function() {
502
- o.removeEventListener("scroll", u), x();
520
+ c.removeEventListener("scroll", i), P();
503
521
  };
504
522
  }
505
523
  }, [
506
524
  e.length
507
525
  ]);
508
- var B = te(!!l, n);
526
+ var y = le(!!t, n);
509
527
  return _react.useEffect(function() {
510
- if (B && l) {
511
- var o = typeof l == "boolean" ? oe : l.time, u = typeof l == "object" && l.loop, x = setInterval(function() {
512
- var h;
513
- P !== 0 ? p() : u && ((h = n.current) == null || h.scrollTo({
528
+ if (y && t) {
529
+ var c = typeof t == "boolean" ? ce : t.time, i = typeof t == "object" && t.loop, P = setInterval(function() {
530
+ var k;
531
+ x !== 0 ? m() : i && ((k = n.current) == null || k.scrollTo({
514
532
  left: 0,
515
533
  behavior: "smooth"
516
534
  }));
517
- }, o);
535
+ }, c);
518
536
  return function() {
519
- return clearInterval(x);
537
+ return clearInterval(P);
520
538
  };
521
539
  }
522
540
  }, [
523
- l,
524
- p,
525
- P,
526
- B
541
+ t,
542
+ m,
543
+ x,
544
+ y
527
545
  ]), _react.useEffect(function() {
528
- r && r(w);
546
+ o && o(S);
529
547
  }, [
530
- w,
531
- r
548
+ S,
549
+ o
532
550
  ]), /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", _objectSpreadProps(_objectSpread({
533
551
  className: _carouselCssMisticaJs.slideshowContainer
534
552
  }, (0, _domJs.getPrefixedDataAttributes)(d, "SlideShow")), {
@@ -537,9 +555,9 @@ var te = function te(e, c) {
537
555
  isInverse: !1,
538
556
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
539
557
  className: _carouselCssMisticaJs.slideshowPrevArrowButton,
540
- "aria-label": g.carouselPrevButton,
541
- onPress: L,
542
- disabled: !_,
558
+ "aria-label": p.carouselPrevButton,
559
+ onPress: N,
560
+ disabled: !F,
543
561
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronLeftRegularJs.default, {})
544
562
  })
545
563
  }),
@@ -547,14 +565,14 @@ var te = function te(e, c) {
547
565
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
548
566
  className: _carouselCssMisticaJs.slideshow,
549
567
  ref: n,
550
- children: e.map(function(o, u) {
568
+ children: e.map(function(c, i) {
551
569
  return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
552
570
  className: _carouselCssMisticaJs.slideshowItem,
553
571
  style: {
554
- scrollSnapStop: (0, _platformJs.isAndroid)(b) ? "always" : "normal"
572
+ scrollSnapStop: (0, _platformJs.isAndroid)(v) ? "always" : "normal"
555
573
  },
556
- children: o
557
- }, u);
574
+ children: c
575
+ }, i);
558
576
  })
559
577
  })
560
578
  }),
@@ -562,19 +580,19 @@ var te = function te(e, c) {
562
580
  isInverse: !1,
563
581
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
564
582
  className: _carouselCssMisticaJs.slideshowNextArrowButton,
565
- "aria-label": g.carouselNextButton,
566
- onPress: p,
567
- disabled: !S,
583
+ "aria-label": p.carouselNextButton,
584
+ onPress: m,
585
+ disabled: !A,
568
586
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronRightRegularJs.default, {})
569
587
  })
570
588
  }),
571
- c && e.length > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
589
+ s && e.length > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
572
590
  isInverse: !0,
573
591
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
574
592
  className: _carouselCssMisticaJs.slideshowBullets,
575
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
593
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(ne, {
576
594
  numPages: e.length,
577
- currentIndex: w
595
+ currentIndex: S
578
596
  })
579
597
  })
580
598
  })
@@ -8,10 +8,18 @@ declare type PageBulletsProps = {
8
8
  onPress?: (index: number) => void,
9
9
  };
10
10
  declare export var PageBullets: React.ComponentType<PageBulletsProps>;
11
+ declare type DesktopItemsPerPage =
12
+ | {
13
+ small?: number,
14
+ medium?: number,
15
+ large?: number,
16
+ }
17
+ | number;
11
18
  declare type ItemsPerPageProp =
12
19
  | {
13
20
  mobile?: number,
14
- desktop?: number,
21
+ tablet?: number,
22
+ desktop?: DesktopItemsPerPage,
15
23
  }
16
24
  | number;
17
25
  declare type MobilePageOffset =