@opensite/ui 0.7.7 → 0.7.8

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/registry.cjs CHANGED
@@ -18523,7 +18523,8 @@ function CarouselGalleryThumbnails({
18523
18523
  background = "white",
18524
18524
  spacing = "xl",
18525
18525
  pattern,
18526
- patternOpacity
18526
+ patternOpacity,
18527
+ slideMediaBrightness = "50"
18527
18528
  }) {
18528
18529
  const [currentIndex, setCurrentIndex] = React52__namespace.useState(0);
18529
18530
  const prevSlide = React52__namespace.useCallback(() => {
@@ -18577,7 +18578,11 @@ function CarouselGalleryThumbnails({
18577
18578
  {
18578
18579
  src: image.src,
18579
18580
  alt: typeof image.alt === "string" ? image.alt : `Image ${index + 1}`,
18580
- className: cn("h-full w-full object-cover", image.imageClassName),
18581
+ className: cn(
18582
+ "h-full w-full object-cover",
18583
+ BRIGHTNESS_CLASS_MAP[slideMediaBrightness],
18584
+ image.imageClassName
18585
+ ),
18581
18586
  optixFlowConfig
18582
18587
  }
18583
18588
  )
@@ -18688,7 +18693,7 @@ function CarouselHorizontalCards({
18688
18693
  return items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
18689
18694
  framerMotion.motion.div,
18690
18695
  {
18691
- className: cn("group w-[280px] shrink-0", item.className),
18696
+ className: cn("group w-[320px] shrink-0 sm:w-[360px] lg:w-[400px]", item.className),
18692
18697
  initial: { opacity: 0, y: 20 },
18693
18698
  animate: { opacity: 1, y: 0 },
18694
18699
  transition: { duration: 0.5, delay: index * 0.1 },
@@ -18724,7 +18729,7 @@ function CarouselHorizontalCards({
18724
18729
  patternOpacity,
18725
18730
  "aria-labelledby": "carousel-title",
18726
18731
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("container mx-auto px-4 md:px-6", containerClassName), children: [
18727
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mb-6 flex items-center justify-between", headerClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
18732
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mb-8 flex items-center justify-between gap-4", headerClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
18728
18733
  heading && /* @__PURE__ */ jsxRuntime.jsxs("a", { href: headingHref, className: "group inline-flex items-center", children: [
18729
18734
  typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
18730
18735
  "h2",
@@ -18739,7 +18744,7 @@ function CarouselHorizontalCards({
18739
18744
  {
18740
18745
  name: "lucide/chevron-right",
18741
18746
  size: 24,
18742
- className: "ml-2 transition-transform group-hover:translate-x-1"
18747
+ className: "ml-2 flex-shrink-0 self-center transition-transform group-hover:translate-x-1"
18743
18748
  }
18744
18749
  )
18745
18750
  ] }),
@@ -18758,20 +18763,20 @@ function CarouselHorizontalCards({
18758
18763
  Pressable,
18759
18764
  {
18760
18765
  onClick: () => scroll("left"),
18761
- className: cn("absolute left-0 top-1/2 z-10 -translate-y-1/2 rounded-full border bg-background/60 p-2 text-foreground shadow-md backdrop-blur-sm transition-opacity hover:bg-background/80", navigationClassName),
18766
+ className: cn("absolute left-0 top-1/2 z-10 -translate-y-1/2 flex h-10 w-10 items-center justify-center rounded-full border bg-background/60 text-foreground shadow-md backdrop-blur-sm transition-opacity hover:bg-background/80", navigationClassName),
18762
18767
  "aria-label": "Scroll left",
18763
18768
  asButton: true,
18764
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-left", size: 24 })
18769
+ children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-left", size: 20 })
18765
18770
  }
18766
18771
  ),
18767
18772
  !isAtEnd && /* @__PURE__ */ jsxRuntime.jsx(
18768
18773
  Pressable,
18769
18774
  {
18770
18775
  onClick: () => scroll("right"),
18771
- className: cn("absolute right-0 top-1/2 z-10 -translate-y-1/2 rounded-full border bg-background/60 p-2 text-foreground shadow-md backdrop-blur-sm transition-opacity hover:bg-background/80", navigationClassName),
18776
+ className: cn("absolute right-0 top-1/2 z-10 -translate-y-1/2 flex h-10 w-10 items-center justify-center rounded-full border bg-background/60 text-foreground shadow-md backdrop-blur-sm transition-opacity hover:bg-background/80", navigationClassName),
18772
18777
  "aria-label": "Scroll right",
18773
18778
  asButton: true,
18774
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-right", size: 24 })
18779
+ children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-right", size: 20 })
18775
18780
  }
18776
18781
  )
18777
18782
  ] })
@@ -18827,7 +18832,7 @@ function CarouselImageHero({
18827
18832
  Pressable,
18828
18833
  {
18829
18834
  asButton: true,
18830
- className: cn("bg-primary-foreground text-primary dark:bg-primary dark:text-primary-foreground", actionClassName),
18835
+ className: actionClassName,
18831
18836
  ...pressableProps,
18832
18837
  children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
18833
18838
  icon,
@@ -18895,12 +18900,12 @@ function CarouselImageHero({
18895
18900
  children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-right", size: 24, className: "text-white" })
18896
18901
  }
18897
18902
  ),
18898
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("absolute bottom-6 left-1/2 z-10 flex -translate-x-1/2 gap-2", indicatorsClassName), children: images?.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
18903
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("absolute bottom-6 left-1/2 z-10 flex -translate-x-1/2 gap-3", indicatorsClassName), children: images?.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
18899
18904
  "button",
18900
18905
  {
18901
18906
  onClick: () => setCurrentImageIndex(index),
18902
18907
  className: cn(
18903
- "h-2.5 w-2.5 rounded-full transition-colors",
18908
+ "flex h-3 w-3 items-center justify-center rounded-full transition-colors",
18904
18909
  index === currentImageIndex ? "bg-white" : "bg-white/50 hover:bg-white/80"
18905
18910
  ),
18906
18911
  "aria-label": `Go to image ${index + 1}`
@@ -18908,7 +18913,7 @@ function CarouselImageHero({
18908
18913
  index
18909
18914
  )) })
18910
18915
  ] }),
18911
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("container relative z-10 mx-auto flex min-h-[600px] flex-col items-center justify-center px-4 py-24 text-center md:px-6 md:py-32 2xl:max-w-[1400px]", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("max-w-3xl space-y-8", contentClassName), children: [
18916
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("container relative z-10 mx-auto flex min-h-[600px] flex-col items-center justify-center px-4 py-16 text-center md:px-6 md:py-20", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("max-w-4xl space-y-6", contentClassName), children: [
18912
18917
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
18913
18918
  badge && (typeof badge === "string" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center rounded-full bg-white/10 px-3 py-1 text-sm font-medium text-white backdrop-blur-sm", badgeClassName), children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: badge }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: badgeClassName, children: badge })),
18914
18919
  heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: cn("text-4xl font-bold tracking-tight text-primary-foreground dark:text-primary sm:text-5xl md:text-6xl", headingClassName), children: heading }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: headingClassName, children: heading })),
@@ -19044,38 +19049,42 @@ function CarouselMultiStepShowcase({
19044
19049
  }
19045
19050
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: subheadingClassName, children: subheading }))
19046
19051
  ] }),
19047
- stepsSlot ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: stepNavigationClassName, children: stepsSlot }) : /* @__PURE__ */ jsxRuntime.jsx(
19052
+ stepsSlot ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("hidden sm:block", stepNavigationClassName), children: stepsSlot }) : /* @__PURE__ */ jsxRuntime.jsx(
19048
19053
  "div",
19049
19054
  {
19050
19055
  className: cn(
19051
- "mb-8 flex flex-wrap justify-center gap-2",
19056
+ "mb-8 hidden flex-wrap justify-center gap-2 sm:flex",
19052
19057
  stepNavigationClassName
19053
19058
  ),
19054
- children: steps?.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(
19055
- "button",
19056
- {
19057
- onClick: () => goToStep(index),
19058
- className: cn(
19059
- "flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-all",
19060
- activeStep === index ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/80",
19061
- step.className
19062
- ),
19063
- children: [
19064
- /* @__PURE__ */ jsxRuntime.jsx(
19065
- "span",
19066
- {
19067
- className: cn(
19068
- "flex h-6 w-6 items-center justify-center rounded-full text-xs",
19069
- activeStep === index ? "bg-primary-foreground text-primary" : "bg-background"
19070
- ),
19071
- children: step.step
19072
- }
19059
+ children: steps?.map((step, index) => {
19060
+ const isCompleted = index < activeStep;
19061
+ const isActive = index === activeStep;
19062
+ return /* @__PURE__ */ jsxRuntime.jsxs(
19063
+ "button",
19064
+ {
19065
+ onClick: () => goToStep(index),
19066
+ className: cn(
19067
+ "flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-all",
19068
+ isActive ? "bg-primary text-primary-foreground" : isCompleted ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/80",
19069
+ step.className
19073
19070
  ),
19074
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: typeof step.title === "string" ? step.title.split(":")[0] : step.title })
19075
- ]
19076
- },
19077
- step.id
19078
- ))
19071
+ children: [
19072
+ /* @__PURE__ */ jsxRuntime.jsx(
19073
+ "span",
19074
+ {
19075
+ className: cn(
19076
+ "flex h-6 w-6 items-center justify-center rounded-full text-xs",
19077
+ isActive ? "bg-primary-foreground text-primary" : isCompleted ? "bg-primary-foreground text-primary" : "bg-background"
19078
+ ),
19079
+ children: isCompleted ? /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/check", size: 14 }) : step.step
19080
+ }
19081
+ ),
19082
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: typeof step.title === "string" ? step.title.split(":")[0] : step.title })
19083
+ ]
19084
+ },
19085
+ step.id
19086
+ );
19087
+ })
19079
19088
  }
19080
19089
  ),
19081
19090
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -19224,10 +19233,11 @@ function CarouselPortfolioHero({
19224
19233
  navigationClassName,
19225
19234
  counterClassName,
19226
19235
  optixFlowConfig,
19227
- background = "white",
19228
- spacing = "xl",
19236
+ background = "dark",
19237
+ spacing = "none",
19229
19238
  pattern,
19230
- patternOpacity
19239
+ patternOpacity,
19240
+ slideMediaBrightness = "50"
19231
19241
  }) {
19232
19242
  const [currentIndex, setCurrentIndex] = React52__namespace.useState(0);
19233
19243
  const goToNext = React52__namespace.useCallback(() => {
@@ -19273,7 +19283,7 @@ function CarouselPortfolioHero({
19273
19283
  pattern,
19274
19284
  patternOpacity,
19275
19285
  children: [
19276
- slidesSlot ? slidesSlot : slides?.map((slide, index) => /* @__PURE__ */ jsxRuntime.jsxs(
19286
+ slidesSlot ? slidesSlot : slides?.map((slide, index) => /* @__PURE__ */ jsxRuntime.jsx(
19277
19287
  "div",
19278
19288
  {
19279
19289
  className: cn(
@@ -19281,22 +19291,23 @@ function CarouselPortfolioHero({
19281
19291
  index === currentIndex ? "opacity-100" : "opacity-0",
19282
19292
  slide.className
19283
19293
  ),
19284
- children: [
19285
- /* @__PURE__ */ jsxRuntime.jsx(
19286
- img.Img,
19287
- {
19288
- src: slide.image,
19289
- alt: typeof slide.title === "string" ? slide.title : `Slide ${index + 1}`,
19290
- className: cn("h-full w-full object-cover", slide.imageClassName),
19291
- optixFlowConfig
19292
- }
19293
- ),
19294
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent" })
19295
- ]
19294
+ children: /* @__PURE__ */ jsxRuntime.jsx(
19295
+ img.Img,
19296
+ {
19297
+ src: slide.image,
19298
+ alt: typeof slide.title === "string" ? slide.title : `Slide ${index + 1}`,
19299
+ className: cn(
19300
+ "h-full w-full object-cover",
19301
+ BRIGHTNESS_CLASS_MAP[slideMediaBrightness],
19302
+ slide.imageClassName
19303
+ ),
19304
+ optixFlowConfig
19305
+ }
19306
+ )
19296
19307
  },
19297
19308
  slide.id
19298
19309
  )),
19299
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative z-10 flex h-full w-full flex-col justify-end p-4 pb-16 text-white sm:p-8 md:p-12", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("max-w-3xl", contentClassName), children: [
19310
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative z-10 flex h-full w-full flex-col justify-end px-6 pb-16 text-white md:px-8 lg:px-12", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("max-w-4xl", contentClassName), children: [
19300
19311
  currentSlide?.tag && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4", children: typeof currentSlide.tag === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("inline-block rounded-full bg-primary px-3 py-1 text-sm font-medium", tagClassName), children: currentSlide.tag }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: tagClassName, children: currentSlide.tag }) }),
19301
19312
  currentSlide?.title && (typeof currentSlide.title === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: cn("text-4xl font-bold sm:text-5xl md:text-6xl", titleClassName), children: currentSlide.title }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: titleClassName, children: currentSlide.title })),
19302
19313
  currentSlide?.description && (typeof currentSlide.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("mt-4 text-lg text-white/80 sm:text-xl md:max-w-2xl", descriptionClassName), children: currentSlide.description }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: currentSlide.description })),
@@ -19400,13 +19411,13 @@ function CarouselProductFeatureShowcase({
19400
19411
  const renderActions = () => {
19401
19412
  if (actionsSlot) return actionsSlot;
19402
19413
  if (!actions || actions.length === 0) return null;
19403
- return actions.map((action, index) => {
19414
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-8 flex flex-wrap gap-3", children: actions.map((action, index) => {
19404
19415
  const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
19405
19416
  return /* @__PURE__ */ jsxRuntime.jsx(
19406
19417
  Pressable,
19407
19418
  {
19408
19419
  asButton: true,
19409
- className: cn("mt-8", actionClassName),
19420
+ className: actionClassName,
19410
19421
  ...pressableProps,
19411
19422
  children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19412
19423
  icon,
@@ -19416,7 +19427,7 @@ function CarouselProductFeatureShowcase({
19416
19427
  },
19417
19428
  index
19418
19429
  );
19419
- });
19430
+ }) });
19420
19431
  };
19421
19432
  return /* @__PURE__ */ jsxRuntime.jsx(
19422
19433
  Section,
@@ -19461,9 +19472,9 @@ function CarouselProductFeatureShowcase({
19461
19472
  {
19462
19473
  onClick: goToPrev,
19463
19474
  asButton: true,
19464
- variant: "secondary",
19475
+ variant: "outline",
19465
19476
  size: "icon",
19466
- className: "rounded-full bg-background/80 backdrop-blur-sm",
19477
+ className: "flex h-10 w-10 items-center justify-center rounded-full border-border bg-background/90 text-foreground backdrop-blur-sm hover:bg-background",
19467
19478
  children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-left", size: 20 })
19468
19479
  }
19469
19480
  ),
@@ -19472,9 +19483,9 @@ function CarouselProductFeatureShowcase({
19472
19483
  {
19473
19484
  onClick: goToNext,
19474
19485
  asButton: true,
19475
- variant: "secondary",
19486
+ variant: "outline",
19476
19487
  size: "icon",
19477
- className: "rounded-full bg-background/80 backdrop-blur-sm",
19488
+ className: "flex h-10 w-10 items-center justify-center rounded-full border-border bg-background/90 text-foreground backdrop-blur-sm hover:bg-background",
19478
19489
  children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-right", size: 20 })
19479
19490
  }
19480
19491
  )
@@ -19560,13 +19571,13 @@ function SliderBtn({
19560
19571
  /* @__PURE__ */ jsxRuntime.jsx(
19561
19572
  "div",
19562
19573
  {
19563
- className: "absolute inset-0 -z-10 max-h-full max-w-full overflow-hidden",
19574
+ className: "absolute inset-0 -z-10 max-h-full max-w-full overflow-hidden rounded-lg",
19564
19575
  role: "progressbar",
19565
19576
  "aria-valuenow": active === value ? progress : 0,
19566
19577
  children: /* @__PURE__ */ jsxRuntime.jsx(
19567
19578
  "span",
19568
19579
  {
19569
- className: cn("absolute left-0", progressBarClass),
19580
+ className: cn("absolute left-0 rounded-b-lg", progressBarClass),
19570
19581
  style: {
19571
19582
  [vertical ? "height" : "width"]: active === value ? `${progress}%` : "0%"
19572
19583
  }
@@ -19597,7 +19608,7 @@ function CarouselProgressSlider({
19597
19608
  subheading,
19598
19609
  slides,
19599
19610
  slidesSlot,
19600
- duration = 5e3,
19611
+ duration = 8e3,
19601
19612
  fastDuration = 400,
19602
19613
  vertical = false,
19603
19614
  className,
@@ -19616,22 +19627,35 @@ function CarouselProgressSlider({
19616
19627
  const [active, setActive] = React52__namespace.useState(slides?.[0]?.id ?? "");
19617
19628
  const [progress, setProgress] = React52__namespace.useState(0);
19618
19629
  const [isFastForward, setIsFastForward] = React52__namespace.useState(false);
19630
+ const [isPaused, setIsPaused] = React52__namespace.useState(false);
19619
19631
  const frame = React52__namespace.useRef(0);
19620
19632
  const firstFrameTime = React52__namespace.useRef(performance.now());
19621
19633
  const targetValue = React52__namespace.useRef(null);
19634
+ const pausedProgress = React52__namespace.useRef(0);
19622
19635
  const sliderValues = React52__namespace.useMemo(
19623
19636
  () => slides?.map((slide) => slide.id),
19624
19637
  [slides]
19625
19638
  );
19626
19639
  React52__namespace.useEffect(() => {
19627
- if ((sliderValues?.length ?? 0) > 0) {
19640
+ if ((sliderValues?.length ?? 0) > 0 && !isPaused) {
19628
19641
  firstFrameTime.current = performance.now();
19642
+ if (pausedProgress.current > 0) {
19643
+ setProgress(pausedProgress.current);
19644
+ pausedProgress.current = 0;
19645
+ }
19629
19646
  frame.current = requestAnimationFrame(animate);
19630
19647
  }
19631
19648
  return () => {
19632
19649
  cancelAnimationFrame(frame.current);
19633
19650
  };
19634
- }, [sliderValues, active, isFastForward]);
19651
+ }, [sliderValues, active, isFastForward, isPaused]);
19652
+ const togglePause = () => {
19653
+ if (!isPaused) {
19654
+ pausedProgress.current = progress;
19655
+ cancelAnimationFrame(frame.current);
19656
+ }
19657
+ setIsPaused(!isPaused);
19658
+ };
19635
19659
  const animate = (now) => {
19636
19660
  const currentDuration = isFastForward ? fastDuration : duration;
19637
19661
  const elapsedTime = now - firstFrameTime.current;
@@ -19683,26 +19707,40 @@ function CarouselProgressSlider({
19683
19707
  pattern,
19684
19708
  patternOpacity,
19685
19709
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid gap-8 lg:grid-cols-2", contentClassName), children: [
19686
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative min-h-[300px]", imageClassName), children: slidesSlot ? slidesSlot : slides?.map((slide) => /* @__PURE__ */ jsxRuntime.jsx(
19687
- SliderWrapper,
19688
- {
19689
- value: slide.id,
19690
- className: cn("absolute inset-0", slide.className),
19691
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aspect-video overflow-hidden rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(
19692
- img.Img,
19693
- {
19694
- src: slide.image,
19695
- alt: typeof slide.title === "string" ? slide.title : `Slide ${slide.id}`,
19696
- className: cn(
19697
- "h-full w-full object-cover",
19698
- slide.imageClassName
19699
- ),
19700
- optixFlowConfig
19701
- }
19702
- ) })
19703
- },
19704
- slide.id
19705
- )) }),
19710
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", imageClassName), children: [
19711
+ slidesSlot ? slidesSlot : slides?.map((slide) => /* @__PURE__ */ jsxRuntime.jsx(
19712
+ SliderWrapper,
19713
+ {
19714
+ value: slide.id,
19715
+ className: cn("", slide.className),
19716
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aspect-video overflow-hidden rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(
19717
+ img.Img,
19718
+ {
19719
+ src: slide.image,
19720
+ alt: typeof slide.title === "string" ? slide.title : `Slide ${slide.id}`,
19721
+ className: cn(
19722
+ "h-full w-full object-cover",
19723
+ slide.imageClassName
19724
+ ),
19725
+ optixFlowConfig
19726
+ }
19727
+ ) })
19728
+ },
19729
+ slide.id
19730
+ )),
19731
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 flex justify-center lg:justify-start", children: /* @__PURE__ */ jsxRuntime.jsx(
19732
+ Pressable,
19733
+ {
19734
+ onClick: togglePause,
19735
+ asButton: true,
19736
+ variant: "outline",
19737
+ size: "icon",
19738
+ className: "flex h-10 w-10 items-center justify-center rounded-full",
19739
+ "aria-label": isPaused ? "Play" : "Pause",
19740
+ children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: isPaused ? "lucide/play" : "lucide/pause", size: 18 })
19741
+ }
19742
+ ) })
19743
+ ] }),
19706
19744
  /* @__PURE__ */ jsxRuntime.jsx(
19707
19745
  "div",
19708
19746
  {
@@ -19760,78 +19798,85 @@ function CarouselScrollingFeatureShowcase({
19760
19798
  const [activeFeature, setActiveFeature] = React52__namespace.useState(
19761
19799
  features?.[0]?.id ?? ""
19762
19800
  );
19763
- const containerRef = React52__namespace.useRef(null);
19764
- const { scrollYProgress } = framerMotion.useScroll({
19765
- target: containerRef,
19766
- offset: ["start start", "end end"]
19767
- });
19768
- const imageOpacity = framerMotion.useTransform(scrollYProgress, [0, 0.1], [0, 1]);
19801
+ const featureRefs = React52__namespace.useRef(/* @__PURE__ */ new Map());
19769
19802
  React52__namespace.useEffect(() => {
19770
- const observers = [];
19771
- features?.forEach((feature) => {
19772
- const element = document.getElementById(feature.id);
19773
- if (element) {
19774
- const observer = new IntersectionObserver(
19775
- (entries) => {
19776
- entries.forEach((entry) => {
19777
- if (entry.isIntersecting) {
19778
- setActiveFeature(feature.id);
19779
- }
19780
- });
19781
- },
19782
- { threshold: 0.5 }
19783
- );
19784
- observer.observe(element);
19785
- observers.push(observer);
19786
- }
19803
+ if (!features || features.length === 0) return;
19804
+ const observerOptions = {
19805
+ root: null,
19806
+ rootMargin: "-20% 0px -60% 0px",
19807
+ threshold: 0
19808
+ };
19809
+ const observer = new IntersectionObserver((entries) => {
19810
+ entries.forEach((entry) => {
19811
+ if (entry.isIntersecting) {
19812
+ const featureId = entry.target.getAttribute("data-feature-id");
19813
+ if (featureId) {
19814
+ setActiveFeature(featureId);
19815
+ }
19816
+ }
19817
+ });
19818
+ }, observerOptions);
19819
+ featureRefs.current.forEach((element) => {
19820
+ observer.observe(element);
19787
19821
  });
19788
19822
  return () => {
19789
- observers.forEach((observer) => observer.disconnect());
19823
+ observer.disconnect();
19790
19824
  };
19791
19825
  }, [features]);
19792
19826
  const activeFeatureData = features?.find((f) => f.id === activeFeature);
19827
+ const setFeatureRef = (id) => (el) => {
19828
+ if (el) {
19829
+ featureRefs.current.set(id, el);
19830
+ } else {
19831
+ featureRefs.current.delete(id);
19832
+ }
19833
+ };
19793
19834
  return /* @__PURE__ */ jsxRuntime.jsx(
19794
19835
  Section,
19795
19836
  {
19796
- ref: containerRef,
19797
19837
  background,
19798
19838
  spacing,
19799
19839
  className: cn(className),
19800
19840
  pattern,
19801
19841
  patternOpacity,
19802
19842
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("container mx-auto px-4", containerClassName), children: [
19803
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("py-16 text-center", headerClassName), children: [
19843
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mb-12 text-center", headerClassName), children: [
19804
19844
  heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-3xl font-bold tracking-tight md:text-4xl", headingClassName), children: heading }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: headingClassName, children: heading })),
19805
19845
  subheading && (typeof subheading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("mt-4 text-lg text-muted-foreground", subheadingClassName), children: subheading }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mt-4", subheadingClassName), children: subheading }))
19806
19846
  ] }),
19807
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid gap-8 lg:grid-cols-2", contentClassName), children: [
19808
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-24", children: /* @__PURE__ */ jsxRuntime.jsx(
19847
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid gap-8 lg:grid-cols-2 lg:gap-12", contentClassName), children: [
19848
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-24", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("aspect-video overflow-hidden rounded-xl bg-muted", imageClassName), children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: activeFeatureData && /* @__PURE__ */ jsxRuntime.jsx(
19809
19849
  framerMotion.motion.div,
19810
19850
  {
19811
- style: { opacity: imageOpacity },
19812
- className: cn("aspect-video overflow-hidden rounded-xl", imageClassName),
19813
- children: activeFeatureData && /* @__PURE__ */ jsxRuntime.jsx(
19851
+ initial: { opacity: 0 },
19852
+ animate: { opacity: 1 },
19853
+ exit: { opacity: 0 },
19854
+ transition: { duration: 0.3 },
19855
+ className: "h-full w-full",
19856
+ children: /* @__PURE__ */ jsxRuntime.jsx(
19814
19857
  img.Img,
19815
19858
  {
19816
19859
  src: activeFeatureData.image,
19817
19860
  alt: typeof activeFeatureData.title === "string" ? activeFeatureData.title : `Feature ${activeFeatureData.id}`,
19818
- className: cn("h-full w-full object-cover transition-all duration-500", activeFeatureData.imageClassName),
19861
+ className: cn("h-full w-full object-cover", activeFeatureData.imageClassName),
19819
19862
  optixFlowConfig
19820
19863
  }
19821
19864
  )
19822
- }
19823
- ) }) }),
19824
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-32 py-16", featuresClassName), children: featuresSlot ? featuresSlot : features?.map((feature, index) => /* @__PURE__ */ jsxRuntime.jsxs(
19865
+ },
19866
+ activeFeatureData.id
19867
+ ) }) }) }) }),
19868
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-24 lg:space-y-32", featuresClassName), children: featuresSlot ? featuresSlot : features?.map((feature, index) => /* @__PURE__ */ jsxRuntime.jsxs(
19825
19869
  "div",
19826
19870
  {
19827
- id: feature.id,
19871
+ ref: setFeatureRef(feature.id),
19872
+ "data-feature-id": feature.id,
19828
19873
  className: cn(
19829
- "min-h-[50vh] transition-opacity duration-300",
19874
+ "scroll-mt-24 transition-opacity duration-300",
19830
19875
  activeFeature === feature.id ? "opacity-100" : "opacity-50",
19831
19876
  feature.className
19832
19877
  ),
19833
19878
  children: [
19834
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6 lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aspect-video overflow-hidden rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(
19879
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6 lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aspect-video overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(
19835
19880
  img.Img,
19836
19881
  {
19837
19882
  src: feature.image,