@harshit-wander/component-lib 1.0.1 → 1.1.1

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
@@ -278,33 +278,50 @@ EventBanner.displayName = "EventBanner";
278
278
  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";
279
279
  var videoClass = "block w-full h-full object-cover";
280
280
  var EventVideoBanner = react.forwardRef(
281
- ({ posterUrl, videoUrl, 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: frameClass2, children: /* @__PURE__ */ jsxRuntime.jsx(
282
- "video",
283
- {
284
- src: videoUrl,
285
- poster: posterUrl,
286
- "aria-label": alt,
287
- muted: true,
288
- autoPlay: true,
289
- loop: true,
290
- playsInline: true,
291
- preload: "metadata",
292
- className: videoClass
293
- }
294
- ) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: frameClass2, children: /* @__PURE__ */ jsxRuntime.jsx(
295
- "video",
296
- {
297
- src: videoUrl,
298
- poster: posterUrl,
299
- "aria-label": alt,
300
- muted: true,
301
- autoPlay: true,
302
- loop: true,
303
- playsInline: true,
304
- preload: "metadata",
305
- className: videoClass
306
- }
307
- ) }) })
281
+ ({ posterUrl, videoUrl, alt, href, className, ...rest }, ref) => {
282
+ const videoRef = react.useRef(null);
283
+ react.useEffect(() => {
284
+ const video = videoRef.current;
285
+ if (!video || !videoUrl) return;
286
+ if (!videoUrl.includes(".m3u8")) {
287
+ video.src = videoUrl;
288
+ return;
289
+ }
290
+ if (video.canPlayType("application/vnd.apple.mpegurl")) {
291
+ video.src = videoUrl;
292
+ return;
293
+ }
294
+ let cancelled = false;
295
+ import('hls.js').then(({ default: Hls }) => {
296
+ if (cancelled || !Hls.isSupported()) return;
297
+ const hls = new Hls({ autoStartLoad: true, startLevel: -1 });
298
+ hls.loadSource(videoUrl);
299
+ hls.attachMedia(video);
300
+ video._hls = hls;
301
+ });
302
+ return () => {
303
+ cancelled = true;
304
+ const stored = video._hls;
305
+ stored?.destroy();
306
+ };
307
+ }, [videoUrl]);
308
+ const videoEl = /* @__PURE__ */ jsxRuntime.jsx(
309
+ "video",
310
+ {
311
+ ref: videoRef,
312
+ src: videoUrl?.includes(".m3u8") ? void 0 : videoUrl,
313
+ poster: posterUrl,
314
+ "aria-label": alt,
315
+ muted: true,
316
+ autoPlay: true,
317
+ loop: true,
318
+ playsInline: true,
319
+ preload: "metadata",
320
+ className: videoClass
321
+ }
322
+ );
323
+ 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 }) });
324
+ }
308
325
  );
309
326
  EventVideoBanner.displayName = "EventVideoBanner";
310
327
  var ExpandableValueCard = react.forwardRef(
@@ -2790,6 +2807,94 @@ var TripsCategorySection = react.forwardRef(
2790
2807
  }
2791
2808
  );
2792
2809
  TripsCategorySection.displayName = "TripsCategorySection";
2810
+ var UCT_VIDEO_DEFAULT = "https://wanderon-video.gumlet.io/upcoming-community-trips-a.mp4";
2811
+ var UCT_POSTER_DEFAULT = "https://wanderon-images.gumlet.io/uct-thumbnail.jpg?updatedAt=1739361886945";
2812
+ var UctMobileBanner = react.forwardRef(
2813
+ ({
2814
+ href,
2815
+ videoUrl = UCT_VIDEO_DEFAULT,
2816
+ posterUrl = UCT_POSTER_DEFAULT,
2817
+ LinkComponent,
2818
+ className,
2819
+ ...rest
2820
+ }, ref) => {
2821
+ const Link = LinkComponent ?? "a";
2822
+ return /* @__PURE__ */ jsxRuntime.jsx(
2823
+ Link,
2824
+ {
2825
+ ref,
2826
+ href,
2827
+ className: cn(
2828
+ "flex justify-center no-underline outline-none select-none [-webkit-tap-highlight-color:transparent]",
2829
+ className
2830
+ ),
2831
+ ...rest,
2832
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full mx-4", children: [
2833
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-[-15px] left-[10px] w-[51px] h-[50px] rounded-full z-[6] [box-shadow:0px_4px_10px_0px_rgba(254,230,11,0.2)]", children: /* @__PURE__ */ jsxRuntime.jsx(
2834
+ "video",
2835
+ {
2836
+ src: videoUrl,
2837
+ poster: posterUrl,
2838
+ muted: true,
2839
+ loop: true,
2840
+ autoPlay: true,
2841
+ playsInline: true,
2842
+ className: "w-full h-full object-cover rounded-full"
2843
+ }
2844
+ ) }),
2845
+ /* @__PURE__ */ jsxRuntime.jsxs(
2846
+ "div",
2847
+ {
2848
+ className: "relative flex items-center justify-between overflow-hidden h-[60px] pl-[70px] pr-[10px] py-[10px] rounded-xl cursor-pointer",
2849
+ style: {
2850
+ background: "linear-gradient(90deg, #015f74 0%, #02b3da 100%)",
2851
+ boxShadow: "0px 4px 4px 0px rgba(1, 95, 116, 0.3) inset"
2852
+ },
2853
+ children: [
2854
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[#f5fdff] text-base font-medium leading-7 font-[inherit]", children: "Upcoming Community Trips" }),
2855
+ /* @__PURE__ */ jsxRuntime.jsx(
2856
+ "span",
2857
+ {
2858
+ "aria-hidden": "true",
2859
+ className: "inline-flex",
2860
+ style: { animation: "uct-move-arrow 1.5s infinite" },
2861
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
2862
+ "path",
2863
+ {
2864
+ d: "M13 6L19 12L13 18M5 6L11 12L5 18",
2865
+ stroke: "white",
2866
+ strokeWidth: "1.5",
2867
+ strokeLinecap: "round",
2868
+ strokeLinejoin: "round"
2869
+ }
2870
+ ) })
2871
+ }
2872
+ ),
2873
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[300px] h-[250px] pointer-events-none", children: [
2874
+ /* @__PURE__ */ jsxRuntime.jsx(
2875
+ "div",
2876
+ {
2877
+ className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-[#ababab] w-0 h-0",
2878
+ style: { animation: "uct-pulse-one 2s infinite 0s ease-in-out" }
2879
+ }
2880
+ ),
2881
+ /* @__PURE__ */ jsxRuntime.jsx(
2882
+ "div",
2883
+ {
2884
+ className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-[#ababab] w-0 h-0",
2885
+ style: { animation: "uct-pulse-two 2s infinite 1s ease-in-out" }
2886
+ }
2887
+ )
2888
+ ] })
2889
+ ]
2890
+ }
2891
+ )
2892
+ ] })
2893
+ }
2894
+ );
2895
+ }
2896
+ );
2897
+ UctMobileBanner.displayName = "UctMobileBanner";
2793
2898
  var ValuesSection = react.forwardRef(
2794
2899
  ({ heading: heading2, subheading, values, singleOpen = false, className, ...rest }, ref) => {
2795
2900
  const [openIndex, setOpenIndex] = react.useState(null);
@@ -3011,6 +3116,7 @@ exports.TestimonialsCarousel = TestimonialsCarousel;
3011
3116
  exports.TextSection = TextSection;
3012
3117
  exports.TripCategoryCard = TripCategoryCard;
3013
3118
  exports.TripsCategorySection = TripsCategorySection;
3119
+ exports.UctMobileBanner = UctMobileBanner;
3014
3120
  exports.ValuesSection = ValuesSection;
3015
3121
  exports.WarriorCard = WarriorCard;
3016
3122
  exports.WarriorsSection = WarriorsSection;