@zenpatient-org/healthspan-marketing-ui 0.1.105 → 0.1.106

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,54 +1,55 @@
1
1
  "use client";
2
2
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
3
3
  import { useRef as l } from "react";
4
- import { Button as j } from "../../components/Button/Button.es.js";
5
- import { Typography as u } from "../../components/Typography/Typography.es.js";
6
- import { Icon as A } from "../../components/Icon/Icon.es.js";
7
- import { EIconName as I } from "../../components/Icon/constants.es.js";
8
- import { HighlightedTitle as v } from "../../components/HighlightedTitle/HighlightedTitle.es.js";
4
+ import { Button as K } from "../../components/Button/Button.es.js";
5
+ import { Typography as f } from "../../components/Typography/Typography.es.js";
6
+ import { Icon as W } from "../../components/Icon/Icon.es.js";
7
+ import { EIconName as B } from "../../components/Icon/constants.es.js";
8
+ import { HighlightedTitle as L } from "../../components/HighlightedTitle/HighlightedTitle.es.js";
9
9
  import { gsap as a } from "../../node_modules/gsap/index.es.js";
10
- import { useGSAP as $ } from "../../node_modules/@gsap/react/src/index.es.js";
11
- import { ScrollTrigger as D } from "../../node_modules/gsap/ScrollTrigger.es.js";
12
- import G from "../../utils/debounce.es.js";
10
+ import { useGSAP as J } from "../../node_modules/@gsap/react/src/index.es.js";
11
+ import { ScrollTrigger as q } from "../../node_modules/gsap/ScrollTrigger.es.js";
12
+ import Q from "../../utils/debounce.es.js";
13
13
  import r from "./callToAction.module.css.es.js";
14
- a.registerPlugin(D);
15
- const ne = ({
16
- subtitle: k,
17
- titleTop: q,
18
- scrollableLabels: R,
19
- titleBottom: x,
20
- description: X,
21
- hsaText: _,
22
- buttonText: z,
23
- buttonLink: f,
24
- backgroundImage: B
14
+ a.registerPlugin(q);
15
+ const ce = ({
16
+ subtitle: x,
17
+ titleTop: X,
18
+ scrollableLabels: V,
19
+ titleBottom: _,
20
+ description: z,
21
+ hsaText: F,
22
+ buttonText: O,
23
+ buttonLink: h,
24
+ backgroundImage: j
25
25
  }) => {
26
- const V = l(null), o = l(null), L = l(null), p = l(null), h = l(null), T = l(null), b = l(null), g = l(null), y = l(null);
27
- return $(() => {
28
- var C, E, H;
29
- const d = (C = L.current) == null ? void 0 : C.querySelector("p"), m = (E = T.current) == null ? void 0 : E.querySelector("p"), F = [
30
- d,
31
- p.current,
26
+ const u = l(null), o = l(null), w = l(null), y = l(null), b = l(null), S = l(null), g = l(null), v = l(null), N = l(null);
27
+ return J(() => {
28
+ var k, M, A;
29
+ const m = u.current && u.current.getBoundingClientRect().top < window.innerHeight * 0.8, p = (k = w.current) == null ? void 0 : k.querySelector("p"), T = (M = S.current) == null ? void 0 : M.querySelector("p"), D = [
30
+ p,
31
+ y.current,
32
32
  o.current,
33
- h.current,
34
- m,
35
33
  b.current,
34
+ T,
36
35
  g.current,
37
- y.current
36
+ v.current,
37
+ N.current
38
38
  ].filter(Boolean);
39
- a.set(F, {
39
+ a.set(D, {
40
40
  clipPath: "inset(0% 0% 100% 0%)",
41
41
  yPercent: 100
42
- }), a.to(
42
+ });
43
+ const c = a.to(
43
44
  [
44
- d,
45
- p.current,
45
+ p,
46
+ y.current,
46
47
  o.current,
47
- h.current,
48
- m,
49
48
  b.current,
49
+ T,
50
50
  g.current,
51
- y.current
51
+ v.current,
52
+ N.current
52
53
  ],
53
54
  {
54
55
  clipPath: "inset(0% 0% 0% 0%)",
@@ -60,117 +61,127 @@ const ne = ({
60
61
  amount: 1,
61
62
  from: "start"
62
63
  },
63
- scrollTrigger: {
64
- trigger: V.current,
65
- start: "top 80%",
66
- end: "+=500"
67
- }
64
+ paused: !0
65
+ // Start paused, we'll control when it plays
68
66
  }
69
67
  );
70
- const t = (H = o.current) == null ? void 0 : H.querySelector("ul");
68
+ q.create({
69
+ trigger: u.current,
70
+ start: "top 80%",
71
+ end: "+=500",
72
+ onEnter: () => c.play(),
73
+ onLeave: () => c.reverse(),
74
+ onEnterBack: () => c.play(),
75
+ onLeaveBack: () => c.reverse()
76
+ }), m && a.delayedCall(0.1, () => {
77
+ c.play();
78
+ });
79
+ const t = (A = o.current) == null ? void 0 : A.querySelector("ul");
71
80
  if (!t) return;
72
- const w = t.innerHTML;
73
- let i = null, S = !0;
74
- const M = () => {
75
- i && i.kill(), t.innerHTML = w, a.set(t, { y: 0 });
81
+ const C = t.innerHTML;
82
+ let i = null, E = !0;
83
+ const H = () => {
84
+ i && i.kill(), t.innerHTML = C, a.set(t, { y: 0 });
76
85
  const n = Array.from(t.querySelectorAll("li"));
77
86
  if (n.length <= 1) return;
78
- const N = n[0].clientHeight;
79
- if (!N) return;
80
- a.set(o.current, { height: N, overflow: "hidden" });
81
- const P = Array.from(n);
82
- P.forEach((W) => {
83
- t.appendChild(W.cloneNode(!0));
84
- }), i = a.timeline({
87
+ const R = n[0].clientHeight;
88
+ if (!R) return;
89
+ a.set(o.current, { height: R, overflow: "hidden" });
90
+ const I = Array.from(n);
91
+ I.forEach((P) => {
92
+ t.appendChild(P.cloneNode(!0));
93
+ });
94
+ const $ = E && !m ? 2.5 : 0;
95
+ i = a.timeline({
85
96
  repeat: -1,
86
- delay: S ? 2.5 : 0,
97
+ delay: $,
87
98
  onRepeat: () => {
88
99
  a.set(t, { y: 0 });
89
100
  }
90
- }), P.forEach((W, O) => {
101
+ }), I.forEach((P, G) => {
91
102
  i && i.to({}, { duration: 2 }).to(t, {
92
- y: `-${(O + 1) * N}`,
103
+ y: `-${(G + 1) * R}`,
93
104
  duration: 0.5,
94
105
  ease: "power1.inOut"
95
106
  });
96
- }), S = !1;
97
- }, c = G(M, 200);
98
- return M(), window.addEventListener("resize", c), () => {
107
+ }), E = !1;
108
+ }, d = Q(H, 200);
109
+ return H(), window.addEventListener("resize", d), () => {
99
110
  var n;
100
- window.removeEventListener("resize", c), (n = c.kill) == null || n.call(c), i && i.kill(), t && (t.innerHTML = w, a.set(t, { y: 0 }));
111
+ window.removeEventListener("resize", d), (n = d.kill) == null || n.call(d), i && i.kill(), t && (t.innerHTML = C, a.set(t, { y: 0 }));
101
112
  };
102
- }, [R]), /* @__PURE__ */ s("section", { ref: V, className: r.root, children: [
103
- /* @__PURE__ */ e("div", { className: r.backgroundImage, style: { backgroundImage: `url(${B})` } }),
113
+ }, [V]), /* @__PURE__ */ s("section", { ref: u, className: r.root, children: [
114
+ /* @__PURE__ */ e("div", { className: r.backgroundImage, style: { backgroundImage: `url(${j})` } }),
104
115
  /* @__PURE__ */ s("div", { className: r.container, children: [
105
116
  /* @__PURE__ */ e("div", { className: r.leftContent, children: /* @__PURE__ */ s("div", { className: r.content, children: [
106
- /* @__PURE__ */ e("div", { ref: p, children: /* @__PURE__ */ e(
107
- v,
117
+ /* @__PURE__ */ e("div", { ref: y, children: /* @__PURE__ */ e(
118
+ L,
108
119
  {
109
120
  defaultVariant: "displayXl",
110
121
  mobileVariant: "displayMd",
111
122
  as: "div",
112
123
  className: r.title,
113
- title: q
124
+ title: X
114
125
  }
115
126
  ) }),
116
- /* @__PURE__ */ e("div", { ref: o, className: r.scrollableLabelsWrapper, children: /* @__PURE__ */ e("ul", { className: r.scrollableLabels, children: R.map((d, m) => /* @__PURE__ */ e("li", { className: r.scrollableLabel, children: /* @__PURE__ */ e(u, { defaultVariant: "displayXl", mobileVariant: "displayMd", as: "span", children: d }) }, m)) }) }),
117
- /* @__PURE__ */ e("div", { ref: h, children: /* @__PURE__ */ e(
118
- v,
127
+ /* @__PURE__ */ e("div", { ref: o, className: r.scrollableLabelsWrapper, children: /* @__PURE__ */ e("ul", { className: r.scrollableLabels, children: V.map((m, p) => /* @__PURE__ */ e("li", { className: r.scrollableLabel, children: /* @__PURE__ */ e(f, { defaultVariant: "displayXl", mobileVariant: "displayMd", as: "span", children: m }) }, p)) }) }),
128
+ /* @__PURE__ */ e("div", { ref: b, children: /* @__PURE__ */ e(
129
+ L,
119
130
  {
120
131
  defaultVariant: "displayXl",
121
132
  mobileVariant: "displayMd",
122
133
  as: "div",
123
134
  className: r.title,
124
- title: x
135
+ title: _
125
136
  }
126
137
  ) })
127
138
  ] }) }),
128
- /* @__PURE__ */ e("div", { ref: L, className: r.subtitleWrapper, children: /* @__PURE__ */ e(
129
- v,
139
+ /* @__PURE__ */ e("div", { ref: w, className: r.subtitleWrapper, children: /* @__PURE__ */ e(
140
+ L,
130
141
  {
131
142
  defaultVariant: "labelMd",
132
143
  mobileVariant: "labelSm",
133
144
  as: "div",
134
145
  className: r.subtitle,
135
- title: k
146
+ title: x
136
147
  }
137
148
  ) }),
138
- /* @__PURE__ */ e("div", { ref: T, className: r.arrowWrapper, children: /* @__PURE__ */ s(u, { defaultVariant: "labelXl", mobileVariant: "labelLg", className: r.arrow, as: "p", children: [
149
+ /* @__PURE__ */ e("div", { ref: S, className: r.arrowWrapper, children: /* @__PURE__ */ s(f, { defaultVariant: "labelXl", mobileVariant: "labelLg", className: r.arrow, as: "p", children: [
139
150
  "(",
140
- /* @__PURE__ */ e(A, { name: I.ARROW_FORWARD }),
151
+ /* @__PURE__ */ e(W, { name: B.ARROW_FORWARD }),
141
152
  ")"
142
153
  ] }) }),
143
154
  /* @__PURE__ */ e("div", { className: r.rightContent, children: /* @__PURE__ */ s("div", { className: r.descriptionWrapper, children: [
144
- /* @__PURE__ */ e("div", { ref: b, children: /* @__PURE__ */ e(
145
- u,
155
+ /* @__PURE__ */ e("div", { ref: g, children: /* @__PURE__ */ e(
156
+ f,
146
157
  {
147
158
  as: "p",
148
159
  defaultVariant: "bodyLg",
149
160
  mobileVariant: "bodyMd",
150
161
  className: r.description,
151
- children: X
162
+ children: z
152
163
  }
153
164
  ) }),
154
- /* @__PURE__ */ e("div", { ref: g, className: r.buttonWrapper, children: f && /* @__PURE__ */ e(
155
- j,
165
+ /* @__PURE__ */ e("div", { ref: v, className: r.buttonWrapper, children: h && /* @__PURE__ */ e(
166
+ K,
156
167
  {
157
- as: f ? "a" : "button",
158
- href: f,
168
+ as: h ? "a" : "button",
169
+ href: h,
159
170
  variant: "secondary",
160
171
  size: "lg",
161
- children: z
172
+ children: O
162
173
  }
163
174
  ) }),
164
- /* @__PURE__ */ s("div", { ref: y, className: r.hsaEligible, children: [
165
- /* @__PURE__ */ e(A, { name: I.CIRCLE_CHECK_FILL, className: r.checkIcon }),
175
+ /* @__PURE__ */ s("div", { ref: N, className: r.hsaEligible, children: [
176
+ /* @__PURE__ */ e(W, { name: B.CIRCLE_CHECK_FILL, className: r.checkIcon }),
166
177
  /* @__PURE__ */ e(
167
- u,
178
+ f,
168
179
  {
169
180
  as: "p",
170
181
  defaultVariant: "bodySm",
171
182
  mobileVariant: "bodySm",
172
183
  className: r.hsaText,
173
- children: _
184
+ children: F
174
185
  }
175
186
  )
176
187
  ] })
@@ -179,5 +190,5 @@ const ne = ({
179
190
  ] });
180
191
  };
181
192
  export {
182
- ne as CallToAction
193
+ ce as CallToAction
183
194
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),e=require("react"),d=require("../../utils/cn/cn.cjs.js"),r=require("./bubbles.module.css.cjs.js"),v=["xs","lg","md","md","xl","sm","sm","md","lg","md","xl","xl","xl"],w=({className:b})=>{const[n,f]=e.useState(!1),[c,m]=e.useState("forward"),[o,u]=e.useState(!1),l=e.useRef(null),a=e.useRef(0);return e.useEffect(()=>{const s=()=>{const t=window.scrollY;m(t>a.current?"forward":"reverse"),a.current=t};return window.addEventListener("scroll",s,{passive:!0}),()=>window.removeEventListener("scroll",s)},[]),e.useEffect(()=>{const s=new window.IntersectionObserver(([t])=>{f(t.isIntersecting)},{threshold:.5});return l.current&&s.observe(l.current),()=>s.disconnect()},[]),e.useEffect(()=>{n&&c==="forward"&&u(!0),n&&c==="reverse"&&u(!1)},[n,c]),i.jsx("section",{ref:l,className:d.cn(r.default.root,b),children:i.jsx("div",{className:r.default.container,children:v.map((s,t)=>i.jsx("div",{className:d.cn(r.default.bubble,o&&r.default.bubbleFinished,!o&&r.default.bubbleReverse),"data-size":s,"data-index":t},t))})})};exports.Bubbles=w;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),e=require("react"),d=require("../../utils/cn/cn.cjs.js"),r=require("./bubbles.module.css.cjs.js"),v=["xs","lg","md","md","xl","sm","sm","md","lg","md","xl","xl","xl"],w=({className:b})=>{const[n,f]=e.useState(!1),[c,m]=e.useState("forward"),[o,u]=e.useState(!1),i=e.useRef(null),a=e.useRef(0);return e.useEffect(()=>{const s=()=>{const t=window.scrollY;m(t>a.current?"forward":"reverse"),a.current=t};return window.addEventListener("scroll",s,{passive:!0}),()=>window.removeEventListener("scroll",s)},[]),e.useEffect(()=>{const s=new window.IntersectionObserver(([t])=>{f(t.isIntersecting)},{rootMargin:"0px 0px -20% 0px",threshold:.2});return i.current&&s.observe(i.current),()=>s.disconnect()},[]),e.useEffect(()=>{n&&c==="forward"&&u(!0),n&&c==="reverse"&&u(!1)},[n,c]),l.jsx("section",{ref:i,className:d.cn(r.default.root,b),children:l.jsx("div",{className:r.default.container,children:v.map((s,t)=>l.jsx("div",{className:d.cn(r.default.bubble,o&&r.default.bubbleFinished,!o&&r.default.bubbleReverse),"data-size":s,"data-index":t},t))})})};exports.Bubbles=w;
@@ -2,37 +2,37 @@
2
2
  import { jsx as i } from "react/jsx-runtime";
3
3
  import { useState as c, useRef as u, useEffect as l } from "react";
4
4
  import { cn as b } from "../../utils/cn/cn.es.js";
5
- import r from "./bubbles.module.css.es.js";
6
- const h = ["xs", "lg", "md", "md", "xl", "sm", "sm", "md", "lg", "md", "xl", "xl", "xl"], F = ({ className: f }) => {
5
+ import s from "./bubbles.module.css.es.js";
6
+ const p = ["xs", "lg", "md", "md", "xl", "sm", "sm", "md", "lg", "md", "xl", "xl", "xl"], F = ({ className: f }) => {
7
7
  const [t, v] = c(!1), [n, w] = c("forward"), [d, a] = c(!1), o = u(null), m = u(0);
8
8
  return l(() => {
9
9
  const e = () => {
10
- const s = window.scrollY;
11
- w(s > m.current ? "forward" : "reverse"), m.current = s;
10
+ const r = window.scrollY;
11
+ w(r > m.current ? "forward" : "reverse"), m.current = r;
12
12
  };
13
13
  return window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
14
14
  }, []), l(() => {
15
15
  const e = new window.IntersectionObserver(
16
- ([s]) => {
17
- v(s.isIntersecting);
16
+ ([r]) => {
17
+ v(r.isIntersecting);
18
18
  },
19
- { threshold: 0.5 }
19
+ { rootMargin: "0px 0px -20% 0px", threshold: 0.2 }
20
20
  );
21
21
  return o.current && e.observe(o.current), () => e.disconnect();
22
22
  }, []), l(() => {
23
23
  t && n === "forward" && a(!0), t && n === "reverse" && a(!1);
24
- }, [t, n]), /* @__PURE__ */ i("section", { ref: o, className: b(r.root, f), children: /* @__PURE__ */ i("div", { className: r.container, children: h.map((e, s) => /* @__PURE__ */ i(
24
+ }, [t, n]), /* @__PURE__ */ i("section", { ref: o, className: b(s.root, f), children: /* @__PURE__ */ i("div", { className: s.container, children: p.map((e, r) => /* @__PURE__ */ i(
25
25
  "div",
26
26
  {
27
27
  className: b(
28
- r.bubble,
29
- d && r.bubbleFinished,
30
- !d && r.bubbleReverse
28
+ s.bubble,
29
+ d && s.bubbleFinished,
30
+ !d && s.bubbleReverse
31
31
  ),
32
32
  "data-size": e,
33
- "data-index": s
33
+ "data-index": r
34
34
  },
35
- s
35
+ r
36
36
  )) }) });
37
37
  };
38
38
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("../../modules/CallToAction/CallToAction.cjs.js"),o=["health","energy","strength","smiles","balance","sleep","miles","love","fun","years"],i=()=>{const e={subtitle:t.jsx("p",{children:"YOUR LONGEVITY JOURNEY"}),titleTop:t.jsx("p",{children:"Get more"}),scrollableLabels:o,titleBottom:t.jsx("p",{children:"out of life"}),description:"It's time to shift our thinking from healthcare and lifespan to something deeper. Healthspan.",hsaText:"Healthspan is HSA/FSA Eligible",buttonText:"JOIN NOW",buttonLink:"https://app.gethealthspan.com/#/get-started",backgroundImage:"https://methodical-vitality-96814f361f.media.strapiapp.com/aio_step_9_67b550bfe1.jpg"};return t.jsx(l.CallToAction,{...e})};exports.CallToActionDefault=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("../../modules/CallToAction/CallToAction.cjs.js"),o=["health","energy","strength","smiles","balance","sleep","miles","love","fun","years"],i=()=>{const e={subtitle:t.jsx("p",{children:"YOUR LONGEVITY JOURNEY"}),titleTop:t.jsx("p",{children:"Get more"}),scrollableLabels:o,titleBottom:t.jsx("p",{children:"out of life"}),description:"It's time to shift our thinking from healthcare and lifespan to something deeper. Healthspan.",hsaText:"Healthspan is HSA/FSA Eligible",buttonText:"JOIN NOW",buttonLink:"https://app.gethealthspan.com/#/get-started",backgroundImage:"https://methodical-vitality-96814f361f.media.strapiapp.com/aio_step_9_1_6d46345746.jpg"};return t.jsx(l.CallToAction,{...e})};exports.CallToActionDefault=i;
@@ -21,7 +21,7 @@ const o = [
21
21
  buttonText: "JOIN NOW",
22
22
  // TODO: How to we make this not eventually break...
23
23
  buttonLink: "https://app.gethealthspan.com/#/get-started",
24
- backgroundImage: "https://methodical-vitality-96814f361f.media.strapiapp.com/aio_step_9_67b550bfe1.jpg"
24
+ backgroundImage: "https://methodical-vitality-96814f361f.media.strapiapp.com/aio_step_9_1_6d46345746.jpg"
25
25
  } });
26
26
  export {
27
27
  s as CallToActionDefault
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.1.105",
3
+ "version": "0.1.106",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",