@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.
package/dist/index.mjs CHANGED
@@ -10772,11 +10772,11 @@ var defaultCarouselSlideTranslationType = {
10772
10772
  var CarouselSlide = forwardRef8(
10773
10773
  function CarouselSlide2({
10774
10774
  index,
10775
+ isSelected,
10775
10776
  ...props
10776
10777
  }, ref) {
10777
10778
  const translation = useTranslation([defaultCarouselSlideTranslationType]);
10778
- const { id, currentIndex, slideCount } = useCarouselContext();
10779
- const isSelected = currentIndex === index;
10779
+ const { id, slideCount } = useCarouselContext();
10780
10780
  return /* @__PURE__ */ jsx31(
10781
10781
  "div",
10782
10782
  {
@@ -10824,8 +10824,9 @@ var Carousel = ({
10824
10824
  dots = true,
10825
10825
  blurColor = "from-background",
10826
10826
  heightClassName = "h-96",
10827
- widthClassName = "w-[70%] desktop:w-1/2",
10827
+ slideClassName = "w-[70%] desktop:w-1/2",
10828
10828
  slideContainerProps,
10829
+ onSlideChanged,
10829
10830
  ...props
10830
10831
  }) => {
10831
10832
  const translation = useTranslation([defaultCarouselTranslationType]);
@@ -10939,6 +10940,9 @@ var Carousel = ({
10939
10940
  useEffect18(() => {
10940
10941
  setDisableClick(!dragState);
10941
10942
  }, [dragState]);
10943
+ useEffect18(() => {
10944
+ onSlideChanged?.(currentIndex);
10945
+ }, [currentIndex]);
10942
10946
  return /* @__PURE__ */ jsx31(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ jsxs17(
10943
10947
  "div",
10944
10948
  {
@@ -10974,9 +10978,10 @@ var Carousel = ({
10974
10978
  {
10975
10979
  ref: isInItems ? slideRefs[index] : void 0,
10976
10980
  index,
10981
+ isSelected: isInItems && currentIndex === index,
10977
10982
  className: clsx20(
10978
10983
  `absolute left-[50%] h-full overflow-hidden transition-transform ease-in-out`,
10979
- widthClassName
10984
+ slideClassName
10980
10985
  ),
10981
10986
  onClick: () => !disableClick && setCurrentIndex(index),
10982
10987
  style: {