@harshit-wander/component-lib 1.1.1 → 1.1.2
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 +43 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -7
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -240,7 +240,7 @@ function FieldShell({
|
|
|
240
240
|
children
|
|
241
241
|
] }) });
|
|
242
242
|
}
|
|
243
|
-
var cardClass = "shrink-0 flex flex-col items-center gap-sm w-[
|
|
243
|
+
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";
|
|
244
244
|
var DestinationCard = react.forwardRef(
|
|
245
245
|
({ image, alt, label, href, className, ...rest }, ref) => {
|
|
246
246
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -249,7 +249,7 @@ var DestinationCard = react.forwardRef(
|
|
|
249
249
|
{
|
|
250
250
|
src: image,
|
|
251
251
|
alt,
|
|
252
|
-
className: "w-[
|
|
252
|
+
className: "w-[66px] h-[66px] rounded-full object-cover bg-border"
|
|
253
253
|
}
|
|
254
254
|
),
|
|
255
255
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium leading-5 text-secondary text-center whitespace-nowrap", children: label })
|
|
@@ -682,7 +682,7 @@ var PackageCard = react.forwardRef(
|
|
|
682
682
|
),
|
|
683
683
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative inline-flex items-center self-start gap-xs py-[4px] px-md bg-accent border border-surface rounded-full", children: [
|
|
684
684
|
originalPrice ? /* @__PURE__ */ jsxRuntime.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,
|
|
685
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
685
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold leading-4 text-text-deep", children: currentPrice }),
|
|
686
686
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-normal leading-4 text-text-deep", children: priceSuffix })
|
|
687
687
|
] }),
|
|
688
688
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col gap-md text-on-image", children: [
|
|
@@ -1317,7 +1317,7 @@ var CategoryNavbar = react.forwardRef(
|
|
|
1317
1317
|
{
|
|
1318
1318
|
href: logoHref,
|
|
1319
1319
|
"aria-label": "Home",
|
|
1320
|
-
className: "inline-flex items-center no-underline text-inherit h-
|
|
1320
|
+
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",
|
|
1321
1321
|
children: typeof logo === "string" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: "" }) : logo
|
|
1322
1322
|
}
|
|
1323
1323
|
) }),
|
|
@@ -1476,7 +1476,7 @@ var ContactSection = react.forwardRef(
|
|
|
1476
1476
|
ref,
|
|
1477
1477
|
className: cn(
|
|
1478
1478
|
"flex w-full justify-center",
|
|
1479
|
-
"lg:items-center lg:
|
|
1479
|
+
"lg:items-center lg:gap-xl lg:px-xl lg:py-xl lg:bg-primary lg:rounded-lg lg:shadow-card",
|
|
1480
1480
|
className
|
|
1481
1481
|
),
|
|
1482
1482
|
...rest,
|
|
@@ -1619,7 +1619,10 @@ var useScrollSnap = (itemCount) => {
|
|
|
1619
1619
|
const scrollNext = react.useCallback(() => {
|
|
1620
1620
|
elRef.current?.scrollBy({ left: elRef.current.clientWidth, behavior: "smooth" });
|
|
1621
1621
|
}, []);
|
|
1622
|
-
|
|
1622
|
+
const scrollToStart = react.useCallback(() => {
|
|
1623
|
+
elRef.current?.scrollTo({ left: 0, behavior: "smooth" });
|
|
1624
|
+
}, []);
|
|
1625
|
+
return { ref: setRef, scrollPrev, scrollNext, scrollToStart, canPrev, canNext, activeIndex, scrollProgress };
|
|
1623
1626
|
};
|
|
1624
1627
|
var ChevronLeft = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1625
1628
|
"path",
|
|
@@ -1648,10 +1651,26 @@ var EventCarousel = react.forwardRef(
|
|
|
1648
1651
|
ref: trackRef,
|
|
1649
1652
|
scrollPrev,
|
|
1650
1653
|
scrollNext,
|
|
1654
|
+
scrollToStart,
|
|
1651
1655
|
canPrev,
|
|
1652
1656
|
canNext,
|
|
1653
1657
|
activeIndex
|
|
1654
1658
|
} = useScrollSnap(events.length);
|
|
1659
|
+
const canNextRef = react.useRef(canNext);
|
|
1660
|
+
react.useEffect(() => {
|
|
1661
|
+
canNextRef.current = canNext;
|
|
1662
|
+
}, [canNext]);
|
|
1663
|
+
react.useEffect(() => {
|
|
1664
|
+
if (events.length <= 1) return;
|
|
1665
|
+
const id = setInterval(() => {
|
|
1666
|
+
if (canNextRef.current) {
|
|
1667
|
+
scrollNext();
|
|
1668
|
+
} else {
|
|
1669
|
+
scrollToStart();
|
|
1670
|
+
}
|
|
1671
|
+
}, 3e3);
|
|
1672
|
+
return () => clearInterval(id);
|
|
1673
|
+
}, [events.length, scrollNext, scrollToStart]);
|
|
1655
1674
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1656
1675
|
"section",
|
|
1657
1676
|
{
|
|
@@ -2589,6 +2608,7 @@ var TestimonialsCarousel = react.forwardRef(
|
|
|
2589
2608
|
const isControlled = activeIndex !== void 0;
|
|
2590
2609
|
const [internalIndex, setInternalIndex] = react.useState(defaultIndex);
|
|
2591
2610
|
const currentIndex = isControlled ? activeIndex : internalIndex;
|
|
2611
|
+
const touchStartX = react.useRef(null);
|
|
2592
2612
|
const setIndex = (next) => {
|
|
2593
2613
|
if (!isControlled) setInternalIndex(next);
|
|
2594
2614
|
onActiveIndexChange?.(next);
|
|
@@ -2597,11 +2617,27 @@ var TestimonialsCarousel = react.forwardRef(
|
|
|
2597
2617
|
if (!current) return null;
|
|
2598
2618
|
const isFirst = currentIndex <= 0;
|
|
2599
2619
|
const isLast = currentIndex >= testimonials.length - 1;
|
|
2620
|
+
const handleTouchStart = (e) => {
|
|
2621
|
+
touchStartX.current = e.touches[0]?.clientX ?? null;
|
|
2622
|
+
};
|
|
2623
|
+
const handleTouchEnd = (e) => {
|
|
2624
|
+
if (touchStartX.current === null) return;
|
|
2625
|
+
const endX = e.changedTouches[0]?.clientX;
|
|
2626
|
+
if (endX === void 0) return;
|
|
2627
|
+
const delta = touchStartX.current - endX;
|
|
2628
|
+
if (Math.abs(delta) > 40) {
|
|
2629
|
+
if (delta > 0 && !isLast) setIndex(currentIndex + 1);
|
|
2630
|
+
else if (delta < 0 && !isFirst) setIndex(currentIndex - 1);
|
|
2631
|
+
}
|
|
2632
|
+
touchStartX.current = null;
|
|
2633
|
+
};
|
|
2600
2634
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2601
2635
|
"section",
|
|
2602
2636
|
{
|
|
2603
2637
|
ref,
|
|
2604
2638
|
className: cn("flex flex-col items-center gap-[28px] bg-surface", className),
|
|
2639
|
+
onTouchStart: handleTouchStart,
|
|
2640
|
+
onTouchEnd: handleTouchEnd,
|
|
2605
2641
|
...rest,
|
|
2606
2642
|
children: [
|
|
2607
2643
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2858,7 +2894,7 @@ var UctMobileBanner = react.forwardRef(
|
|
|
2858
2894
|
"aria-hidden": "true",
|
|
2859
2895
|
className: "inline-flex",
|
|
2860
2896
|
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(
|
|
2897
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2862
2898
|
"path",
|
|
2863
2899
|
{
|
|
2864
2900
|
d: "M13 6L19 12L13 18M5 6L11 12L5 18",
|