@zenpatient-org/healthspan-marketing-ui 0.1.103 → 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.
Files changed (40) hide show
  1. package/dist/components/TextInput/TextInput.d.ts +1 -2
  2. package/dist/components/TextInput/index.d.ts +1 -0
  3. package/dist/components/Typography/Typography.cjs.js +1 -1
  4. package/dist/components/Typography/Typography.es.js +9 -9
  5. package/dist/healthspan-marketing-ui.css +1 -1
  6. package/dist/modules/AllInOne/AllInOne.cjs.js +1 -1
  7. package/dist/modules/AllInOne/AllInOne.es.js +193 -142
  8. package/dist/modules/AllInOne/allInOne.module.css.cjs.js +1 -1
  9. package/dist/modules/AllInOne/allInOne.module.css.es.js +14 -12
  10. package/dist/modules/CallToAction/CallToAction.cjs.js +1 -1
  11. package/dist/modules/CallToAction/CallToAction.es.js +112 -83
  12. package/dist/modules/HSModal/HSModal.cjs.js +1 -0
  13. package/dist/modules/HSModal/HSModal.d.ts +4 -0
  14. package/dist/modules/HSModal/HSModal.es.js +25 -0
  15. package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.cjs.js +1 -0
  16. package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.d.ts +3 -0
  17. package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.es.js +53 -0
  18. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.cjs.js +1 -0
  19. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.d.ts +8 -0
  20. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.es.js +88 -0
  21. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/index.d.ts +1 -0
  22. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/newsletter.module.css.cjs.js +1 -0
  23. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/newsletter.module.css.es.js +8 -0
  24. package/dist/modules/HSModal/components/MailchimpModal/components/index.d.ts +1 -0
  25. package/dist/modules/HSModal/components/MailchimpModal/index.d.ts +1 -0
  26. package/dist/modules/HSModal/components/MailchimpModal/mailchimpModal.module.css.cjs.js +1 -0
  27. package/dist/modules/HSModal/components/MailchimpModal/mailchimpModal.module.css.es.js +21 -0
  28. package/dist/modules/HSModal/components/index.d.ts +1 -0
  29. package/dist/modules/HSModal/hsModal.module.css.cjs.js +1 -0
  30. package/dist/modules/HSModal/hsModal.module.css.es.js +7 -0
  31. package/dist/modules/HSModal/index.d.ts +3 -0
  32. package/dist/modules/HSModal/types.d.ts +23 -0
  33. package/dist/modules/HSModal/useHSModal.cjs.js +1 -0
  34. package/dist/modules/HSModal/useHSModal.d.ts +20 -0
  35. package/dist/modules/HSModal/useHSModal.es.js +63 -0
  36. package/dist/pageComponents/Bubbles/Bubbles.cjs.js +1 -1
  37. package/dist/pageComponents/Bubbles/Bubbles.es.js +13 -13
  38. package/dist/pageComponents/CallToActionDefault/CallToActionDefault.cjs.js +1 -1
  39. package/dist/pageComponents/CallToActionDefault/CallToActionDefault.es.js +1 -1
  40. package/package.json +6 -1
@@ -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,106 +61,134 @@ const ne = ({
60
61
  amount: 1,
61
62
  from: "start"
62
63
  },
63
- scrollTrigger: {
64
- trigger: V.current,
65
- start: "top center",
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(u, { defaultVariant: "bodyLg", mobileVariant: "bodyMd", className: r.description, children: X }) }),
145
- /* @__PURE__ */ e("div", { ref: g, className: r.buttonWrapper, children: f && /* @__PURE__ */ e(
146
- j,
155
+ /* @__PURE__ */ e("div", { ref: g, children: /* @__PURE__ */ e(
156
+ f,
157
+ {
158
+ as: "p",
159
+ defaultVariant: "bodyLg",
160
+ mobileVariant: "bodyMd",
161
+ className: r.description,
162
+ children: z
163
+ }
164
+ ) }),
165
+ /* @__PURE__ */ e("div", { ref: v, className: r.buttonWrapper, children: h && /* @__PURE__ */ e(
166
+ K,
147
167
  {
148
- as: f ? "a" : "button",
149
- href: f,
168
+ as: h ? "a" : "button",
169
+ href: h,
150
170
  variant: "secondary",
151
171
  size: "lg",
152
- children: z
172
+ children: O
153
173
  }
154
174
  ) }),
155
- /* @__PURE__ */ s("div", { ref: y, className: r.hsaEligible, children: [
156
- /* @__PURE__ */ e(A, { name: I.CIRCLE_CHECK_FILL, className: r.checkIcon }),
157
- /* @__PURE__ */ e(u, { defaultVariant: "bodySm", mobileVariant: "bodySm", className: r.hsaText, children: _ })
175
+ /* @__PURE__ */ s("div", { ref: N, className: r.hsaEligible, children: [
176
+ /* @__PURE__ */ e(W, { name: B.CIRCLE_CHECK_FILL, className: r.checkIcon }),
177
+ /* @__PURE__ */ e(
178
+ f,
179
+ {
180
+ as: "p",
181
+ defaultVariant: "bodySm",
182
+ mobileVariant: "bodySm",
183
+ className: r.hsaText,
184
+ children: F
185
+ }
186
+ )
158
187
  ] })
159
188
  ] }) })
160
189
  ] })
161
190
  ] });
162
191
  };
163
192
  export {
164
- ne as CallToAction
193
+ ce as CallToAction
165
194
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./components/MailchimpModal/MailchimpModal.cjs.js"),r=require("./useHSModal.cjs.js"),d=require("./hsModal.module.css.cjs.js"),u=l=>{const{isOpen:a,closeModal:i,handleClick:n,handleOverlayClick:c}=r.useHSModal({id:l.id,initiallyOpen:l.initiallyOpen,trigger:l.trigger,onCloseCallback:l.onCloseCallback,onClickCallback:l.onClickCallback}),o=()=>{switch(l.type){case"mailchimp":return e.jsx(t.MailchimpModal,{...l,onCloseCallback:i,onClickCallback:n});default:return null}};return a?e.jsx("div",{className:d.default.overlay,onClick:c,children:o()}):null};exports.HSModal=u;
@@ -0,0 +1,4 @@
1
+ import { TMailchimpModal } from './types';
2
+
3
+ export type HSModalProps = TMailchimpModal;
4
+ export declare const HSModal: (props: HSModalProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { MailchimpModal as t } from "./components/MailchimpModal/MailchimpModal.es.js";
4
+ import { useHSModal as r } from "./useHSModal.es.js";
5
+ import C from "./hsModal.module.css.es.js";
6
+ const u = (l) => {
7
+ const { isOpen: i, closeModal: a, handleClick: n, handleOverlayClick: o } = r({
8
+ id: l.id,
9
+ initiallyOpen: l.initiallyOpen,
10
+ trigger: l.trigger,
11
+ onCloseCallback: l.onCloseCallback,
12
+ onClickCallback: l.onClickCallback
13
+ }), c = () => {
14
+ switch (l.type) {
15
+ case "mailchimp":
16
+ return /* @__PURE__ */ e(t, { ...l, onCloseCallback: a, onClickCallback: n });
17
+ default:
18
+ return null;
19
+ }
20
+ };
21
+ return i ? /* @__PURE__ */ e("div", { className: C.overlay, onClick: o, children: c() }) : null;
22
+ };
23
+ export {
24
+ u as HSModal
25
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../../../components/Typography/Typography.cjs.js"),s=require("../../../../utils/cn/cn.cjs.js"),y=require("./components/Newsletter/Newsletter.cjs.js"),a=require("./mailchimpModal.module.css.cjs.js"),f=({title:r,description:c,buttonText:d,image:n,layout:i="plain-column",colorScheme:t="light",onCloseCallback:o,onClickCallback:u,cancelButtonText:p="no, thanks",tags:m})=>{const h=g=>{g.stopPropagation()};return e.jsxs("div",{className:s.cn(a.default.contentWrapper,a.default[t]),"data-image-position":i,onClick:h,children:[e.jsxs("div",{className:s.cn(a.default.content,a.default[t]),children:[e.jsxs("div",{className:a.default.text,children:[e.jsx(l.Typography,{defaultVariant:"headingLg",children:r}),e.jsx(l.Typography,{defaultVariant:"bodySm",children:c})]}),e.jsx(y.Newsletter,{buttonText:d,cancelButtonText:p,colorScheme:t,onCloseCallback:o,onClickCallback:u,tags:m})]}),n&&i!=="plain-column"&&e.jsx("div",{className:a.default.imageWrapper,children:e.jsx("div",{style:{backgroundImage:`url(${n})`},className:a.default.image})})]})};exports.MailchimpModal=f;
@@ -0,0 +1,3 @@
1
+ import { TMailchimpModal } from '../../types';
2
+
3
+ export declare const MailchimpModal: ({ title, description, buttonText, image, layout, colorScheme, onCloseCallback, onClickCallback, cancelButtonText, tags, }: Omit<TMailchimpModal, "id" | "type">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { jsxs as t, jsx as i } from "react/jsx-runtime";
3
+ import { Typography as l } from "../../../../components/Typography/Typography.es.js";
4
+ import { cn as o } from "../../../../utils/cn/cn.es.js";
5
+ import { Newsletter as N } from "./components/Newsletter/Newsletter.es.js";
6
+ import a from "./mailchimpModal.module.css.es.js";
7
+ const b = ({
8
+ title: s,
9
+ description: m,
10
+ buttonText: c,
11
+ image: e,
12
+ layout: r = "plain-column",
13
+ colorScheme: n = "light",
14
+ onCloseCallback: d,
15
+ onClickCallback: p,
16
+ cancelButtonText: h = "no, thanks",
17
+ tags: g
18
+ }) => {
19
+ const f = (u) => {
20
+ u.stopPropagation();
21
+ };
22
+ return /* @__PURE__ */ t(
23
+ "div",
24
+ {
25
+ className: o(a.contentWrapper, a[n]),
26
+ "data-image-position": r,
27
+ onClick: f,
28
+ children: [
29
+ /* @__PURE__ */ t("div", { className: o(a.content, a[n]), children: [
30
+ /* @__PURE__ */ t("div", { className: a.text, children: [
31
+ /* @__PURE__ */ i(l, { defaultVariant: "headingLg", children: s }),
32
+ /* @__PURE__ */ i(l, { defaultVariant: "bodySm", children: m })
33
+ ] }),
34
+ /* @__PURE__ */ i(
35
+ N,
36
+ {
37
+ buttonText: c,
38
+ cancelButtonText: h,
39
+ colorScheme: n,
40
+ onCloseCallback: d,
41
+ onClickCallback: p,
42
+ tags: g
43
+ }
44
+ )
45
+ ] }),
46
+ e && r !== "plain-column" && /* @__PURE__ */ i("div", { className: a.imageWrapper, children: /* @__PURE__ */ i("div", { style: { backgroundImage: `url(${e})` }, className: a.image }) })
47
+ ]
48
+ }
49
+ );
50
+ };
51
+ export {
52
+ b as MailchimpModal
53
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),_=require("../../../../../../components/TextInput/TextInput.cjs.js"),I=require("../../../../../../node_modules/react-mailchimp-subscribe/es/index.cjs.js"),B=require("../../../../../../utils/isValidEmail.cjs.js"),v=require("../../../../../../components/Button/Button.cjs.js"),x=require("./newsletter.module.css.cjs.js"),M=e=>`//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&amp;id=2483a4d606&amp;f_id=0050e6e6f0&tags=${e}`,N=({status:e,message:o,subscribe:c,buttonText:l,colorScheme:d,onCloseCallback:r,cancelButtonText:m,onClickCallback:a})=>{const[i,f]=u.useState(""),[p,s]=u.useState(!1),[y,n]=u.useState(""),[j,g]=u.useState(!1),q=h=>{f(h.target.value),p&&(s(!1),n("")),g(h.target.value.length>0)},E=()=>{if(!i){s(!0),n("Please enter your email address");return}if(!B.isValidEmail(i)){s(!0),n("Please enter a valid email address");return}s(!1),n(""),c({EMAIL:i}),a==null||a()};u.useEffect(()=>{e==="success"&&(f(""),s(!1),n(""),g(!1),r==null||r()),e==="error"&&typeof o=="string"&&(s(!0),n("Subscription failed. Please try again."))},[e,o]);const S=d==="light"?"primary":"primary-invert",T=d==="light"?"primary":"primary-invert";return t.jsxs("div",{className:x.default.interface,children:[t.jsx(_.TextInput,{placeholder:"Email",variant:S,value:i,handleChange:q,error:p,errorText:y,active:j}),t.jsxs("div",{className:x.default.buttonContainer,children:[t.jsx(v.Button,{size:"md",variant:T,onClick:E,children:e==="sending"?"submitting…":l}),t.jsx(v.Button,{size:"md",variant:"ghost",onClick:r,children:m})]})]})},P=({buttonText:e,colorScheme:o,onCloseCallback:c,cancelButtonText:l,tags:d,onClickCallback:r})=>t.jsx(I.default,{url:M(d),render:({subscribe:m,status:a,message:i})=>t.jsx(N,{status:a,message:i,subscribe:m,buttonText:e,colorScheme:o,onCloseCallback:c,onClickCallback:r,cancelButtonText:l})});exports.Newsletter=P;
@@ -0,0 +1,8 @@
1
+ export declare const Newsletter: ({ buttonText, colorScheme, onCloseCallback, cancelButtonText, tags, onClickCallback, }: {
2
+ buttonText: string;
3
+ colorScheme: "light" | "dark";
4
+ onCloseCallback?: () => void;
5
+ cancelButtonText: string;
6
+ tags: string;
7
+ onClickCallback?: () => void;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,88 @@
1
+ "use client";
2
+ import { jsx as n, jsxs as v } from "react/jsx-runtime";
3
+ import { useState as u, useEffect as T } from "react";
4
+ import { TextInput as V } from "../../../../../../components/TextInput/TextInput.es.js";
5
+ import j from "../../../../../../node_modules/react-mailchimp-subscribe/es/index.es.js";
6
+ import { isValidEmail as z } from "../../../../../../utils/isValidEmail.es.js";
7
+ import { Button as y } from "../../../../../../components/Button/Button.es.js";
8
+ import E from "./newsletter.module.css.es.js";
9
+ const A = (e) => `//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&amp;id=2483a4d606&amp;f_id=0050e6e6f0&tags=${e}`, b = ({
10
+ status: e,
11
+ message: m,
12
+ subscribe: f,
13
+ buttonText: d,
14
+ colorScheme: o,
15
+ onCloseCallback: r,
16
+ cancelButtonText: p,
17
+ onClickCallback: a
18
+ }) => {
19
+ const [t, c] = u(""), [l, i] = u(!1), [x, s] = u(""), [M, h] = u(!1), I = (g) => {
20
+ c(g.target.value), l && (i(!1), s("")), h(g.target.value.length > 0);
21
+ }, N = () => {
22
+ if (!t) {
23
+ i(!0), s("Please enter your email address");
24
+ return;
25
+ }
26
+ if (!z(t)) {
27
+ i(!0), s("Please enter a valid email address");
28
+ return;
29
+ }
30
+ i(!1), s(""), f({
31
+ EMAIL: t
32
+ }), a == null || a();
33
+ };
34
+ T(() => {
35
+ e === "success" && (c(""), i(!1), s(""), h(!1), r == null || r()), e === "error" && typeof m == "string" && (i(!0), s("Subscription failed. Please try again."));
36
+ }, [e, m]);
37
+ const P = o === "light" ? "primary" : "primary-invert", S = o === "light" ? "primary" : "primary-invert";
38
+ return /* @__PURE__ */ v("div", { className: E.interface, children: [
39
+ /* @__PURE__ */ n(
40
+ V,
41
+ {
42
+ placeholder: "Email",
43
+ variant: P,
44
+ value: t,
45
+ handleChange: I,
46
+ error: l,
47
+ errorText: x,
48
+ active: M
49
+ }
50
+ ),
51
+ /* @__PURE__ */ v("div", { className: E.buttonContainer, children: [
52
+ /* @__PURE__ */ n(y, { size: "md", variant: S, onClick: N, children: e === "sending" ? "submitting…" : d }),
53
+ /* @__PURE__ */ n(y, { size: "md", variant: "ghost", onClick: r, children: p })
54
+ ] })
55
+ ] });
56
+ }, q = ({
57
+ buttonText: e,
58
+ colorScheme: m,
59
+ onCloseCallback: f,
60
+ cancelButtonText: d,
61
+ tags: o,
62
+ onClickCallback: r
63
+ }) => /* @__PURE__ */ n(
64
+ j,
65
+ {
66
+ url: A(o),
67
+ render: ({
68
+ subscribe: p,
69
+ status: a,
70
+ message: t
71
+ }) => /* @__PURE__ */ n(
72
+ b,
73
+ {
74
+ status: a,
75
+ message: t,
76
+ subscribe: p,
77
+ buttonText: e,
78
+ colorScheme: m,
79
+ onCloseCallback: f,
80
+ onClickCallback: r,
81
+ cancelButtonText: d
82
+ }
83
+ )
84
+ }
85
+ );
86
+ export {
87
+ q as Newsletter
88
+ };
@@ -0,0 +1 @@
1
+ export { Newsletter } from './Newsletter';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="newsletter-module__buttonContainer___Jn0WJ",t={interface:"newsletter-module__interface___dgwMa",buttonContainer:e};exports.buttonContainer=e;exports.default=t;
@@ -0,0 +1,8 @@
1
+ const t = "newsletter-module__buttonContainer___Jn0WJ", e = {
2
+ interface: "newsletter-module__interface___dgwMa",
3
+ buttonContainer: t
4
+ };
5
+ export {
6
+ t as buttonContainer,
7
+ e as default
8
+ };
@@ -0,0 +1 @@
1
+ export { Newsletter } from './Newsletter';
@@ -0,0 +1 @@
1
+ export { MailchimpModal } from './MailchimpModal';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="mailchimpModal-module__overlay___peQPr",t="mailchimpModal-module__contentWrapper___HpcOd",a="mailchimpModal-module__light___-lF5m",o="mailchimpModal-module__dark___7FKcx",_="mailchimpModal-module__content___xscO6",l="mailchimpModal-module__imageWrapper___lBCUP",m="mailchimpModal-module__text___t5kPi",i="mailchimpModal-module__image___2R979",c={overlay:e,contentWrapper:t,light:a,dark:o,content:_,imageWrapper:l,text:m,image:i};exports.content=_;exports.contentWrapper=t;exports.dark=o;exports.default=c;exports.image=i;exports.imageWrapper=l;exports.light=a;exports.overlay=e;exports.text=m;
@@ -0,0 +1,21 @@
1
+ const _ = "mailchimpModal-module__overlay___peQPr", a = "mailchimpModal-module__contentWrapper___HpcOd", e = "mailchimpModal-module__light___-lF5m", o = "mailchimpModal-module__dark___7FKcx", l = "mailchimpModal-module__content___xscO6", t = "mailchimpModal-module__imageWrapper___lBCUP", m = "mailchimpModal-module__text___t5kPi", c = "mailchimpModal-module__image___2R979", i = {
2
+ overlay: _,
3
+ contentWrapper: a,
4
+ light: e,
5
+ dark: o,
6
+ content: l,
7
+ imageWrapper: t,
8
+ text: m,
9
+ image: c
10
+ };
11
+ export {
12
+ l as content,
13
+ a as contentWrapper,
14
+ o as dark,
15
+ i as default,
16
+ c as image,
17
+ t as imageWrapper,
18
+ e as light,
19
+ _ as overlay,
20
+ m as text
21
+ };
@@ -0,0 +1 @@
1
+ export { MailchimpModal } from './MailchimpModal';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="hsModal-module__overlay___kdLCe",l={overlay:e};exports.default=l;exports.overlay=e;
@@ -0,0 +1,7 @@
1
+ const e = "hsModal-module__overlay___kdLCe", o = {
2
+ overlay: e
3
+ };
4
+ export {
5
+ o as default,
6
+ e as overlay
7
+ };
@@ -0,0 +1,3 @@
1
+ export { HSModal } from './HSModal';
2
+ export { useHSModal, shouldShowPopup, getDaysUntilNextShow } from './useHSModal';
3
+ export type { TMailchimpModal, THSModal } from './types';
@@ -0,0 +1,23 @@
1
+ type TimerTrigger = {
2
+ type: 'timer';
3
+ delay: number;
4
+ };
5
+ type THSModal = {
6
+ id: string;
7
+ title: string;
8
+ description: string;
9
+ buttonText: string;
10
+ trigger?: TimerTrigger;
11
+ layout?: 'plain-column' | 'header-image' | 'side-image';
12
+ cancelButtonText?: string;
13
+ colorScheme?: 'light' | 'dark';
14
+ image?: string;
15
+ onCloseCallback?: () => void;
16
+ onClickCallback?: () => void;
17
+ initiallyOpen?: boolean;
18
+ };
19
+ export type TMailchimpModal = THSModal & {
20
+ type: 'mailchimp';
21
+ tags: string;
22
+ };
23
+ export type { THSModal };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),m=7,i=24*60*60*1e3,w=o=>{try{const n=localStorage.getItem(`popup_${o}_lastShown`);if(!n)return!0;const e=parseInt(n,10);return(new Date().getTime()-e)/i>=m}catch(n){return console.warn("Error checking popup cooldown:",n),!0}},E=({id:o,initiallyOpen:n=!1,trigger:e,onCloseCallback:r,onClickCallback:u})=>{const[c,S]=t.useState(n),a=t.useCallback(()=>{w(o)&&S(!0)},[o]),d=t.useCallback(()=>{S(!1),r==null||r()},[r]),y=t.useCallback(()=>{u==null||u()},[u]);t.useEffect(()=>{if((e==null?void 0:e.type)==="timer"&&!c){const s=setTimeout(()=>{a()},e.delay*1e3);return()=>clearTimeout(s)}},[e,c,a]),t.useEffect(()=>{if(!c)return;const s=new Date().getTime();localStorage.setItem(`popup_${o}_lastShown`,s.toString());const h=window.getComputedStyle(document.body).overflow;document.body.style.overflow="hidden";const p=l=>{l.key==="Escape"&&d()};return document.addEventListener("keydown",p),()=>{document.body.style.overflow=h,document.removeEventListener("keydown",p)}},[c,d,o]);const f=t.useCallback(s=>{s.target===s.currentTarget&&d()},[d]);return{isOpen:c,openModal:a,closeModal:d,handleClick:y,handleOverlayClick:f}};exports.shouldShowPopup=w;exports.useHSModal=E;
@@ -0,0 +1,20 @@
1
+ export declare const shouldShowPopup: (id: string) => boolean;
2
+ export declare const getDaysUntilNextShow: (id: string) => number;
3
+ type UseHSModalProps = {
4
+ id: string;
5
+ initiallyOpen?: boolean;
6
+ trigger?: {
7
+ type: 'timer';
8
+ delay: number;
9
+ };
10
+ onCloseCallback?: () => void;
11
+ onClickCallback?: () => void;
12
+ };
13
+ export declare const useHSModal: ({ id, initiallyOpen, trigger, onCloseCallback, onClickCallback, }: UseHSModalProps) => {
14
+ isOpen: boolean;
15
+ openModal: () => void;
16
+ closeModal: () => void;
17
+ handleClick: () => void;
18
+ handleOverlayClick: (e: React.MouseEvent) => void;
19
+ };
20
+ export {};