@harshit-wander/component-lib 1.1.11 → 1.1.13

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
@@ -14,7 +14,16 @@ var containerClass = "inline-flex flex-col items-center justify-center gap-sm p-
14
14
  var BrandLogo = react.forwardRef(
15
15
  ({ logo, name, href, className, ...rest }, ref) => {
16
16
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17
- /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: name, className: "h-[50px] w-auto max-w-full object-contain" }),
17
+ /* @__PURE__ */ jsxRuntime.jsx(
18
+ "img",
19
+ {
20
+ src: logo,
21
+ alt: name,
22
+ loading: "lazy",
23
+ decoding: "async",
24
+ className: "h-[50px] w-auto max-w-full object-contain"
25
+ }
26
+ ),
18
27
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium leading-button text-text", children: name })
19
28
  ] });
20
29
  if (href) {
@@ -251,6 +260,8 @@ var DestinationCard = react.forwardRef(
251
260
  {
252
261
  src: image,
253
262
  alt,
263
+ loading: "lazy",
264
+ decoding: "async",
254
265
  className: "w-[66px] h-[66px] rounded-full object-cover bg-border"
255
266
  }
256
267
  ),
@@ -538,6 +549,8 @@ var FeatureCard = react.forwardRef(
538
549
  src: imageUrl,
539
550
  alt: "",
540
551
  "aria-hidden": "true",
552
+ loading: "lazy",
553
+ decoding: "async",
541
554
  className: "absolute bottom-0 left-0 w-full pointer-events-none"
542
555
  }
543
556
  ) : null
@@ -609,7 +622,7 @@ var LocationCard = react.forwardRef(
609
622
  {
610
623
  "aria-hidden": "true",
611
624
  className: "flex items-center h-[50px] [&>img]:h-full [&>img]:w-auto [&>img]:max-w-full [&>img]:object-contain [&>svg]:h-full [&>svg]:w-auto [&>svg]:max-w-full [&>svg]:object-contain",
612
- children: typeof logo === "string" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: "" }) : logo
625
+ children: typeof logo === "string" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: "", loading: "lazy", decoding: "async" }) : logo
613
626
  }
614
627
  ) : null,
615
628
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "m-0 text-card-title", children: location }),
@@ -706,12 +719,13 @@ var PackageCard = react.forwardRef(
706
719
  }, ref) => {
707
720
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
708
721
  /* @__PURE__ */ jsxRuntime.jsx(
709
- "span",
722
+ "img",
710
723
  {
711
- role: "img",
712
- "aria-label": alt,
713
- className: "absolute inset-0 bg-cover bg-center pointer-events-none",
714
- style: { backgroundImage: `url(${image})` }
724
+ src: image,
725
+ alt,
726
+ loading: "lazy",
727
+ decoding: "async",
728
+ className: "absolute inset-0 w-full h-full object-cover object-center pointer-events-none"
715
729
  }
716
730
  ),
717
731
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -791,6 +805,8 @@ var TeamInfoCard = react.forwardRef(
791
805
  {
792
806
  src: image,
793
807
  alt: name,
808
+ loading: "lazy",
809
+ decoding: "async",
794
810
  className: "w-[140px] h-[140px] rounded-full object-cover shadow-card-lg"
795
811
  }
796
812
  ),
@@ -813,7 +829,7 @@ var TeamInfoCard = react.forwardRef(
813
829
  target: "_blank",
814
830
  rel: "noopener noreferrer",
815
831
  className: "inline-flex items-center justify-center w-8 h-8 text-primary no-underline text-sm transition-opacity duration-150 ease-in [&>img]:w-full [&>img]:h-full [&>img]:object-contain [&>svg]:w-full [&>svg]:h-full [&>svg]:object-contain hover:opacity-70 focus-visible:outline-2 focus-visible:outline-primary focus-visible:outline-offset-2 focus-visible:rounded-sm",
816
- children: typeof link.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: link.icon, alt: "" }) : link.icon ?? link.label
832
+ children: typeof link.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: link.icon, alt: "", loading: "lazy", decoding: "async" }) : link.icon ?? link.label
817
833
  }
818
834
  ) }, link.href)) })
819
835
  ] }) : null
@@ -1569,29 +1585,39 @@ var CtaBanner = react.forwardRef(
1569
1585
  }
1570
1586
  cta.onClick?.();
1571
1587
  };
1572
- return /* @__PURE__ */ jsxRuntime.jsx("section", { ref, className: cn("flex justify-center bg-surface", className), ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
1588
+ return /* @__PURE__ */ jsxRuntime.jsx("section", { ref, className: cn("flex justify-center bg-surface", className), ...rest, children: /* @__PURE__ */ jsxRuntime.jsxs(
1573
1589
  "div",
1574
1590
  {
1575
- className: "relative flex items-center w-full min-h-[300px] pl-[50px] rounded-md bg-cover bg-center overflow-hidden max-md:px-lg",
1576
- style: {
1577
- backgroundColor: backgroundColor ?? "var(--color-primary)",
1578
- backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0
1579
- },
1580
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-xl max-w-[550px]", children: [
1581
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-xs text-white", children: [
1582
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "m-0 text-xl font-semibold leading-button", children: title }),
1583
- subtitle ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "m-0 text-sm font-medium leading-body", children: subtitle }) : null
1584
- ] }),
1585
- /* @__PURE__ */ jsxRuntime.jsx(
1586
- "button",
1591
+ className: "relative flex items-center w-full min-h-[300px] pl-[50px] rounded-md overflow-hidden max-md:px-lg",
1592
+ style: { backgroundColor: backgroundColor ?? "var(--color-primary)" },
1593
+ children: [
1594
+ backgroundImage ? /* @__PURE__ */ jsxRuntime.jsx(
1595
+ "img",
1587
1596
  {
1588
- type: "button",
1589
- onClick: handleCtaClick,
1590
- className: "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",
1591
- children: cta.label
1597
+ src: backgroundImage,
1598
+ alt: "",
1599
+ "aria-hidden": "true",
1600
+ loading: "lazy",
1601
+ decoding: "async",
1602
+ className: "absolute inset-0 w-full h-full object-cover object-center pointer-events-none"
1592
1603
  }
1593
- )
1594
- ] })
1604
+ ) : null,
1605
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col gap-xl max-w-[550px]", children: [
1606
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-xs text-white", children: [
1607
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "m-0 text-xl font-semibold leading-button", children: title }),
1608
+ subtitle ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "m-0 text-sm font-medium leading-body", children: subtitle }) : null
1609
+ ] }),
1610
+ /* @__PURE__ */ jsxRuntime.jsx(
1611
+ "button",
1612
+ {
1613
+ type: "button",
1614
+ onClick: handleCtaClick,
1615
+ className: "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",
1616
+ children: cta.label
1617
+ }
1618
+ )
1619
+ ] })
1620
+ ]
1595
1621
  }
1596
1622
  ) });
1597
1623
  }
@@ -2161,7 +2187,8 @@ var RatingBadge = ({ logo, alt, rating, reviewCount }) => /* @__PURE__ */ jsxRun
2161
2187
  ] })
2162
2188
  ] })
2163
2189
  ] });
2164
- var sectionBase = "relative flex flex-col justify-center gap-md min-h-[420px] py-xl px-xl text-white bg-cover bg-center before:content-[''] before:absolute before:inset-0 before:pointer-events-none [&>*]:relative max-md:items-center max-md:text-center max-md:min-h-[360px] max-md:pt-xl max-md:px-md max-md:pb-0 max-md:gap-lg";
2190
+ var sectionBase = "relative flex flex-col justify-center gap-md min-h-[420px] py-xl px-xl text-white overflow-hidden before:content-[''] before:absolute before:inset-0 before:pointer-events-none [&>:not(img)]:relative max-md:items-center max-md:text-center max-md:min-h-[360px] max-md:pt-xl max-md:px-md max-md:pb-0 max-md:gap-lg";
2191
+ var backgroundImageClass = "absolute inset-0 w-full h-full object-cover object-center pointer-events-none -z-10";
2165
2192
  var Hero = react.forwardRef((props, ref) => {
2166
2193
  const variant = props.variant ?? "centered";
2167
2194
  if (variant === "reviews") {
@@ -2186,12 +2213,20 @@ var Hero = react.forwardRef((props, ref) => {
2186
2213
  backgroundImage2 ? "before:bg-black/45" : "before:bg-transparent",
2187
2214
  className2
2188
2215
  ),
2189
- style: {
2190
- backgroundColor: backgroundColor2 ?? "var(--color-primary)",
2191
- backgroundImage: backgroundImage2 ? `url(${backgroundImage2})` : void 0
2192
- },
2216
+ style: { backgroundColor: backgroundColor2 ?? "var(--color-primary)" },
2193
2217
  ...rest2,
2194
2218
  children: [
2219
+ backgroundImage2 ? /* @__PURE__ */ jsxRuntime.jsx(
2220
+ "img",
2221
+ {
2222
+ src: backgroundImage2,
2223
+ alt: "",
2224
+ "aria-hidden": "true",
2225
+ loading: "lazy",
2226
+ decoding: "async",
2227
+ className: backgroundImageClass
2228
+ }
2229
+ ) : null,
2195
2230
  /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "absolute top-0 left-0 right-0 h-[3px] bg-primary" }),
2196
2231
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-stretch gap-md before:content-[''] before:w-1 before:bg-accent before:rounded-sm max-md:justify-center max-md:gap-0 max-md:before:hidden", children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "m-0 text-2xl font-bold leading-heading max-w-[760px] max-md:text-xl", children: title2 }) }),
2197
2232
  subtitle2 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "inline-block m-0 py-sm px-md bg-accent text-secondary text-md font-semibold leading-button max-md:bg-transparent max-md:text-accent max-md:p-0 max-md:self-center", children: subtitle2 }) : null,
@@ -2220,12 +2255,20 @@ var Hero = react.forwardRef((props, ref) => {
2220
2255
  backgroundImage ? "before:bg-black/45" : "before:bg-transparent",
2221
2256
  className
2222
2257
  ),
2223
- style: {
2224
- backgroundColor: backgroundColor ?? "var(--color-primary)",
2225
- backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0
2226
- },
2258
+ style: { backgroundColor: backgroundColor ?? "var(--color-primary)" },
2227
2259
  ...rest,
2228
2260
  children: [
2261
+ backgroundImage ? /* @__PURE__ */ jsxRuntime.jsx(
2262
+ "img",
2263
+ {
2264
+ src: backgroundImage,
2265
+ alt: "",
2266
+ "aria-hidden": "true",
2267
+ loading: "lazy",
2268
+ decoding: "async",
2269
+ className: backgroundImageClass
2270
+ }
2271
+ ) : null,
2229
2272
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "m-0 text-2xl font-bold leading-heading max-w-[760px] max-md:text-xl", children: title }),
2230
2273
  subtitle ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "m-0 max-w-[640px] text-lg font-normal leading-body opacity-95", children: subtitle }) : null
2231
2274
  ]
@@ -3043,6 +3086,12 @@ var UctMobileBanner = react.forwardRef(
3043
3086
  ...rest
3044
3087
  }, ref) => {
3045
3088
  const Link = LinkComponent ?? "a";
3089
+ const videoRef = react.useRef(null);
3090
+ react.useEffect(() => {
3091
+ const video = videoRef.current;
3092
+ if (!video || !videoUrl) return;
3093
+ video.src = videoUrl;
3094
+ }, [videoUrl]);
3046
3095
  return /* @__PURE__ */ jsxRuntime.jsx(
3047
3096
  Link,
3048
3097
  {
@@ -3057,12 +3106,13 @@ var UctMobileBanner = react.forwardRef(
3057
3106
  /* @__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(
3058
3107
  "video",
3059
3108
  {
3060
- src: videoUrl,
3109
+ ref: videoRef,
3061
3110
  poster: posterUrl,
3062
3111
  muted: true,
3063
3112
  loop: true,
3064
3113
  autoPlay: true,
3065
3114
  playsInline: true,
3115
+ preload: "metadata",
3066
3116
  className: "w-full h-full object-cover rounded-full"
3067
3117
  }
3068
3118
  ) }),