@zenpatient-org/healthspan-marketing-ui 0.1.145 → 0.1.146

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 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:"headingSm",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
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../../utils/cn/cn.cjs.js"),v=require("../../ProgressButton/ProgressButton.cjs.js"),u=require("../../Typography/Typography.cjs.js"),b=require("../useComplexImageCarousel.cjs.js"),r=require("./complexImageCarousel.module.css.cjs.js"),I=({images:a})=>{const{MOBILE_BREAKPOINT:n,containerRef:m,carouselRef:f,imageRefs:p,descriptionRef:g,descriptionItemRef:h,progressButtonContainerRef:C,visible:s,cardSizes:o,handleCustomPrevClick:x,handleCustomNextClick:y,current:j,mobileCardIndex:l,xLargeCardIndex:d}=b.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((N,t)=>e.jsx("div",{className:i.cn(r.default.slideContainer,r.default[`size-${o[t]}`]),ref:c=>{c&&(p.current[t]=c)},"data-flip-id":`slide-${(j+t)%a.length}`,"data-size":o[t],children:e.jsx("img",{src:N.image,alt:`Slide ${t+1}`,className:r.default.image})},t+1))}),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:"headingSm",children:typeof window<"u"&&window.innerWidth<=n?s[l].title:s[d].title}),e.jsx(u.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:r.default.text,children:typeof window<"u"&&window.innerWidth<=n?s[l].description:s[d].description})]})}),e.jsx("div",{ref:C,className:r.default.progressButtonContainer,children:e.jsx(v.ProgressButton,{left:{onClick:x},right:{onClick:y},className:i.cn("progress-buttons",r.default.progressButton)})})]})})};exports.ComplexCarousel=I;
@@ -1,52 +1,53 @@
1
1
  "use client";
2
- import { jsx as i, jsxs as c } from "react/jsx-runtime";
2
+ import { jsx as i, jsxs as m } from "react/jsx-runtime";
3
3
  import { cn as s } from "../../../utils/cn/cn.es.js";
4
- import { ProgressButton as y } from "../../ProgressButton/ProgressButton.es.js";
5
- import { Typography as m } from "../../Typography/Typography.es.js";
4
+ import { ProgressButton as I } from "../../ProgressButton/ProgressButton.es.js";
5
+ import { Typography as f } from "../../Typography/Typography.es.js";
6
6
  import { useComplexImageCarousel as R } from "../useComplexImageCarousel.es.js";
7
7
  import e from "./complexImageCarousel.module.css.es.js";
8
- const z = ({ images: o }) => {
8
+ const L = ({ images: o }) => {
9
9
  const {
10
- containerRef: f,
11
- carouselRef: p,
12
- imageRefs: h,
13
- descriptionRef: u,
14
- descriptionItemRef: g,
15
- progressButtonContainerRef: C,
10
+ MOBILE_BREAKPOINT: a,
11
+ containerRef: p,
12
+ carouselRef: h,
13
+ imageRefs: u,
14
+ descriptionRef: g,
15
+ descriptionItemRef: C,
16
+ progressButtonContainerRef: N,
16
17
  visible: r,
17
- cardSizes: a,
18
- handleCustomPrevClick: N,
19
- handleCustomNextClick: v,
20
- current: w,
21
- mobileCardIndex: n,
22
- xLargeCardIndex: d
18
+ cardSizes: n,
19
+ handleCustomPrevClick: v,
20
+ handleCustomNextClick: w,
21
+ current: b,
22
+ mobileCardIndex: d,
23
+ xLargeCardIndex: l
23
24
  } = R({ 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
+ return /* @__PURE__ */ i("div", { className: e.root, children: /* @__PURE__ */ m("div", { ref: p, className: e.container, children: [
26
+ /* @__PURE__ */ i("div", { ref: h, className: e.carouselArea, children: r.length > 0 && r.map((y, t) => /* @__PURE__ */ i(
26
27
  "div",
27
28
  {
28
- className: s(e.slideContainer, e[`size-${a[t]}`]),
29
- ref: (l) => {
30
- l && (h.current[t] = l);
29
+ className: s(e.slideContainer, e[`size-${n[t]}`]),
30
+ ref: (c) => {
31
+ c && (u.current[t] = c);
31
32
  },
32
- "data-flip-id": `slide-${(w + t) % o.length}`,
33
- "data-size": a[t],
34
- children: /* @__PURE__ */ i("img", { src: b.image, alt: `Slide ${t + 1}`, className: e.image })
33
+ "data-flip-id": `slide-${(b + t) % o.length}`,
34
+ "data-size": n[t],
35
+ children: /* @__PURE__ */ i("img", { src: y.image, alt: `Slide ${t + 1}`, className: e.image })
35
36
  },
36
37
  t + 1
37
38
  )) }),
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: "headingSm", 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 })
39
+ /* @__PURE__ */ i("div", { ref: g, className: e.description, children: /* @__PURE__ */ m("div", { ref: C, className: s("description-item", e.descriptionItem), children: [
40
+ /* @__PURE__ */ i(f, { as: "h3", defaultVariant: "headingLg", mobileVariant: "headingSm", children: typeof window < "u" && window.innerWidth <= a ? r[d].title : r[l].title }),
41
+ /* @__PURE__ */ i(f, { as: "p", defaultVariant: "bodyMd", mobileVariant: "bodySm", className: e.text, children: typeof window < "u" && window.innerWidth <= a ? r[d].description : r[l].description })
41
42
  ] }) }),
42
- /* @__PURE__ */ i("div", { ref: C, className: e.progressButtonContainer, children: /* @__PURE__ */ i(
43
- y,
43
+ /* @__PURE__ */ i("div", { ref: N, className: e.progressButtonContainer, children: /* @__PURE__ */ i(
44
+ I,
44
45
  {
45
46
  left: {
46
- onClick: N
47
+ onClick: v
47
48
  },
48
49
  right: {
49
- onClick: v
50
+ onClick: w
50
51
  },
51
52
  className: s("progress-buttons", e.progressButton)
52
53
  }
@@ -54,5 +55,5 @@ const z = ({ images: o }) => {
54
55
  ] }) });
55
56
  };
56
57
  export {
57
- z as ComplexCarousel
58
+ L as ComplexCarousel
58
59
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),p=require("../../ComplexTooltip/ComplexTooltip.cjs.js");require("../../Icon/Icon.cjs.js");const o=require("../../Typography/Typography.cjs.js"),m=require("../../InfiniteScroll/InfiniteScroll.cjs.js"),e=require("./simpleImageCarousel.module.css.cjs.js"),u=({images:a})=>{const[l,r]=c.useState(null);return t.jsx("div",{className:e.default.simpleContainer,children:t.jsx(m.InfiniteScroll,{items:a,renderItem:(s,n)=>t.jsxs("div",{className:e.default.simpleItem,onMouseEnter:i=>{r({x:i.clientX,y:i.clientY})},onMouseMove:i=>{r({x:i.clientX,y:i.clientY})},children:[t.jsx(p.ComplexTooltip,{trigger:"hover",title:s.title||"",description:s.description||"",style:"light",transformMode:"absolute",transform:{top:(l==null?void 0:l.y)||0,left:l==null?void 0:l.x},children:t.jsx("img",{src:s.image,alt:s.title,className:e.default.simpleImage})}),t.jsx(o.Typography,{as:"h4",defaultVariant:"headingXs",mobileVariant:"bodyLg",className:e.default.simpleTitle,children:s.title}),t.jsx(o.Typography,{as:"p",defaultVariant:"bodySm",mobileVariant:"bodyXs",className:e.default.simpleDescription,children:s.description})]},n),itemClassName:e.default.simpleItemWrapper,contentClassName:e.default.simpleContent,rootClassName:e.default.simpleRoot})})};exports.SimpleImageCarousel=u;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),p=require("react"),m=require("../../../utils/useIsMobile.cjs.js"),u=require("../../ComplexTooltip/ComplexTooltip.cjs.js");require("../../Icon/Icon.cjs.js");const n=require("../../Typography/Typography.cjs.js"),d=require("../../InfiniteScroll/InfiniteScroll.cjs.js"),e=require("./simpleImageCarousel.module.css.cjs.js"),f=({images:a})=>{const[t,i]=p.useState(null),r=m.useIsMobile(930);return l.jsx("div",{className:e.default.simpleContainer,children:l.jsx(d.InfiniteScroll,{items:a,enableManualScroll:r,slowOnTouch:r,renderItem:(s,c)=>l.jsxs("div",{className:e.default.simpleItem,onMouseEnter:o=>{i({x:o.clientX,y:window.scrollY+o.clientY})},onMouseMove:o=>{i({x:o.clientX,y:window.scrollY+o.clientY})},children:[l.jsx(u.ComplexTooltip,{trigger:"hover",title:s.title||"",description:s.description||"",style:"light",transformMode:"absolute",transform:{top:(t==null?void 0:t.y)||0,left:t==null?void 0:t.x},children:l.jsx("img",{src:s.image,alt:s.title,className:e.default.simpleImage})}),l.jsx(n.Typography,{as:"h4",defaultVariant:"headingXs",mobileVariant:"bodyLg",className:e.default.simpleTitle,children:s.title}),l.jsx(n.Typography,{as:"p",defaultVariant:"bodySm",mobileVariant:"bodyXs",className:e.default.simpleDescription,children:s.description})]},c),itemClassName:e.default.simpleItemWrapper,contentClassName:e.default.simpleContent,rootClassName:e.default.simpleRoot})})};exports.SimpleImageCarousel=f;
@@ -1,69 +1,72 @@
1
1
  "use client";
2
- import { jsx as l, jsxs as n } from "react/jsx-runtime";
3
- import { useState as p } from "react";
4
- import { ComplexTooltip as c } from "../../ComplexTooltip/ComplexTooltip.es.js";
2
+ import { jsx as i, jsxs as p } from "react/jsx-runtime";
3
+ import { useState as c } from "react";
4
+ import { useIsMobile as d } from "../../../utils/useIsMobile.es.js";
5
+ import { ComplexTooltip as f } from "../../ComplexTooltip/ComplexTooltip.es.js";
5
6
  import "../../Icon/Icon.es.js";
6
- import { Typography as o } from "../../Typography/Typography.es.js";
7
- import { InfiniteScroll as d } from "../../InfiniteScroll/InfiniteScroll.es.js";
7
+ import { Typography as n } from "../../Typography/Typography.es.js";
8
+ import { InfiniteScroll as h } from "../../InfiniteScroll/InfiniteScroll.es.js";
8
9
  import e from "./simpleImageCarousel.module.css.es.js";
9
- const b = ({ images: m }) => {
10
- const [t, s] = p(null);
11
- return /* @__PURE__ */ l("div", { className: e.simpleContainer, children: /* @__PURE__ */ l(
12
- d,
10
+ const g = ({ images: a }) => {
11
+ const [t, s] = c(null), r = d(930);
12
+ return /* @__PURE__ */ i("div", { className: e.simpleContainer, children: /* @__PURE__ */ i(
13
+ h,
13
14
  {
14
- items: m,
15
- renderItem: (i, a) => /* @__PURE__ */ n(
15
+ items: a,
16
+ enableManualScroll: r,
17
+ slowOnTouch: r,
18
+ renderItem: (l, m) => /* @__PURE__ */ p(
16
19
  "div",
17
20
  {
18
21
  className: e.simpleItem,
19
- onMouseEnter: (r) => {
22
+ onMouseEnter: (o) => {
20
23
  s({
21
- x: r.clientX,
22
- y: r.clientY
24
+ x: o.clientX,
25
+ y: window.scrollY + o.clientY
23
26
  });
24
27
  },
25
- onMouseMove: (r) => {
28
+ onMouseMove: (o) => {
26
29
  s({
27
- x: r.clientX,
28
- y: r.clientY
30
+ x: o.clientX,
31
+ y: window.scrollY + o.clientY
29
32
  });
30
33
  },
31
34
  children: [
32
- /* @__PURE__ */ l(
33
- c,
35
+ /* @__PURE__ */ i(
36
+ f,
34
37
  {
35
38
  trigger: "hover",
36
- title: i.title || "",
37
- description: i.description || "",
39
+ title: l.title || "",
40
+ description: l.description || "",
38
41
  style: "light",
39
42
  transformMode: "absolute",
40
43
  transform: { top: (t == null ? void 0 : t.y) || 0, left: t == null ? void 0 : t.x },
41
- children: /* @__PURE__ */ l("img", { src: i.image, alt: i.title, className: e.simpleImage })
44
+ children: /* @__PURE__ */ i("img", { src: l.image, alt: l.title, className: e.simpleImage })
42
45
  }
43
46
  ),
44
- /* @__PURE__ */ l(
45
- o,
47
+ /* @__PURE__ */ i(
48
+ n,
46
49
  {
47
50
  as: "h4",
48
51
  defaultVariant: "headingXs",
49
52
  mobileVariant: "bodyLg",
50
53
  className: e.simpleTitle,
51
- children: i.title
54
+ children: l.title
52
55
  }
53
56
  ),
54
- /* @__PURE__ */ l(
55
- o,
57
+ /* @__PURE__ */ i(
58
+ n,
56
59
  {
57
60
  as: "p",
58
61
  defaultVariant: "bodySm",
59
62
  mobileVariant: "bodyXs",
60
63
  className: e.simpleDescription,
61
- children: i.description
64
+ children: l.description
62
65
  }
63
66
  )
64
67
  ]
65
68
  },
66
- a
69
+ m
67
70
  ),
68
71
  itemClassName: e.simpleItemWrapper,
69
72
  contentClassName: e.simpleContent,
@@ -72,5 +75,5 @@ const b = ({ images: m }) => {
72
75
  ) });
73
76
  };
74
77
  export {
75
- b as SimpleImageCarousel
78
+ g as SimpleImageCarousel
76
79
  };
@@ -1 +1 @@
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
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("../../node_modules/@gsap/react/src/index.cjs.js"),r=require("../../node_modules/gsap/index.cjs.js"),P=require("../../node_modules/gsap/Flip.cjs.js"),U=require("../../node_modules/gsap/Draggable.cjs.js"),c=require("react");r.gsap.registerPlugin(P.Flip);r.gsap.registerPlugin(U.Draggable);const F=12,ne=({images:i})=>{if(i.length>0&&i.length<F){const s=[...i];for(;i.length<F;)i.push(...s)}const[a,q]=c.useState(0),x=c.useRef(a);x.current=a;const[C,T]=c.useState(!1),j=c.useRef(null),t=c.useRef(null),R=c.useRef([]),I=c.useRef(null),N=c.useRef(null),S=c.useRef(null),L=c.useRef(null),u=["atom","small","medium","large","medium","small","atom"],_=["atom","small","medium","large","x-large","large","medium","small","atom"],[$,O]=c.useState(0),[g,G]=c.useState(typeof window<"u"&&window.innerWidth<=930?u:_),V=u.indexOf("large"),J=g.indexOf("x-large"),H=r.gsap.matchMedia(),h=c.useCallback(s=>{var p,K,v,D;if(!t.current)return;let o=0;if(window.innerWidth<=930){const l=t.current.querySelector('[data-size="large"]');o=l?l.offsetHeight:0}else{const l=t.current.querySelector('[data-size="x-large"]');o=l?l.offsetHeight:0,r.gsap.set(t.current,{x:0})}if(o>0&&(O(o),r.gsap.set(t.current,{height:o})),r.gsap.set((p=t.current)==null?void 0:p.querySelectorAll("[data-size]"),{y:0}),!R.current.length)return;const n=(K=t.current)==null?void 0:K.querySelector('[data-size="x-large"]'),e=n==null?void 0:n.getBoundingClientRect(),m=(v=t.current)==null?void 0:v.querySelector('[data-size="large"]'),d=m==null?void 0:m.getBoundingClientRect();H.add({isMobile:"(max-width: 930px)",isDesktop:"(min-width: 931px)"},l=>{var k,W;const{isDesktop:z,isMobile:ee}=l.conditions||{};if(O(((k=t.current)==null?void 0:k.offsetHeight)||0),r.gsap.set(t.current,{height:$||((W=t.current)==null?void 0:W.offsetHeight)||"auto"}),ee){if(!d)return;const f=window.innerWidth/2,E=d.right-d.width/2,M=f-E;if(r.gsap.set(t.current,{x:`+=${M}`}),!S.current)return;const A=S.current.querySelector(".progress-buttons");if(A){const w=A.getBoundingClientRect(),B=w.left+w.width/2,b=f-B;r.gsap.set(A,{x:`+=${b}`})}const te=f-d.width/2;r.gsap.set(I.current,{width:d.width,marginLeft:te}),R.current.forEach((w,B)=>{w&&B<u.length&&(u.forEach(b=>{w.classList.remove(`size-${b}`)}),w.classList.add(`size-${u[B]}`))})}z&&(r.gsap.set(I.current,{width:e?e.width:"auto",marginLeft:e?e.left:0}),R.current.forEach((f,E)=>{f&&E<g.length&&(g.forEach(M=>{f.classList.remove(`size-${M}`)}),f.classList.add(`size-${g[E]}`))}))}),(((D=I.current)==null?void 0:D.querySelectorAll(".description-item"))||[]).forEach((l,z)=>{l.style.zIndex=`${i.length-z}`}),T(!0),L.current=P.Flip.getState(R.current,{simple:!0}),q(s),r.gsap.delayedCall(0,()=>{P.Flip.from(L.current,{duration:.3,ease:"power3.out",absolute:!0,onComplete:()=>{T(!1)}}),r.gsap.fromTo(N.current,{opacity:0,y:20},{opacity:1,y:0,duration:.5,ease:"power3.out",onComplete:()=>{L.current=null}})})},[g,u,i.length,$]),Q=()=>{if(C)return;const s=(a-1+i.length)%i.length;h(s)},X=()=>{if(C)return;const s=(a+1)%i.length;h(s)};function Y(s,o){const n=[];if(typeof window<"u"&&window.innerWidth<=930)for(let e=0;e<u.length;e++)n.push(s[(o+e)%s.length]);else for(let e=0;e<g.length;e++)n.push(s[(o+e)%s.length]);return n}const Z=Y(i,a);return re.useGSAP(()=>{h(a);const s=()=>{G(window.innerWidth<=930?u:_),r.gsap.matchMediaRefresh(),q(0),r.gsap.delayedCall(0,()=>{if(!t.current)return;let n=0;if(window.innerWidth<=930){const e=t.current.querySelector('[data-size="large"]');n=e?e.offsetHeight:0}else{const e=t.current.querySelector('[data-size="x-large"]');n=e?e.offsetHeight:0,r.gsap.set(t.current,{x:0})}n>0&&(O(n),r.gsap.set(t.current,{height:n})),h(a)})};window.addEventListener("resize",s);const o=t.current;if(o)return H.add("(max-width: 930px)",()=>{const n={x:0},e=U.Draggable.create(o,{type:"x",onDragStart:()=>{C||(n.x=o.scrollLeft+o.getBoundingClientRect().left)},onDragEnd:()=>{const d=o.scrollLeft+o.getBoundingClientRect().left-n.x,y=20;if(d>y){if(C)return;const p=(x.current-1+i.length)%i.length;h(p)}else if(d<-y){if(C)return;const p=(x.current+1)%i.length;h(p)}}});return()=>{e[0]&&e[0].kill()}}),()=>{window.removeEventListener("resize",s)}},[]),{MOBILE_BREAKPOINT:930,containerRef:j,carouselRef:t,imageRefs:R,descriptionRef:I,descriptionItemRef:N,progressButtonContainerRef:S,visible:Z,cardSizes:g,handleCustomPrevClick:Q,handleCustomNextClick:X,current:a,mobileCardIndex:V,xLargeCardIndex:J}};exports.useComplexImageCarousel=ne;
@@ -3,6 +3,7 @@ import { TAdvancedImageView } from './types';
3
3
  export declare const useComplexImageCarousel: ({ images }: {
4
4
  images: TAdvancedImageView[];
5
5
  }) => {
6
+ MOBILE_BREAKPOINT: number;
6
7
  containerRef: import('react').RefObject<HTMLDivElement>;
7
8
  carouselRef: import('react').RefObject<HTMLDivElement>;
8
9
  imageRefs: import('react').MutableRefObject<HTMLDivElement[]>;
@@ -1,77 +1,99 @@
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";
1
+ "use client";
2
+ import { useGSAP as ne } from "../../node_modules/@gsap/react/src/index.es.js";
3
+ import { gsap as r } from "../../node_modules/gsap/index.es.js";
4
+ import { Flip as N } from "../../node_modules/gsap/Flip.es.js";
4
5
  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;
16
- if (!f.current.length) return;
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(
29
- ".progress-buttons"
30
- );
31
- if (w) {
32
- const C = w.getBoundingClientRect(), y = C.left + C.width / 2, q = u - y;
33
- o.set(w, {
34
- x: `+=${q}`
35
- });
36
- }
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]}`));
45
- });
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]}`));
6
+ import { useState as x, useRef as d, useCallback as se } from "react";
7
+ r.registerPlugin(N);
8
+ r.registerPlugin(G);
9
+ const F = 12, de = ({ images: i }) => {
10
+ if (i.length > 0 && i.length < F) {
11
+ const s = [...i];
12
+ for (; i.length < F; )
13
+ i.push(...s);
14
+ }
15
+ const [l, _] = x(0), L = d(l);
16
+ L.current = l;
17
+ const [w, b] = x(!1), V = d(null), t = d(null), C = d([]), I = d(null), H = d(null), O = d(null), S = d(null), u = ["atom", "small", "medium", "large", "medium", "small", "atom"], K = ["atom", "small", "medium", "large", "x-large", "large", "medium", "small", "atom"], [$, y] = x(0), [f, j] = x(
18
+ typeof window < "u" && window.innerWidth <= 930 ? u : K
19
+ ), J = u.indexOf("large"), Q = f.indexOf("x-large"), q = r.matchMedia(), h = se(
20
+ (s) => {
21
+ var p, k, v, W;
22
+ if (!t.current) return;
23
+ let o = 0;
24
+ if (window.innerWidth <= 930) {
25
+ const c = t.current.querySelector('[data-size="large"]');
26
+ o = c ? c.offsetHeight : 0;
27
+ } else {
28
+ const c = t.current.querySelector('[data-size="x-large"]');
29
+ o = c ? c.offsetHeight : 0, r.set(t.current, {
30
+ x: 0
57
31
  });
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, {
61
- props: "width,height",
32
+ }
33
+ if (o > 0 && (y(o), r.set(t.current, {
34
+ height: o
35
+ })), r.set((p = t.current) == null ? void 0 : p.querySelectorAll("[data-size]"), {
36
+ y: 0
37
+ }), !C.current.length) return;
38
+ const n = (k = t.current) == null ? void 0 : k.querySelector('[data-size="x-large"]'), e = n == null ? void 0 : n.getBoundingClientRect(), E = (v = t.current) == null ? void 0 : v.querySelector('[data-size="large"]'), a = E == null ? void 0 : E.getBoundingClientRect();
39
+ q.add(
40
+ {
41
+ isMobile: "(max-width: 930px)",
42
+ isDesktop: "(min-width: 931px)"
43
+ },
44
+ (c) => {
45
+ var D, U;
46
+ const { isDesktop: M, isMobile: te } = c.conditions || {};
47
+ if (y(((D = t.current) == null ? void 0 : D.offsetHeight) || 0), r.set(t.current, {
48
+ height: $ || ((U = t.current) == null ? void 0 : U.offsetHeight) || "auto"
49
+ }), te) {
50
+ if (!a) return;
51
+ const g = window.innerWidth / 2, B = a.right - a.width / 2, A = g - B;
52
+ if (r.set(t.current, {
53
+ x: `+=${A}`
54
+ }), !O.current) return;
55
+ const P = O.current.querySelector(
56
+ ".progress-buttons"
57
+ );
58
+ if (P) {
59
+ const m = P.getBoundingClientRect(), R = m.left + m.width / 2, T = g - R;
60
+ r.set(P, {
61
+ x: `+=${T}`
62
+ });
63
+ }
64
+ const re = g - a.width / 2;
65
+ r.set(I.current, {
66
+ width: a.width,
67
+ marginLeft: re
68
+ }), C.current.forEach((m, R) => {
69
+ m && R < u.length && (u.forEach((T) => {
70
+ m.classList.remove(`size-${T}`);
71
+ }), m.classList.add(`size-${u[R]}`));
72
+ });
73
+ }
74
+ M && (r.set(I.current, {
75
+ width: e ? e.width : "auto",
76
+ marginLeft: e ? e.left : 0
77
+ }), C.current.forEach((g, B) => {
78
+ g && B < f.length && (f.forEach((A) => {
79
+ g.classList.remove(`size-${A}`);
80
+ }), g.classList.add(`size-${f[B]}`));
81
+ }));
82
+ }
83
+ ), (((W = I.current) == null ? void 0 : W.querySelectorAll(".description-item")) || []).forEach((c, M) => {
84
+ c.style.zIndex = `${i.length - M}`;
85
+ }), b(!0), S.current = N.getState(C.current, {
62
86
  simple: !0
63
- }), M(r), requestAnimationFrame(() => {
64
- A.from(v.current, {
65
- duration: 0.5,
87
+ }), _(s), r.delayedCall(0, () => {
88
+ N.from(S.current, {
89
+ duration: 0.3,
66
90
  ease: "power3.out",
67
- targets: f.current,
68
- scale: !1,
69
- nested: !0,
91
+ absolute: !0,
70
92
  onComplete: () => {
71
- P(!1);
93
+ b(!1);
72
94
  }
73
- }), o.fromTo(
74
- W.current,
95
+ }), r.fromTo(
96
+ H.current,
75
97
  {
76
98
  opacity: 0,
77
99
  y: 20
@@ -82,82 +104,98 @@ const st = ({ images: i }) => {
82
104
  duration: 0.5,
83
105
  ease: "power3.out",
84
106
  onComplete: () => {
85
- v.current = null;
107
+ S.current = null;
86
108
  }
87
109
  }
88
110
  );
89
111
  });
90
112
  },
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);
113
+ [f, u, i.length, $]
114
+ ), X = () => {
115
+ if (w) return;
116
+ const s = (l - 1 + i.length) % i.length;
117
+ h(s);
118
+ }, Y = () => {
119
+ if (w) return;
120
+ const s = (l + 1) % i.length;
121
+ h(s);
100
122
  };
101
- function U(r, n) {
102
- const s = [];
103
- if (typeof window < "u" && window.innerWidth <= 768)
104
- for (let t = 0; t < l.length; t++)
105
- s.push(r[(n + t) % r.length]);
123
+ function Z(s, o) {
124
+ const n = [];
125
+ if (typeof window < "u" && window.innerWidth <= 930)
126
+ for (let e = 0; e < u.length; e++)
127
+ n.push(s[(o + e) % s.length]);
106
128
  else
107
- for (let t = 0; t < d.length; t++)
108
- s.push(r[(n + t) % r.length]);
109
- return s;
129
+ for (let e = 0; e < f.length; e++)
130
+ n.push(s[(o + e) % s.length]);
131
+ return n;
110
132
  }
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);
133
+ const ee = Z(i, l);
134
+ return ne(() => {
135
+ h(l);
136
+ const s = () => {
137
+ j(window.innerWidth <= 930 ? u : K), r.matchMediaRefresh(), _(0), r.delayedCall(0, () => {
138
+ if (!t.current) return;
139
+ let n = 0;
140
+ if (window.innerWidth <= 930) {
141
+ const e = t.current.querySelector('[data-size="large"]');
142
+ n = e ? e.offsetHeight : 0;
143
+ } else {
144
+ const e = t.current.querySelector('[data-size="x-large"]');
145
+ n = e ? e.offsetHeight : 0, r.set(t.current, {
146
+ x: 0
147
+ });
148
+ }
149
+ n > 0 && (y(n), r.set(t.current, {
150
+ height: n
151
+ })), h(l);
152
+ });
116
153
  };
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, {
154
+ window.addEventListener("resize", s);
155
+ const o = t.current;
156
+ if (o)
157
+ return q.add("(max-width: 930px)", () => {
158
+ const n = { x: 0 }, e = G.create(o, {
122
159
  type: "x",
123
160
  onDragStart: () => {
124
- x || (s.x = n.scrollLeft + n.getBoundingClientRect().left);
161
+ w || (n.x = o.scrollLeft + o.getBoundingClientRect().left);
125
162
  },
126
163
  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);
164
+ const a = o.scrollLeft + o.getBoundingClientRect().left - n.x, z = 20;
165
+ if (a > z) {
166
+ if (w) return;
167
+ const p = (L.current - 1 + i.length) % i.length;
168
+ h(p);
169
+ } else if (a < -z) {
170
+ if (w) return;
171
+ const p = (L.current + 1) % i.length;
172
+ h(p);
136
173
  }
137
174
  }
138
175
  });
139
176
  return () => {
140
- t[0] && t[0].kill();
177
+ e[0] && e[0].kill();
141
178
  };
142
179
  }), () => {
143
- window.removeEventListener("resize", r);
180
+ window.removeEventListener("resize", s);
144
181
  };
145
182
  }, []), {
146
- containerRef: N,
147
- carouselRef: e,
148
- imageRefs: f,
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
183
+ MOBILE_BREAKPOINT: 930,
184
+ containerRef: V,
185
+ carouselRef: t,
186
+ imageRefs: C,
187
+ descriptionRef: I,
188
+ descriptionItemRef: H,
189
+ progressButtonContainerRef: O,
190
+ visible: ee,
191
+ cardSizes: f,
192
+ handleCustomPrevClick: X,
193
+ handleCustomNextClick: Y,
194
+ current: l,
195
+ mobileCardIndex: J,
196
+ xLargeCardIndex: Q
159
197
  };
160
198
  };
161
199
  export {
162
- st as useComplexImageCarousel
200
+ de as useComplexImageCarousel
163
201
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../utils/cn/cn.cjs.js"),s=require("../Typography/Typography.cjs.js"),d=require("../IconBracket/IconBracket.cjs.js"),u=require("../Icon/Icon.cjs.js"),n=require("./contentTabs.module.css.cjs.js");function m({tabs:c,activeTab:t,colorScheme:r,activeWithArrow:o,onTabClick:i}){return e.jsx("div",{className:l.cn(n.default.root,n.default[r]),children:c.map(a=>e.jsxs("div",{className:n.default.tabWrap,children:[e.jsxs("button",{className:l.cn(n.default.tab,{[n.default.activeTab]:t.label===a.label}),onClick:()=>i(a),children:[t.label===a.label&&o&&e.jsx("div",{className:n.default.arrow,children:e.jsx(d.IconBracket,{variant:"arrow",size:"md",colorScheme:r})}),a.icon&&e.jsx(u.Icon,{name:a.icon,className:n.default.icon}),e.jsx(s.Typography,{defaultVariant:"headingXxs",children:a.label})]}),e.jsx("div",{className:l.cn(n.default.itemContent,{[n.default.itemContentOpen]:t.label===a.label}),children:e.jsx("div",{className:n.default.itemContentInner,children:e.jsx(s.Typography,{as:"p",defaultVariant:"bodySm",children:a.description})})})]},String(a.label)))})}exports.ContentTabs=m;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../utils/cn/cn.cjs.js"),s=require("../Typography/Typography.cjs.js"),d=require("../IconBracket/IconBracket.cjs.js"),u=require("../Icon/Icon.cjs.js"),n=require("./contentTabs.module.css.cjs.js");function m({tabs:c,activeTab:t,colorScheme:r,activeWithArrow:o,onTabClick:i}){return e.jsx("div",{className:l.cn(n.default.root,n.default[r]),children:c.map(a=>e.jsxs("div",{className:n.default.tabWrap,children:[e.jsxs("button",{className:l.cn(n.default.tab,{[n.default.activeTab]:t.label===a.label}),onClick:()=>i(a),children:[t.label===a.label&&o&&e.jsx("div",{className:n.default.arrow,children:e.jsx(d.IconBracket,{variant:"arrow",size:"md",colorScheme:r})}),a.icon&&e.jsx(u.Icon,{name:a.icon,className:n.default.icon}),e.jsx(s.Typography,{defaultVariant:"headingXxs",children:a.label})]}),e.jsx("div",{className:l.cn(n.default.itemContent,{[n.default.itemContentOpen]:t.label===a.label}),children:e.jsx("div",{className:n.default.itemContentInner,children:e.jsx(s.Typography,{as:"div",defaultVariant:"bodySm",children:a.description})})})]},String(a.label)))})}exports.ContentTabs=m;