@harshit-wander/component-lib 1.1.1 → 1.1.3

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.js CHANGED
@@ -238,7 +238,7 @@ function FieldShell({
238
238
  children
239
239
  ] }) });
240
240
  }
241
- var cardClass = "shrink-0 flex flex-col items-center gap-sm w-[88px] no-underline text-inherit focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2 focus-visible:rounded-md";
241
+ var cardClass = "shrink-0 flex flex-col items-center gap-sm w-[66px] no-underline text-inherit focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2 focus-visible:rounded-md";
242
242
  var DestinationCard = forwardRef(
243
243
  ({ image, alt, label, href, className, ...rest }, ref) => {
244
244
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -247,7 +247,7 @@ var DestinationCard = forwardRef(
247
247
  {
248
248
  src: image,
249
249
  alt,
250
- className: "w-[88px] h-[88px] rounded-full object-cover bg-border"
250
+ className: "w-[66px] h-[66px] rounded-full object-cover bg-border"
251
251
  }
252
252
  ),
253
253
  /* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-5 text-secondary text-center whitespace-nowrap", children: label })
@@ -679,8 +679,8 @@ var PackageCard = forwardRef(
679
679
  }
680
680
  ),
681
681
  /* @__PURE__ */ jsxs("div", { className: "relative inline-flex items-center self-start gap-xs py-[4px] px-md bg-accent border border-surface rounded-full", children: [
682
- originalPrice ? /* @__PURE__ */ jsx("span", { className: "relative text-2xs font-normal leading-18 text-strike after:content-[''] after:absolute after:left-[-2px] after:right-[-2px] after:top-1/2 after:h-px after:bg-strike after:rotate-[-8deg]", children: originalPrice }) : null,
683
- /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold leading-4 text-text-deep", children: currentPrice }),
682
+ originalPrice ? /* @__PURE__ */ jsx("span", { className: "relative text-[7px] font-normal leading-18 text-strike after:content-[''] after:absolute after:left-[-2px] after:right-[-2px] after:top-1/2 after:h-px after:bg-strike after:rotate-[-8deg]", children: originalPrice }) : null,
683
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold leading-4 text-text-deep", children: currentPrice }),
684
684
  /* @__PURE__ */ jsx("span", { className: "text-xs font-normal leading-4 text-text-deep", children: priceSuffix })
685
685
  ] }),
686
686
  /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col gap-md text-on-image", children: [
@@ -1315,7 +1315,7 @@ var CategoryNavbar = forwardRef(
1315
1315
  {
1316
1316
  href: logoHref,
1317
1317
  "aria-label": "Home",
1318
- className: "inline-flex items-center no-underline text-inherit h-10 shrink-0 [&>img]:h-full [&>img]:w-auto [&>img]:object-contain [&>svg]:h-full [&>svg]:w-auto [&>svg]:object-contain",
1318
+ className: "inline-flex items-center no-underline text-inherit h-[50px] shrink-0 [&>img]:h-full [&>img]:w-auto [&>img]:object-contain [&>svg]:h-full [&>svg]:w-auto [&>svg]:object-contain",
1319
1319
  children: typeof logo === "string" ? /* @__PURE__ */ jsx("img", { src: logo, alt: "" }) : logo
1320
1320
  }
1321
1321
  ) }),
@@ -1474,7 +1474,7 @@ var ContactSection = forwardRef(
1474
1474
  ref,
1475
1475
  className: cn(
1476
1476
  "flex w-full justify-center",
1477
- "lg:items-center lg:justify-between lg:gap-xl lg:py-xl lg:bg-primary lg:rounded-lg lg:shadow-card",
1477
+ "lg:items-center lg:gap-16 lg:px-xl lg:py-xl lg:bg-primary lg:rounded-lg lg:shadow-card",
1478
1478
  className
1479
1479
  ),
1480
1480
  ...rest,
@@ -1617,7 +1617,10 @@ var useScrollSnap = (itemCount) => {
1617
1617
  const scrollNext = useCallback(() => {
1618
1618
  elRef.current?.scrollBy({ left: elRef.current.clientWidth, behavior: "smooth" });
1619
1619
  }, []);
1620
- return { ref: setRef, scrollPrev, scrollNext, canPrev, canNext, activeIndex, scrollProgress };
1620
+ const scrollToStart = useCallback(() => {
1621
+ elRef.current?.scrollTo({ left: 0, behavior: "smooth" });
1622
+ }, []);
1623
+ return { ref: setRef, scrollPrev, scrollNext, scrollToStart, canPrev, canNext, activeIndex, scrollProgress };
1621
1624
  };
1622
1625
  var ChevronLeft = () => /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
1623
1626
  "path",
@@ -1646,10 +1649,26 @@ var EventCarousel = forwardRef(
1646
1649
  ref: trackRef,
1647
1650
  scrollPrev,
1648
1651
  scrollNext,
1652
+ scrollToStart,
1649
1653
  canPrev,
1650
1654
  canNext,
1651
1655
  activeIndex
1652
1656
  } = useScrollSnap(events.length);
1657
+ const canNextRef = useRef(canNext);
1658
+ useEffect(() => {
1659
+ canNextRef.current = canNext;
1660
+ }, [canNext]);
1661
+ useEffect(() => {
1662
+ if (events.length <= 1) return;
1663
+ const id = setInterval(() => {
1664
+ if (canNextRef.current) {
1665
+ scrollNext();
1666
+ } else {
1667
+ scrollToStart();
1668
+ }
1669
+ }, 5e3);
1670
+ return () => clearInterval(id);
1671
+ }, [events.length, scrollNext, scrollToStart]);
1653
1672
  return /* @__PURE__ */ jsxs(
1654
1673
  "section",
1655
1674
  {
@@ -2587,6 +2606,7 @@ var TestimonialsCarousel = forwardRef(
2587
2606
  const isControlled = activeIndex !== void 0;
2588
2607
  const [internalIndex, setInternalIndex] = useState(defaultIndex);
2589
2608
  const currentIndex = isControlled ? activeIndex : internalIndex;
2609
+ const touchStartX = useRef(null);
2590
2610
  const setIndex = (next) => {
2591
2611
  if (!isControlled) setInternalIndex(next);
2592
2612
  onActiveIndexChange?.(next);
@@ -2595,11 +2615,27 @@ var TestimonialsCarousel = forwardRef(
2595
2615
  if (!current) return null;
2596
2616
  const isFirst = currentIndex <= 0;
2597
2617
  const isLast = currentIndex >= testimonials.length - 1;
2618
+ const handleTouchStart = (e) => {
2619
+ touchStartX.current = e.touches[0]?.clientX ?? null;
2620
+ };
2621
+ const handleTouchEnd = (e) => {
2622
+ if (touchStartX.current === null) return;
2623
+ const endX = e.changedTouches[0]?.clientX;
2624
+ if (endX === void 0) return;
2625
+ const delta = touchStartX.current - endX;
2626
+ if (Math.abs(delta) > 40) {
2627
+ if (delta > 0 && !isLast) setIndex(currentIndex + 1);
2628
+ else if (delta < 0 && !isFirst) setIndex(currentIndex - 1);
2629
+ }
2630
+ touchStartX.current = null;
2631
+ };
2598
2632
  return /* @__PURE__ */ jsxs(
2599
2633
  "section",
2600
2634
  {
2601
2635
  ref,
2602
2636
  className: cn("flex flex-col items-center gap-[28px] bg-surface", className),
2637
+ onTouchStart: handleTouchStart,
2638
+ onTouchEnd: handleTouchEnd,
2603
2639
  ...rest,
2604
2640
  children: [
2605
2641
  /* @__PURE__ */ jsx(
@@ -2856,7 +2892,7 @@ var UctMobileBanner = forwardRef(
2856
2892
  "aria-hidden": "true",
2857
2893
  className: "inline-flex",
2858
2894
  style: { animation: "uct-move-arrow 1.5s infinite" },
2859
- children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
2895
+ children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
2860
2896
  "path",
2861
2897
  {
2862
2898
  d: "M13 6L19 12L13 18M5 6L11 12L5 18",