@asdp/ferryui 0.1.22-dev.9319 → 0.1.22-dev.9336

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/index.mjs CHANGED
@@ -639,10 +639,9 @@ var CarouselWithCustomNav = ({
639
639
  }),
640
640
  [language, customLabels, deprecatedAriaLabel]
641
641
  );
642
- const activeIndex = isSingleSlide ? 0 : controlledIndex !== void 0 ? controlledIndex : internalIndex;
642
+ const activeIndex = controlledIndex !== void 0 ? controlledIndex : internalIndex;
643
643
  const handleIndexChange = useCallback(
644
644
  (index) => {
645
- if (isSingleSlide) return;
646
645
  if (controlledIndex === void 0) {
647
646
  setInternalIndex(index);
648
647
  }
@@ -651,10 +650,11 @@ var CarouselWithCustomNav = ({
651
650
  [controlledIndex, onActiveIndexChange, isSingleSlide]
652
651
  );
653
652
  React.useEffect(() => {
654
- if (!autoPlay || isSingleSlide) return;
653
+ if (!autoPlay) return;
654
+ const effectiveTotalSlides = isSingleSlide ? 2 : totalSlides;
655
655
  const intervalId = setInterval(() => {
656
656
  let nextIndex = activeIndex + 1;
657
- if (nextIndex >= totalSlides) {
657
+ if (nextIndex >= effectiveTotalSlides) {
658
658
  nextIndex = circular ? 0 : activeIndex;
659
659
  }
660
660
  if (nextIndex !== activeIndex) {