@telefonica/mistica 16.30.1 → 16.32.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 (281) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +6 -6
  3. package/dist/align.css-mistica.js +1 -1
  4. package/dist/avatar.css-mistica.js +2 -2
  5. package/dist/badge.css-mistica.js +1 -1
  6. package/dist/box.css-mistica.js +13 -13
  7. package/dist/box.js +5 -5
  8. package/dist/boxed.css-mistica.js +25 -25
  9. package/dist/button-group.css-mistica.js +1 -1
  10. package/dist/button-group.js +2 -2
  11. package/dist/button-layout.css-mistica.js +13 -13
  12. package/dist/button.css-mistica.js +16 -16
  13. package/dist/button.d.ts +4 -0
  14. package/dist/button.js +10 -6
  15. package/dist/callout.css-mistica.js +5 -5
  16. package/dist/card.css-mistica.js +3 -3
  17. package/dist/card.d.ts +22 -0
  18. package/dist/card.js +491 -424
  19. package/dist/carousel.css-mistica.js +99 -44
  20. package/dist/carousel.css.d.ts +35 -16
  21. package/dist/carousel.d.ts +43 -5
  22. package/dist/carousel.js +570 -384
  23. package/dist/checkbox.css-mistica.js +7 -7
  24. package/dist/checkbox.js +2 -2
  25. package/dist/chip.css-mistica.js +12 -12
  26. package/dist/circle.css-mistica.js +1 -1
  27. package/dist/community/advanced-data-card.css-mistica.js +6 -6
  28. package/dist/community/advanced-data-card.js +4 -4
  29. package/dist/community/blocks.css-mistica.js +3 -3
  30. package/dist/community/example-component.css-mistica.js +1 -1
  31. package/dist/counter.css-mistica.js +1 -1
  32. package/dist/counter.js +8 -8
  33. package/dist/cover-hero.css-mistica.js +14 -15
  34. package/dist/credit-card-number-field.css-mistica.js +3 -3
  35. package/dist/date-field.css-mistica.js +1 -1
  36. package/dist/date-time-picker.css-mistica.js +1 -1
  37. package/dist/dialog-context.js +32 -27
  38. package/dist/dialog.css-mistica.js +4 -4
  39. package/dist/dialog.d.ts +1 -0
  40. package/dist/dialog.js +14 -14
  41. package/dist/divider.css-mistica.js +2 -2
  42. package/dist/double-field.css-mistica.js +2 -2
  43. package/dist/drawer.css-mistica.js +1 -1
  44. package/dist/drawer.d.ts +5 -0
  45. package/dist/empty-state-card.css-mistica.js +1 -1
  46. package/dist/empty-state.css-mistica.js +7 -7
  47. package/dist/fade-in.css-mistica.js +1 -1
  48. package/dist/feedback.css-mistica.js +1 -1
  49. package/dist/fixed-footer-layout.css-mistica.js +4 -4
  50. package/dist/fixed-footer-layout.js +5 -5
  51. package/dist/form.css-mistica.js +1 -1
  52. package/dist/form.js +5 -5
  53. package/dist/grid-layout.css-mistica.js +5 -5
  54. package/dist/grid.css-mistica.js +124 -124
  55. package/dist/grid.js +9 -9
  56. package/dist/header.css-mistica.js +1 -1
  57. package/dist/hero.css-mistica.js +2 -2
  58. package/dist/highlighted-card.css-mistica.js +4 -4
  59. package/dist/horizontal-scroll.css-mistica.js +3 -3
  60. package/dist/horizontal-scroll.js +2 -2
  61. package/dist/icon-button.css-mistica.js +42 -42
  62. package/dist/icon-button.js +43 -47
  63. package/dist/icons/icon-chevron.css-mistica.js +2 -2
  64. package/dist/icons/icon-error.css-mistica.js +1 -1
  65. package/dist/image.css-mistica.js +3 -3
  66. package/dist/image.js +5 -5
  67. package/dist/index.d.ts +1 -1
  68. package/dist/index.js +6 -0
  69. package/dist/inline.css-mistica.js +13 -13
  70. package/dist/list.css-mistica.js +1 -1
  71. package/dist/list.d.ts +10 -5
  72. package/dist/list.js +79 -76
  73. package/dist/loading-bar.css-mistica.js +1 -1
  74. package/dist/loading-bar.js +2 -2
  75. package/dist/loading-screen.css-mistica.js +5 -5
  76. package/dist/loading-screen.js +3 -3
  77. package/dist/logo.css-mistica.js +6 -6
  78. package/dist/maybe-dismissable.css-mistica.js +1 -1
  79. package/dist/menu.css-mistica.js +12 -12
  80. package/dist/menu.js +7 -7
  81. package/dist/mosaic.css-mistica.js +2 -2
  82. package/dist/mosaic.d.ts +2 -1
  83. package/dist/mosaic.js +33 -32
  84. package/dist/navigation-bar.css-mistica.js +16 -16
  85. package/dist/navigation-breadcrumbs.css-mistica.js +1 -1
  86. package/dist/package-version.js +1 -1
  87. package/dist/pin-field.css-mistica.js +1 -1
  88. package/dist/pin-field.js +2 -2
  89. package/dist/popover.css-mistica.js +1 -1
  90. package/dist/progress-bar.css-mistica.js +5 -5
  91. package/dist/progress-bar.js +2 -2
  92. package/dist/radio-button.css-mistica.js +14 -14
  93. package/dist/radio-button.d.ts +1 -0
  94. package/dist/radio-button.js +72 -61
  95. package/dist/rating.css-mistica.js +3 -3
  96. package/dist/rating.js +8 -8
  97. package/dist/responsive-layout.css-mistica.js +6 -6
  98. package/dist/responsive-layout.js +6 -6
  99. package/dist/screen-reader-only.css-mistica.js +1 -1
  100. package/dist/select.css-mistica.js +15 -15
  101. package/dist/select.js +9 -9
  102. package/dist/sheet-action-row.css-mistica.js +1 -1
  103. package/dist/sheet-common.css-mistica.js +1 -1
  104. package/dist/sheet-info.css-mistica.js +2 -2
  105. package/dist/sheet-root.js +42 -38
  106. package/dist/skeletons.css-mistica.js +4 -4
  107. package/dist/skins/skin-contract.css-mistica.js +354 -354
  108. package/dist/slider.css-mistica.js +10 -10
  109. package/dist/slider.js +9 -9
  110. package/dist/snackbar.css-mistica.js +4 -4
  111. package/dist/spinner.css-mistica.js +1 -1
  112. package/dist/stack.css-mistica.js +7 -7
  113. package/dist/stacking-group.css-mistica.js +1 -1
  114. package/dist/stepper.css-mistica.js +12 -9
  115. package/dist/stepper.css.d.ts +1 -0
  116. package/dist/stepper.d.ts +4 -2
  117. package/dist/stepper.js +54 -39
  118. package/dist/switch-component.css-mistica.js +26 -26
  119. package/dist/table.css-mistica.js +8 -8
  120. package/dist/table.js +8 -8
  121. package/dist/tabs.css-mistica.js +12 -12
  122. package/dist/tabs.d.ts +15 -1
  123. package/dist/tabs.js +154 -81
  124. package/dist/tag.css-mistica.js +1 -1
  125. package/dist/text-field-base.css-mistica.js +1 -1
  126. package/dist/text-field-base.js +126 -115
  127. package/dist/text-field-components.css-mistica.js +6 -6
  128. package/dist/text-field-components.js +2 -2
  129. package/dist/text-link.css-mistica.js +5 -5
  130. package/dist/text-tokens.d.ts +12 -0
  131. package/dist/text-tokens.js +154 -106
  132. package/dist/text.css-mistica.js +9 -9
  133. package/dist/text.js +7 -7
  134. package/dist/theme-context.css-mistica.js +398 -398
  135. package/dist/timeline.css-mistica.js +10 -10
  136. package/dist/timer.css-mistica.js +6 -6
  137. package/dist/tooltip.css-mistica.js +1 -1
  138. package/dist/touchable.css-mistica.js +1 -1
  139. package/dist/touchable.d.ts +5 -2
  140. package/dist/touchable.js +53 -53
  141. package/dist/utils/aspect-ratio-support.css-mistica.js +3 -3
  142. package/dist/utils/aspect-ratio-support.js +3 -3
  143. package/dist/video.css-mistica.js +2 -2
  144. package/dist/video.js +2 -2
  145. package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +3 -3
  146. package/dist-es/accordion.css-mistica.js +6 -6
  147. package/dist-es/align.css-mistica.js +1 -1
  148. package/dist-es/avatar.css-mistica.js +2 -2
  149. package/dist-es/badge.css-mistica.js +1 -1
  150. package/dist-es/box.css-mistica.js +13 -13
  151. package/dist-es/box.js +9 -9
  152. package/dist-es/boxed.css-mistica.js +24 -24
  153. package/dist-es/button-group.css-mistica.js +1 -1
  154. package/dist-es/button-group.js +4 -4
  155. package/dist-es/button-layout.css-mistica.js +13 -13
  156. package/dist-es/button.css-mistica.js +16 -16
  157. package/dist-es/button.js +14 -10
  158. package/dist-es/callout.css-mistica.js +5 -5
  159. package/dist-es/callout.js +5 -5
  160. package/dist-es/card.css-mistica.js +3 -3
  161. package/dist-es/card.js +627 -559
  162. package/dist-es/carousel.css-mistica.js +9 -8
  163. package/dist-es/carousel.js +587 -407
  164. package/dist-es/checkbox.css-mistica.js +7 -7
  165. package/dist-es/checkbox.js +6 -6
  166. package/dist-es/chip.css-mistica.js +12 -12
  167. package/dist-es/circle.css-mistica.js +1 -1
  168. package/dist-es/community/advanced-data-card.css-mistica.js +6 -6
  169. package/dist-es/community/advanced-data-card.js +11 -11
  170. package/dist-es/community/blocks.css-mistica.js +2 -2
  171. package/dist-es/community/example-component.css-mistica.js +1 -1
  172. package/dist-es/counter.css-mistica.js +1 -1
  173. package/dist-es/counter.js +8 -8
  174. package/dist-es/cover-hero.css-mistica.js +4 -5
  175. package/dist-es/credit-card-number-field.css-mistica.js +3 -3
  176. package/dist-es/date-field.css-mistica.js +1 -1
  177. package/dist-es/date-time-picker.css-mistica.js +1 -1
  178. package/dist-es/dialog-context.js +33 -28
  179. package/dist-es/dialog.css-mistica.js +4 -4
  180. package/dist-es/dialog.js +31 -31
  181. package/dist-es/divider.css-mistica.js +2 -2
  182. package/dist-es/double-field.css-mistica.js +2 -2
  183. package/dist-es/drawer.css-mistica.js +1 -1
  184. package/dist-es/empty-state-card.css-mistica.js +1 -1
  185. package/dist-es/empty-state.css-mistica.js +6 -6
  186. package/dist-es/empty-state.js +7 -7
  187. package/dist-es/fade-in.css-mistica.js +1 -1
  188. package/dist-es/feedback.css-mistica.js +1 -1
  189. package/dist-es/fixed-footer-layout.css-mistica.js +4 -4
  190. package/dist-es/fixed-footer-layout.js +5 -5
  191. package/dist-es/form.css-mistica.js +1 -1
  192. package/dist-es/form.js +5 -5
  193. package/dist-es/grid-layout.css-mistica.js +4 -4
  194. package/dist-es/grid.css-mistica.js +124 -124
  195. package/dist-es/grid.js +10 -10
  196. package/dist-es/header.css-mistica.js +1 -1
  197. package/dist-es/hero.css-mistica.js +2 -2
  198. package/dist-es/highlighted-card.css-mistica.js +4 -4
  199. package/dist-es/horizontal-scroll.css-mistica.js +2 -2
  200. package/dist-es/horizontal-scroll.js +2 -2
  201. package/dist-es/icon-button.css-mistica.js +42 -42
  202. package/dist-es/icon-button.js +52 -56
  203. package/dist-es/icons/icon-chevron.css-mistica.js +2 -2
  204. package/dist-es/icons/icon-error.css-mistica.js +1 -1
  205. package/dist-es/image.css-mistica.js +3 -3
  206. package/dist-es/image.js +5 -5
  207. package/dist-es/index.js +1843 -1843
  208. package/dist-es/inline.css-mistica.js +11 -11
  209. package/dist-es/list.css-mistica.js +1 -1
  210. package/dist-es/list.js +108 -105
  211. package/dist-es/loading-bar.css-mistica.js +1 -1
  212. package/dist-es/loading-bar.js +6 -6
  213. package/dist-es/loading-screen.css-mistica.js +5 -5
  214. package/dist-es/loading-screen.js +8 -8
  215. package/dist-es/logo.css-mistica.js +6 -6
  216. package/dist-es/maybe-dismissable.css-mistica.js +1 -1
  217. package/dist-es/menu.css-mistica.js +12 -12
  218. package/dist-es/menu.js +7 -7
  219. package/dist-es/mosaic.css-mistica.js +2 -2
  220. package/dist-es/mosaic.js +47 -46
  221. package/dist-es/navigation-bar.css-mistica.js +16 -16
  222. package/dist-es/navigation-breadcrumbs.css-mistica.js +1 -1
  223. package/dist-es/package-version.js +1 -1
  224. package/dist-es/pin-field.css-mistica.js +1 -1
  225. package/dist-es/pin-field.js +8 -8
  226. package/dist-es/popover.css-mistica.js +1 -1
  227. package/dist-es/progress-bar.css-mistica.js +5 -5
  228. package/dist-es/progress-bar.js +10 -10
  229. package/dist-es/radio-button.css-mistica.js +14 -14
  230. package/dist-es/radio-button.js +98 -88
  231. package/dist-es/rating.css-mistica.js +3 -3
  232. package/dist-es/rating.js +12 -12
  233. package/dist-es/responsive-layout.css-mistica.js +6 -6
  234. package/dist-es/responsive-layout.js +15 -15
  235. package/dist-es/screen-reader-only.css-mistica.js +1 -1
  236. package/dist-es/select.css-mistica.js +15 -15
  237. package/dist-es/select.js +15 -15
  238. package/dist-es/sheet-action-row.css-mistica.js +1 -1
  239. package/dist-es/sheet-common.css-mistica.js +1 -1
  240. package/dist-es/sheet-common.js +6 -6
  241. package/dist-es/sheet-info.css-mistica.js +2 -2
  242. package/dist-es/sheet-root.js +44 -40
  243. package/dist-es/skeletons.css-mistica.js +4 -4
  244. package/dist-es/skins/skin-contract.css-mistica.js +354 -354
  245. package/dist-es/slider.css-mistica.js +10 -10
  246. package/dist-es/slider.js +9 -9
  247. package/dist-es/snackbar.css-mistica.js +4 -4
  248. package/dist-es/spinner.css-mistica.js +1 -1
  249. package/dist-es/stack.css-mistica.js +6 -6
  250. package/dist-es/stacking-group.css-mistica.js +1 -1
  251. package/dist-es/stepper.css-mistica.js +3 -3
  252. package/dist-es/stepper.js +76 -60
  253. package/dist-es/style.css +1 -1
  254. package/dist-es/switch-component.css-mistica.js +26 -26
  255. package/dist-es/table.css-mistica.js +8 -8
  256. package/dist-es/table.js +12 -12
  257. package/dist-es/tabs.css-mistica.js +12 -12
  258. package/dist-es/tabs.js +166 -93
  259. package/dist-es/tag.css-mistica.js +1 -1
  260. package/dist-es/tag.js +8 -8
  261. package/dist-es/text-field-base.css-mistica.js +1 -1
  262. package/dist-es/text-field-base.js +153 -141
  263. package/dist-es/text-field-components.css-mistica.js +5 -5
  264. package/dist-es/text-field-components.js +4 -4
  265. package/dist-es/text-link.css-mistica.js +5 -5
  266. package/dist-es/text-tokens.js +87 -57
  267. package/dist-es/text.css-mistica.js +8 -8
  268. package/dist-es/text.js +6 -6
  269. package/dist-es/theme-context.css-mistica.js +396 -396
  270. package/dist-es/timeline.css-mistica.js +10 -10
  271. package/dist-es/timeline.js +4 -4
  272. package/dist-es/timer.css-mistica.js +6 -6
  273. package/dist-es/tooltip.css-mistica.js +1 -1
  274. package/dist-es/touchable.css-mistica.js +1 -1
  275. package/dist-es/touchable.js +67 -67
  276. package/dist-es/utils/aspect-ratio-support.css-mistica.js +3 -3
  277. package/dist-es/utils/aspect-ratio-support.js +10 -10
  278. package/dist-es/video.css-mistica.js +2 -2
  279. package/dist-es/video.js +5 -5
  280. package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +2 -2
  281. package/package.json +1 -1
@@ -51,110 +51,197 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsx as n, jsxs as oe } from "react/jsx-runtime";
54
+ import { jsx as a, jsxs as H } from "react/jsx-runtime";
55
55
  import * as o from "react";
56
- import { createElement as Ve } from "react";
57
- import fe from "./generated/mistica-icons/icon-chevron-left-regular.js";
58
- import de from "./generated/mistica-icons/icon-chevron-right-regular.js";
59
- import { useScreenSize as he, useTheme as me, useIsInViewport as ze } from "./hooks.js";
60
- import _e from "./inline.js";
61
- import { BaseTouchable as _ } from "./touchable.js";
62
- import V from "classnames";
63
- import { useIsInverseOrMediaVariant as je, ThemeVariant as z } from "./theme-variant-context.js";
64
- import { listenResize as pe, getPrefixedDataAttributes as be } from "./utils/dom.js";
65
- import { isAndroid as ge, isIos as Fe, isRunningAcceptanceTest as Ke } from "./utils/platform.js";
66
- import { useDocumentVisibility as Ue } from "./utils/document-visibility.js";
67
- import { bulletButton as Ye, bulletButtonMobile as qe, bulletButtonTablet as Ze, bulletButtonDesktop as $e, slideshowContainer as He, slideshowWithBullets as Je, slideshowPrevArrowButton as Qe, slideshow as Xe, slideshowItem as et, slideshowNextArrowButton as tt, slideshowBullets as ot, bulletActiveInverse as st, bulletInverse as rt, bulletActive as lt, bullet as nt, carouselContainer as ct, carouselPrevArrowButton as at, carousel as it, centeredCarousel as ut, carouselWithScrollMobile as ft, carouselWithScrollTablet as dt, vars as y, carouselItem as ht, carouselNextArrowButton as mt, carouselBullets as pt, noCarouselBulletsDesktop as bt, noCarouselBulletsTablet as gt, noCarouselBulletsMobile as vt } from "./carousel.css-mistica.js";
68
- import { vars as xt } from "./image.css-mistica.js";
69
- import { useDesktopContainerType as Ct } from "./desktop-container-type-context.js";
70
- import { VIVO_NEW_SKIN as Pt } from "./skins/constants.js";
71
- import { applyCssVars as ve } from "./utils/css.js";
72
- import { ResetResponsiveLayout as wt } from "./responsive-layout.js";
73
- import { carouselPrevButton as xe, carouselNextButton as Ce } from "./text-tokens.js";
74
- const Pe = (t, e)=>{
75
- const s = Ue();
76
- return ze(e, !1) && s && !!t;
77
- }, we = (param)=>{
78
- let { currentIndex: t, numPages: e, onPress: s } = param;
79
- var _e_tablet;
80
- const r = je(), { isDesktopOrBigger: i } = he(), m = (u)=>{
81
- const f = u === t;
82
- return r ? f ? st : rt : f ? lt : nt;
83
- }, P = typeof e == "number" ? e : Math.max(e.mobile, (_e_tablet = e.tablet) !== null && _e_tablet !== void 0 ? _e_tablet : e.mobile, e.desktop);
84
- return /* @__PURE__ */ n(_e, {
85
- space: 0,
86
- alignItems: "center",
87
- dataAttributes: {
88
- "component-name": "PageBullets"
89
- },
90
- children: Array.from({
91
- length: P
92
- }, (u, f)=>/* @__PURE__ */ {
93
- var _e_tablet;
94
- return n(_, {
95
- className: V(typeof e == "number" ? Ye : {
96
- [qe]: f < e.mobile,
97
- [Ze]: f < ((_e_tablet = e.tablet) !== null && _e_tablet !== void 0 ? _e_tablet : e.mobile),
98
- [$e]: f < e.desktop
99
- }),
100
- style: f === 0 ? {
101
- paddingLeft: 0
102
- } : {},
103
- maybe: !0,
104
- onPress: i && s ? ()=>s(f) : void 0,
105
- children: /* @__PURE__ */ n("div", {
106
- className: m(f)
107
- })
108
- }, f);
109
- })
110
- });
111
- }, se = ()=>{
56
+ import { createElement as tt } from "react";
57
+ import ot from "./generated/mistica-icons/icon-chevron-left-regular.js";
58
+ import st from "./generated/mistica-icons/icon-chevron-right-regular.js";
59
+ import { useScreenSize as We, useTheme as ce, useIsInViewport as lt } from "./hooks.js";
60
+ import Y from "./inline.js";
61
+ import k from "classnames";
62
+ import { useIsInverseOrMediaVariant as rt, useThemeVariant as nt, ThemeVariant as Le } from "./theme-variant-context.js";
63
+ import { getPrefixedDataAttributes as me, listenResize as Ve } from "./utils/dom.js";
64
+ import { isAndroid as De, isIos as at, isRunningAcceptanceTest as ct } from "./utils/platform.js";
65
+ import { useDocumentVisibility as it } from "./utils/document-visibility.js";
66
+ import { bulletsScrollableContainerBase as ut, bulletsScrollableContainer as ft, VISIBLE_BULLETS as z, scrollableBullet as dt, bulletButton as Ie, bulletVisibility as ht, bulletVisibilityMobile as pt, bulletVisibilityTablet as mt, bulletVisibilityDesktop as bt, slideshowBulletsContainer as gt, slideshowContainer as Ct, slideshowWithBullets as vt, slideshowControlsContainer as Re, slideshowControlsContainerSingleItem as Pt, slideshowAutoplayControlContainer as yt, slideshow as St, slideshowItem as Et, bulletActiveInverse as At, bulletInverse as Lt, bulletActive as It, bullet as Rt, bulletActiveSizing as Tt, bulletInactiveSizing as Te, bulletInactiveMediumSizing as Me, bulletInactiveSmallSizing as ke, vars as x, LARGE_BULLET_FULL_SIZE as Mt, SMALL_BULLET_FULL_SIZE as kt, carouselBullets as wt, noCarouselBulletsDesktop as xt, noCarouselBulletsTablet as Nt, noCarouselBulletsMobile as Bt, carouselComponentContainer as Wt, carouselControlsVisibility as Vt, carouselControlsVisibilityMobile as Dt, carouselControlsVisibilityTablet as Ot, carouselControlsVisibilityDesktop as zt, carouselControlsContainer as we, carouselAutoplayControlContainer as _t, carouselPagesControlsContainer as Gt, carouselContainer as Ft, carousel as Ut, centeredCarousel as $t, carouselWithScrollMobile as jt, carouselWithScrollTablet as Kt, carouselItem as Zt } from "./carousel.css-mistica.js";
67
+ import { vars as Ht } from "./image.css-mistica.js";
68
+ import { useDesktopContainerType as Yt } from "./desktop-container-type-context.js";
69
+ import { VIVO_NEW_SKIN as qt } from "./skins/constants.js";
70
+ import { applyCssVars as be } from "./utils/css.js";
71
+ import { ResetResponsiveLayout as Jt } from "./responsive-layout.js";
72
+ import { IconButton as xe, ToggleIconButton as Qt } from "./icon-button.js";
73
+ import Xt from "./generated/mistica-icons/icon-pause-filled.js";
74
+ import eo from "./generated/mistica-icons/icon-play-filled.js";
75
+ import to from "./generated/mistica-icons/icon-reload-regular.js";
76
+ import { carouselPrevButton as oo, carouselNextButton as so, carouselPauseAutoplay as lo, carouselReloadAutoplay as ro, carouselEnableAutoplay as no, carouselRegion as ao } from "./text-tokens.js";
77
+ import { isClientSide as co } from "./utils/environment.js";
78
+ const Oe = (e, t)=>{
79
+ const r = co() ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1, [s, f] = o.useState(!!e && !r), i = it(), m = lt(t, !1);
80
+ return {
81
+ isAutoplayEnabled: s && !!e,
82
+ shouldAutoplay: m && i && !!e && s,
83
+ setShouldAutoPlay: f
84
+ };
85
+ }, w = ()=>{
112
86
  throw new Error("You must wrap your component with a CarouselContextProvider to use CarouselContext");
113
- }, Ie = se, Me = se, ke = se, Ne = {
87
+ }, ze = {
114
88
  currentIndex: 0,
115
89
  numPages: 0
116
- }, re = /*#__PURE__*/ o.createContext({
117
- goPrev: Ie,
118
- goNext: Me,
119
- goToPage: ke,
120
- bulletsProps: Ne
121
- }), le = /*#__PURE__*/ o.createContext(null), Kt = (param)=>{
122
- let { children: t } = param;
123
- const [e, s] = o.useState(Ne), r = o.useRef(Ie), i = o.useRef(Me), m = o.useRef(ke), P = o.useMemo(()=>({
90
+ }, _e = {
91
+ isAutoplayEnabled: !1,
92
+ isAtLastPage: !1,
93
+ onAutoplayChanged: w
94
+ }, Ge = {
95
+ setShouldAutoplay: w,
96
+ prevArrowEnabled: !1,
97
+ nextArrowEnabled: !1
98
+ }, ge = /*#__PURE__*/ o.createContext({
99
+ goPrev: w,
100
+ goNext: w,
101
+ goToPage: w,
102
+ bulletsProps: ze,
103
+ autoplayControlProps: _e,
104
+ pageControlsProps: Ge
105
+ }), Ce = /*#__PURE__*/ o.createContext(null), Wo = (param)=>{
106
+ let { children: e } = param;
107
+ const [t, r] = o.useState(ze), [s, f] = o.useState(_e), [i, m] = o.useState(Ge), v = o.useRef(w), h = o.useRef(w), l = o.useRef(w), u = o.useRef(w), A = o.useMemo(()=>({
124
108
  goPrev: ()=>{
125
- r.current();
109
+ v.current();
126
110
  },
127
111
  goNext: ()=>{
128
- i.current();
112
+ h.current();
129
113
  },
130
- goToPage: function(u) {
131
- let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
132
- m.current(u, f);
114
+ goToPage: function(d) {
115
+ let _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
116
+ l.current(d, _);
133
117
  },
134
- bulletsProps: e
118
+ bulletsProps: t,
119
+ autoplayControlProps: s,
120
+ pageControlsProps: i
135
121
  }), [
136
- e
122
+ t,
123
+ s,
124
+ i
137
125
  ]);
138
- return /* @__PURE__ */ n(re.Provider, {
139
- value: P,
140
- children: /* @__PURE__ */ n(le.Provider, {
126
+ return /* @__PURE__ */ a(ge.Provider, {
127
+ value: A,
128
+ children: /* @__PURE__ */ a(Ce.Provider, {
141
129
  value: {
142
- setGoPrev: (u)=>{
143
- r.current = u;
130
+ setGoPrev: (d)=>{
131
+ v.current = d;
144
132
  },
145
- setGoNext: (u)=>{
146
- i.current = u;
133
+ setGoNext: (d)=>{
134
+ h.current = d;
147
135
  },
148
- setGoToPage: (u)=>{
149
- m.current = u;
136
+ setGoToPage: (d)=>{
137
+ l.current = d;
150
138
  },
151
- setBulletsProps: s
139
+ setBulletsProps: r,
140
+ setAutoplayControlProps: f,
141
+ setPageControlsProps: m,
142
+ setIsAutoplayEnabledSetter: (d)=>{
143
+ u.current = d;
144
+ }
152
145
  },
153
- children: t
146
+ children: e
147
+ })
148
+ });
149
+ }, Vo = ()=>o.useContext(ge), Do = ge.Consumer, Fe = (param)=>{
150
+ let { currentIndex: e, numPages: t } = param;
151
+ var _t_tablet;
152
+ const r = rt(), { isTablet: s, isDesktopOrBigger: f } = We(), i = typeof t == "number" ? t : f ? t.desktop : s ? (_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile : t.mobile, m = (h)=>{
153
+ const l = {};
154
+ if (r ? l[e === h ? At : Lt] = !0 : l[e === h ? It : Rt] = !0, e === h) return l[Tt] = !0, l;
155
+ const u = Math.abs(h - e);
156
+ return i <= z || u === 1 ? (l[Te] = !0, l) : e === 0 || e === i - 1 ? (l[Te] = u === 2, l[Me] = u === 3, l[ke] = u > 3, l) : (l[Me] = u === 2, l[ke] = u > 2, l);
157
+ }, v = (h)=>e + 2 < z ? h : i - e + 1 < z ? h - (i - z) : h - (e - 2);
158
+ return /* @__PURE__ */ a("div", _object_spread_props(_object_spread({}, me({
159
+ "component-name": "PageBullets"
160
+ })), {
161
+ className: k(ut, {
162
+ [ft]: i > z
163
+ }),
164
+ children: Array.from({
165
+ length: i
166
+ }, (h, l)=>{
167
+ const u = v(l);
168
+ var _t_tablet;
169
+ return /* @__PURE__ */ a("div", {
170
+ className: k({
171
+ [dt]: i > z
172
+ }, typeof t == "number" ? {
173
+ [Ie]: !0,
174
+ [ht]: l < t
175
+ } : {
176
+ [Ie]: !0,
177
+ [pt]: l < t.mobile,
178
+ [mt]: l < ((_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile),
179
+ [bt]: l < t.desktop
180
+ }),
181
+ style: _object_spread({}, be({
182
+ [x.desktopBulletLeftPosition]: `${u * Mt}px`,
183
+ [x.mobileBulletLeftPosition]: `${u * kt}px`
184
+ })),
185
+ children: /* @__PURE__ */ a("div", {
186
+ className: k(m(l))
187
+ })
188
+ }, l);
154
189
  })
190
+ }));
191
+ }, Ue = (param)=>{
192
+ let { bleedLeft: e, bleedRight: t, goPrev: r, goNext: s, setShouldAutoplay: f, prevArrowEnabled: i, nextArrowEnabled: m } = param;
193
+ const { texts: v, t: h } = ce(), l = nt();
194
+ return /* @__PURE__ */ H(Y, {
195
+ space: l === "media" ? 16 : 8,
196
+ children: [
197
+ /* @__PURE__ */ a(xe, {
198
+ Icon: ot,
199
+ "aria-label": v.carouselPrevButton || h(oo),
200
+ type: "neutral",
201
+ backgroundType: l === "media" ? "transparent" : "soft",
202
+ small: !0,
203
+ bleedLeft: e,
204
+ onPress: ()=>{
205
+ r(), f(!1);
206
+ },
207
+ disabled: !i
208
+ }),
209
+ /* @__PURE__ */ a(xe, {
210
+ Icon: st,
211
+ "aria-label": v.carouselNextButton || h(so),
212
+ type: "neutral",
213
+ backgroundType: l === "media" ? "transparent" : "soft",
214
+ small: !0,
215
+ bleedRight: t,
216
+ onPress: ()=>{
217
+ s(), f(!1);
218
+ },
219
+ disabled: !m
220
+ })
221
+ ]
222
+ });
223
+ }, $e = (param)=>{
224
+ let { isAutoplayEnabled: e, isAtLastPage: t, onAutoplayChanged: r, bleedLeft: s = !1, bleedRight: f = !1 } = param;
225
+ const { texts: i, t: m } = ce();
226
+ return /* @__PURE__ */ a(Qt, {
227
+ checkedProps: {
228
+ Icon: Xt,
229
+ type: "neutral",
230
+ "aria-label": i.carouselPauseAutoplay || m(lo)
231
+ },
232
+ uncheckedProps: {
233
+ Icon: t ? to : eo,
234
+ type: "neutral",
235
+ "aria-label": t ? i.carouselReloadAutoplay || m(ro) : i.carouselEnableAutoplay || m(no)
236
+ },
237
+ small: !0,
238
+ bleedLeft: s,
239
+ bleedRight: f,
240
+ onChange: r,
241
+ checked: e
155
242
  });
156
- }, Ut = ()=>o.useContext(re), Yt = re.Consumer, ie = (t, e, s)=>s ? typeof s == "number" ? s : s[t] || e[t] : e[t], It = (t, e)=>{
157
- const s = {
243
+ }, Ne = (e, t, r)=>r ? typeof r == "number" ? r : r[e] || t[e] : t[e], io = (e, t)=>{
244
+ const r = {
158
245
  mobile: 1,
159
246
  tablet: 2,
160
247
  desktop: {
@@ -163,280 +250,347 @@ const Pe = (t, e)=>{
163
250
  large: 3
164
251
  }
165
252
  };
166
- if (!e) return _object_spread_props(_object_spread({}, s), {
167
- desktop: ie(t, s.desktop)
253
+ if (!t) return _object_spread_props(_object_spread({}, r), {
254
+ desktop: Ne(e, r.desktop)
168
255
  });
169
- if (typeof e == "number") return {
170
- mobile: e,
171
- tablet: e,
172
- desktop: e
256
+ if (typeof t == "number") return {
257
+ mobile: t,
258
+ tablet: t,
259
+ desktop: t
173
260
  };
174
- const r = ie(t, s.desktop, e.desktop);
175
- return _object_spread_props(_object_spread({}, s, e), {
176
- desktop: r
261
+ const s = Ne(e, r.desktop, t.desktop);
262
+ return _object_spread_props(_object_spread({}, r, t), {
263
+ desktop: s
177
264
  });
178
- }, ue = (t, e)=>{
179
- if (t.length === 0) return [];
180
- const s = Math.ceil(t.length / e), r = [];
181
- for(let i = 0; i < t.length; i += s)r.push(t[i]);
182
- return r[r.length - 1] = t[t.length - s], r;
183
- }, Mt = (t, e)=>{
184
- const s = [];
185
- for(let r = 0; r < e.length; r++)r === 0 ? s.push(e[0]) : s.push((e[r] + e[r - 1]) / 2);
186
- for(let r = s.length - 1; r >= 0; r--)if (t - s[r] >= -1) return r;
265
+ }, Be = (e, t)=>{
266
+ if (e.length === 0) return [];
267
+ const r = Math.ceil(e.length / t), s = [];
268
+ for(let f = 0; f < e.length; f += r)s.push(e[f]);
269
+ return s[s.length - 1] = e[e.length - r], s;
270
+ }, uo = (e, t)=>{
271
+ const r = [];
272
+ for(let s = 0; s < t.length; s++)s === 0 ? r.push(t[0]) : r.push((t[s] + t[s - 1]) / 2);
273
+ for(let s = r.length - 1; s >= 0; s--)if (e - r[s] >= -1) return s;
187
274
  return 0;
188
- }, Se = 5e3, Re = (param)=>{
189
- let { items: t, itemStyle: e, itemClassName: s, withBullets: r, renderBullets: i, initialActiveItem: m, itemsPerPage: P, itemsToScroll: u, mobilePageOffset: f, gap: S, free: I, centered: h, autoplay: x, onPageChange: N, dataAttributes: J } = param;
190
- const { texts: R, platformOverrides: w, skinName: j, t: F } = me(), Q = Ct(), a = It(Q || "large", P), { isDesktopOrBigger: B, isTablet: W } = he(), K = W ? a.tablet : a.mobile, C = Math.max(Math.floor(B ? a.desktop : K), 1), l = o.useRef(null), p = Math.ceil(t.length / Math.max(Math.floor(a.mobile), 1)), v = Math.ceil(t.length / Math.max(Math.floor(a.tablet), 1)), M = Math.ceil(t.length / Math.max(Math.floor(a.desktop), 1)), E = Math.ceil(t.length / C), [{ scrollLeft: A, scrollRight: D }, Le] = o.useState({
275
+ }, je = 5e3, Ke = (param)=>{
276
+ let { items: e, itemStyle: t, itemClassName: r, withBullets: s, renderBullets: f, initialActiveItem: i, itemsPerPage: m, itemsToScroll: v, mobilePageOffset: h, gap: l, free: u, centered: A, autoplay: d, withControls: _ = !0, onPageChange: G, dataAttributes: ie, "aria-label": N, "aria-labelledby": B } = param;
277
+ const { platformOverrides: W, skinName: P, texts: ue, t: q } = ce(), D = Yt(), b = io(D || "large", m), { isDesktopOrBigger: V, isTablet: J } = We(), F = J ? b.tablet : b.mobile, T = Math.max(Math.floor(V ? b.desktop : F), 1), L = o.useRef(null), n = Math.ceil(e.length / Math.max(Math.floor(b.mobile), 1)), g = Math.ceil(e.length / Math.max(Math.floor(b.tablet), 1)), y = Math.ceil(e.length / Math.max(Math.floor(b.desktop), 1)), I = Math.ceil(e.length / T), [{ scrollLeft: Q, scrollRight: O }, fe] = o.useState({
191
278
  scrollLeft: 0,
192
- scrollRight: 0
193
- }), [X, Te] = o.useState([]), U = o.useMemo(()=>ue(X, E), [
194
- X,
195
- E
196
- ]), Y = u ? ue(X, Math.ceil(t.length / u)) : U, ye = D !== 0, We = A !== 0;
279
+ scrollRight: 1
280
+ }), [de, Ye] = o.useState([]), X = o.useMemo(()=>Be(de, I), [
281
+ de,
282
+ I
283
+ ]), ee = v ? Be(de, Math.ceil(e.length / v)) : X, U = O !== 0, te = Q !== 0, { isAutoplayEnabled: oe, shouldAutoplay: ve, setShouldAutoPlay: E } = Oe(!!d, L);
197
284
  o.useEffect(()=>{
198
- if (l.current) {
199
- const c = l.current, d = ()=>{
200
- const { scrollWidth: Z, clientWidth: O } = c, $ = Math.round(c.scrollLeft), H = Math.round(Z - ($ + O));
201
- Le({
202
- scrollLeft: $,
203
- scrollRight: H
285
+ if (L.current) {
286
+ const c = L.current, p = ()=>{
287
+ const { scrollWidth: re, clientWidth: Z } = c, ne = Math.round(c.scrollLeft), ae = Math.round(re - (ne + Z));
288
+ fe({
289
+ scrollLeft: ne,
290
+ scrollRight: ae
204
291
  });
205
- }, b = ()=>{
206
- const Z = c.scrollWidth - c.clientWidth;
207
- Te(Array.from(c.querySelectorAll("[data-item]")).map((O, $)=>{
208
- if ($ === t.length - 1) return Z;
209
- const H = O.offsetLeft, Ge = parseInt(getComputedStyle(O).scrollMargin), Oe = h && !B ? H - O.clientWidth / 2 : H;
210
- return Math.min(Oe - Ge - c.offsetLeft, Z);
292
+ }, C = ()=>{
293
+ const re = c.scrollWidth - c.clientWidth;
294
+ Ye(Array.from(c.querySelectorAll("[data-item]")).map((Z, ne)=>{
295
+ if (ne === e.length - 1) return re;
296
+ const ae = Z.offsetLeft, Xe = parseInt(getComputedStyle(Z).scrollMargin), et = A && !V ? ae - Z.clientWidth / 2 : ae;
297
+ return Math.min(et - Xe - c.offsetLeft, re);
211
298
  }));
212
299
  };
213
- d(), b(), c.addEventListener("scroll", d);
214
- const g = pe(c, ()=>{
215
- d(), b();
300
+ p(), C(), c.addEventListener("scroll", p);
301
+ const R = Ve(c, ()=>{
302
+ p(), C();
216
303
  });
217
304
  return ()=>{
218
- c.removeEventListener("scroll", d), g();
305
+ c.removeEventListener("scroll", p), R();
219
306
  };
220
307
  }
221
308
  return ()=>{};
222
309
  }, [
223
- a.desktop,
224
- a.tablet,
225
- a.mobile,
226
- E,
227
- S,
228
- h,
229
- B,
230
- t.length
310
+ b.desktop,
311
+ b.tablet,
312
+ b.mobile,
313
+ I,
314
+ l,
315
+ A,
316
+ V,
317
+ e.length
231
318
  ]);
232
- const L = o.useCallback(function(c) {
233
- let d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
234
- const b = l.current;
235
- if (b) {
236
- const g = U[c];
237
- b.scrollTo({
238
- left: g,
239
- behavior: d ? "smooth" : "auto"
319
+ const $ = o.useCallback(function(c) {
320
+ let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
321
+ const C = L.current;
322
+ if (C) {
323
+ const R = X[c];
324
+ C.scrollTo({
325
+ left: R,
326
+ behavior: p ? "smooth" : "auto"
240
327
  });
241
328
  }
242
329
  }, [
243
- U
244
- ]), ee = o.useCallback(()=>{
245
- const c = l.current;
330
+ X
331
+ ]), he = o.useCallback(()=>{
332
+ const c = L.current;
246
333
  if (c) {
247
- const { scrollLeft: d } = c, b = [
248
- ...Y
249
- ].reverse().find((g)=>g - d < -1);
334
+ const { scrollLeft: p } = c, C = [
335
+ ...ee
336
+ ].reverse().find((R)=>R - p < -1);
250
337
  c.scrollTo({
251
- left: b,
338
+ left: C,
252
339
  behavior: "smooth"
253
340
  });
254
341
  }
255
342
  }, [
256
- Y
257
- ]), G = o.useCallback(()=>{
258
- const c = l.current;
343
+ ee
344
+ ]), j = o.useCallback(()=>{
345
+ const c = L.current;
259
346
  if (c) {
260
- const { scrollLeft: d } = c, b = Y.find((g)=>g - d > 1);
347
+ const { scrollLeft: p } = c, C = ee.find((R)=>R - p > 1);
261
348
  c.scrollTo({
262
- left: b,
349
+ left: C,
263
350
  behavior: "smooth"
264
351
  });
265
352
  }
266
353
  }, [
267
- Y
268
- ]), ne = Pe(!!x, l);
354
+ ee
355
+ ]);
269
356
  o.useEffect(()=>{
270
- m !== void 0 && L(Math.floor(m / C), !1);
357
+ i !== void 0 && $(Math.floor(i / T), !1);
271
358
  }, [
272
- m,
273
- L,
274
- C
275
- ]), o.useEffect(()=>{
276
- if (ne && x) {
277
- const c = typeof x == "boolean" ? Se : x.time, d = typeof x == "object" && x.loop, b = setInterval(()=>{
278
- var g;
279
- D !== 0 ? G() : d && ((g = l.current) == null || g.scrollTo({
359
+ i,
360
+ $,
361
+ T
362
+ ]);
363
+ const se = typeof d == "object" && d.loop || !1, K = o.useRef({
364
+ interacting: !1,
365
+ left: 0
366
+ });
367
+ o.useEffect(()=>{
368
+ if (ve && d) {
369
+ const c = typeof d == "boolean" ? je : d.time, p = setInterval(()=>{
370
+ var C;
371
+ K.current.interacting || (O !== 0 ? j() : se && ((C = L.current) == null || C.scrollTo({
280
372
  left: 0,
281
373
  behavior: "smooth"
282
- }));
374
+ })));
283
375
  }, c);
284
- return ()=>clearInterval(b);
376
+ return ()=>clearInterval(p);
285
377
  }
286
378
  }, [
287
- x,
288
- G,
289
- D,
290
- ne
379
+ d,
380
+ j,
381
+ O,
382
+ ve,
383
+ se
384
+ ]);
385
+ const S = uo(Q, X), qe = 20;
386
+ o.useEffect(()=>{
387
+ S === I - 1 && !se && E(!1);
388
+ }, [
389
+ S,
390
+ I,
391
+ E,
392
+ se
291
393
  ]);
292
- const k = Mt(A, U), ce = o.useRef(!m), ae = o.useRef(0);
394
+ const Pe = o.useRef(!i), ye = o.useRef(0);
293
395
  o.useEffect(()=>{
294
- if (N) {
295
- const c = Math.min((k + 1) * C - 1, t.length - 1), d = [];
296
- for(let b = 0; b < C; b++){
297
- const g = c - b;
298
- g >= 0 && d.unshift(g);
396
+ if (G) {
397
+ const c = Math.min((S + 1) * T - 1, e.length - 1), p = [];
398
+ for(let C = 0; C < T; C++){
399
+ const R = c - C;
400
+ R >= 0 && p.unshift(R);
299
401
  }
300
- ce.current ? ae.current !== k && N({
301
- pageIndex: k,
302
- shownItemIndexes: d
303
- }) : ce.current = d.includes(m || 0), ae.current = k;
402
+ Pe.current ? ye.current !== S && G({
403
+ pageIndex: S,
404
+ shownItemIndexes: p
405
+ }) : Pe.current = p.includes(i || 0), ye.current = S;
304
406
  }
305
407
  }, [
306
- k,
307
- t.length,
308
- C,
309
- m,
310
- N
408
+ S,
409
+ e.length,
410
+ T,
411
+ i,
412
+ G
311
413
  ]);
312
- const T = o.useContext(le), te = o.useMemo(()=>({
313
- currentIndex: k,
414
+ const M = o.useContext(Ce), pe = o.useMemo(()=>({
415
+ currentIndex: S,
314
416
  numPages: {
315
- mobile: p,
316
- tablet: v,
317
- desktop: M
417
+ mobile: n,
418
+ tablet: g,
419
+ desktop: y
318
420
  }
319
421
  }), [
320
- k,
321
- M,
322
- p,
323
- v
422
+ S,
423
+ y,
424
+ n,
425
+ g
426
+ ]), Se = o.useMemo(()=>({
427
+ isAutoplayEnabled: oe,
428
+ isAtLastPage: S === I - 1,
429
+ onAutoplayChanged: E
430
+ }), [
431
+ oe,
432
+ S,
433
+ I,
434
+ E
435
+ ]), Ee = o.useMemo(()=>({
436
+ setShouldAutoplay: E,
437
+ prevArrowEnabled: te,
438
+ nextArrowEnabled: U
439
+ }), [
440
+ E,
441
+ te,
442
+ U
324
443
  ]);
325
444
  o.useEffect(()=>{
326
- T && (T.setGoPrev(ee), T.setGoNext(G), T.setGoToPage(L), T.setBulletsProps(te));
445
+ M && (M.setGoPrev(he), M.setGoNext(j), M.setGoToPage($), M.setBulletsProps(pe), M.setAutoplayControlProps(Se), M.setPageControlsProps(Ee), M.setIsAutoplayEnabledSetter(E));
327
446
  }, [
328
- T,
329
- G,
330
- ee,
447
+ M,
448
+ j,
449
+ he,
450
+ pe,
451
+ Se,
452
+ Ee,
453
+ $,
331
454
  te,
332
- L
455
+ U,
456
+ d,
457
+ oe,
458
+ E
333
459
  ]);
334
- let q = null;
335
- i ? q = i({
336
- numPages: E,
337
- currentIndex: k,
338
- onPress: L
339
- }) : r && (q = /* @__PURE__ */ n(we, _object_spread_props(_object_spread({}, te), {
340
- onPress: L
341
- })));
342
- const Ae = "64px", De = "36px";
343
- return /* @__PURE__ */ oe("div", _object_spread_props(_object_spread({}, be(_object_spread({
460
+ let le = null;
461
+ f ? le = f({
462
+ numPages: I,
463
+ currentIndex: S
464
+ }) : s && (le = /* @__PURE__ */ a(Fe, _object_spread({}, pe)));
465
+ const Je = "64px", Qe = "36px", Ae = /* @__PURE__ */ a("div", {
466
+ className: k(wt, // when renderBullets is provided, we let the consumer decide if the bullets should be hidden
467
+ !f && {
468
+ [xt]: y <= 1,
469
+ [Nt]: g <= 1,
470
+ [Bt]: n <= 1
471
+ }),
472
+ children: le
473
+ });
474
+ return /* @__PURE__ */ H("div", _object_spread_props(_object_spread({}, me(_object_spread({
344
475
  "component-name": "Carousel"
345
- }, J))), {
476
+ }, ie))), {
477
+ className: Wt,
478
+ role: "region",
479
+ "aria-label": N ? `${N}, ${ue.carouselRegion || q(ao)}` : void 0,
480
+ "aria-labelledby": N ? void 0 : B,
346
481
  children: [
347
- /* @__PURE__ */ oe("div", {
348
- className: ct,
349
- children: [
350
- /* @__PURE__ */ n(z, {
351
- isInverse: !1,
352
- children: /* @__PURE__ */ n(_, {
353
- className: at,
354
- "aria-label": R.carouselPrevButton || F(xe),
355
- onPress: ee,
356
- disabled: !We,
357
- children: /* @__PURE__ */ n(fe, {})
358
- })
359
- }),
360
- /* @__PURE__ */ n("div", {
361
- className: V(it, {
362
- [ut]: h,
363
- [ft]: p > 1,
364
- [dt]: v > 1
365
- }),
366
- style: _object_spread_props(_object_spread({}, ve(_object_spread({
367
- [y.itemsPerPageDesktop]: String(a.desktop),
368
- [y.itemsPerPageTablet]: String(a.tablet),
369
- [y.itemsPerPageMobile]: String(a.mobile)
370
- }, f === "large" ? {
371
- [y.mobilePageOffset]: Ae
372
- } : j === Pt ? {
373
- [y.mobilePageOffset]: De
374
- } : {}, S !== void 0 ? {
375
- [y.gap]: String(S)
376
- } : {}))), {
377
- scrollSnapType: I ? "initial" : "x mandatory",
378
- // Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
379
- // there is a webkit rendering bug that causes a half pixel white line to appear at
380
- // the bottom of the scrollable area in retina displays when it has a height with
381
- // decimals. This extra padding avoids that line to partially cover the carousel
382
- // slides border:
383
- paddingBottom: Fe(w) && !Ke(w) ? 0.5 : void 0
482
+ /* @__PURE__ */ a("div", {
483
+ className: k(Vt, {
484
+ [Dt]: n > 1,
485
+ [Ot]: g > 1,
486
+ [zt]: y > 1
487
+ }),
488
+ children: _ ? /* @__PURE__ */ H(Y, {
489
+ space: "between",
490
+ alignItems: "center",
491
+ className: we,
492
+ children: [
493
+ !!d && /* @__PURE__ */ a("div", {
494
+ className: _t,
495
+ children: /* @__PURE__ */ a($e, {
496
+ isAutoplayEnabled: oe,
497
+ isAtLastPage: S === I - 1,
498
+ onAutoplayChanged: (c)=>{
499
+ !U && c && $(0), E(c);
500
+ }
501
+ })
384
502
  }),
385
- ref: l,
386
- children: t.map((c, d)=>/* @__PURE__ */ n("div", {
387
- className: V(ht, s),
388
- style: _object_spread_props(_object_spread({}, e), {
389
- scrollSnapStop: ge(w) ? "always" : "normal"
390
- }),
391
- "data-item": !0,
392
- children: c
393
- }, d))
394
- }),
395
- /* @__PURE__ */ n(z, {
396
- isInverse: !1,
397
- children: /* @__PURE__ */ n(_, {
398
- className: mt,
399
- "aria-label": R.carouselNextButton || F(Ce),
400
- onPress: G,
401
- disabled: !ye,
402
- children: /* @__PURE__ */ n(de, {})
503
+ Ae,
504
+ /* @__PURE__ */ a("div", {
505
+ className: Gt,
506
+ children: /* @__PURE__ */ a(Ue, {
507
+ goNext: j,
508
+ goPrev: he,
509
+ setShouldAutoplay: E,
510
+ prevArrowEnabled: te,
511
+ nextArrowEnabled: U
512
+ })
403
513
  })
404
- })
405
- ]
514
+ ]
515
+ }) : le && /* @__PURE__ */ a(Y, {
516
+ space: "around",
517
+ className: we,
518
+ children: Ae
519
+ })
406
520
  }),
407
- q && /* @__PURE__ */ n("div", {
408
- className: V(pt, // when renderBullets is provided, we let the consumer decide if the bullets should be hidden
409
- !i && {
410
- [bt]: M <= 1,
411
- [gt]: v <= 1,
412
- [vt]: p <= 1
413
- }),
414
- children: q
521
+ /* @__PURE__ */ a("div", {
522
+ className: Ft,
523
+ children: /* @__PURE__ */ a("div", {
524
+ className: k(Ut, {
525
+ [$t]: A,
526
+ [jt]: n > 1,
527
+ [Kt]: g > 1
528
+ }),
529
+ role: "list",
530
+ style: _object_spread_props(_object_spread({}, be(_object_spread({
531
+ [x.itemsPerPageDesktop]: String(b.desktop),
532
+ [x.itemsPerPageTablet]: String(b.tablet),
533
+ [x.itemsPerPageMobile]: String(b.mobile)
534
+ }, h === "large" ? {
535
+ [x.mobilePageOffset]: Je
536
+ } : P === qt ? {
537
+ [x.mobilePageOffset]: Qe
538
+ } : {}, l !== void 0 ? {
539
+ [x.gap]: String(l)
540
+ } : {}))), {
541
+ scrollSnapType: u ? "initial" : "x mandatory",
542
+ // Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
543
+ // there is a webkit rendering bug that causes a half pixel white line to appear at
544
+ // the bottom of the scrollable area in retina displays when it has a height with
545
+ // decimals. This extra padding avoids that line to partially cover the carousel
546
+ // slides border:
547
+ paddingBottom: at(W) && !ct(W) ? 0.5 : void 0
548
+ }),
549
+ ref: L,
550
+ onTouchStart: (c)=>{
551
+ K.current.left = c.currentTarget.scrollLeft, K.current.interacting = !0;
552
+ },
553
+ onTouchEnd: (c)=>{
554
+ K.current.interacting = !1, Math.abs(c.currentTarget.scrollLeft - K.current.left) > qe && E(!1);
555
+ },
556
+ onKeyDown: ()=>{
557
+ E(!1);
558
+ },
559
+ children: e.map((c, p)=>/* @__PURE__ */ a("div", {
560
+ className: k(Zt, r),
561
+ style: _object_spread_props(_object_spread({}, t), {
562
+ scrollSnapStop: De(W) ? "always" : "normal"
563
+ }),
564
+ role: "listitem",
565
+ "data-item": !0,
566
+ children: c
567
+ }, p))
568
+ })
415
569
  })
416
570
  ]
417
571
  }));
418
- }, Be = ()=>{
419
- const [t, e] = o.useState(1);
572
+ }, Ze = ()=>{
573
+ const [e, t] = o.useState(1);
420
574
  return o.useEffect(()=>{
421
- const s = ()=>{
422
- window.innerWidth !== 0 && (e((r)=>r + 1), window.removeEventListener("resize", s));
575
+ const r = ()=>{
576
+ window.innerWidth !== 0 && (t((s)=>s + 1), window.removeEventListener("resize", r));
423
577
  };
424
- return window.innerWidth === 0 && window.addEventListener("resize", s), ()=>{
425
- window.removeEventListener("resize", s);
578
+ return window.innerWidth === 0 && window.addEventListener("resize", r), ()=>{
579
+ window.removeEventListener("resize", r);
426
580
  };
427
- }, []), t;
428
- }, qt = (t)=>{
429
- const e = Be();
430
- return /* @__PURE__ */ /*#__PURE__*/ Ve(Re, _object_spread_props(_object_spread({}, t), {
431
- key: e
581
+ }, []), e;
582
+ }, Oo = (e)=>{
583
+ const t = Ze();
584
+ return /* @__PURE__ */ /*#__PURE__*/ tt(Ke, _object_spread_props(_object_spread({}, e), {
585
+ key: t
432
586
  }));
433
- }, Zt = (param)=>{
434
- let { items: t, itemStyle: e, itemClassName: s, withBullets: r, renderBullets: i, initialActiveItem: m, onPageChange: P, dataAttributes: u } = param;
435
- const f = Be();
436
- return /* @__PURE__ */ n(Re, {
437
- items: t,
438
- itemStyle: e,
439
- itemClassName: s,
587
+ }, zo = (param)=>{
588
+ let { items: e, itemStyle: t, itemClassName: r, withBullets: s, renderBullets: f, withControls: i = !0, initialActiveItem: m, onPageChange: v, dataAttributes: h, "aria-label": l, "aria-labelledby": u } = param;
589
+ const A = Ze();
590
+ return /* @__PURE__ */ a(Ke, {
591
+ items: e,
592
+ itemStyle: t,
593
+ itemClassName: r,
440
594
  itemsPerPage: {
441
595
  mobile: 1,
442
596
  tablet: 1,
@@ -445,159 +599,185 @@ const Pe = (t, e)=>{
445
599
  centered: !0,
446
600
  itemsToScroll: 1,
447
601
  gap: 0,
448
- withBullets: r,
449
- renderBullets: i,
602
+ withBullets: s,
603
+ renderBullets: f,
604
+ withControls: i,
450
605
  initialActiveItem: m,
451
- onPageChange: P,
452
- dataAttributes: u
453
- }, f);
454
- }, Ee = /*#__PURE__*/ o.createContext(void 0), $t = ()=>o.useContext(Ee), Ht = (param)=>{
455
- let { items: t, withBullets: e, autoplay: s, initialPageIndex: r = 0, onPageChange: i, dataAttributes: m, inverseBullets: P = !0 } = param;
456
- const { texts: u, platformOverrides: f, t: S } = me(), I = o.useContext(le), h = o.useRef(null), [{ scrollLeft: x, scrollRight: N }, J] = o.useState({
606
+ onPageChange: v,
607
+ dataAttributes: h,
608
+ "aria-label": l,
609
+ "aria-labelledby": u
610
+ }, A);
611
+ }, He = /*#__PURE__*/ o.createContext(void 0), _o = ()=>o.useContext(He), Go = (param)=>{
612
+ let { items: e, withBullets: t, withControls: r = !0, autoplay: s, initialPageIndex: f = 0, onPageChange: i, dataAttributes: m, inverseBullets: v = !0 } = param;
613
+ const { platformOverrides: h } = ce(), l = o.useContext(Ce), u = o.useRef(null), [{ scrollLeft: A, scrollRight: d }, _] = o.useState({
457
614
  scrollLeft: 0,
458
- scrollRight: 0
459
- }), R = o.useCallback(()=>{
460
- const l = h.current;
461
- l && l.scrollBy({
462
- left: -l.clientWidth,
615
+ scrollRight: 1
616
+ }), G = d !== 0, ie = A !== 0, N = o.useCallback(()=>{
617
+ const n = u.current;
618
+ n && n.scrollBy({
619
+ left: -n.clientWidth,
463
620
  behavior: "smooth"
464
621
  });
465
- }, []), w = o.useCallback(()=>{
466
- const l = h.current;
467
- l && l.scrollBy({
468
- left: l.clientWidth,
622
+ }, []), B = o.useCallback(()=>{
623
+ const n = u.current;
624
+ n && n.scrollBy({
625
+ left: n.clientWidth,
469
626
  behavior: "smooth"
470
627
  });
471
- }, []), j = o.useCallback(function(l) {
472
- let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
473
- const v = h.current;
474
- v && v.scrollTo({
475
- left: v.clientWidth * l,
476
- behavior: p ? "smooth" : "auto"
628
+ }, []), W = o.useCallback(function(n) {
629
+ let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
630
+ const y = u.current;
631
+ y && y.scrollTo({
632
+ left: y.clientWidth * n,
633
+ behavior: g ? "smooth" : "auto"
477
634
  });
478
635
  }, [
479
- h
480
- ]), F = N !== 0, Q = x !== 0, a = h.current ? Math.floor((x + h.current.clientWidth / 2) / h.current.clientWidth) : 0;
636
+ u
637
+ ]), P = u.current ? Math.floor((A + u.current.clientWidth / 2) / u.current.clientWidth) : 0;
481
638
  o.useLayoutEffect(()=>{
482
- const l = h.current;
483
- if (l) {
484
- const p = ()=>{
485
- const { scrollWidth: M, clientWidth: E } = l, A = Math.round(l.scrollLeft), D = Math.round(M - (A + E));
486
- J({
487
- scrollLeft: A,
488
- scrollRight: D
639
+ const n = u.current;
640
+ if (n) {
641
+ const g = ()=>{
642
+ const { scrollWidth: I, clientWidth: Q } = n, O = Math.round(n.scrollLeft), fe = Math.round(I - (O + Q));
643
+ _({
644
+ scrollLeft: O,
645
+ scrollRight: fe
489
646
  });
490
647
  };
491
- p(), l.addEventListener("scroll", p);
492
- const v = pe(l, p);
648
+ g(), n.addEventListener("scroll", g);
649
+ const y = Ve(n, g);
493
650
  return ()=>{
494
- l.removeEventListener("scroll", p), v();
651
+ n.removeEventListener("scroll", g), y();
495
652
  };
496
653
  }
497
654
  }, [
498
- t.length
655
+ e.length
499
656
  ]);
500
- const B = Pe(!!s, h);
657
+ const { isAutoplayEnabled: ue, shouldAutoplay: q, setShouldAutoPlay: D } = Oe(!!s, u), b = typeof s == "object" && s.loop || !1;
501
658
  o.useEffect(()=>{
502
- if (B && s) {
503
- const l = typeof s == "boolean" ? Se : s.time, p = typeof s == "object" && s.loop, v = setInterval(()=>{
504
- var M;
505
- N !== 0 ? w() : p && ((M = h.current) == null || M.scrollTo({
659
+ if (q && s) {
660
+ const n = typeof s == "boolean" ? je : s.time, g = setInterval(()=>{
661
+ var y;
662
+ d !== 0 ? B() : b && ((y = u.current) == null || y.scrollTo({
506
663
  left: 0,
507
664
  behavior: "smooth"
508
665
  }));
509
- }, l);
510
- return ()=>clearInterval(v);
666
+ }, n);
667
+ return ()=>clearInterval(g);
511
668
  }
512
669
  }, [
513
670
  s,
514
- w,
515
- N,
516
- B
671
+ B,
672
+ d,
673
+ q,
674
+ b
675
+ ]), o.useEffect(()=>{
676
+ P === e.length - 1 && !b && D(!1);
677
+ }, [
678
+ P,
679
+ e.length,
680
+ D,
681
+ b
517
682
  ]);
518
- const W = o.useRef(!1), K = o.useRef(0);
683
+ const V = o.useRef(!1), J = o.useRef(0);
519
684
  o.useEffect(()=>{
520
- i && (W.current ? K.current !== a && i(a) : W.current = r === a), K.current = a;
685
+ i && (V.current ? J.current !== P && i(P) : V.current = f === P), J.current = P;
521
686
  }, [
522
- a,
523
- r,
687
+ P,
688
+ f,
524
689
  i
525
690
  ]), o.useEffect(()=>{
526
- const l = h.current;
527
- r !== void 0 && l && !W.current && l.scrollTo({
528
- left: l.clientWidth * r
691
+ const n = u.current;
692
+ f !== void 0 && n && !V.current && n.scrollTo({
693
+ left: n.clientWidth * f
529
694
  });
530
695
  }, [
531
- r
696
+ f
532
697
  ]);
533
- const C = o.useMemo(()=>({
534
- currentIndex: a,
535
- numPages: t.length
698
+ const F = o.useMemo(()=>({
699
+ currentIndex: P,
700
+ numPages: e.length
536
701
  }), [
537
- a,
538
- t.length
702
+ P,
703
+ e.length
539
704
  ]);
540
- return o.useEffect(()=>{
541
- I && (I.setGoPrev(R), I.setGoNext(w), I.setGoToPage(j), I.setBulletsProps(C));
705
+ o.useEffect(()=>{
706
+ l && (l.setGoPrev(N), l.setGoNext(B), l.setGoToPage(W), l.setBulletsProps(F));
542
707
  }, [
543
- I,
544
- w,
545
- R,
546
- C,
547
- j
548
- ]), /* @__PURE__ */ n(Ee.Provider, {
708
+ l,
709
+ B,
710
+ N,
711
+ F,
712
+ W
713
+ ]);
714
+ const T = t && /* @__PURE__ */ a("div", {
715
+ className: gt,
716
+ children: /* @__PURE__ */ a(Le, {
717
+ variant: v ? "inverse" : "default",
718
+ children: /* @__PURE__ */ a(Fe, _object_spread({}, F))
719
+ })
720
+ }), L = !t && !s;
721
+ return /* @__PURE__ */ a(He.Provider, {
549
722
  value: {
550
- withBullets: !!e
723
+ withBullets: !!t
551
724
  },
552
- children: /* @__PURE__ */ n(wt, {
725
+ children: /* @__PURE__ */ a(Jt, {
553
726
  skipDesktop: !0,
554
- children: /* @__PURE__ */ oe("div", _object_spread_props(_object_spread({
555
- className: V(He, {
556
- [Je]: !!e
727
+ children: /* @__PURE__ */ H("div", _object_spread_props(_object_spread({
728
+ className: k(Ct, {
729
+ [vt]: !!t
557
730
  })
558
- }, be(m, "SlideShow")), {
731
+ }, me(m, "SlideShow")), {
559
732
  children: [
560
- /* @__PURE__ */ n(z, {
561
- isInverse: !1,
562
- children: /* @__PURE__ */ n(_, {
563
- className: Qe,
564
- "aria-label": u.carouselPrevButton || S(xe),
565
- onPress: R,
566
- disabled: !Q,
567
- children: /* @__PURE__ */ n(fe, {})
733
+ e.length > 1 && (r ? /* @__PURE__ */ a(Le, {
734
+ variant: "media",
735
+ children: /* @__PURE__ */ H(Y, {
736
+ space: L ? 0 : "between",
737
+ alignItems: "center",
738
+ className: k(Re, {
739
+ [Pt]: L
740
+ }),
741
+ children: [
742
+ !!s && /* @__PURE__ */ a("div", {
743
+ className: yt,
744
+ children: /* @__PURE__ */ a($e, {
745
+ isAutoplayEnabled: ue,
746
+ isAtLastPage: P === e.length - 1,
747
+ onAutoplayChanged: (n)=>{
748
+ P === e.length - 1 && n && W(0), D(n);
749
+ }
750
+ })
751
+ }),
752
+ T,
753
+ /* @__PURE__ */ a(Ue, {
754
+ goNext: B,
755
+ goPrev: N,
756
+ setShouldAutoplay: D,
757
+ prevArrowEnabled: ie,
758
+ nextArrowEnabled: G
759
+ })
760
+ ]
568
761
  })
569
- }),
570
- /* @__PURE__ */ n("div", {
571
- style: ve({
572
- [xt.mediaBorderRadius]: "0px"
762
+ }) : t && /* @__PURE__ */ a(Y, {
763
+ space: "around",
764
+ className: Re,
765
+ children: T
766
+ })),
767
+ /* @__PURE__ */ a("div", {
768
+ style: be({
769
+ [Ht.mediaBorderRadius]: "0px"
573
770
  }),
574
- children: /* @__PURE__ */ n("div", {
575
- className: Xe,
576
- ref: h,
577
- children: t.map((l, p)=>/* @__PURE__ */ n("div", {
578
- className: et,
771
+ children: /* @__PURE__ */ a("div", {
772
+ className: St,
773
+ ref: u,
774
+ children: e.map((n, g)=>/* @__PURE__ */ a("div", {
775
+ className: Et,
579
776
  style: {
580
- scrollSnapStop: ge(f) ? "always" : "normal"
777
+ scrollSnapStop: De(h) ? "always" : "normal"
581
778
  },
582
- children: l
583
- }, p))
584
- })
585
- }),
586
- /* @__PURE__ */ n(z, {
587
- isInverse: !1,
588
- children: /* @__PURE__ */ n(_, {
589
- className: tt,
590
- "aria-label": u.carouselNextButton || S(Ce),
591
- onPress: w,
592
- disabled: !F,
593
- children: /* @__PURE__ */ n(de, {})
594
- })
595
- }),
596
- e && t.length > 1 && /* @__PURE__ */ n(z, {
597
- isInverse: P,
598
- children: /* @__PURE__ */ n("div", {
599
- className: ot,
600
- children: /* @__PURE__ */ n(we, _object_spread({}, C))
779
+ children: n
780
+ }, g))
601
781
  })
602
782
  })
603
783
  ]
@@ -605,4 +785,4 @@ const Pe = (t, e)=>{
605
785
  })
606
786
  });
607
787
  };
608
- export { qt as Carousel, Yt as CarouselContextConsumer, Kt as CarouselContextProvider, Zt as CenteredCarousel, we as PageBullets, Ht as Slideshow, Ut as useCarouselContext, $t as useSlideshowContext };
788
+ export { Oo as Carousel, $e as CarouselAutoplayControl, Do as CarouselContextConsumer, Wo as CarouselContextProvider, Ue as CarouselPageControls, zo as CenteredCarousel, Fe as PageBullets, Go as Slideshow, Vo as useCarouselContext, _o as useSlideshowContext };