@zenpatient-org/healthspan-marketing-ui 0.1.127 → 0.1.129

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../../utils/cn/cn.cjs.js"),N=require("../../ProgressButton/ProgressButton.cjs.js"),u=require("../../Typography/Typography.cjs.js"),v=require("../useComplexImageCarousel.cjs.js"),r=require("./complexImageCarousel.module.css.cjs.js"),b=({images:a})=>{const{containerRef:m,carouselRef:f,imageRefs:p,descriptionRef:g,descriptionItemRef:h,progressButtonContainerRef:C,visible:s,cardSizes:n,handleCustomPrevClick:x,handleCustomNextClick:y,current:j,mobileCardIndex:o,xLargeCardIndex:l}=v.useComplexImageCarousel({images:a});return e.jsx("div",{className:r.default.root,children:e.jsxs("div",{ref:m,className:r.default.container,children:[e.jsx("div",{ref:f,className:r.default.carouselArea,children:s.length>0&&s.map((d,t)=>e.jsx("div",{className:i.cn(r.default.slideContainer,r.default[`size-${n[t]}`]),ref:c=>{c&&(p.current[t]=c)},"data-flip-id":`slide-${(j+t)%a.length}`,"data-size":n[t],children:e.jsx("img",{src:d.image,alt:`Slide ${t+1}`,className:r.default.image})},d.name))}),e.jsx("div",{ref:g,className:r.default.description,children:e.jsxs("div",{ref:h,className:i.cn("description-item",r.default.descriptionItem),children:[e.jsx(u.Typography,{as:"h3",defaultVariant:"headingLg",mobileVariant:"headingXxs",children:typeof window<"u"&&window.innerWidth<=768?s[o].title:s[l].title}),e.jsx(u.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:r.default.text,children:typeof window<"u"&&window.innerWidth<=768?s[o].description:s[l].description})]})}),e.jsx("div",{ref:C,className:r.default.progressButtonContainer,children:e.jsx(N.ProgressButton,{left:{onClick:x},right:{onClick:y},className:i.cn("progress-buttons",r.default.progressButton)})})]})})};exports.ComplexCarousel=b;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../../utils/cn/cn.cjs.js"),N=require("../../ProgressButton/ProgressButton.cjs.js"),c=require("../../Typography/Typography.cjs.js"),v=require("../useComplexImageCarousel.cjs.js"),r=require("./complexImageCarousel.module.css.cjs.js"),b=({images:a})=>{const{containerRef:u,carouselRef:m,imageRefs:f,descriptionRef:p,descriptionItemRef:g,progressButtonContainerRef:h,visible:s,cardSizes:n,handleCustomPrevClick:C,handleCustomNextClick:x,current:y,mobileCardIndex:o,xLargeCardIndex:l}=v.useComplexImageCarousel({images:a});return e.jsx("div",{className:r.default.root,children:e.jsxs("div",{ref:u,className:r.default.container,children:[e.jsx("div",{ref:m,className:r.default.carouselArea,children:s.length>0&&s.map((j,t)=>e.jsx("div",{className:i.cn(r.default.slideContainer,r.default[`size-${n[t]}`]),ref:d=>{d&&(f.current[t]=d)},"data-flip-id":`slide-${(y+t)%a.length}`,"data-size":n[t],children:e.jsx("img",{src:j.image,alt:`Slide ${t+1}`,className:r.default.image})},t+1))}),e.jsx("div",{ref:p,className:r.default.description,children:e.jsxs("div",{ref:g,className:i.cn("description-item",r.default.descriptionItem),children:[e.jsx(c.Typography,{as:"h3",defaultVariant:"headingLg",mobileVariant:"headingXxs",children:typeof window<"u"&&window.innerWidth<=768?s[o].title:s[l].title}),e.jsx(c.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:r.default.text,children:typeof window<"u"&&window.innerWidth<=768?s[o].description:s[l].description})]})}),e.jsx("div",{ref:h,className:r.default.progressButtonContainer,children:e.jsx(N.ProgressButton,{left:{onClick:C},right:{onClick:x},className:i.cn("progress-buttons",r.default.progressButton)})})]})})};exports.ComplexCarousel=b;
@@ -1,51 +1,52 @@
1
- import { jsx as i, jsxs as m } from "react/jsx-runtime";
1
+ "use client";
2
+ import { jsx as i, jsxs as c } from "react/jsx-runtime";
2
3
  import { cn as s } from "../../../utils/cn/cn.es.js";
3
- import { ProgressButton as x } from "../../ProgressButton/ProgressButton.es.js";
4
- import { Typography as f } from "../../Typography/Typography.es.js";
5
- import { useComplexImageCarousel as y } from "../useComplexImageCarousel.es.js";
4
+ import { ProgressButton as y } from "../../ProgressButton/ProgressButton.es.js";
5
+ import { Typography as m } from "../../Typography/Typography.es.js";
6
+ import { useComplexImageCarousel as x } from "../useComplexImageCarousel.es.js";
6
7
  import e from "./complexImageCarousel.module.css.es.js";
7
8
  const S = ({ images: o }) => {
8
9
  const {
9
- containerRef: p,
10
- carouselRef: h,
11
- imageRefs: u,
12
- descriptionRef: g,
13
- descriptionItemRef: C,
14
- progressButtonContainerRef: N,
10
+ containerRef: f,
11
+ carouselRef: p,
12
+ imageRefs: h,
13
+ descriptionRef: u,
14
+ descriptionItemRef: g,
15
+ progressButtonContainerRef: C,
15
16
  visible: r,
16
17
  cardSizes: a,
17
- handleCustomPrevClick: v,
18
- handleCustomNextClick: w,
19
- current: b,
18
+ handleCustomPrevClick: N,
19
+ handleCustomNextClick: v,
20
+ current: w,
20
21
  mobileCardIndex: n,
21
22
  xLargeCardIndex: d
22
- } = y({ images: o });
23
- return /* @__PURE__ */ i("div", { className: e.root, children: /* @__PURE__ */ m("div", { ref: p, className: e.container, children: [
24
- /* @__PURE__ */ i("div", { ref: h, className: e.carouselArea, children: r.length > 0 && r.map((l, t) => /* @__PURE__ */ i(
23
+ } = x({ images: o });
24
+ return /* @__PURE__ */ i("div", { className: e.root, children: /* @__PURE__ */ c("div", { ref: f, className: e.container, children: [
25
+ /* @__PURE__ */ i("div", { ref: p, className: e.carouselArea, children: r.length > 0 && r.map((b, t) => /* @__PURE__ */ i(
25
26
  "div",
26
27
  {
27
28
  className: s(e.slideContainer, e[`size-${a[t]}`]),
28
- ref: (c) => {
29
- c && (u.current[t] = c);
29
+ ref: (l) => {
30
+ l && (h.current[t] = l);
30
31
  },
31
- "data-flip-id": `slide-${(b + t) % o.length}`,
32
+ "data-flip-id": `slide-${(w + t) % o.length}`,
32
33
  "data-size": a[t],
33
- children: /* @__PURE__ */ i("img", { src: l.image, alt: `Slide ${t + 1}`, className: e.image })
34
+ children: /* @__PURE__ */ i("img", { src: b.image, alt: `Slide ${t + 1}`, className: e.image })
34
35
  },
35
- l.name
36
+ t + 1
36
37
  )) }),
37
- /* @__PURE__ */ i("div", { ref: g, className: e.description, children: /* @__PURE__ */ m("div", { ref: C, className: s("description-item", e.descriptionItem), children: [
38
- /* @__PURE__ */ i(f, { as: "h3", defaultVariant: "headingLg", mobileVariant: "headingXxs", children: typeof window < "u" && window.innerWidth <= 768 ? r[n].title : r[d].title }),
39
- /* @__PURE__ */ i(f, { as: "p", defaultVariant: "bodyMd", mobileVariant: "bodySm", className: e.text, children: typeof window < "u" && window.innerWidth <= 768 ? r[n].description : r[d].description })
38
+ /* @__PURE__ */ i("div", { ref: u, className: e.description, children: /* @__PURE__ */ c("div", { ref: g, className: s("description-item", e.descriptionItem), children: [
39
+ /* @__PURE__ */ i(m, { as: "h3", defaultVariant: "headingLg", mobileVariant: "headingXxs", children: typeof window < "u" && window.innerWidth <= 768 ? r[n].title : r[d].title }),
40
+ /* @__PURE__ */ i(m, { as: "p", defaultVariant: "bodyMd", mobileVariant: "bodySm", className: e.text, children: typeof window < "u" && window.innerWidth <= 768 ? r[n].description : r[d].description })
40
41
  ] }) }),
41
- /* @__PURE__ */ i("div", { ref: N, className: e.progressButtonContainer, children: /* @__PURE__ */ i(
42
- x,
42
+ /* @__PURE__ */ i("div", { ref: C, className: e.progressButtonContainer, children: /* @__PURE__ */ i(
43
+ y,
43
44
  {
44
45
  left: {
45
- onClick: v
46
+ onClick: N
46
47
  },
47
48
  right: {
48
- onClick: w
49
+ onClick: v
49
50
  },
50
51
  className: s("progress-buttons", e.progressButton)
51
52
  }
@@ -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),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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("../../node_modules/@gsap/react/src/index.cjs.js"),i=require("../../node_modules/gsap/index.cjs.js"),H=require("../../node_modules/gsap/Flip.cjs.js"),T=require("../../node_modules/gsap/Draggable.cjs.js"),s=require("react");i.gsap.registerPlugin(H.Flip);i.gsap.registerPlugin(T.Draggable);const Y=({images:c})=>{const[u,M]=s.useState(0),b=s.useRef(u);b.current=u;const[R,P]=s.useState(!1),[L,I]=s.useState(0),j=s.useRef(null),t=s.useRef(null),g=s.useRef([]),y=s.useRef(null),k=s.useRef(null),q=s.useRef(null),B=s.useRef(null),a=["atom","small","medium","large","medium","small","atom"],A=["atom","small","medium","large","x-large","large","medium","small","atom"],[d,G]=s.useState(typeof window<"u"&&window.innerWidth<=768?a:A),N=a.indexOf("large"),V=d.indexOf("x-large"),E=i.gsap.matchMedia(),f=s.useCallback(r=>{var x,p,F,O;if(!g.current.length)return;I(((x=t.current)==null?void 0:x.offsetHeight)||0);const n=(p=t.current)==null?void 0:p.querySelector('[data-size="x-large"]'),o=n==null?void 0:n.getBoundingClientRect(),e=(F=t.current)==null?void 0:F.querySelector('[data-size="large"]'),h=e==null?void 0:e.getBoundingClientRect();E.add("(max-width: 768px",()=>{var W;if(i.gsap.set(t.current,{height:L||((W=t.current)==null?void 0:W.offsetHeight)||"auto"}),!h)return;const l=window.innerWidth/2,m=h.right-h.width/2,S=l-m;if(i.gsap.set(t.current,{x:`+=${S}`}),!q.current)return;const w=q.current.querySelector(".progress-buttons");if(w){const C=w.getBoundingClientRect(),z=C.left+C.width/2,D=l-z;i.gsap.set(w,{x:`+=${D}`})}const $=l-h.width/2;i.gsap.set(y.current,{width:h.width,marginLeft:$}),g.current.forEach((C,z)=>{C&&z<a.length&&(a.forEach(D=>{C.classList.remove(`size-${D}`)}),C.classList.add(`size-${a[z]}`))})}),E.add("(min-width: 769px",()=>{var l,m;I(((l=t.current)==null?void 0:l.offsetHeight)||0),i.gsap.set(t.current,{height:L||((m=t.current)==null?void 0:m.offsetHeight)||"auto"}),i.gsap.set(y.current,{width:o?o.width:"auto",marginLeft:o?o.left:0}),g.current.forEach((S,w)=>{S&&w<d.length&&(d.forEach($=>{S.classList.remove(`size-${$}`)}),S.classList.add(`size-${d[w]}`))})}),(((O=y.current)==null?void 0:O.querySelectorAll(".description-item"))||[]).forEach((l,m)=>{l.style.zIndex=`${c.length-m}`}),P(!0),B.current=H.Flip.getState(g.current,{props:"width,height",simple:!0}),M(r),requestAnimationFrame(()=>{H.Flip.from(B.current,{duration:.5,ease:"power3.out",targets:g.current,scale:!1,nested:!0,onComplete:()=>{P(!1)}}),i.gsap.fromTo(k.current,{opacity:0,y:20},{opacity:1,y:0,duration:.5,ease:"power3.out",onComplete:()=>{B.current=null}})})},[d,a,c.length,L]),J=()=>{if(R)return;const r=(u-1+c.length)%c.length;f(r)},K=()=>{if(R)return;const r=(u+1)%c.length;f(r)};function Q(r,n){const o=[];if(typeof window<"u"&&window.innerWidth<=768)for(let e=0;e<a.length;e++)o.push(r[(n+e)%r.length]);else for(let e=0;e<d.length;e++)o.push(r[(n+e)%r.length]);return o}const U=Q(c,u);return X.useGSAP(()=>{f(u),t.current&&i.gsap.set(t.current,{clearProps:"all"});const r=()=>{G(window.innerWidth<=768?a:A),I(0),f(u)};window.addEventListener("resize",r);const n=t.current;if(n)return E.add("(max-width: 768px)",()=>{const o={x:0},e=T.Draggable.create(n,{type:"x",onDragStart:()=>{R||(o.x=n.scrollLeft+n.getBoundingClientRect().left)},onDragEnd:()=>{const v=n.scrollLeft+n.getBoundingClientRect().left-o.x,x=20;if(v>x){if(R)return;const p=(b.current-1+c.length)%c.length;f(p)}else if(v<-x){if(R)return;const p=(b.current+1)%c.length;f(p)}}});return()=>{e[0]&&e[0].kill()}}),()=>{window.removeEventListener("resize",r)}},[]),{containerRef:j,carouselRef:t,imageRefs:g,descriptionRef:y,descriptionItemRef:k,progressButtonContainerRef:q,visible:U,cardSizes:d,handleCustomPrevClick:J,handleCustomNextClick:K,current:u,mobileCardIndex:N,xLargeCardIndex:V}};exports.useComplexImageCarousel=Y;
@@ -1,72 +1,77 @@
1
- import { useGSAP as D } from "../../node_modules/@gsap/react/src/index.es.js";
2
- import { gsap as c } from "../../node_modules/gsap/index.es.js";
3
- import { Flip as x } from "../../node_modules/gsap/Flip.es.js";
4
- import { useState as S, useRef as l, useCallback as J } from "react";
5
- import K from "../../utils/debounce.es.js";
6
- c.registerPlugin(x);
7
- const _ = ({ images: a }) => {
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
- (e) => {
12
- var b, v, E, W;
1
+ import { useGSAP as Y } from "../../node_modules/@gsap/react/src/index.es.js";
2
+ import { gsap as o } from "../../node_modules/gsap/index.es.js";
3
+ import { Flip as A } from "../../node_modules/gsap/Flip.es.js";
4
+ import { Draggable as G } from "../../node_modules/gsap/Draggable.es.js";
5
+ import { useState as L, useRef as a, useCallback as Z } from "react";
6
+ o.registerPlugin(A);
7
+ o.registerPlugin(G);
8
+ const st = ({ images: i }) => {
9
+ const [c, M] = L(0), B = a(c);
10
+ B.current = c;
11
+ const [x, P] = L(!1), [E, I] = L(0), N = a(null), e = a(null), f = a([]), z = a(null), W = a(null), b = a(null), v = a(null), l = ["atom", "small", "medium", "large", "medium", "small", "atom"], D = ["atom", "small", "medium", "large", "x-large", "large", "medium", "small", "atom"], [d, V] = L(
12
+ typeof window < "u" && window.innerWidth <= 768 ? l : D
13
+ ), j = l.indexOf("large"), J = d.indexOf("x-large"), $ = o.matchMedia(), g = Z(
14
+ (r) => {
15
+ var R, m, O, F;
13
16
  if (!f.current.length) return;
14
- c.set(s.current, {
15
- height: ((b = s.current) == null ? void 0 : b.offsetHeight) || "auto"
16
- });
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
- if (window.innerWidth <= 768) {
19
- if (!m || !C.current) return;
20
- const t = window.innerWidth / 2, r = m.left + m.width / 2, g = t - r;
21
- c.set(s.current, {
22
- x: `+=${g}`
23
- });
24
- const R = C.current.querySelector(
17
+ I(((R = e.current) == null ? void 0 : R.offsetHeight) || 0);
18
+ const n = (m = e.current) == null ? void 0 : m.querySelector('[data-size="x-large"]'), s = n == null ? void 0 : n.getBoundingClientRect(), t = (O = e.current) == null ? void 0 : O.querySelector('[data-size="large"]'), h = t == null ? void 0 : t.getBoundingClientRect();
19
+ $.add("(max-width: 768px", () => {
20
+ var T;
21
+ if (o.set(e.current, {
22
+ height: E || ((T = e.current) == null ? void 0 : T.offsetHeight) || "auto"
23
+ }), !h) return;
24
+ const u = window.innerWidth / 2, p = h.right - h.width / 2, S = u - p;
25
+ if (o.set(e.current, {
26
+ x: `+=${S}`
27
+ }), !b.current) return;
28
+ const w = b.current.querySelector(
25
29
  ".progress-buttons"
26
30
  );
27
- if (R) {
28
- const $ = R.getBoundingClientRect(), V = $.left + $.width / 2, j = t - V;
29
- c.set(R, {
30
- x: `+=${j}`
31
+ if (w) {
32
+ const C = w.getBoundingClientRect(), y = C.left + C.width / 2, q = u - y;
33
+ o.set(w, {
34
+ x: `+=${q}`
31
35
  });
32
36
  }
33
- const N = t - m.width / 2;
34
- c.set(p.current, {
35
- width: m.width,
36
- height: "auto",
37
- marginLeft: N
37
+ const k = u - h.width / 2;
38
+ o.set(z.current, {
39
+ width: h.width,
40
+ marginLeft: k
41
+ }), f.current.forEach((C, y) => {
42
+ C && y < l.length && (l.forEach((q) => {
43
+ C.classList.remove(`size-${q}`);
44
+ }), C.classList.add(`size-${l[y]}`));
38
45
  });
39
- } else
40
- c.set(p.current, {
41
- width: i ? i.width : "auto",
42
- height: "auto",
43
- marginLeft: i ? i.left : 0
46
+ }), $.add("(min-width: 769px", () => {
47
+ var u, p;
48
+ I(((u = e.current) == null ? void 0 : u.offsetHeight) || 0), o.set(e.current, {
49
+ height: E || ((p = e.current) == null ? void 0 : p.offsetHeight) || "auto"
50
+ }), o.set(z.current, {
51
+ width: s ? s.width : "auto",
52
+ marginLeft: s ? s.left : 0
53
+ }), f.current.forEach((S, w) => {
54
+ S && w < d.length && (d.forEach((k) => {
55
+ S.classList.remove(`size-${k}`);
56
+ }), S.classList.add(`size-${d[w]}`));
44
57
  });
45
- (((W = p.current) == null ? void 0 : W.querySelectorAll(".description-item")) || []).forEach((t, r) => {
46
- t.style.zIndex = `${a.length - r}`;
47
- }), L(!0), z.current = x.getState(f.current, {
58
+ }), (((F = z.current) == null ? void 0 : F.querySelectorAll(".description-item")) || []).forEach((u, p) => {
59
+ u.style.zIndex = `${i.length - p}`;
60
+ }), P(!0), v.current = A.getState(f.current, {
48
61
  props: "width,height",
49
62
  simple: !0
50
- }), q(e), window.innerWidth <= 768 ? f.current.forEach((t, r) => {
51
- t && r < o.length && (o.forEach((g) => {
52
- t.classList.remove(`size-${g}`);
53
- }), t.classList.add(`size-${o[r]}`));
54
- }) : f.current.forEach((t, r) => {
55
- t && r < u.length && (u.forEach((g) => {
56
- t.classList.remove(`size-${g}`);
57
- }), t.classList.add(`size-${u[r]}`));
58
- }), requestAnimationFrame(() => {
59
- x.from(z.current, {
63
+ }), M(r), requestAnimationFrame(() => {
64
+ A.from(v.current, {
60
65
  duration: 0.5,
61
66
  ease: "power3.out",
62
67
  targets: f.current,
63
68
  scale: !1,
64
69
  nested: !0,
65
70
  onComplete: () => {
66
- L(!1);
71
+ P(!1);
67
72
  }
68
- }), c.fromTo(
69
- I.current,
73
+ }), o.fromTo(
74
+ W.current,
70
75
  {
71
76
  opacity: 0,
72
77
  y: 20
@@ -77,57 +82,82 @@ const _ = ({ images: a }) => {
77
82
  duration: 0.5,
78
83
  ease: "power3.out",
79
84
  onComplete: () => {
80
- z.current = null;
85
+ v.current = null;
81
86
  }
82
87
  }
83
88
  );
84
89
  });
85
90
  },
86
- [u, o, a.length]
87
- ), F = () => {
88
- if (y) return;
89
- const e = (d - 1 + a.length) % a.length;
90
- w(e);
91
- }, T = () => {
92
- if (y) return;
93
- const e = (d + 1) % a.length;
94
- w(e);
91
+ [d, l, i.length, E]
92
+ ), K = () => {
93
+ if (x) return;
94
+ const r = (c - 1 + i.length) % i.length;
95
+ g(r);
96
+ }, Q = () => {
97
+ if (x) return;
98
+ const r = (c + 1) % i.length;
99
+ g(r);
95
100
  };
96
- function G(e, h) {
97
- const i = [];
101
+ function U(r, n) {
102
+ const s = [];
98
103
  if (typeof window < "u" && window.innerWidth <= 768)
99
- for (let n = 0; n < o.length; n++)
100
- i.push(e[(h + n) % e.length]);
104
+ for (let t = 0; t < l.length; t++)
105
+ s.push(r[(n + t) % r.length]);
101
106
  else
102
- for (let n = 0; n < u.length; n++)
103
- i.push(e[(h + n) % e.length]);
104
- return i;
107
+ for (let t = 0; t < d.length; t++)
108
+ s.push(r[(n + t) % r.length]);
109
+ return s;
105
110
  }
106
- const H = G(a, d);
107
- return D(() => {
108
- w(d), s.current && c.set(s.current, { clearProps: "all" });
109
- const e = K(() => {
110
- k(window.innerWidth <= 768 ? o : B), w(d);
111
- }, 600);
112
- return window.addEventListener("resize", e), () => {
113
- window.removeEventListener("resize", e);
111
+ const X = U(i, c);
112
+ return Y(() => {
113
+ g(c), e.current && o.set(e.current, { clearProps: "all" });
114
+ const r = () => {
115
+ V(window.innerWidth <= 768 ? l : D), I(0), g(c);
114
116
  };
117
+ window.addEventListener("resize", r);
118
+ const n = e.current;
119
+ if (n)
120
+ return $.add("(max-width: 768px)", () => {
121
+ const s = { x: 0 }, t = G.create(n, {
122
+ type: "x",
123
+ onDragStart: () => {
124
+ x || (s.x = n.scrollLeft + n.getBoundingClientRect().left);
125
+ },
126
+ onDragEnd: () => {
127
+ const H = n.scrollLeft + n.getBoundingClientRect().left - s.x, R = 20;
128
+ if (H > R) {
129
+ if (x) return;
130
+ const m = (B.current - 1 + i.length) % i.length;
131
+ g(m);
132
+ } else if (H < -R) {
133
+ if (x) return;
134
+ const m = (B.current + 1) % i.length;
135
+ g(m);
136
+ }
137
+ }
138
+ });
139
+ return () => {
140
+ t[0] && t[0].kill();
141
+ };
142
+ }), () => {
143
+ window.removeEventListener("resize", r);
144
+ };
115
145
  }, []), {
116
- containerRef: A,
117
- carouselRef: s,
146
+ containerRef: N,
147
+ carouselRef: e,
118
148
  imageRefs: f,
119
- descriptionRef: p,
120
- descriptionItemRef: I,
121
- progressButtonContainerRef: C,
122
- visible: H,
123
- cardSizes: u,
124
- handleCustomPrevClick: F,
125
- handleCustomNextClick: T,
126
- current: d,
127
- mobileCardIndex: P,
128
- xLargeCardIndex: O
149
+ descriptionRef: z,
150
+ descriptionItemRef: W,
151
+ progressButtonContainerRef: b,
152
+ visible: X,
153
+ cardSizes: d,
154
+ handleCustomPrevClick: K,
155
+ handleCustomNextClick: Q,
156
+ current: c,
157
+ mobileCardIndex: j,
158
+ xLargeCardIndex: J
129
159
  };
130
160
  };
131
161
  export {
132
- _ as useComplexImageCarousel
162
+ st as useComplexImageCarousel
133
163
  };
@@ -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:"labelSm",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
9
  defaultVariant: m = "displayMd",
10
- as: l = "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: "labelSm", emphasis: !0, className: t.tag, children: e }),
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: l,
18
+ as: d,
19
19
  defaultVariant: m,
20
- mobileVariant: d,
21
- className: r(t.title, {
22
- [t.taggedTitle]: !!e
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
  ] });