@zenpatient-org/healthspan-marketing-ui 0.1.111 → 0.1.113
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/components/ComplexImageCarousel/SimpleImageCarousel/simpleImageCarousel.module.css.cjs.js +1 -1
- package/dist/components/ComplexImageCarousel/SimpleImageCarousel/simpleImageCarousel.module.css.es.js +7 -5
- package/dist/components/ComplexImageCarousel/useComplexImageCarousel.cjs.js +1 -1
- package/dist/components/ComplexImageCarousel/useComplexImageCarousel.es.js +29 -29
- package/dist/components/HighlightedTitle/HighlightedTitle.cjs.js +1 -1
- package/dist/components/HighlightedTitle/HighlightedTitle.es.js +16 -16
- package/dist/components/StepsCarousel/StepsCarousel.cjs.js +1 -1
- package/dist/components/StepsCarousel/StepsCarousel.es.js +71 -61
- package/dist/healthspan-marketing-ui.css +1 -1
- package/dist/modules/CallToAction/CallToAction.cjs.js +1 -1
- package/dist/modules/CallToAction/CallToAction.es.js +17 -18
- package/dist/modules/HSModal/HSModal.cjs.js +1 -1
- package/dist/modules/HSModal/HSModal.es.js +4 -4
- package/dist/modules/HSModal/components/MailchimpModal/mailchimpModal.module.css.cjs.js +1 -1
- package/dist/modules/HSModal/components/MailchimpModal/mailchimpModal.module.css.es.js +16 -18
- package/dist/modules/HSModal/index.d.ts +1 -1
- package/dist/modules/HSModal/useHSModal.cjs.js +1 -1
- package/dist/modules/HSModal/useHSModal.d.ts +2 -2
- package/dist/modules/HSModal/useHSModal.es.js +46 -44
- package/dist/modules/IndividualProductCard/components/PlanCard/PlanCard.cjs.js +1 -1
- package/dist/modules/IndividualProductCard/components/PlanCard/PlanCard.es.js +18 -14
- package/dist/modules/IndividualProductCard/types.d.ts +1 -0
- package/dist/modules/LongevityPathways/LongevityPathways.cjs.js +1 -1
- package/dist/modules/LongevityPathways/LongevityPathways.es.js +8 -7
- package/dist/modules/OptimalHealth/components/ClockImages/ClockImages.cjs.js +1 -1
- package/dist/modules/OptimalHealth/components/ClockImages/ClockImages.es.js +36 -37
- package/dist/modules/ResearchStudies/ResearchStudies.cjs.js +1 -1
- package/dist/modules/ResearchStudies/ResearchStudies.es.js +10 -10
- package/dist/modules/Reviews/Reviews.cjs.js +1 -1
- package/dist/modules/Reviews/Reviews.es.js +27 -22
- package/dist/modules/Reviews/components/ReviewList/ReviewList.cjs.js +1 -1
- package/dist/modules/Reviews/components/ReviewList/ReviewList.d.ts +2 -1
- package/dist/modules/Reviews/components/ReviewList/ReviewList.es.js +35 -16
- package/dist/modules/Reviews/components/ReviewList/reviewList.module.css.cjs.js +1 -1
- package/dist/modules/Reviews/components/ReviewList/reviewList.module.css.es.js +10 -4
- package/dist/modules/Reviews/reviews.module.css.cjs.js +1 -1
- package/dist/modules/Reviews/reviews.module.css.es.js +7 -11
- package/dist/pageComponents/TreatmentsHero/components/TreatmentHeroCard/TreatmentHeroCard.cjs.js +1 -1
- package/dist/pageComponents/TreatmentsHero/components/TreatmentHeroCard/TreatmentHeroCard.es.js +17 -7
- package/dist/pageComponents/TreatmentsHero/components/TreatmentHeroCard/treatmentHeroCard.module.css.cjs.js +1 -1
- package/dist/pageComponents/TreatmentsHero/components/TreatmentHeroCard/treatmentHeroCard.module.css.es.js +9 -7
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="simpleImageCarousel-module__simpleContainer___ic1jr",
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="simpleImageCarousel-module__simpleContainer___ic1jr",l="simpleImageCarousel-module__simpleContent___FGCNH",s="simpleImageCarousel-module__simpleItemWrapper___Z9nwO",i="simpleImageCarousel-module__simpleItem___91wGk",m="simpleImageCarousel-module__simpleTitle___FOcTx",t="simpleImageCarousel-module__simpleDescription___dV2Sv",p={simpleContainer:e,simpleContent:l,simpleItemWrapper:s,simpleItem:i,simpleTitle:m,simpleDescription:t};exports.default=p;exports.simpleContainer=e;exports.simpleContent=l;exports.simpleDescription=t;exports.simpleItem=i;exports.simpleItemWrapper=s;exports.simpleTitle=m;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
const e = "simpleImageCarousel-module__simpleContainer___ic1jr", s = "simpleImageCarousel-module__simpleContent___FGCNH", m = "simpleImageCarousel-module__simpleItemWrapper___Z9nwO", l = "simpleImageCarousel-module__simpleItem___91wGk", i = "simpleImageCarousel-
|
|
1
|
+
const e = "simpleImageCarousel-module__simpleContainer___ic1jr", s = "simpleImageCarousel-module__simpleContent___FGCNH", m = "simpleImageCarousel-module__simpleItemWrapper___Z9nwO", l = "simpleImageCarousel-module__simpleItem___91wGk", i = "simpleImageCarousel-module__simpleTitle___FOcTx", p = "simpleImageCarousel-module__simpleDescription___dV2Sv", t = {
|
|
2
2
|
simpleContainer: e,
|
|
3
3
|
simpleContent: s,
|
|
4
4
|
simpleItemWrapper: m,
|
|
5
5
|
simpleItem: l,
|
|
6
|
-
|
|
6
|
+
simpleTitle: i,
|
|
7
|
+
simpleDescription: p
|
|
7
8
|
};
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
t as default,
|
|
10
11
|
e as simpleContainer,
|
|
11
12
|
s as simpleContent,
|
|
12
|
-
|
|
13
|
+
p as simpleDescription,
|
|
13
14
|
l as simpleItem,
|
|
14
|
-
m as simpleItemWrapper
|
|
15
|
+
m as simpleItemWrapper,
|
|
16
|
+
i as simpleTitle
|
|
15
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../../node_modules/@gsap/react/src/index.cjs.js"),c=require("../../node_modules/gsap/index.cjs.js"),x=require("../../node_modules/gsap/Flip.cjs.js"),r=require("react"),V=require("../../utils/debounce.cjs.js");c.gsap.registerPlugin(x.Flip);const D=({images:a})=>{const[d,E]=r.useState(0),[z,y]=r.useState(!1),W=r.useRef(null),o=r.useRef(null),f=r.useRef([]),m=r.useRef(null),q=r.useRef(null),C=r.useRef(null),R=r.useRef(null),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../../node_modules/@gsap/react/src/index.cjs.js"),c=require("../../node_modules/gsap/index.cjs.js"),x=require("../../node_modules/gsap/Flip.cjs.js"),r=require("react"),V=require("../../utils/debounce.cjs.js");c.gsap.registerPlugin(x.Flip);const D=({images:a})=>{const[d,E]=r.useState(0),[z,y]=r.useState(!1),W=r.useRef(null),o=r.useRef(null),f=r.useRef([]),m=r.useRef(null),q=r.useRef(null),C=r.useRef(null),R=r.useRef(null),i=["atom","small","medium","small","atom"],I=["atom","small","medium","large","x-large","large","medium","small","atom"],[l,A]=r.useState(typeof window<"u"&&window.innerWidth<=768?i:I),F=i.indexOf("medium"),P=l.indexOf("x-large"),w=r.useCallback(e=>{var L,b,v,B;if(!f.current.length)return;c.gsap.set(o.current,{height:((L=o.current)==null?void 0:L.offsetHeight)||"auto"});const g=(b=o.current)==null?void 0:b.querySelector('[data-size="x-large"]'),u=g==null?void 0:g.getBoundingClientRect(),n=(v=o.current)==null?void 0:v.querySelector('[data-size="medium"]'),h=n==null?void 0:n.getBoundingClientRect();if(window.innerWidth<=768){if(!h||!C.current)return;const t=window.innerWidth/2,s=h.left+h.width/2,p=t-s;c.gsap.set(o.current,{x:`+=${p}`});const S=C.current.querySelector(".progress-buttons");if(S){const $=S.getBoundingClientRect(),H=$.left+$.width/2,M=t-H;c.gsap.set(S,{x:`+=${M}`})}const G=t-h.width/2;c.gsap.set(m.current,{width:h.width,height:"auto",marginLeft:G})}else c.gsap.set(m.current,{width:u?u.width:"auto",height:"auto",marginLeft:u?u.left:0});(((B=m.current)==null?void 0:B.querySelectorAll(".description-item"))||[]).forEach((t,s)=>{t.style.zIndex=`${a.length-s}`}),y(!0),R.current=x.Flip.getState(f.current,{props:"width,height",simple:!0}),E(e),window.innerWidth<=768?f.current.forEach((t,s)=>{t&&s<i.length&&(i.forEach(p=>{t.classList.remove(`size-${p}`)}),t.classList.add(`size-${i[s]}`))}):f.current.forEach((t,s)=>{t&&s<l.length&&(l.forEach(p=>{t.classList.remove(`size-${p}`)}),t.classList.add(`size-${l[s]}`))}),requestAnimationFrame(()=>{x.Flip.from(R.current,{duration:.5,ease:"power3.out",targets:f.current,scale:!1,nested:!0,onComplete:()=>{y(!1)}}),c.gsap.fromTo(q.current,{opacity:0,y:20},{opacity:1,y:0,duration:.5,ease:"power3.out",onComplete:()=>{R.current=null}})})},[l,i,a.length]),k=()=>{if(z)return;const e=(d-1+a.length)%a.length;w(e)},O=()=>{if(z)return;const e=(d+1)%a.length;w(e)};function T(e,g){const u=[];if(typeof window<"u"&&window.innerWidth<=768)for(let n=0;n<i.length;n++)u.push(e[(g+n)%e.length]);else for(let n=0;n<l.length;n++)u.push(e[(g+n)%e.length]);return u}const j=T(a,d);return N.useGSAP(()=>{w(d),o.current&&c.gsap.set(o.current,{clearProps:"all"});const e=V.default(()=>{A(window.innerWidth<=768?i:I),w(d)},600);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),{containerRef:W,carouselRef:o,imageRefs:f,descriptionRef:m,descriptionItemRef:q,progressButtonContainerRef:C,visible:j,cardSizes:l,handleCustomPrevClick:k,handleCustomNextClick:O,current:d,mobileCardIndex:F,xLargeCardIndex:P}};exports.useComplexImageCarousel=D;
|
|
@@ -5,20 +5,20 @@ import { useState as S, useRef as l, useCallback as J } from "react";
|
|
|
5
5
|
import K from "../../utils/debounce.es.js";
|
|
6
6
|
c.registerPlugin(x);
|
|
7
7
|
const _ = ({ images: a }) => {
|
|
8
|
-
const [d, q] = S(0), [y, L] = S(!1), A = l(null),
|
|
9
|
-
typeof window < "u" && window.innerWidth <= 768 ?
|
|
10
|
-
), P =
|
|
8
|
+
const [d, q] = S(0), [y, L] = S(!1), A = l(null), s = l(null), f = l([]), p = l(null), I = l(null), C = l(null), z = l(null), o = ["atom", "small", "medium", "small", "atom"], B = ["atom", "small", "medium", "large", "x-large", "large", "medium", "small", "atom"], [u, k] = S(
|
|
9
|
+
typeof window < "u" && window.innerWidth <= 768 ? o : B
|
|
10
|
+
), P = o.indexOf("medium"), O = u.indexOf("x-large"), w = J(
|
|
11
11
|
(e) => {
|
|
12
12
|
var b, v, E, W;
|
|
13
13
|
if (!f.current.length) return;
|
|
14
|
-
c.set(
|
|
15
|
-
height: ((b =
|
|
14
|
+
c.set(s.current, {
|
|
15
|
+
height: ((b = s.current) == null ? void 0 : b.offsetHeight) || "auto"
|
|
16
16
|
});
|
|
17
|
-
const h = (v =
|
|
17
|
+
const h = (v = s.current) == null ? void 0 : v.querySelector('[data-size="x-large"]'), i = h == null ? void 0 : h.getBoundingClientRect(), n = (E = s.current) == null ? void 0 : E.querySelector('[data-size="medium"]'), m = n == null ? void 0 : n.getBoundingClientRect();
|
|
18
18
|
if (window.innerWidth <= 768) {
|
|
19
19
|
if (!m || !C.current) return;
|
|
20
|
-
const t = window.innerWidth / 2,
|
|
21
|
-
c.set(
|
|
20
|
+
const t = window.innerWidth / 2, r = m.left + m.width / 2, g = t - r;
|
|
21
|
+
c.set(s.current, {
|
|
22
22
|
x: `+=${g}`
|
|
23
23
|
});
|
|
24
24
|
const R = C.current.querySelector(
|
|
@@ -33,28 +33,28 @@ const _ = ({ images: a }) => {
|
|
|
33
33
|
const N = t - m.width / 2;
|
|
34
34
|
c.set(p.current, {
|
|
35
35
|
width: m.width,
|
|
36
|
-
height:
|
|
36
|
+
height: "auto",
|
|
37
37
|
marginLeft: N
|
|
38
38
|
});
|
|
39
39
|
} else
|
|
40
40
|
c.set(p.current, {
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
43
|
-
marginLeft:
|
|
41
|
+
width: i ? i.width : "auto",
|
|
42
|
+
height: "auto",
|
|
43
|
+
marginLeft: i ? i.left : 0
|
|
44
44
|
});
|
|
45
|
-
(((W = p.current) == null ? void 0 : W.querySelectorAll(".description-item")) || []).forEach((t,
|
|
46
|
-
t.style.zIndex = `${a.length -
|
|
45
|
+
(((W = p.current) == null ? void 0 : W.querySelectorAll(".description-item")) || []).forEach((t, r) => {
|
|
46
|
+
t.style.zIndex = `${a.length - r}`;
|
|
47
47
|
}), L(!0), z.current = x.getState(f.current, {
|
|
48
48
|
props: "width,height",
|
|
49
49
|
simple: !0
|
|
50
|
-
}), q(e), window.innerWidth <= 768 ? f.current.forEach((t,
|
|
51
|
-
t &&
|
|
50
|
+
}), q(e), window.innerWidth <= 768 ? f.current.forEach((t, r) => {
|
|
51
|
+
t && r < o.length && (o.forEach((g) => {
|
|
52
52
|
t.classList.remove(`size-${g}`);
|
|
53
|
-
}), t.classList.add(`size-${
|
|
54
|
-
}) : f.current.forEach((t,
|
|
55
|
-
t &&
|
|
53
|
+
}), t.classList.add(`size-${o[r]}`));
|
|
54
|
+
}) : f.current.forEach((t, r) => {
|
|
55
|
+
t && r < u.length && (u.forEach((g) => {
|
|
56
56
|
t.classList.remove(`size-${g}`);
|
|
57
|
-
}), t.classList.add(`size-${u[
|
|
57
|
+
}), t.classList.add(`size-${u[r]}`));
|
|
58
58
|
}), requestAnimationFrame(() => {
|
|
59
59
|
x.from(z.current, {
|
|
60
60
|
duration: 0.5,
|
|
@@ -83,7 +83,7 @@ const _ = ({ images: a }) => {
|
|
|
83
83
|
);
|
|
84
84
|
});
|
|
85
85
|
},
|
|
86
|
-
[u,
|
|
86
|
+
[u, o, a.length]
|
|
87
87
|
), F = () => {
|
|
88
88
|
if (y) return;
|
|
89
89
|
const e = (d - 1 + a.length) % a.length;
|
|
@@ -94,27 +94,27 @@ const _ = ({ images: a }) => {
|
|
|
94
94
|
w(e);
|
|
95
95
|
};
|
|
96
96
|
function G(e, h) {
|
|
97
|
-
const
|
|
97
|
+
const i = [];
|
|
98
98
|
if (typeof window < "u" && window.innerWidth <= 768)
|
|
99
|
-
for (let n = 0; n <
|
|
100
|
-
|
|
99
|
+
for (let n = 0; n < o.length; n++)
|
|
100
|
+
i.push(e[(h + n) % e.length]);
|
|
101
101
|
else
|
|
102
102
|
for (let n = 0; n < u.length; n++)
|
|
103
|
-
|
|
104
|
-
return
|
|
103
|
+
i.push(e[(h + n) % e.length]);
|
|
104
|
+
return i;
|
|
105
105
|
}
|
|
106
106
|
const H = G(a, d);
|
|
107
107
|
return D(() => {
|
|
108
|
-
w(d),
|
|
108
|
+
w(d), s.current && c.set(s.current, { clearProps: "all" });
|
|
109
109
|
const e = K(() => {
|
|
110
|
-
k(window.innerWidth <= 768 ?
|
|
110
|
+
k(window.innerWidth <= 768 ? o : B), w(d);
|
|
111
111
|
}, 600);
|
|
112
112
|
return window.addEventListener("resize", e), () => {
|
|
113
113
|
window.removeEventListener("resize", e);
|
|
114
114
|
};
|
|
115
115
|
}, []), {
|
|
116
116
|
containerRef: A,
|
|
117
|
-
carouselRef:
|
|
117
|
+
carouselRef: s,
|
|
118
118
|
imageRefs: f,
|
|
119
119
|
descriptionRef: p,
|
|
120
120
|
descriptionItemRef: I,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../Typography/Typography.cjs.js"),s=require("../../utils/cn/cn.cjs.js"),t=require("./highlightedTitle.module.css.cjs.js"),h=({title:i,label:r,className:l,defaultVariant:n="displayMd",as:d="h2",mobileVariant:o="headingLg",colorScheme:c="light"})=>e.jsxs("div",{"data-scheme":c,className:s.cn(t.default.root,l),children:[r&&e.jsx(a.Typography,{as:"p",defaultVariant:"labelSm",emphasis:!0,className:t.default.tag,children:r}),e.jsx(a.Typography,{as:d,defaultVariant:n,mobileVariant:o,className:s.cn(t.default.title,{[t.default.taggedTitle]:!!r}),children:typeof i=="string"?e.jsx("p",{children:i}):i})]});exports.HighlightedTitle=h;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { Typography as i } from "../Typography/Typography.es.js";
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
3
|
+
import { cn as s } from "../../utils/cn/cn.es.js";
|
|
4
|
+
import e from "./highlightedTitle.module.css.es.js";
|
|
5
5
|
const y = ({
|
|
6
|
-
title:
|
|
7
|
-
label:
|
|
6
|
+
title: r,
|
|
7
|
+
label: t,
|
|
8
8
|
className: o,
|
|
9
|
-
defaultVariant:
|
|
10
|
-
as:
|
|
11
|
-
mobileVariant:
|
|
12
|
-
colorScheme:
|
|
13
|
-
}) => /* @__PURE__ */ p("div", { "data-scheme":
|
|
14
|
-
|
|
9
|
+
defaultVariant: m = "displayMd",
|
|
10
|
+
as: d = "h2",
|
|
11
|
+
mobileVariant: h = "headingLg",
|
|
12
|
+
colorScheme: l = "light"
|
|
13
|
+
}) => /* @__PURE__ */ p("div", { "data-scheme": l, className: s(e.root, o), children: [
|
|
14
|
+
t && /* @__PURE__ */ a(i, { as: "p", defaultVariant: "labelSm", emphasis: !0, className: e.tag, children: t }),
|
|
15
15
|
/* @__PURE__ */ a(
|
|
16
16
|
i,
|
|
17
17
|
{
|
|
18
|
-
as:
|
|
19
|
-
defaultVariant:
|
|
20
|
-
mobileVariant:
|
|
21
|
-
className:
|
|
22
|
-
[
|
|
18
|
+
as: d,
|
|
19
|
+
defaultVariant: m,
|
|
20
|
+
mobileVariant: h,
|
|
21
|
+
className: s(e.title, {
|
|
22
|
+
[e.taggedTitle]: !!t
|
|
23
23
|
}),
|
|
24
|
-
children:
|
|
24
|
+
children: typeof r == "string" ? /* @__PURE__ */ a("p", { children: r }) : r
|
|
25
25
|
}
|
|
26
26
|
)
|
|
27
27
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),f=require("../../utils/cn/cn.cjs.js"),g=require("../Label/Label.cjs.js"),k=require("../ProgressButton/ProgressButton.cjs.js"),m=require("../Typography/Typography.cjs.js"),r=require("./stepsCarousel.module.css.cjs.js"),v=50,T=({steps:d,colorScheme:o})=>{const[n,y]=s.useState(0),p=s.useRef(null),b=s.useRef([]),l=s.useRef(null),h=s.useRef(null),j=s.useCallback(e=>{l.current={x:e.touches[0].clientX,y:e.touches[0].clientY}},[]),i=s.useCallback(e=>{var t;y(e),(t=b.current[e])==null||t.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[]),x=s.useCallback(()=>{if(l.current!==null&&h.current!==null){const e=h.current-l.current.x;let t=n;e>v&&n>0?t=n-1:e<-v&&n<d.length-1&&(t=n+1),t!==n&&i(t)}l.current=null,h.current=null},[n,d.length,i]);return s.useEffect(()=>{const e=p.current;if(!e)return;const t=c=>{if(l.current===null)return;const u=c.touches[0].clientX,S=c.touches[0].clientY,C=Math.abs(u-l.current.x),N=Math.abs(S-l.current.y);C>N&&(c.preventDefault(),h.current=u)};return e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchmove",t)}},[]),a.jsxs("div",{className:r.default.root,"data-scheme":o,children:[a.jsx("div",{ref:p,className:r.default.stepsContainer,"data-scheme":o,onTouchStart:j,onTouchEnd:x,children:d.map((e,t)=>{const c=n===t;return a.jsxs("button",{ref:u=>{u&&(b.current[t]=u)},className:f.cn(r.default.card,c&&r.default.cardActive),onClick:()=>i(t),type:"button",children:[a.jsx("div",{className:f.cn(r.default.imageWrapper,c&&r.default.imageWrapperActive),children:a.jsx("img",{src:e.image,alt:e.title,className:r.default.image})}),a.jsx("div",{className:r.default.stepLabel,children:c?a.jsxs(a.Fragment,{children:[a.jsx(g.Label,{size:"lg",className:r.default.desktop,color:o==="dark"?"white":"black",children:`Step ${t+1}`}),a.jsx(g.Label,{size:"sm",className:r.default.mobile,color:o==="dark"?"white":"black",children:`Step ${t+1}`})]}):a.jsxs(m.Typography,{defaultVariant:"labelSm",mobileVariant:"labelXs",emphasis:!0,className:r.default.labelText,children:["Step ",t+1]})}),a.jsxs("div",{className:r.default.textContainer,children:[a.jsx(m.Typography,{as:"h3",defaultVariant:"headingSm",mobileVariant:"headingXxs",children:e.title}),e.description&&a.jsx(m.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:r.default.cardDescription,children:e.description})]})]},`step-${t}`)})}),a.jsx("div",{className:f.cn(r.default.mobile,r.default.progressButtonContainer),children:a.jsx(k.ProgressButton,{invert:o==="dark",left:{disabled:n<=0,onClick:()=>i(n-1)},right:{disabled:n>=d.length-1,onClick:()=>i(n+1)}})})]})};exports.StepsCarousel=T;
|
|
@@ -1,116 +1,126 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Label as
|
|
6
|
-
import { ProgressButton as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
const [
|
|
11
|
-
|
|
12
|
-
}, []),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
f((n) => e > r && n > 0 ? n - 1 : e < -r && n < s.length - 1 ? n + 1 : n);
|
|
2
|
+
import { jsxs as u, jsx as a, Fragment as V } from "react/jsx-runtime";
|
|
3
|
+
import { useState as A, useRef as h, useCallback as f, useEffect as M } from "react";
|
|
4
|
+
import { cn as p } from "../../utils/cn/cn.es.js";
|
|
5
|
+
import { Label as N } from "../Label/Label.es.js";
|
|
6
|
+
import { ProgressButton as x } from "../ProgressButton/ProgressButton.es.js";
|
|
7
|
+
import { Typography as b } from "../Typography/Typography.es.js";
|
|
8
|
+
import r from "./stepsCarousel.module.css.es.js";
|
|
9
|
+
const S = 50, $ = ({ steps: d, colorScheme: i }) => {
|
|
10
|
+
const [n, k] = A(0), v = h(null), g = h([]), c = h(null), m = h(null), C = f((e) => {
|
|
11
|
+
c.current = { x: e.touches[0].clientX, y: e.touches[0].clientY };
|
|
12
|
+
}, []), s = f((e) => {
|
|
13
|
+
var t;
|
|
14
|
+
k(e), (t = g.current[e]) == null || t.scrollIntoView({ behavior: "smooth", inline: "center", block: "nearest" });
|
|
15
|
+
}, []), y = f(() => {
|
|
16
|
+
if (c.current !== null && m.current !== null) {
|
|
17
|
+
const e = m.current - c.current.x;
|
|
18
|
+
let t = n;
|
|
19
|
+
e > S && n > 0 ? t = n - 1 : e < -S && n < d.length - 1 && (t = n + 1), t !== n && s(t);
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
return
|
|
21
|
+
c.current = null, m.current = null;
|
|
22
|
+
}, [n, d.length, s]);
|
|
23
|
+
return M(() => {
|
|
24
|
+
const e = v.current;
|
|
25
|
+
if (!e) return;
|
|
26
|
+
const t = (l) => {
|
|
27
|
+
if (c.current === null) return;
|
|
28
|
+
const o = l.touches[0].clientX, E = l.touches[0].clientY, T = Math.abs(o - c.current.x), X = Math.abs(E - c.current.y);
|
|
29
|
+
T > X && (l.preventDefault(), m.current = o);
|
|
30
|
+
};
|
|
31
|
+
return e.addEventListener("touchmove", t, { passive: !1 }), () => {
|
|
32
|
+
e.removeEventListener("touchmove", t);
|
|
33
|
+
};
|
|
34
|
+
}, []), /* @__PURE__ */ u("div", { className: r.root, "data-scheme": i, children: [
|
|
25
35
|
/* @__PURE__ */ a(
|
|
26
36
|
"div",
|
|
27
37
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onTouchEnd:
|
|
33
|
-
children:
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */
|
|
38
|
+
ref: v,
|
|
39
|
+
className: r.stepsContainer,
|
|
40
|
+
"data-scheme": i,
|
|
41
|
+
onTouchStart: C,
|
|
42
|
+
onTouchEnd: y,
|
|
43
|
+
children: d.map((e, t) => {
|
|
44
|
+
const l = n === t;
|
|
45
|
+
return /* @__PURE__ */ u(
|
|
36
46
|
"button",
|
|
37
47
|
{
|
|
38
|
-
ref: (
|
|
39
|
-
|
|
48
|
+
ref: (o) => {
|
|
49
|
+
o && (g.current[t] = o);
|
|
40
50
|
},
|
|
41
|
-
className:
|
|
42
|
-
onClick: () =>
|
|
51
|
+
className: p(r.card, l && r.cardActive),
|
|
52
|
+
onClick: () => s(t),
|
|
43
53
|
type: "button",
|
|
44
54
|
children: [
|
|
45
|
-
/* @__PURE__ */ a("div", { className:
|
|
46
|
-
/* @__PURE__ */ a("div", { className:
|
|
55
|
+
/* @__PURE__ */ a("div", { className: p(r.imageWrapper, l && r.imageWrapperActive), children: /* @__PURE__ */ a("img", { src: e.image, alt: e.title, className: r.image }) }),
|
|
56
|
+
/* @__PURE__ */ a("div", { className: r.stepLabel, children: l ? /* @__PURE__ */ u(V, { children: [
|
|
47
57
|
/* @__PURE__ */ a(
|
|
48
|
-
|
|
58
|
+
N,
|
|
49
59
|
{
|
|
50
60
|
size: "lg",
|
|
51
|
-
className:
|
|
52
|
-
color:
|
|
53
|
-
children: `Step ${
|
|
61
|
+
className: r.desktop,
|
|
62
|
+
color: i === "dark" ? "white" : "black",
|
|
63
|
+
children: `Step ${t + 1}`
|
|
54
64
|
}
|
|
55
65
|
),
|
|
56
66
|
/* @__PURE__ */ a(
|
|
57
|
-
|
|
67
|
+
N,
|
|
58
68
|
{
|
|
59
69
|
size: "sm",
|
|
60
|
-
className:
|
|
61
|
-
color:
|
|
62
|
-
children: `Step ${
|
|
70
|
+
className: r.mobile,
|
|
71
|
+
color: i === "dark" ? "white" : "black",
|
|
72
|
+
children: `Step ${t + 1}`
|
|
63
73
|
}
|
|
64
74
|
)
|
|
65
|
-
] }) : /* @__PURE__ */
|
|
66
|
-
|
|
75
|
+
] }) : /* @__PURE__ */ u(
|
|
76
|
+
b,
|
|
67
77
|
{
|
|
68
78
|
defaultVariant: "labelSm",
|
|
69
79
|
mobileVariant: "labelXs",
|
|
70
80
|
emphasis: !0,
|
|
71
|
-
className:
|
|
81
|
+
className: r.labelText,
|
|
72
82
|
children: [
|
|
73
83
|
"Step ",
|
|
74
|
-
|
|
84
|
+
t + 1
|
|
75
85
|
]
|
|
76
86
|
}
|
|
77
87
|
) }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */ a(
|
|
88
|
+
/* @__PURE__ */ u("div", { className: r.textContainer, children: [
|
|
89
|
+
/* @__PURE__ */ a(b, { as: "h3", defaultVariant: "headingSm", mobileVariant: "headingXxs", children: e.title }),
|
|
80
90
|
e.description && /* @__PURE__ */ a(
|
|
81
|
-
|
|
91
|
+
b,
|
|
82
92
|
{
|
|
83
93
|
as: "p",
|
|
84
94
|
defaultVariant: "bodyMd",
|
|
85
95
|
mobileVariant: "bodySm",
|
|
86
|
-
className:
|
|
96
|
+
className: r.cardDescription,
|
|
87
97
|
children: e.description
|
|
88
98
|
}
|
|
89
99
|
)
|
|
90
100
|
] })
|
|
91
101
|
]
|
|
92
102
|
},
|
|
93
|
-
`step-${
|
|
103
|
+
`step-${t}`
|
|
94
104
|
);
|
|
95
105
|
})
|
|
96
106
|
}
|
|
97
107
|
),
|
|
98
|
-
/* @__PURE__ */ a("div", { className:
|
|
99
|
-
|
|
108
|
+
/* @__PURE__ */ a("div", { className: p(r.mobile, r.progressButtonContainer), children: /* @__PURE__ */ a(
|
|
109
|
+
x,
|
|
100
110
|
{
|
|
101
|
-
invert:
|
|
111
|
+
invert: i === "dark",
|
|
102
112
|
left: {
|
|
103
|
-
disabled:
|
|
104
|
-
onClick: () =>
|
|
113
|
+
disabled: n <= 0,
|
|
114
|
+
onClick: () => s(n - 1)
|
|
105
115
|
},
|
|
106
116
|
right: {
|
|
107
|
-
disabled:
|
|
108
|
-
onClick: () =>
|
|
117
|
+
disabled: n >= d.length - 1,
|
|
118
|
+
onClick: () => s(n + 1)
|
|
109
119
|
}
|
|
110
120
|
}
|
|
111
121
|
) })
|
|
112
122
|
] });
|
|
113
123
|
};
|
|
114
124
|
export {
|
|
115
|
-
|
|
125
|
+
$ as StepsCarousel
|
|
116
126
|
};
|