@helpwave/hightide 0.1.38 → 0.1.40

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.
@@ -387,11 +387,11 @@ var defaultCarouselSlideTranslationType = {
387
387
  var CarouselSlide = forwardRef2(
388
388
  function CarouselSlide2({
389
389
  index,
390
+ isSelected,
390
391
  ...props
391
392
  }, ref) {
392
393
  const translation = useTranslation([defaultCarouselSlideTranslationType]);
393
- const { id, currentIndex, slideCount } = useCarouselContext();
394
- const isSelected = currentIndex === index;
394
+ const { id, slideCount } = useCarouselContext();
395
395
  return /* @__PURE__ */ jsx3(
396
396
  "div",
397
397
  {
@@ -439,8 +439,9 @@ var Carousel = ({
439
439
  dots = true,
440
440
  blurColor = "from-background",
441
441
  heightClassName = "h-96",
442
- widthClassName = "w-[70%] desktop:w-1/2",
442
+ slideClassName = "w-[70%] desktop:w-1/2",
443
443
  slideContainerProps,
444
+ onSlideChanged,
444
445
  ...props
445
446
  }) => {
446
447
  const translation = useTranslation([defaultCarouselTranslationType]);
@@ -554,6 +555,9 @@ var Carousel = ({
554
555
  useEffect2(() => {
555
556
  setDisableClick(!dragState);
556
557
  }, [dragState]);
558
+ useEffect2(() => {
559
+ onSlideChanged?.(currentIndex);
560
+ }, [currentIndex]);
557
561
  return /* @__PURE__ */ jsx3(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ jsxs2(
558
562
  "div",
559
563
  {
@@ -589,9 +593,10 @@ var Carousel = ({
589
593
  {
590
594
  ref: isInItems ? slideRefs[index] : void 0,
591
595
  index,
596
+ isSelected: isInItems && currentIndex === index,
592
597
  className: clsx2(
593
598
  `absolute left-[50%] h-full overflow-hidden transition-transform ease-in-out`,
594
- widthClassName
599
+ slideClassName
595
600
  ),
596
601
  onClick: () => !disableClick && setCurrentIndex(index),
597
602
  style: {