@harshit-wander/component-lib 1.1.9 → 1.1.11

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.cjs CHANGED
@@ -274,30 +274,65 @@ var DestinationCard = react.forwardRef(
274
274
  DestinationCard.displayName = "DestinationCard";
275
275
  var frameClass = "block w-full h-[300px] overflow-hidden rounded-md no-underline text-inherit focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2";
276
276
  var EventBanner = react.forwardRef(
277
- ({ imageUrl, alt, href, className, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("shrink-0 w-full snap-start", className), ...rest, children: href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: frameClass, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: imageUrl, alt, className: "block w-full h-full object-cover" }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: frameClass, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: imageUrl, alt, className: "block w-full h-full object-cover" }) }) })
277
+ ({ imageUrl, alt, href, className, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("shrink-0 w-full snap-start", className), ...rest, children: href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: frameClass, children: /* @__PURE__ */ jsxRuntime.jsx(
278
+ "img",
279
+ {
280
+ src: imageUrl,
281
+ alt,
282
+ loading: "lazy",
283
+ decoding: "async",
284
+ className: "block w-full h-full object-cover"
285
+ }
286
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: frameClass, children: /* @__PURE__ */ jsxRuntime.jsx(
287
+ "img",
288
+ {
289
+ src: imageUrl,
290
+ alt,
291
+ loading: "lazy",
292
+ decoding: "async",
293
+ className: "block w-full h-full object-cover"
294
+ }
295
+ ) }) })
278
296
  );
279
297
  EventBanner.displayName = "EventBanner";
280
298
  var frameClass2 = "block w-full h-[300px] overflow-hidden rounded-md no-underline text-inherit focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2";
281
- var videoClass = "block w-full h-full object-cover";
299
+ var mediaClass = "block w-full h-full object-cover";
282
300
  var EventVideoBanner = react.forwardRef(
283
- ({ posterUrl, videoUrl, alt, href, className, ...rest }, ref) => {
301
+ ({
302
+ posterUrl,
303
+ videoUrl,
304
+ alt,
305
+ href,
306
+ mobileVideoUrl,
307
+ mobilePosterUrl,
308
+ isActive = true,
309
+ className,
310
+ ...rest
311
+ }, ref) => {
284
312
  const videoRef = react.useRef(null);
285
313
  react.useEffect(() => {
314
+ if (!isActive) return;
286
315
  const video = videoRef.current;
287
316
  if (!video || !videoUrl) return;
288
- if (!videoUrl.includes(".m3u8")) {
289
- video.src = videoUrl;
317
+ const isMobileViewport = typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(max-width: 767px)").matches;
318
+ const activeUrl = isMobileViewport && mobileVideoUrl ? mobileVideoUrl : videoUrl;
319
+ const activePoster = isMobileViewport && mobilePosterUrl ? mobilePosterUrl : posterUrl;
320
+ if (activePoster && video.poster !== activePoster) {
321
+ video.poster = activePoster;
322
+ }
323
+ if (!activeUrl.includes(".m3u8")) {
324
+ video.src = activeUrl;
290
325
  return;
291
326
  }
292
327
  if (video.canPlayType("application/vnd.apple.mpegurl")) {
293
- video.src = videoUrl;
328
+ video.src = activeUrl;
294
329
  return;
295
330
  }
296
331
  let cancelled = false;
297
332
  import('hls.js').then(({ default: Hls }) => {
298
333
  if (cancelled || !Hls.isSupported()) return;
299
334
  const hls = new Hls({ autoStartLoad: true, startLevel: -1 });
300
- hls.loadSource(videoUrl);
335
+ hls.loadSource(activeUrl);
301
336
  hls.attachMedia(video);
302
337
  video._hls = hls;
303
338
  });
@@ -306,12 +341,11 @@ var EventVideoBanner = react.forwardRef(
306
341
  const stored = video._hls;
307
342
  stored?.destroy();
308
343
  };
309
- }, [videoUrl]);
310
- const videoEl = /* @__PURE__ */ jsxRuntime.jsx(
344
+ }, [videoUrl, mobileVideoUrl, posterUrl, mobilePosterUrl, isActive]);
345
+ const mediaEl = isActive ? /* @__PURE__ */ jsxRuntime.jsx(
311
346
  "video",
312
347
  {
313
348
  ref: videoRef,
314
- src: videoUrl?.includes(".m3u8") ? void 0 : videoUrl,
315
349
  poster: posterUrl,
316
350
  "aria-label": alt,
317
351
  muted: true,
@@ -319,10 +353,16 @@ var EventVideoBanner = react.forwardRef(
319
353
  loop: true,
320
354
  playsInline: true,
321
355
  preload: "metadata",
322
- className: videoClass
356
+ className: mediaClass
323
357
  }
358
+ ) : (
359
+ // <picture> lets the browser pick mobile/desktop poster via CSS, no JS
360
+ /* @__PURE__ */ jsxRuntime.jsxs("picture", { children: [
361
+ mobilePosterUrl ? /* @__PURE__ */ jsxRuntime.jsx("source", { media: "(max-width: 767px)", srcSet: mobilePosterUrl }) : null,
362
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: posterUrl, alt, loading: "lazy", decoding: "async", className: mediaClass })
363
+ ] })
324
364
  );
325
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("shrink-0 w-full snap-start", className), ...rest, children: href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: frameClass2, children: videoEl }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: frameClass2, children: videoEl }) });
365
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("shrink-0 w-full snap-start", className), ...rest, children: href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: frameClass2, children: mediaEl }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: frameClass2, children: mediaEl }) });
326
366
  }
327
367
  );
328
368
  EventVideoBanner.displayName = "EventVideoBanner";
@@ -395,7 +435,16 @@ var cardClass2 = "shrink-0 w-[132px] flex flex-col bg-surface border border-bord
395
435
  var ExploreCard = react.forwardRef(
396
436
  ({ image, alt, label, href, className, ...rest }, ref) => {
397
437
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
398
- /* @__PURE__ */ jsxRuntime.jsx("img", { src: image, alt, className: "block w-full h-[102px] object-cover" }),
438
+ /* @__PURE__ */ jsxRuntime.jsx(
439
+ "img",
440
+ {
441
+ src: image,
442
+ alt,
443
+ loading: "lazy",
444
+ decoding: "async",
445
+ className: "block w-full h-[102px] object-cover"
446
+ }
447
+ ),
399
448
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center min-h-[56px] py-sm px-md text-md font-medium leading-card text-secondary text-center", children: label })
400
449
  ] });
401
450
  if (href) {
@@ -518,7 +567,16 @@ var GalleryPhoto = react.forwardRef(
518
567
  ),
519
568
  ...rest,
520
569
  children: [
521
- /* @__PURE__ */ jsxRuntime.jsx("img", { src: image, alt, className: "block w-full h-full object-cover" }),
570
+ /* @__PURE__ */ jsxRuntime.jsx(
571
+ "img",
572
+ {
573
+ src: image,
574
+ alt,
575
+ loading: "lazy",
576
+ decoding: "async",
577
+ className: "block w-full h-full object-cover"
578
+ }
579
+ ),
522
580
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-12 left-sm inline-flex items-center gap-xs py-[2px] px-[6px] bg-black/40 border-[0.5px] border-secondary rounded-full text-on-dark text-xs font-normal leading-4 max-md:bottom-8", children: [
523
581
  /* @__PURE__ */ jsxRuntime.jsx(
524
582
  "span",
@@ -774,7 +832,7 @@ var TestimonialCard = react.forwardRef(
774
832
  ({ thumbnail, thumbnailAlt, logo, logoAlt, caption, videoHref, onPlayClick, className, ...rest }, ref) => {
775
833
  const playLabel = `Play testimonial: ${caption}`;
776
834
  const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
777
- /* @__PURE__ */ jsxRuntime.jsx("img", { src: thumbnail, alt: thumbnailAlt }),
835
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: thumbnail, alt: thumbnailAlt, loading: "lazy", decoding: "async" }),
778
836
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 inline-flex items-center justify-center w-[56px] h-[56px] pointer-events-none z-[1] text-white", children: /* @__PURE__ */ jsxRuntime.jsx(PlaySvg, {}) })
779
837
  ] });
780
838
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -809,7 +867,16 @@ var TestimonialCard = react.forwardRef(
809
867
  }
810
868
  ),
811
869
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-sm w-full py-md", children: [
812
- /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: logoAlt, className: "w-[60px] h-[60px] object-contain shrink-0" }),
870
+ /* @__PURE__ */ jsxRuntime.jsx(
871
+ "img",
872
+ {
873
+ src: logo,
874
+ alt: logoAlt,
875
+ loading: "lazy",
876
+ decoding: "async",
877
+ className: "w-[60px] h-[60px] object-contain shrink-0"
878
+ }
879
+ ),
813
880
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "m-0 text-md font-medium leading-8 text-secondary", children: caption })
814
881
  ] })
815
882
  ]
@@ -820,17 +887,21 @@ var TestimonialCard = react.forwardRef(
820
887
  TestimonialCard.displayName = "TestimonialCard";
821
888
  var cardClass4 = "relative flex flex-col justify-end shrink-0 w-[200px] h-[316px] p-[20px] border-2 border-surface rounded-lg overflow-hidden no-underline text-inherit snap-start focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2";
822
889
  var TripCategoryCard = react.forwardRef(
823
- ({ image, alt, destination, startingPrice, href, className, ...rest }, ref) => {
890
+ ({ image, mobileImage, alt, destination, startingPrice, href, className, ...rest }, ref) => {
824
891
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
825
- /* @__PURE__ */ jsxRuntime.jsx(
826
- "span",
827
- {
828
- role: "img",
829
- "aria-label": alt,
830
- className: "absolute inset-0 bg-cover bg-center pointer-events-none",
831
- style: { backgroundImage: `url(${image})` }
832
- }
833
- ),
892
+ /* @__PURE__ */ jsxRuntime.jsxs("picture", { className: "absolute inset-0 pointer-events-none", children: [
893
+ mobileImage ? /* @__PURE__ */ jsxRuntime.jsx("source", { media: "(max-width: 767px)", srcSet: mobileImage }) : null,
894
+ /* @__PURE__ */ jsxRuntime.jsx(
895
+ "img",
896
+ {
897
+ src: image,
898
+ alt,
899
+ loading: "lazy",
900
+ decoding: "async",
901
+ className: "absolute inset-0 w-full h-full object-cover"
902
+ }
903
+ )
904
+ ] }),
834
905
  /* @__PURE__ */ jsxRuntime.jsx(
835
906
  "span",
836
907
  {
@@ -1574,7 +1645,9 @@ var useScrollSnap = (itemCount) => {
1574
1645
  setScrollProgress(maxScroll > 0 ? el.scrollLeft / maxScroll : 0);
1575
1646
  if (itemCount > 0) {
1576
1647
  const itemWidth = el.scrollWidth / itemCount;
1577
- setActiveIndex(Math.round(el.scrollLeft / itemWidth));
1648
+ if (itemWidth > 0) {
1649
+ setActiveIndex(Math.round(el.scrollLeft / itemWidth));
1650
+ }
1578
1651
  }
1579
1652
  }, [itemCount]);
1580
1653
  const setRef = react.useCallback(
@@ -1676,13 +1749,16 @@ var EventCarousel = react.forwardRef(
1676
1749
  ref: trackRef,
1677
1750
  className: "flex w-full gap-sm overflow-x-auto snap-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
1678
1751
  children: events.map(
1679
- (event) => "videoUrl" in event ? /* @__PURE__ */ jsxRuntime.jsx(
1752
+ (event, index) => "videoUrl" in event ? /* @__PURE__ */ jsxRuntime.jsx(
1680
1753
  EventVideoBanner,
1681
1754
  {
1682
1755
  posterUrl: event.posterUrl,
1683
1756
  videoUrl: event.videoUrl,
1757
+ mobileVideoUrl: event.mobileVideoUrl,
1758
+ mobilePosterUrl: event.mobilePosterUrl,
1684
1759
  alt: event.alt,
1685
- href: event.href
1760
+ href: event.href,
1761
+ isActive: index === activeIndex
1686
1762
  },
1687
1763
  `${event.videoUrl}|${event.alt}`
1688
1764
  ) : /* @__PURE__ */ jsxRuntime.jsx(
@@ -2224,9 +2300,28 @@ var useTypewriter = (phrases, options) => {
2224
2300
  return text;
2225
2301
  };
2226
2302
  var HomeHero = react.forwardRef(
2227
- ({ videoUrl, posterUrl, title, cyclingPhrases, typewriter, reviews, className, ...rest }, ref) => {
2303
+ ({
2304
+ videoUrl,
2305
+ posterUrl,
2306
+ mobilePosterUrl,
2307
+ title,
2308
+ cyclingPhrases,
2309
+ typewriter,
2310
+ reviews,
2311
+ className,
2312
+ ...rest
2313
+ }, ref) => {
2228
2314
  const currentPhrase = useTypewriter(cyclingPhrases, typewriter);
2229
2315
  const hasReviews = reviews !== void 0 && reviews.length > 0;
2316
+ const videoRef = react.useRef(null);
2317
+ react.useEffect(() => {
2318
+ const video = videoRef.current;
2319
+ if (!video || !mobilePosterUrl) return;
2320
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
2321
+ if (window.matchMedia("(max-width: 767px)").matches) {
2322
+ video.poster = mobilePosterUrl;
2323
+ }
2324
+ }, [mobilePosterUrl]);
2230
2325
  return /* @__PURE__ */ jsxRuntime.jsxs(
2231
2326
  "section",
2232
2327
  {
@@ -2237,6 +2332,7 @@ var HomeHero = react.forwardRef(
2237
2332
  /* @__PURE__ */ jsxRuntime.jsx(
2238
2333
  "video",
2239
2334
  {
2335
+ ref: videoRef,
2240
2336
  src: videoUrl,
2241
2337
  poster: posterUrl,
2242
2338
  muted: true,
@@ -2715,6 +2811,34 @@ var TextSection = react.forwardRef(
2715
2811
  )
2716
2812
  );
2717
2813
  TextSection.displayName = "TextSection";
2814
+ var useDesktopVideoVisible = (ref, breakpointPx = 768) => {
2815
+ const [shouldRender, setShouldRender] = react.useState(false);
2816
+ react.useEffect(() => {
2817
+ if (typeof window === "undefined") return;
2818
+ const mq = window.matchMedia(`(min-width: ${breakpointPx}px)`);
2819
+ if (!mq.matches) {
2820
+ setShouldRender(false);
2821
+ return;
2822
+ }
2823
+ const el = ref.current;
2824
+ if (!el || typeof IntersectionObserver === "undefined") {
2825
+ setShouldRender(true);
2826
+ return;
2827
+ }
2828
+ const io = new IntersectionObserver(
2829
+ (entries) => {
2830
+ if (entries[0]?.isIntersecting) {
2831
+ setShouldRender(true);
2832
+ io.disconnect();
2833
+ }
2834
+ },
2835
+ { rootMargin: "200px" }
2836
+ );
2837
+ io.observe(el);
2838
+ return () => io.disconnect();
2839
+ }, [ref, breakpointPx]);
2840
+ return shouldRender;
2841
+ };
2718
2842
  var ChevronLeft5 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
2719
2843
  "path",
2720
2844
  {
@@ -2746,6 +2870,8 @@ var TripsCategorySection = react.forwardRef(
2746
2870
  canNext,
2747
2871
  scrollProgress
2748
2872
  } = useScrollSnap(trips.length);
2873
+ const heroRef = react.useRef(null);
2874
+ const showDesktopVideo = useDesktopVideoVisible(heroRef);
2749
2875
  const handleCtaClick = () => {
2750
2876
  if (cta.href) {
2751
2877
  window.location.assign(cta.href);
@@ -2754,134 +2880,154 @@ var TripsCategorySection = react.forwardRef(
2754
2880
  cta.onClick?.();
2755
2881
  };
2756
2882
  const progressWidth = Math.min(33 + scrollProgress * (120 - 33), 120);
2757
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { ref, className: cn("relative flex flex-col bg-surface max-md:overflow-x-clip", className), ...rest, children: [
2758
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-[318px] rounded-lg overflow-hidden max-md:h-[260px]", children: [
2759
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0", children: [
2760
- /* @__PURE__ */ jsxRuntime.jsx(
2761
- "img",
2883
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2884
+ "section",
2885
+ {
2886
+ ref,
2887
+ className: cn("relative flex flex-col bg-surface max-md:overflow-x-clip", className),
2888
+ ...rest,
2889
+ children: [
2890
+ /* @__PURE__ */ jsxRuntime.jsxs(
2891
+ "div",
2762
2892
  {
2763
- src: poster,
2764
- alt: "",
2765
- "aria-hidden": "true",
2766
- className: "w-full h-full object-cover md:hidden"
2893
+ ref: heroRef,
2894
+ className: "relative h-[318px] rounded-lg overflow-hidden max-md:h-[260px]",
2895
+ children: [
2896
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0", children: [
2897
+ /* @__PURE__ */ jsxRuntime.jsx(
2898
+ "img",
2899
+ {
2900
+ src: poster,
2901
+ alt: "",
2902
+ "aria-hidden": "true",
2903
+ className: "w-full h-full object-cover",
2904
+ loading: "lazy",
2905
+ decoding: "async"
2906
+ }
2907
+ ),
2908
+ showDesktopVideo && /* @__PURE__ */ jsxRuntime.jsx(
2909
+ "video",
2910
+ {
2911
+ autoPlay: true,
2912
+ muted: true,
2913
+ loop: true,
2914
+ playsInline: true,
2915
+ preload: "metadata",
2916
+ poster,
2917
+ src: videoSrc,
2918
+ className: "hidden md:block absolute inset-0 w-full h-full object-cover"
2919
+ }
2920
+ )
2921
+ ] }),
2922
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 flex flex-col justify-center gap-lg p-[44px] max-md:p-[24px] text-on-image [text-shadow:0px_6px_24px_rgba(0,0,0,0.16)]", children: [
2923
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "m-0 text-hero-title max-w-[436px] max-md:text-secondary max-md:[text-shadow:none]", children: title }),
2924
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-md:hidden m-0 text-xs font-bold leading-5", children: description }),
2925
+ /* @__PURE__ */ jsxRuntime.jsx(
2926
+ "button",
2927
+ {
2928
+ type: "button",
2929
+ onClick: handleCtaClick,
2930
+ className: "max-md:hidden inline-flex items-center justify-center self-start h-11 px-xl bg-accent text-secondary border-none rounded-md font-[inherit] text-button cursor-pointer shadow-[inset_0_0_6px_rgba(0,0,0,0.14)] transition-colors duration-150 ease-in hover:bg-accent-hover focus-visible:outline-2 focus-visible:outline-white focus-visible:outline-offset-2",
2931
+ children: cta.label
2932
+ }
2933
+ )
2934
+ ] })
2935
+ ]
2767
2936
  }
2768
2937
  ),
2769
- /* @__PURE__ */ jsxRuntime.jsx(
2770
- "video",
2771
- {
2772
- autoPlay: true,
2773
- muted: true,
2774
- loop: true,
2775
- playsInline: true,
2776
- poster,
2777
- src: videoSrc,
2778
- className: "hidden md:block w-full h-full object-cover"
2779
- }
2780
- )
2781
- ] }),
2782
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 flex flex-col justify-center gap-lg p-[44px] max-md:p-[24px] text-on-image [text-shadow:0px_6px_24px_rgba(0,0,0,0.16)]", children: [
2783
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "m-0 text-hero-title max-w-[436px] max-md:text-secondary max-md:[text-shadow:none]", children: title }),
2784
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-md:hidden m-0 text-xs font-bold leading-5", children: description }),
2785
- /* @__PURE__ */ jsxRuntime.jsx(
2786
- "button",
2787
- {
2788
- type: "button",
2789
- onClick: handleCtaClick,
2790
- className: "max-md:hidden inline-flex items-center justify-center self-start h-11 px-xl bg-accent text-secondary border-none rounded-md font-[inherit] text-button cursor-pointer shadow-[inset_0_0_6px_rgba(0,0,0,0.14)] transition-colors duration-150 ease-in hover:bg-accent-hover focus-visible:outline-2 focus-visible:outline-white focus-visible:outline-offset-2",
2791
- children: cta.label
2792
- }
2793
- )
2794
- ] })
2795
- ] }),
2796
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative -mt-[68px] py-sm px-[25px] hidden md:block", children: [
2797
- /* @__PURE__ */ jsxRuntime.jsx(
2798
- "button",
2799
- {
2800
- type: "button",
2801
- onClick: scrollPrev,
2802
- disabled: !canPrev,
2803
- "aria-label": "Previous trips",
2804
- className: cn(arrowBase4, "left-2"),
2805
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft5, {})
2806
- }
2807
- ),
2808
- /* @__PURE__ */ jsxRuntime.jsx(
2809
- "div",
2810
- {
2811
- ref: trackRef,
2812
- className: "flex gap-sm overflow-x-auto snap-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
2813
- children: trips.map((trip) => /* @__PURE__ */ jsxRuntime.jsx(
2814
- TripCategoryCard,
2938
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative -mt-[68px] py-sm px-[25px] hidden md:block", children: [
2939
+ /* @__PURE__ */ jsxRuntime.jsx(
2940
+ "button",
2815
2941
  {
2816
- image: trip.image,
2817
- alt: trip.alt,
2818
- destination: trip.destination,
2819
- startingPrice: trip.startingPrice,
2820
- href: trip.href
2821
- },
2822
- `${trip.image}|${trip.destination}`
2823
- ))
2824
- }
2825
- ),
2826
- /* @__PURE__ */ jsxRuntime.jsx(
2827
- "button",
2828
- {
2829
- type: "button",
2830
- onClick: scrollNext,
2831
- disabled: !canNext,
2832
- "aria-label": "Next trips",
2833
- className: cn(arrowBase4, "right-2"),
2834
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight5, {})
2835
- }
2836
- ),
2837
- /* @__PURE__ */ jsxRuntime.jsx(
2838
- "div",
2839
- {
2840
- role: "progressbar",
2841
- "aria-valuenow": Math.round(scrollProgress * 100),
2842
- "aria-valuemin": 0,
2843
- "aria-valuemax": 100,
2844
- "aria-label": "Scroll position",
2845
- className: "relative w-[120px] h-[6px] mt-md mx-auto bg-track rounded-[32px] overflow-hidden",
2846
- children: /* @__PURE__ */ jsxRuntime.jsx(
2847
- "span",
2942
+ type: "button",
2943
+ onClick: scrollPrev,
2944
+ disabled: !canPrev,
2945
+ "aria-label": "Previous trips",
2946
+ className: cn(arrowBase4, "left-2"),
2947
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft5, {})
2948
+ }
2949
+ ),
2950
+ /* @__PURE__ */ jsxRuntime.jsx(
2951
+ "div",
2848
2952
  {
2849
- className: "absolute top-0 left-0 h-full bg-primary rounded-[32px] transition-[width] duration-200 ease-in",
2850
- style: { width: `${progressWidth}px` }
2953
+ ref: trackRef,
2954
+ className: "flex gap-sm overflow-x-auto snap-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
2955
+ children: trips.map((trip) => /* @__PURE__ */ jsxRuntime.jsx(
2956
+ TripCategoryCard,
2957
+ {
2958
+ image: trip.image,
2959
+ mobileImage: trip.mobileImage,
2960
+ alt: trip.alt,
2961
+ destination: trip.destination,
2962
+ startingPrice: trip.startingPrice,
2963
+ href: trip.href
2964
+ },
2965
+ `${trip.image}|${trip.destination}`
2966
+ ))
2967
+ }
2968
+ ),
2969
+ /* @__PURE__ */ jsxRuntime.jsx(
2970
+ "button",
2971
+ {
2972
+ type: "button",
2973
+ onClick: scrollNext,
2974
+ disabled: !canNext,
2975
+ "aria-label": "Next trips",
2976
+ className: cn(arrowBase4, "right-2"),
2977
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight5, {})
2978
+ }
2979
+ ),
2980
+ /* @__PURE__ */ jsxRuntime.jsx(
2981
+ "div",
2982
+ {
2983
+ role: "progressbar",
2984
+ "aria-valuenow": Math.round(scrollProgress * 100),
2985
+ "aria-valuemin": 0,
2986
+ "aria-valuemax": 100,
2987
+ "aria-label": "Scroll position",
2988
+ className: "relative w-[120px] h-[6px] mt-md mx-auto bg-track rounded-[32px] overflow-hidden",
2989
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2990
+ "span",
2991
+ {
2992
+ className: "absolute top-0 left-0 h-full bg-primary rounded-[32px] transition-[width] duration-200 ease-in",
2993
+ style: { width: `${progressWidth}px` }
2994
+ }
2995
+ )
2851
2996
  }
2852
2997
  )
2853
- }
2854
- )
2855
- ] }),
2856
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative -mt-[60px] pb-md md:hidden flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
2857
- react$1.Swiper,
2858
- {
2859
- effect: "cards",
2860
- grabCursor: true,
2861
- modules: [modules.EffectCards],
2862
- className: "w-[74vw] [aspect-ratio:289/367]",
2863
- style: { overflow: "visible" },
2864
- children: trips.map((trip) => /* @__PURE__ */ jsxRuntime.jsx(
2865
- react$1.SwiperSlide,
2998
+ ] }),
2999
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative -mt-[60px] pb-md md:hidden flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
3000
+ react$1.Swiper,
2866
3001
  {
2867
- style: { borderRadius: "12px", overflow: "hidden" },
2868
- children: /* @__PURE__ */ jsxRuntime.jsx(
2869
- TripCategoryCard,
3002
+ effect: "cards",
3003
+ grabCursor: true,
3004
+ modules: [modules.EffectCards],
3005
+ className: "w-[74vw] [aspect-ratio:289/367]",
3006
+ style: { overflow: "visible" },
3007
+ children: trips.map((trip) => /* @__PURE__ */ jsxRuntime.jsx(
3008
+ react$1.SwiperSlide,
2870
3009
  {
2871
- image: trip.image,
2872
- alt: trip.alt,
2873
- destination: trip.destination,
2874
- startingPrice: trip.startingPrice,
2875
- href: trip.href,
2876
- className: "w-full h-full rounded-xl shrink-0"
2877
- }
2878
- )
2879
- },
2880
- `${trip.image}|${trip.destination}|mobile`
2881
- ))
2882
- }
2883
- ) })
2884
- ] });
3010
+ style: { borderRadius: "12px", overflow: "hidden" },
3011
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3012
+ TripCategoryCard,
3013
+ {
3014
+ image: trip.image,
3015
+ mobileImage: trip.mobileImage,
3016
+ alt: trip.alt,
3017
+ destination: trip.destination,
3018
+ startingPrice: trip.startingPrice,
3019
+ href: trip.href,
3020
+ className: "w-full h-full rounded-xl shrink-0"
3021
+ }
3022
+ )
3023
+ },
3024
+ `${trip.image}|${trip.destination}|mobile`
3025
+ ))
3026
+ }
3027
+ ) })
3028
+ ]
3029
+ }
3030
+ );
2885
3031
  }
2886
3032
  );
2887
3033
  TripsCategorySection.displayName = "TripsCategorySection";