@telefonica/mistica 13.2.3 → 13.4.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
@@ -9,10 +9,12 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- Carousel: ()=>it,
13
- CenteredCarousel: ()=>at,
12
+ Carousel: ()=>ut,
13
+ CenteredCarousel: ()=>dt,
14
+ IsInsideSlideshowProvider: ()=>Ge,
14
15
  PageBullets: ()=>re,
15
- Slideshow: ()=>ut
16
+ Slideshow: ()=>ht,
17
+ useIsInsideSlideshowContext: ()=>ft
16
18
  });
17
19
  const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
18
20
  const _iconChevronLeftRegularJs = /*#__PURE__*/ _interopRequireDefault(require("./generated/mistica-icons/icon-chevron-left-regular.js"));
@@ -133,19 +135,19 @@ const oe = (e, r)=>{
133
135
  return (0, _hooksJs.useIsInViewport)(r, !1) && t && !!e;
134
136
  }, re = (param)=>{
135
137
  let { currentIndex: e , numPages: r , onPress: t } = param;
136
- const s = (0, _themeVariantContextJs.useIsInverseVariant)(), { isDesktopOrBigger: f } = (0, _hooksJs.useScreenSize)(), p = (v)=>{
137
- const c = v === e;
138
- return s ? c ? _carouselCssMisticaJs.bulletActiveInverse : _carouselCssMisticaJs.bulletInverse : c ? _carouselCssMisticaJs.bulletActive : _carouselCssMisticaJs.bullet;
138
+ const o = (0, _themeVariantContextJs.useIsInverseVariant)(), { isDesktopOrBigger: u } = (0, _hooksJs.useScreenSize)(), I = (P)=>{
139
+ const d = P === e;
140
+ return o ? d ? _carouselCssMisticaJs.bulletActiveInverse : _carouselCssMisticaJs.bulletInverse : d ? _carouselCssMisticaJs.bulletActive : _carouselCssMisticaJs.bullet;
139
141
  };
140
142
  return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_inlineJs.default, {
141
- space: f ? 16 : 8,
143
+ space: u ? 16 : 8,
142
144
  alignItems: "center",
143
145
  dataAttributes: {
144
146
  "component-name": "PageBullets"
145
147
  },
146
148
  children: Array.from({
147
149
  length: r
148
- }, (v, c)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
150
+ }, (P, d)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
149
151
  className: (0, _sprinklesCssMisticaJs.sprinkles)({
150
152
  display: "block",
151
153
  padding: 0,
@@ -153,13 +155,13 @@ const oe = (e, r)=>{
153
155
  background: "transparent"
154
156
  }),
155
157
  maybe: !0,
156
- onPress: f && t ? ()=>t(c) : void 0,
158
+ onPress: u && t ? ()=>t(d) : void 0,
157
159
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
158
- className: p(c)
160
+ className: I(d)
159
161
  })
160
- }, c))
162
+ }, d))
161
163
  });
162
- }, K = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], Ue = (e, r)=>{
164
+ }, K = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], qe = (e, r)=>{
163
165
  const t = {
164
166
  mobile: 1,
165
167
  tablet: 2,
@@ -177,157 +179,157 @@ const oe = (e, r)=>{
177
179
  tablet: r,
178
180
  desktop: r
179
181
  };
180
- const s = K(e, t.desktop, r.desktop);
182
+ const o = K(e, t.desktop, r.desktop);
181
183
  return _objectSpreadProps(_objectSpread({}, t, r), {
182
- desktop: s
184
+ desktop: o
183
185
  });
184
186
  }, Q = (e, r)=>{
185
187
  if (e.length === 0) return [];
186
- const t = Math.ceil(e.length / r), s = [];
187
- for(let f = 0; f < e.length; f += t)s.push(e[f]);
188
- return s[s.length - 1] = e[e.length - t], s;
189
- }, qe = (e, r)=>{
188
+ const t = Math.ceil(e.length / r), o = [];
189
+ for(let u = 0; u < e.length; u += t)o.push(e[u]);
190
+ return o[o.length - 1] = e[e.length - t], o;
191
+ }, Ye = (e, r)=>{
190
192
  const t = [];
191
- for(let s = 0; s < r.length; s++)s === 0 ? t.push(r[0]) : t.push((r[s] + r[s - 1]) / 2);
192
- for(let s1 = t.length - 1; s1 >= 0; s1--)if (e - t[s1] >= -1) return s1;
193
+ for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
194
+ for(let o1 = t.length - 1; o1 >= 0; o1--)if (e - t[o1] >= -1) return o1;
193
195
  return 0;
194
196
  }, le = 5e3, ne = (param)=>{
195
- let { items: e , itemStyle: r , itemClassName: t , withBullets: s , renderBullets: f , initialActiveItem: p , itemsPerPage: v , itemsToScroll: c , gap: w , free: S , centered: k , autoplay: g , onPageChange: P , dataAttributes: _ } = param;
196
- const { texts: B , platformOverrides: L } = (0, _hooksJs.useTheme)(), E = (0, _desktopContainerTypeContextJs.useDesktopContainerType)(), o = Ue(E || "large", v), { isDesktopOrBigger: h , isMobile: N } = (0, _hooksJs.useScreenSize)(), x = N ? o.mobile : o.tablet, I = Math.max(Math.floor(h ? o.desktop : x), 1), m = _react.useRef(null), b = Math.ceil(e.length / I), [{ scrollLeft: G , scrollRight: F }, ce] = _react.useState({
197
+ let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: I , itemsPerPage: P , itemsToScroll: d , gap: f , free: B , centered: w , autoplay: x , onPageChange: S , dataAttributes: k } = param;
198
+ const { texts: E , platformOverrides: F } = (0, _hooksJs.useTheme)(), L = (0, _desktopContainerTypeContextJs.useDesktopContainerType)(), m = qe(L || "large", P), { isDesktopOrBigger: n , isMobile: g } = (0, _hooksJs.useScreenSize)(), C = g ? m.mobile : m.tablet, p = Math.max(Math.floor(n ? m.desktop : C), 1), v = _react.useRef(null), b = Math.ceil(e.length / p), [{ scrollLeft: y , scrollRight: U }, ie] = _react.useState({
197
199
  scrollLeft: 0,
198
200
  scrollRight: 0
199
- }), [U, ie] = _react.useState([]), y = _react.useMemo(()=>Q(U, b), [
200
- U,
201
+ }), [q, ae] = _react.useState([]), T = _react.useMemo(()=>Q(q, b), [
202
+ q,
201
203
  b
202
- ]), T = c ? Q(U, Math.ceil(e.length / c)) : y, ae = F !== 0, ue = G !== 0;
204
+ ]), W = d ? Q(q, Math.ceil(e.length / d)) : T, ue = U !== 0, de = y !== 0;
203
205
  (0, _hooksJs.useIsomorphicLayoutEffect)(()=>{
204
- if (m.current) {
205
- const n = m.current, i = ()=>{
206
- const { scrollWidth: V , clientWidth: C } = n, O = Math.round(n.scrollLeft), z = Math.round(V - (O + C));
207
- ce({
208
- scrollLeft: O,
209
- scrollRight: z
206
+ if (v.current) {
207
+ const l = v.current, i = ()=>{
208
+ const { scrollWidth: O , clientWidth: A } = l, z = Math.round(l.scrollLeft), j = Math.round(O - (z + A));
209
+ ie({
210
+ scrollLeft: z,
211
+ scrollRight: j
210
212
  });
211
- }, u = ()=>{
212
- const V = n.scrollWidth - n.clientWidth;
213
- ie(Array.from(n.querySelectorAll("[data-item]")).map((C, O)=>{
214
- if (O === e.length - 1) return V;
215
- const z = C.offsetLeft, de = parseInt(getComputedStyle(C).scrollMargin), he = k && !h ? z - C.clientWidth / 2 : z;
216
- return Math.min(he - de - n.offsetLeft, V);
213
+ }, a = ()=>{
214
+ const O = l.scrollWidth - l.clientWidth;
215
+ ae(Array.from(l.querySelectorAll("[data-item]")).map((A, z)=>{
216
+ if (z === e.length - 1) return O;
217
+ const j = A.offsetLeft, he = parseInt(getComputedStyle(A).scrollMargin), me = w && !n ? j - A.clientWidth / 2 : j;
218
+ return Math.min(me - he - l.offsetLeft, O);
217
219
  }));
218
220
  };
219
- i(), u(), n.addEventListener("scroll", i);
220
- const d = (0, _domJs.listenResize)(n, ()=>{
221
- i(), u();
221
+ i(), a(), l.addEventListener("scroll", i);
222
+ const h = (0, _domJs.listenResize)(l, ()=>{
223
+ i(), a();
222
224
  });
223
225
  return ()=>{
224
- n.removeEventListener("scroll", i), d();
226
+ l.removeEventListener("scroll", i), h();
225
227
  };
226
228
  }
227
229
  return ()=>{};
228
230
  }, [
229
- o.desktop,
230
- o.tablet,
231
- o.mobile,
231
+ m.desktop,
232
+ m.tablet,
233
+ m.mobile,
232
234
  b,
235
+ f,
233
236
  w,
234
- k,
235
- h,
237
+ n,
236
238
  e.length
237
239
  ]);
238
- const W = _react.useCallback(function(n) {
240
+ const D = _react.useCallback(function(l) {
239
241
  let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
240
- const u = m.current;
241
- if (u) {
242
- const d = y[n];
243
- u.scrollTo({
244
- left: d,
242
+ const a = v.current;
243
+ if (a) {
244
+ const h = T[l];
245
+ a.scrollTo({
246
+ left: h,
245
247
  behavior: i ? "smooth" : "auto"
246
248
  });
247
249
  }
248
250
  }, [
249
- y
251
+ T
250
252
  ]), fe = _react.useCallback(()=>{
251
- const n = m.current;
252
- if (n) {
253
- const { scrollLeft: i } = n, u = [
254
- ...T
255
- ].reverse().find((d)=>d - i < -1);
256
- n.scrollTo({
257
- left: u,
253
+ const l = v.current;
254
+ if (l) {
255
+ const { scrollLeft: i } = l, a = [
256
+ ...W
257
+ ].reverse().find((h)=>h - i < -1);
258
+ l.scrollTo({
259
+ left: a,
258
260
  behavior: "smooth"
259
261
  });
260
262
  }
261
263
  }, [
262
- T
263
- ]), q = _react.useCallback(()=>{
264
- const n = m.current;
265
- if (n) {
266
- const { scrollLeft: i } = n, u = T.find((d)=>d - i > 1);
267
- n.scrollTo({
268
- left: u,
264
+ W
265
+ ]), Y = _react.useCallback(()=>{
266
+ const l = v.current;
267
+ if (l) {
268
+ const { scrollLeft: i } = l, a = W.find((h)=>h - i > 1);
269
+ l.scrollTo({
270
+ left: a,
269
271
  behavior: "smooth"
270
272
  });
271
273
  }
272
274
  }, [
273
- T
274
- ]), H = oe(!!g, m);
275
+ W
276
+ ]), H = oe(!!x, v);
275
277
  _react.useEffect(()=>{
276
- p !== void 0 && W(Math.floor(p / I), !1);
278
+ I !== void 0 && D(Math.floor(I / p), !1);
277
279
  }, [
278
- p,
279
- W,
280
- I
280
+ I,
281
+ D,
282
+ p
281
283
  ]), _react.useEffect(()=>{
282
- if (H && g) {
283
- const n = typeof g == "boolean" ? le : g.time, i = typeof g == "object" && g.loop, u = setInterval(()=>{
284
- var d;
285
- F !== 0 ? q() : i && ((d = m.current) == null || d.scrollTo({
284
+ if (H && x) {
285
+ const l = typeof x == "boolean" ? le : x.time, i = typeof x == "object" && x.loop, a = setInterval(()=>{
286
+ var h;
287
+ U !== 0 ? Y() : i && ((h = v.current) == null || h.scrollTo({
286
288
  left: 0,
287
289
  behavior: "smooth"
288
290
  }));
289
- }, n);
290
- return ()=>clearInterval(u);
291
+ }, l);
292
+ return ()=>clearInterval(a);
291
293
  }
292
294
  }, [
293
- g,
294
- q,
295
- F,
295
+ x,
296
+ Y,
297
+ U,
296
298
  H
297
299
  ]);
298
- const A = qe(G, y);
300
+ const N = Ye(y, T);
299
301
  _react.useEffect(()=>{
300
- if (P) {
301
- const n = Math.min((A + 1) * I - 1, e.length - 1), i = [];
302
- for(let u = 0; u < I; u++){
303
- const d = n - u;
304
- d >= 0 && i.unshift(d);
302
+ if (S) {
303
+ const l = Math.min((N + 1) * p - 1, e.length - 1), i = [];
304
+ for(let a = 0; a < p; a++){
305
+ const h = l - a;
306
+ h >= 0 && i.unshift(h);
305
307
  }
306
- P({
307
- pageIndex: A,
308
+ S({
309
+ pageIndex: N,
308
310
  shownItemIndexes: i
309
311
  });
310
312
  }
311
313
  }, [
312
- A,
314
+ N,
313
315
  e.length,
314
- I,
315
- P
316
+ p,
317
+ S
316
318
  ]);
317
- let D = null;
318
- return f ? D = f({
319
+ let V = null;
320
+ return u ? V = u({
319
321
  numPages: b,
320
- currentIndex: A,
321
- onPress: W
322
- }) : s && (D = b > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
322
+ currentIndex: N,
323
+ onPress: D
324
+ }) : o && (V = b > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
323
325
  numPages: b,
324
- currentIndex: A,
325
- onPress: W
326
+ currentIndex: N,
327
+ onPress: D
326
328
  })), /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)(_stackJs.default, {
327
329
  space: 24,
328
330
  dataAttributes: _objectSpread({
329
331
  "component-name": "Carousel"
330
- }, _),
332
+ }, k),
331
333
  children: [
332
334
  /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", {
333
335
  className: _carouselCssMisticaJs.carouselContainer,
@@ -336,56 +338,56 @@ const oe = (e, r)=>{
336
338
  isInverse: !1,
337
339
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
338
340
  className: _carouselCssMisticaJs.carouselPrevArrowButton,
339
- "aria-label": B.carouselPrevButton,
341
+ "aria-label": E.carouselPrevButton,
340
342
  onPress: fe,
341
- disabled: !ue,
343
+ disabled: !de,
342
344
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronLeftRegularJs.default, {})
343
345
  })
344
346
  }),
345
347
  /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
346
348
  className: (0, _classnames.default)(_carouselCssMisticaJs.carousel, {
347
- [_carouselCssMisticaJs.centeredCarousel]: k,
349
+ [_carouselCssMisticaJs.centeredCarousel]: w,
348
350
  [_carouselCssMisticaJs.carouselWithScroll]: b > 1
349
351
  }),
350
352
  style: _objectSpreadProps(_objectSpread({}, (0, _dynamic.assignInlineVars)(_objectSpread({
351
- [_carouselCssMisticaJs.vars.itemsPerPageDesktop]: String(o.desktop),
352
- [_carouselCssMisticaJs.vars.itemsPerPageTablet]: String(o.tablet),
353
- [_carouselCssMisticaJs.vars.itemsPerPageMobile]: String(o.mobile)
354
- }, w !== void 0 ? {
355
- [_carouselCssMisticaJs.vars.gap]: String(w)
353
+ [_carouselCssMisticaJs.vars.itemsPerPageDesktop]: String(m.desktop),
354
+ [_carouselCssMisticaJs.vars.itemsPerPageTablet]: String(m.tablet),
355
+ [_carouselCssMisticaJs.vars.itemsPerPageMobile]: String(m.mobile)
356
+ }, f !== void 0 ? {
357
+ [_carouselCssMisticaJs.vars.gap]: String(f)
356
358
  } : {}))), {
357
- scrollSnapType: S ? "initial" : "x mandatory"
359
+ scrollSnapType: B ? "initial" : "x mandatory"
358
360
  }),
359
- ref: m,
360
- children: e.map((n, i)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
361
+ ref: v,
362
+ children: e.map((l, i)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
361
363
  className: (0, _classnames.default)(_carouselCssMisticaJs.carouselItem, t),
362
364
  style: _objectSpreadProps(_objectSpread({}, r), {
363
- scrollSnapStop: (0, _platformJs.isAndroid)(L) ? "always" : "normal"
365
+ scrollSnapStop: (0, _platformJs.isAndroid)(F) ? "always" : "normal"
364
366
  }),
365
367
  "data-item": !0,
366
- children: n
368
+ children: l
367
369
  }, i))
368
370
  }),
369
371
  /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
370
372
  isInverse: !1,
371
373
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
372
374
  className: _carouselCssMisticaJs.carouselNextArrowButton,
373
- "aria-label": B.carouselNextButton,
374
- onPress: q,
375
- disabled: !ae,
375
+ "aria-label": E.carouselNextButton,
376
+ onPress: Y,
377
+ disabled: !ue,
376
378
  children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronRightRegularJs.default, {})
377
379
  })
378
380
  })
379
381
  ]
380
382
  }),
381
- D && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
383
+ V && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
382
384
  className: _carouselCssMisticaJs.carouselBullets,
383
- children: D
385
+ children: V
384
386
  })
385
387
  ]
386
388
  });
387
- }, it = (e)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(ne, _objectSpread({}, e)), at = (param)=>/* @__PURE__ */ {
388
- let { items: e , itemStyle: r , itemClassName: t , withBullets: s , renderBullets: f , initialActiveItem: p , onPageChange: v , dataAttributes: c } = param;
389
+ }, ut = (e)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(ne, _objectSpread({}, e)), dt = (param)=>/* @__PURE__ */ {
390
+ let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: I , onPageChange: P , dataAttributes: d } = param;
389
391
  return (0, _jsxRuntimeJs.jsx)(ne, {
390
392
  items: e,
391
393
  itemStyle: r,
@@ -398,118 +400,127 @@ const oe = (e, r)=>{
398
400
  centered: !0,
399
401
  itemsToScroll: 1,
400
402
  gap: 0,
401
- withBullets: s,
402
- renderBullets: f,
403
- initialActiveItem: p,
404
- onPageChange: v,
405
- dataAttributes: c
403
+ withBullets: o,
404
+ renderBullets: u,
405
+ initialActiveItem: I,
406
+ onPageChange: P,
407
+ dataAttributes: d
408
+ });
409
+ }, ce = /*#__PURE__*/ _react.createContext(!1), ft = ()=>_react.useContext(ce), Ge = (param)=>/* @__PURE__ */ {
410
+ let { children: e } = param;
411
+ return (0, _jsxRuntimeJs.jsx)(ce.Provider, {
412
+ value: !0,
413
+ children: e
406
414
  });
407
- }, ut = (param)=>{
408
- let { items: e , withBullets: r , autoplay: t , onPageChange: s , dataAttributes: f } = param;
409
- const { texts: p , platformOverrides: v } = (0, _hooksJs.useTheme)(), c = _react.useRef(null), [{ scrollLeft: w , scrollRight: S }, k] = _react.useState({
415
+ }, ht = (param)=>{
416
+ let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: u , inverseBullets: I = !0 } = param;
417
+ const { texts: P , platformOverrides: d } = (0, _hooksJs.useTheme)(), f = _react.useRef(null), [{ scrollLeft: B , scrollRight: w }, x] = _react.useState({
410
418
  scrollLeft: 0,
411
419
  scrollRight: 0
412
- }), g = _react.useCallback(()=>{
413
- const o = c.current;
414
- o && o.scrollBy({
415
- left: -o.clientWidth,
420
+ }), S = _react.useCallback(()=>{
421
+ const n = f.current;
422
+ n && n.scrollBy({
423
+ left: -n.clientWidth,
416
424
  behavior: "smooth"
417
425
  });
418
- }, []), P = _react.useCallback(()=>{
419
- const o = c.current;
420
- o && o.scrollBy({
421
- left: o.clientWidth,
426
+ }, []), k = _react.useCallback(()=>{
427
+ const n = f.current;
428
+ n && n.scrollBy({
429
+ left: n.clientWidth,
422
430
  behavior: "smooth"
423
431
  });
424
- }, []), _ = S !== 0, B = w !== 0, L = c.current ? Math.floor((w + c.current.clientWidth / 2) / c.current.clientWidth) : 0;
432
+ }, []), E = w !== 0, F = B !== 0, L = f.current ? Math.floor((B + f.current.clientWidth / 2) / f.current.clientWidth) : 0;
425
433
  _react.useLayoutEffect(()=>{
426
- const o = c.current;
427
- if (o) {
428
- const h = ()=>{
429
- const { scrollWidth: x , clientWidth: I } = o, m = Math.round(o.scrollLeft), b = Math.round(x - (m + I));
430
- k({
431
- scrollLeft: m,
432
- scrollRight: b
434
+ const n = f.current;
435
+ if (n) {
436
+ const g = ()=>{
437
+ const { scrollWidth: p , clientWidth: v } = n, b = Math.round(n.scrollLeft), y = Math.round(p - (b + v));
438
+ x({
439
+ scrollLeft: b,
440
+ scrollRight: y
433
441
  });
434
442
  };
435
- h(), o.addEventListener("scroll", h);
436
- const N = (0, _domJs.listenResize)(o, h);
443
+ g(), n.addEventListener("scroll", g);
444
+ const C = (0, _domJs.listenResize)(n, g);
437
445
  return ()=>{
438
- o.removeEventListener("scroll", h), N();
446
+ n.removeEventListener("scroll", g), C();
439
447
  };
440
448
  }
441
449
  }, [
442
450
  e.length
443
451
  ]);
444
- const E = oe(!!t, c);
452
+ const m = oe(!!t, f);
445
453
  return _react.useEffect(()=>{
446
- if (E && t) {
447
- const o = typeof t == "boolean" ? le : t.time, h = typeof t == "object" && t.loop, N = setInterval(()=>{
448
- var x;
449
- S !== 0 ? P() : h && ((x = c.current) == null || x.scrollTo({
454
+ if (m && t) {
455
+ const n = typeof t == "boolean" ? le : t.time, g = typeof t == "object" && t.loop, C = setInterval(()=>{
456
+ var p;
457
+ w !== 0 ? k() : g && ((p = f.current) == null || p.scrollTo({
450
458
  left: 0,
451
459
  behavior: "smooth"
452
460
  }));
453
- }, o);
454
- return ()=>clearInterval(N);
461
+ }, n);
462
+ return ()=>clearInterval(C);
455
463
  }
456
464
  }, [
457
465
  t,
458
- P,
459
- S,
460
- E
466
+ k,
467
+ w,
468
+ m
461
469
  ]), _react.useEffect(()=>{
462
- s && s(L);
470
+ o && o(L);
463
471
  }, [
464
472
  L,
465
- s
466
- ]), /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", _objectSpreadProps(_objectSpread({
467
- className: _carouselCssMisticaJs.slideshowContainer
468
- }, (0, _domJs.getPrefixedDataAttributes)(f, "SlideShow")), {
469
- children: [
470
- /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
471
- isInverse: !1,
472
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
473
- className: _carouselCssMisticaJs.slideshowPrevArrowButton,
474
- "aria-label": p.carouselPrevButton,
475
- onPress: g,
476
- disabled: !B,
477
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronLeftRegularJs.default, {})
478
- })
479
- }),
480
- /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_imageJs.DisableBorderRadiusProvider, {
481
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
482
- className: _carouselCssMisticaJs.slideshow,
483
- ref: c,
484
- children: e.map((o, h)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
485
- className: _carouselCssMisticaJs.slideshowItem,
486
- style: {
487
- scrollSnapStop: (0, _platformJs.isAndroid)(v) ? "always" : "normal"
488
- },
489
- children: o
490
- }, h))
491
- })
492
- }),
493
- /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
494
- isInverse: !1,
495
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
496
- className: _carouselCssMisticaJs.slideshowNextArrowButton,
497
- "aria-label": p.carouselNextButton,
498
- onPress: P,
499
- disabled: !_,
500
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronRightRegularJs.default, {})
501
- })
502
- }),
503
- r && e.length > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
504
- isInverse: !0,
505
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
506
- className: _carouselCssMisticaJs.slideshowBullets,
507
- children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
508
- numPages: e.length,
509
- currentIndex: L
473
+ o
474
+ ]), /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(Ge, {
475
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", _objectSpreadProps(_objectSpread({
476
+ className: _carouselCssMisticaJs.slideshowContainer
477
+ }, (0, _domJs.getPrefixedDataAttributes)(u, "SlideShow")), {
478
+ children: [
479
+ /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
480
+ isInverse: !1,
481
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
482
+ className: _carouselCssMisticaJs.slideshowPrevArrowButton,
483
+ "aria-label": P.carouselPrevButton,
484
+ onPress: S,
485
+ disabled: !F,
486
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronLeftRegularJs.default, {})
487
+ })
488
+ }),
489
+ /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_imageJs.MediaBorderRadiusProvider, {
490
+ value: !1,
491
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
492
+ className: _carouselCssMisticaJs.slideshow,
493
+ ref: f,
494
+ children: e.map((n, g)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
495
+ className: _carouselCssMisticaJs.slideshowItem,
496
+ style: {
497
+ scrollSnapStop: (0, _platformJs.isAndroid)(d) ? "always" : "normal"
498
+ },
499
+ children: n
500
+ }, g))
501
+ })
502
+ }),
503
+ /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
504
+ isInverse: !1,
505
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
506
+ className: _carouselCssMisticaJs.slideshowNextArrowButton,
507
+ "aria-label": P.carouselNextButton,
508
+ onPress: k,
509
+ disabled: !E,
510
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronRightRegularJs.default, {})
511
+ })
512
+ }),
513
+ r && e.length > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
514
+ isInverse: I,
515
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
516
+ className: _carouselCssMisticaJs.slideshowBullets,
517
+ children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
518
+ numPages: e.length,
519
+ currentIndex: L
520
+ })
510
521
  })
511
522
  })
512
- })
513
- ]
514
- }));
523
+ ]
524
+ }))
525
+ });
515
526
  };
package/dist/header.d.ts CHANGED
@@ -51,7 +51,11 @@ export declare const MainSectionHeader: React.FC<MainSectionHeaderProps>;
51
51
  type HeaderLayoutProps = {
52
52
  isInverse?: boolean;
53
53
  breadcrumbs?: RendersNullableElement<typeof NavigationBreadcrumbs>;
54
- header: React.ReactNode;
54
+ /**
55
+ * Intentionally not forced to RendersElement<typeof Header> to allow skeletons for example
56
+ * The header is optional in order to allow webviews to delegate the header visualization to the surrounding native app.
57
+ */
58
+ header?: React.ReactNode;
55
59
  extra?: React.ReactNode;
56
60
  sideBySideExtraOnDesktop?: boolean;
57
61
  children?: void;