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