@zenpatient-org/healthspan-marketing-ui 0.1.89 → 0.1.91

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 l=require("react/jsx-runtime"),H=require("../../node_modules/@gsap/react/src/index.cjs.js"),d=require("../../node_modules/gsap/index.cjs.js"),u=require("../../node_modules/gsap/ScrollTrigger.cjs.js"),w=require("react"),V=require("../../components/HighlightedTitle/HighlightedTitle.cjs.js"),n=require("../../components/Typography/Typography.cjs.js"),A=require("../../utils/debounce.cjs.js"),r=require("./expandingDetails.module.css.cjs.js");d.gsap.registerPlugin(u.ScrollTrigger);const $=({colorScheme:h,label:f,title:N,sections:P})=>{const s=w.useRef(null);return H.useGSAP(()=>{if(!s.current)return;const a=()=>{var x;d.gsap.killTweensOf("*"),u.ScrollTrigger.getAll().forEach(e=>e.kill());const o=d.gsap.utils.toArray('[data-scroll-id="section"]'),t=(x=s.current)==null?void 0:x.querySelector('[data-scroll-id="sections"]');if(!t)return;const p=d.gsap.timeline({scrollTrigger:{trigger:s.current,start:"top top",end:()=>`+=${o.length*500}`,scrub:1,markers:!1,pin:!0}}),y=t==null?void 0:t.querySelector('[data-scroll-id="heading"]');if(!y)return;d.gsap.set(t==null?void 0:t.querySelectorAll('[data-scroll-id="section"]'),{height:y.offsetHeight||0}),d.gsap.set(t==null?void 0:t.querySelectorAll('[data-scroll-id="protocol"]'),{scale:.5,yPercent:0}),d.gsap.set(t==null?void 0:t.querySelectorAll('[data-scroll-id="image-circle"]'),{scale:.5,yPercent:5});const m=window.innerWidth<768?1.2:2,S=window.innerWidth<768?1.2:2;o.forEach((e,E)=>{var q,T,j,b,v;const g=e==null?void 0:e.querySelector('[data-scroll-id="heading"]'),i=e==null?void 0:e.querySelector('[data-scroll-id="content"]');!g||!i||(p.to(e,{height:g.offsetHeight+i.offsetHeight}).to(e==null?void 0:e.querySelector('[data-scroll-id="section-title"]'),{scale:m,yPercent:50},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="section-index"]'),{scale:S,yPercent:50},"<").to(i,{height:i.offsetHeight},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="protocol"]'),{scale:1},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="image-circle"]'),{scale:1,yPercent:5},"<"),E<o.length-1&&p.to(e,{height:g.offsetHeight,delay:.5}).to(e.nextElementSibling,{height:g.offsetHeight+i.offsetHeight},"<").to(((q=e.nextElementSibling)==null?void 0:q.querySelector('[data-scroll-id="section-title"]'))||null,{scale:m,yPercent:100},"<").to(((T=e.nextElementSibling)==null?void 0:T.querySelector('[data-scroll-id="section-index"]'))||null,{scale:S,yPercent:100},"<").to(((j=e.nextElementSibling)==null?void 0:j.querySelector('[data-scroll-id="content"]'))||null,{height:i.offsetHeight,yPercent:0},"<").to(((b=e.nextElementSibling)==null?void 0:b.querySelector('[data-scroll-id="protocol"]'))||null,{scale:1},"<").to(((v=e.nextElementSibling)==null?void 0:v.querySelector('[data-scroll-id="image-circle"]'))||null,{scale:1,yPercent:5},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="section-title"]'),{scale:1,yPercent:-15},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="section-index"]'),{scale:1,yPercent:-15},"<").to(i,{height:0,yPercent:0},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="protocol"]'),{scale:0,yPercent:200},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="image-circle"]'),{scale:0,yPercent:200},"<"))})};a();const c=A.default(()=>{a()},200);return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),u.ScrollTrigger.getAll().forEach(o=>o.kill()),d.gsap.killTweensOf("*")}},{scope:s,dependencies:[s]}),l.jsx("div",{ref:s,className:`${r.default.root} ${r.default[h]}`,children:l.jsxs("div",{className:r.default.expandingDetailsWrapper,children:[l.jsxs("header",{"data-scroll-id":"header",className:r.default.header,children:[f&&l.jsx(n.Typography,{as:"div",defaultVariant:"labelSm",emphasis:!0,className:r.default.label,children:f}),l.jsx(V.HighlightedTitle,{as:"div",defaultVariant:"displayMd",mobileVariant:"headingXl",colorScheme:h,className:r.default.title,title:N})]}),l.jsx("div",{"data-scroll-id":"sections",className:r.default.sections,children:P.map((a,c)=>l.jsxs("div",{id:`section-${c+1}`,"data-scroll-id":"section",className:r.default.section,children:[l.jsxs("div",{"data-scroll-id":"heading",className:r.default.heading,children:[l.jsx("div",{"data-scroll-id":"section-title",className:r.default.sectionTitleWrapper,children:l.jsx(n.Typography,{as:"h3",defaultVariant:"headingSm",className:r.default.sectionTitle,children:a.title})}),l.jsx("div",{"data-scroll-id":"section-index",className:r.default.sectionIndexWrapper,children:l.jsxs(n.Typography,{as:"p",defaultVariant:"headingSm",className:r.default.sectionIndex,children:["(",String(c+1).padStart(2,"0"),")"]})})]}),l.jsxs("div",{"data-scroll-id":"content",className:r.default.content,children:[l.jsxs("div",{"data-scroll-id":"protocol",className:r.default.protocolWrapper,children:[a.subtitle&&l.jsx(n.Typography,{as:"h4",defaultVariant:"headingLg",mobileVariant:"headingXs",children:a.subtitle}),l.jsx(n.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",children:a.description})]}),l.jsx("div",{"data-scroll-id":"image-circle",className:r.default.imageCircle,children:l.jsx("img",{src:a.image,alt:a.title})})]}),l.jsx("div",{className:r.default.leftBorder}),l.jsx("div",{className:r.default.rightBorder})]},a.title))})]})})};exports.ExpandingDetails=$;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),H=require("../../node_modules/@gsap/react/src/index.cjs.js"),d=require("../../node_modules/gsap/index.cjs.js"),u=require("../../node_modules/gsap/ScrollTrigger.cjs.js"),w=require("react"),V=require("../../components/HighlightedTitle/HighlightedTitle.cjs.js"),n=require("../../components/Typography/Typography.cjs.js"),A=require("../../utils/debounce.cjs.js"),r=require("./expandingDetails.module.css.cjs.js");d.gsap.registerPlugin(u.ScrollTrigger);const $=({colorScheme:h,label:f,title:N,sections:P})=>{const s=w.useRef(null);return H.useGSAP(()=>{if(!s.current)return;const a=()=>{var x;d.gsap.killTweensOf("*"),u.ScrollTrigger.getAll().forEach(e=>e.kill());const o=d.gsap.utils.toArray('[data-scroll-id="section"]'),t=(x=s.current)==null?void 0:x.querySelector('[data-scroll-id="sections"]');if(!t)return;const p=d.gsap.timeline({scrollTrigger:{trigger:s.current,start:"top top",end:()=>`+=${o.length*500}`,scrub:1,markers:!1,pin:!0}}),y=t==null?void 0:t.querySelector('[data-scroll-id="heading"]');if(!y)return;d.gsap.set(t==null?void 0:t.querySelectorAll('[data-scroll-id="section"]'),{height:y.offsetHeight||0}),d.gsap.set(t==null?void 0:t.querySelectorAll('[data-scroll-id="protocol"]'),{scale:.5,yPercent:0}),d.gsap.set(t==null?void 0:t.querySelectorAll('[data-scroll-id="image-circle"]'),{scale:.5,yPercent:5});const m=window.innerWidth<768?1.2:2,S=window.innerWidth<768?1.2:2;o.forEach((e,E)=>{var q,T,j,v,b;const g=e==null?void 0:e.querySelector('[data-scroll-id="heading"]'),i=e==null?void 0:e.querySelector('[data-scroll-id="content"]');!g||!i||(p.to(e,{height:g.offsetHeight+i.offsetHeight}).to(e==null?void 0:e.querySelector('[data-scroll-id="section-title"]'),{scale:m,yPercent:50},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="section-index"]'),{scale:S,yPercent:50},"<").to(i,{height:i.offsetHeight},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="protocol"]'),{scale:1},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="image-circle"]'),{scale:1,yPercent:5},"<"),E<o.length-1&&p.to(e,{height:g.offsetHeight,delay:.5}).to(e.nextElementSibling,{height:g.offsetHeight+i.offsetHeight},"<").to(((q=e.nextElementSibling)==null?void 0:q.querySelector('[data-scroll-id="section-title"]'))||null,{scale:m,yPercent:100},"<").to(((T=e.nextElementSibling)==null?void 0:T.querySelector('[data-scroll-id="section-index"]'))||null,{scale:S,yPercent:100},"<").to(((j=e.nextElementSibling)==null?void 0:j.querySelector('[data-scroll-id="content"]'))||null,{height:i.offsetHeight,yPercent:0},"<").to(((v=e.nextElementSibling)==null?void 0:v.querySelector('[data-scroll-id="protocol"]'))||null,{scale:1},"<").to(((b=e.nextElementSibling)==null?void 0:b.querySelector('[data-scroll-id="image-circle"]'))||null,{scale:1,yPercent:5},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="section-title"]'),{scale:1,yPercent:-15},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="section-index"]'),{scale:1,yPercent:-15},"<").to(i,{height:0,yPercent:0},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="protocol"]'),{scale:0,yPercent:200},"<").to(e==null?void 0:e.querySelector('[data-scroll-id="image-circle"]'),{scale:0,yPercent:200},"<"))})};a();const c=A.default(()=>{a()},200);return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),u.ScrollTrigger.getAll().forEach(o=>o.kill()),d.gsap.killTweensOf("*")}},{scope:s,dependencies:[s]}),l.jsx("div",{ref:s,className:`${r.default.root} ${r.default[h]}`,children:l.jsxs("div",{className:r.default.expandingDetailsWrapper,children:[l.jsxs("header",{"data-scroll-id":"header",className:r.default.header,children:[f&&l.jsx(n.Typography,{as:"div",defaultVariant:"labelSm",emphasis:!0,className:r.default.label,children:f}),l.jsx(V.HighlightedTitle,{as:"div",defaultVariant:"displayMd",mobileVariant:"headingXl",colorScheme:h,className:r.default.title,title:N})]}),l.jsx("div",{"data-scroll-id":"sections",className:r.default.sections,children:P.map((a,c)=>l.jsxs("div",{id:`section-${c+1}`,"data-scroll-id":"section",className:r.default.section,children:[l.jsxs("div",{"data-scroll-id":"heading",className:r.default.heading,children:[l.jsx("div",{"data-scroll-id":"section-title",className:r.default.sectionTitleWrapper,children:l.jsx(n.Typography,{as:"h3",defaultVariant:"headingSm",className:r.default.sectionTitle,children:a.title})}),l.jsx("div",{"data-scroll-id":"section-index",className:r.default.sectionIndexWrapper,children:l.jsxs(n.Typography,{as:"p",defaultVariant:"headingSm",className:r.default.sectionIndex,children:["(",String(c+1).padStart(2,"0"),")"]})})]}),l.jsxs("div",{"data-scroll-id":"content",className:r.default.content,children:[l.jsxs("div",{"data-scroll-id":"protocol",className:r.default.protocolWrapper,children:[a.subtitle&&l.jsx(n.Typography,{as:"h4",defaultVariant:"headingLg",mobileVariant:"headingXs",children:a.subtitle}),l.jsx(n.Typography,{className:r.default.description,as:"div",defaultVariant:"bodyMd",mobileVariant:"bodySm",children:a.description})]}),l.jsx("div",{"data-scroll-id":"image-circle",className:r.default.imageCircle,children:l.jsx("img",{src:a.image,alt:a.title})})]}),l.jsx("div",{className:r.default.leftBorder}),l.jsx("div",{className:r.default.rightBorder})]},a.title))})]})})};exports.ExpandingDetails=$;
@@ -41,7 +41,7 @@ const O = ({ colorScheme: u, label: f, title: w, sections: T }) => {
41
41
  });
42
42
  const S = window.innerWidth < 768 ? 1.2 : 2, q = window.innerWidth < 768 ? 1.2 : 2;
43
43
  n.forEach((e, H) => {
44
- var x, N, b, P, E;
44
+ var N, x, b, P, E;
45
45
  const g = e == null ? void 0 : e.querySelector('[data-scroll-id="heading"]'), d = e == null ? void 0 : e.querySelector('[data-scroll-id="content"]');
46
46
  !g || !d || (p.to(e, { height: g.offsetHeight + d.offsetHeight }).to(
47
47
  e == null ? void 0 : e.querySelector('[data-scroll-id="section-title"]'),
@@ -56,11 +56,11 @@ const O = ({ colorScheme: u, label: f, title: w, sections: T }) => {
56
56
  { height: g.offsetHeight + d.offsetHeight },
57
57
  "<"
58
58
  ).to(
59
- ((x = e.nextElementSibling) == null ? void 0 : x.querySelector('[data-scroll-id="section-title"]')) || null,
59
+ ((N = e.nextElementSibling) == null ? void 0 : N.querySelector('[data-scroll-id="section-title"]')) || null,
60
60
  { scale: S, yPercent: 100 },
61
61
  "<"
62
62
  ).to(
63
- ((N = e.nextElementSibling) == null ? void 0 : N.querySelector('[data-scroll-id="section-index"]')) || null,
63
+ ((x = e.nextElementSibling) == null ? void 0 : x.querySelector('[data-scroll-id="section-index"]')) || null,
64
64
  { scale: q, yPercent: 100 },
65
65
  "<"
66
66
  ).to(
@@ -135,7 +135,16 @@ const O = ({ colorScheme: u, label: f, title: w, sections: T }) => {
135
135
  /* @__PURE__ */ c("div", { "data-scroll-id": "content", className: l.content, children: [
136
136
  /* @__PURE__ */ c("div", { "data-scroll-id": "protocol", className: l.protocolWrapper, children: [
137
137
  a.subtitle && /* @__PURE__ */ t(h, { as: "h4", defaultVariant: "headingLg", mobileVariant: "headingXs", children: a.subtitle }),
138
- /* @__PURE__ */ t(h, { as: "p", defaultVariant: "bodyMd", mobileVariant: "bodySm", children: a.description })
138
+ /* @__PURE__ */ t(
139
+ h,
140
+ {
141
+ className: l.description,
142
+ as: "div",
143
+ defaultVariant: "bodyMd",
144
+ mobileVariant: "bodySm",
145
+ children: a.description
146
+ }
147
+ )
139
148
  ] }),
140
149
  /* @__PURE__ */ t("div", { "data-scroll-id": "image-circle", className: l.imageCircle, children: /* @__PURE__ */ t("img", { src: a.image, alt: a.title }) })
141
150
  ] }),
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="expandingDetails-module__root___5WLQh",t="expandingDetails-module__dark___BhUf9",o="expandingDetails-module__expandingDetailsWrapper___sqLS5",n="expandingDetails-module__header___Rp1BD",r="expandingDetails-module__title___5WsER",i="expandingDetails-module__label___w2Sjs",_="expandingDetails-module__sections___xpvak",a="expandingDetails-module__section___zgXvg",l="expandingDetails-module__leftBorder___lZI-L",s="expandingDetails-module__rightBorder___xfwvL",d="expandingDetails-module__topLeftCorner___sT8-Q",p="expandingDetails-module__topRightCorner___q9HbO",c="expandingDetails-module__bottomLeftCorner___E3e0F",g="expandingDetails-module__bottomRightCorner___VQJBu",x="expandingDetails-module__heading___htlX-",m="expandingDetails-module__sectionTitleWrapper___WxS9B",u="expandingDetails-module__sectionIndexWrapper___l-3VD",D="expandingDetails-module__content___1uGIY",h="expandingDetails-module__protocolWrapper___nq7ij",C="expandingDetails-module__imageCircle___HZJB-",W="expandingDetails-module__sectionIndex___spgOf",f={root:e,dark:t,expandingDetailsWrapper:o,header:n,title:r,label:i,sections:_,section:a,leftBorder:l,rightBorder:s,topLeftCorner:d,topRightCorner:p,bottomLeftCorner:c,bottomRightCorner:g,heading:x,sectionTitleWrapper:m,sectionIndexWrapper:u,content:D,protocolWrapper:h,imageCircle:C,sectionIndex:W};exports.bottomLeftCorner=c;exports.bottomRightCorner=g;exports.content=D;exports.dark=t;exports.default=f;exports.expandingDetailsWrapper=o;exports.header=n;exports.heading=x;exports.imageCircle=C;exports.label=i;exports.leftBorder=l;exports.protocolWrapper=h;exports.rightBorder=s;exports.root=e;exports.section=a;exports.sectionIndex=W;exports.sectionIndexWrapper=u;exports.sectionTitleWrapper=m;exports.sections=_;exports.title=r;exports.topLeftCorner=d;exports.topRightCorner=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="expandingDetails-module__root___5WLQh",t="expandingDetails-module__dark___BhUf9",o="expandingDetails-module__expandingDetailsWrapper___sqLS5",n="expandingDetails-module__header___Rp1BD",i="expandingDetails-module__description___U28ia",r="expandingDetails-module__title___5WsER",_="expandingDetails-module__label___w2Sjs",a="expandingDetails-module__sections___xpvak",s="expandingDetails-module__section___zgXvg",l="expandingDetails-module__leftBorder___lZI-L",d="expandingDetails-module__rightBorder___xfwvL",p="expandingDetails-module__topLeftCorner___sT8-Q",c="expandingDetails-module__topRightCorner___q9HbO",g="expandingDetails-module__bottomLeftCorner___E3e0F",x="expandingDetails-module__bottomRightCorner___VQJBu",m="expandingDetails-module__heading___htlX-",u="expandingDetails-module__sectionTitleWrapper___WxS9B",D="expandingDetails-module__sectionIndexWrapper___l-3VD",h="expandingDetails-module__content___1uGIY",C="expandingDetails-module__protocolWrapper___nq7ij",W="expandingDetails-module__imageCircle___HZJB-",f="expandingDetails-module__sectionIndex___spgOf",b={root:e,dark:t,expandingDetailsWrapper:o,header:n,description:i,title:r,label:_,sections:a,section:s,leftBorder:l,rightBorder:d,topLeftCorner:p,topRightCorner:c,bottomLeftCorner:g,bottomRightCorner:x,heading:m,sectionTitleWrapper:u,sectionIndexWrapper:D,content:h,protocolWrapper:C,imageCircle:W,sectionIndex:f};exports.bottomLeftCorner=g;exports.bottomRightCorner=x;exports.content=h;exports.dark=t;exports.default=b;exports.description=i;exports.expandingDetailsWrapper=o;exports.header=n;exports.heading=m;exports.imageCircle=W;exports.label=_;exports.leftBorder=l;exports.protocolWrapper=C;exports.rightBorder=d;exports.root=e;exports.section=s;exports.sectionIndex=f;exports.sectionIndexWrapper=D;exports.sectionTitleWrapper=u;exports.sections=a;exports.title=r;exports.topLeftCorner=p;exports.topRightCorner=c;
@@ -1,47 +1,49 @@
1
- const e = "expandingDetails-module__root___5WLQh", t = "expandingDetails-module__dark___BhUf9", n = "expandingDetails-module__expandingDetailsWrapper___sqLS5", o = "expandingDetails-module__header___Rp1BD", _ = "expandingDetails-module__title___5WsER", i = "expandingDetails-module__label___w2Sjs", r = "expandingDetails-module__sections___xpvak", a = "expandingDetails-module__section___zgXvg", s = "expandingDetails-module__leftBorder___lZI-L", l = "expandingDetails-module__rightBorder___xfwvL", d = "expandingDetails-module__topLeftCorner___sT8-Q", p = "expandingDetails-module__topRightCorner___q9HbO", c = "expandingDetails-module__bottomLeftCorner___E3e0F", g = "expandingDetails-module__bottomRightCorner___VQJBu", x = "expandingDetails-module__heading___htlX-", m = "expandingDetails-module__sectionTitleWrapper___WxS9B", D = "expandingDetails-module__sectionIndexWrapper___l-3VD", u = "expandingDetails-module__content___1uGIY", h = "expandingDetails-module__protocolWrapper___nq7ij", C = "expandingDetails-module__imageCircle___HZJB-", W = "expandingDetails-module__sectionIndex___spgOf", f = {
1
+ const e = "expandingDetails-module__root___5WLQh", t = "expandingDetails-module__dark___BhUf9", n = "expandingDetails-module__expandingDetailsWrapper___sqLS5", o = "expandingDetails-module__header___Rp1BD", _ = "expandingDetails-module__description___U28ia", i = "expandingDetails-module__title___5WsER", r = "expandingDetails-module__label___w2Sjs", a = "expandingDetails-module__sections___xpvak", s = "expandingDetails-module__section___zgXvg", l = "expandingDetails-module__leftBorder___lZI-L", d = "expandingDetails-module__rightBorder___xfwvL", p = "expandingDetails-module__topLeftCorner___sT8-Q", c = "expandingDetails-module__topRightCorner___q9HbO", g = "expandingDetails-module__bottomLeftCorner___E3e0F", x = "expandingDetails-module__bottomRightCorner___VQJBu", m = "expandingDetails-module__heading___htlX-", D = "expandingDetails-module__sectionTitleWrapper___WxS9B", u = "expandingDetails-module__sectionIndexWrapper___l-3VD", h = "expandingDetails-module__content___1uGIY", C = "expandingDetails-module__protocolWrapper___nq7ij", W = "expandingDetails-module__imageCircle___HZJB-", f = "expandingDetails-module__sectionIndex___spgOf", B = {
2
2
  root: e,
3
3
  dark: t,
4
4
  expandingDetailsWrapper: n,
5
5
  header: o,
6
- title: _,
7
- label: i,
8
- sections: r,
9
- section: a,
10
- leftBorder: s,
11
- rightBorder: l,
12
- topLeftCorner: d,
13
- topRightCorner: p,
14
- bottomLeftCorner: c,
15
- bottomRightCorner: g,
16
- heading: x,
17
- sectionTitleWrapper: m,
18
- sectionIndexWrapper: D,
19
- content: u,
20
- protocolWrapper: h,
21
- imageCircle: C,
22
- sectionIndex: W
6
+ description: _,
7
+ title: i,
8
+ label: r,
9
+ sections: a,
10
+ section: s,
11
+ leftBorder: l,
12
+ rightBorder: d,
13
+ topLeftCorner: p,
14
+ topRightCorner: c,
15
+ bottomLeftCorner: g,
16
+ bottomRightCorner: x,
17
+ heading: m,
18
+ sectionTitleWrapper: D,
19
+ sectionIndexWrapper: u,
20
+ content: h,
21
+ protocolWrapper: C,
22
+ imageCircle: W,
23
+ sectionIndex: f
23
24
  };
24
25
  export {
25
- c as bottomLeftCorner,
26
- g as bottomRightCorner,
27
- u as content,
26
+ g as bottomLeftCorner,
27
+ x as bottomRightCorner,
28
+ h as content,
28
29
  t as dark,
29
- f as default,
30
+ B as default,
31
+ _ as description,
30
32
  n as expandingDetailsWrapper,
31
33
  o as header,
32
- x as heading,
33
- C as imageCircle,
34
- i as label,
35
- s as leftBorder,
36
- h as protocolWrapper,
37
- l as rightBorder,
34
+ m as heading,
35
+ W as imageCircle,
36
+ r as label,
37
+ l as leftBorder,
38
+ C as protocolWrapper,
39
+ d as rightBorder,
38
40
  e as root,
39
- a as section,
40
- W as sectionIndex,
41
- D as sectionIndexWrapper,
42
- m as sectionTitleWrapper,
43
- r as sections,
44
- _ as title,
45
- d as topLeftCorner,
46
- p as topRightCorner
41
+ s as section,
42
+ f as sectionIndex,
43
+ u as sectionIndexWrapper,
44
+ D as sectionTitleWrapper,
45
+ a as sections,
46
+ i as title,
47
+ p as topLeftCorner,
48
+ c as topRightCorner
47
49
  };
@@ -8,7 +8,7 @@ export type ExpandingDetailsProps = {
8
8
  sections: Array<{
9
9
  title: string;
10
10
  subtitle?: string;
11
- description?: string;
11
+ description?: ReactNode;
12
12
  image: string;
13
13
  }>;
14
14
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),i=require("../../components/Typography/Typography.cjs.js"),g=require("../../components/ProgressButton/ProgressButton.cjs.js"),s=require("./threeItemsPlainCarousel.module.css.cjs.js"),y=require("../../utils/cn/cn.cjs.js"),f=3,j=({title:p,cards:d})=>{const[r,u]=c.useState(0),l=c.useMemo(()=>d.slice(0,f),[d]),b=c.useMemo(()=>l.length===0?[]:[...l,...l].slice(r,r+f),[l,r]),o=l.length,a=o>1,m=()=>{a&&u(t=>t===0?o-1:t-1)},h=()=>{a&&u(t=>t===o-1?0:t+1)};return e.jsxs("section",{className:s.default.root,children:[e.jsxs("div",{className:s.default.topContainer,children:[e.jsx(i.Typography,{defaultVariant:"displayMd",mobileVariant:"headingXl",className:s.default.title,children:p}),e.jsx("div",{className:s.default.topButton,children:e.jsx(g.ProgressButton,{left:{disabled:!a,onClick:m},right:{disabled:!a,onClick:h}})})]}),e.jsx("div",{className:s.default.bottomContainer,children:e.jsx(e.Fragment,{children:b.map((t,n)=>e.jsxs("div",{className:y.cn({[s.default.mainCard]:n===0,[s.default.minorCard]:n!==0}),children:[e.jsx("img",{src:t.image,alt:t.title}),e.jsxs("div",{className:s.default.cardContent,children:[e.jsx(i.Typography,{defaultVariant:"headingMd",mobileVariant:"headingXs",children:t.title}),t.subtitle&&e.jsx(i.Typography,{defaultVariant:"labelLg",mobileVariant:"labelSm",className:s.default.subtitle,children:t.subtitle})]}),t.description&&n===0&&e.jsx(i.Typography,{defaultVariant:"bodyLg",mobileVariant:"bodySm",className:s.default.descriptionText,children:t.description})]},`${t.title}-${n}`))})}),e.jsx("div",{className:s.default.bottomButton,children:e.jsx(g.ProgressButton,{left:{disabled:!a,onClick:m},right:{disabled:!a,onClick:h}})})]})};exports.ThreeItemsPlainCarousel=j;
@@ -0,0 +1,14 @@
1
+ export type Card = {
2
+ title: string;
3
+ description: string;
4
+ };
5
+ export type ThreeItemsPlainCarouselProps = {
6
+ title: string;
7
+ cards: Array<{
8
+ image: string;
9
+ title: string;
10
+ subtitle?: string;
11
+ description: string;
12
+ }>;
13
+ };
14
+ export declare const ThreeItemsPlainCarousel: ({ title, cards: rawCards }: ThreeItemsPlainCarouselProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,81 @@
1
+ import { jsxs as r, jsx as e, Fragment as N } from "react/jsx-runtime";
2
+ import { useState as V, useMemo as b } from "react";
3
+ import { Typography as s } from "../../components/Typography/Typography.es.js";
4
+ import { ProgressButton as f } from "../../components/ProgressButton/ProgressButton.es.js";
5
+ import i from "./threeItemsPlainCarousel.module.css.es.js";
6
+ import { cn as y } from "../../utils/cn/cn.es.js";
7
+ const p = 3, T = ({ title: g, cards: d }) => {
8
+ const [o, m] = V(0), a = b(() => d.slice(0, p), [d]), C = b(() => a.length === 0 ? [] : [...a, ...a].slice(o, o + p), [a, o]), c = a.length, l = c > 1, h = () => {
9
+ l && m((t) => t === 0 ? c - 1 : t - 1);
10
+ }, u = () => {
11
+ l && m((t) => t === c - 1 ? 0 : t + 1);
12
+ };
13
+ return /* @__PURE__ */ r("section", { className: i.root, children: [
14
+ /* @__PURE__ */ r("div", { className: i.topContainer, children: [
15
+ /* @__PURE__ */ e(s, { defaultVariant: "displayMd", mobileVariant: "headingXl", className: i.title, children: g }),
16
+ /* @__PURE__ */ e("div", { className: i.topButton, children: /* @__PURE__ */ e(
17
+ f,
18
+ {
19
+ left: {
20
+ disabled: !l,
21
+ onClick: h
22
+ },
23
+ right: {
24
+ disabled: !l,
25
+ onClick: u
26
+ }
27
+ }
28
+ ) })
29
+ ] }),
30
+ /* @__PURE__ */ e("div", { className: i.bottomContainer, children: /* @__PURE__ */ e(N, { children: C.map((t, n) => /* @__PURE__ */ r(
31
+ "div",
32
+ {
33
+ className: y({
34
+ [i.mainCard]: n === 0,
35
+ [i.minorCard]: n !== 0
36
+ }),
37
+ children: [
38
+ /* @__PURE__ */ e("img", { src: t.image, alt: t.title }),
39
+ /* @__PURE__ */ r("div", { className: i.cardContent, children: [
40
+ /* @__PURE__ */ e(s, { defaultVariant: "headingMd", mobileVariant: "headingXs", children: t.title }),
41
+ t.subtitle && /* @__PURE__ */ e(
42
+ s,
43
+ {
44
+ defaultVariant: "labelLg",
45
+ mobileVariant: "labelSm",
46
+ className: i.subtitle,
47
+ children: t.subtitle
48
+ }
49
+ )
50
+ ] }),
51
+ t.description && n === 0 && /* @__PURE__ */ e(
52
+ s,
53
+ {
54
+ defaultVariant: "bodyLg",
55
+ mobileVariant: "bodySm",
56
+ className: i.descriptionText,
57
+ children: t.description
58
+ }
59
+ )
60
+ ]
61
+ },
62
+ `${t.title}-${n}`
63
+ )) }) }),
64
+ /* @__PURE__ */ e("div", { className: i.bottomButton, children: /* @__PURE__ */ e(
65
+ f,
66
+ {
67
+ left: {
68
+ disabled: !l,
69
+ onClick: h
70
+ },
71
+ right: {
72
+ disabled: !l,
73
+ onClick: u
74
+ }
75
+ }
76
+ ) })
77
+ ] });
78
+ };
79
+ export {
80
+ T as ThreeItemsPlainCarousel
81
+ };
@@ -0,0 +1 @@
1
+ export { ThreeItemsPlainCarousel } from './ThreeItemsPlainCarousel';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t="threeItemsPlainCarousel-module__root___xtgoy",o="threeItemsPlainCarousel-module__topContainer___f6h9T",e="threeItemsPlainCarousel-module__bottomContainer___Pn1eW",n="threeItemsPlainCarousel-module__subtitle___xYJAD",r="threeItemsPlainCarousel-module__mainCard___F40fV",_="threeItemsPlainCarousel-module__minorCard___yYs9x",a="threeItemsPlainCarousel-module__cardContent___93PTA",s="threeItemsPlainCarousel-module__bottomButton___aII2h",i="threeItemsPlainCarousel-module__topButton___kBUHb",l="threeItemsPlainCarousel-module__descriptionText___7gS89",u={root:t,topContainer:o,bottomContainer:e,subtitle:n,mainCard:r,minorCard:_,cardContent:a,bottomButton:s,topButton:i,descriptionText:l};exports.bottomButton=s;exports.bottomContainer=e;exports.cardContent=a;exports.default=u;exports.descriptionText=l;exports.mainCard=r;exports.minorCard=_;exports.root=t;exports.subtitle=n;exports.topButton=i;exports.topContainer=o;
@@ -0,0 +1,25 @@
1
+ const t = "threeItemsPlainCarousel-module__root___xtgoy", o = "threeItemsPlainCarousel-module__topContainer___f6h9T", e = "threeItemsPlainCarousel-module__bottomContainer___Pn1eW", n = "threeItemsPlainCarousel-module__subtitle___xYJAD", _ = "threeItemsPlainCarousel-module__mainCard___F40fV", r = "threeItemsPlainCarousel-module__minorCard___yYs9x", a = "threeItemsPlainCarousel-module__cardContent___93PTA", s = "threeItemsPlainCarousel-module__bottomButton___aII2h", l = "threeItemsPlainCarousel-module__topButton___kBUHb", m = "threeItemsPlainCarousel-module__descriptionText___7gS89", i = {
2
+ root: t,
3
+ topContainer: o,
4
+ bottomContainer: e,
5
+ subtitle: n,
6
+ mainCard: _,
7
+ minorCard: r,
8
+ cardContent: a,
9
+ bottomButton: s,
10
+ topButton: l,
11
+ descriptionText: m
12
+ };
13
+ export {
14
+ s as bottomButton,
15
+ e as bottomContainer,
16
+ a as cardContent,
17
+ i as default,
18
+ m as descriptionText,
19
+ _ as mainCard,
20
+ r as minorCard,
21
+ t as root,
22
+ n as subtitle,
23
+ l as topButton,
24
+ o as topContainer
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -511,6 +511,11 @@
511
511
  "import": "./dist/modules/TextBlockAnimated/TextBlockAnimated.es.js",
512
512
  "require": "./dist/modules/TextBlockAnimated/TextBlockAnimated.cjs.js"
513
513
  },
514
+ "./ThreeItemsPlainCarousel": {
515
+ "types": "./dist/modules/ThreeItemsPlainCarousel/ThreeItemsPlainCarousel.d.ts",
516
+ "import": "./dist/modules/ThreeItemsPlainCarousel/ThreeItemsPlainCarousel.es.js",
517
+ "require": "./dist/modules/ThreeItemsPlainCarousel/ThreeItemsPlainCarousel.cjs.js"
518
+ },
514
519
  "./CallToAction": {
515
520
  "types": "./dist/modules/CallToAction/CallToAction.d.ts",
516
521
  "import": "./dist/modules/CallToAction/CallToAction.es.js",