@zenpatient-org/healthspan-marketing-ui 0.1.164 → 0.1.166
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.
- package/dist/components/StudyGridCard/StudyGridCard.cjs.js +1 -1
- package/dist/components/StudyGridCard/StudyGridCard.d.ts +5 -0
- package/dist/components/StudyGridCard/StudyGridCard.es.js +62 -42
- package/dist/healthspan-marketing-ui.css +1 -1
- package/dist/modules/Curiosity/Curiosity.cjs.js +1 -1
- package/dist/modules/Curiosity/Curiosity.d.ts +4 -1
- package/dist/modules/Curiosity/Curiosity.es.js +32 -14
- package/dist/modules/FeaturedIn/FeaturedIn.cjs.js +1 -1
- package/dist/modules/FeaturedIn/FeaturedIn.es.js +7 -8
- package/dist/modules/FeaturedIn/featuredIn.module.css.cjs.js +1 -1
- package/dist/modules/FeaturedIn/featuredIn.module.css.es.js +10 -12
- package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.cjs.js +1 -1
- package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.d.ts +1 -1
- package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.es.js +13 -9
- package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.cjs.js +1 -1
- package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.d.ts +5 -1
- package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.es.js +79 -58
- package/dist/modules/HSModal/types.d.ts +4 -0
- package/dist/modules/IndividualProductCard/IndividualProductCard.cjs.js +1 -1
- package/dist/modules/IndividualProductCard/IndividualProductCard.d.ts +4 -1
- package/dist/modules/IndividualProductCard/IndividualProductCard.es.js +74 -56
- package/dist/modules/ResearchFeatured/ResearchFeatured.cjs.js +1 -1
- package/dist/modules/ResearchFeatured/ResearchFeatured.d.ts +4 -1
- package/dist/modules/ResearchFeatured/ResearchFeatured.es.js +21 -8
- package/dist/modules/ResearchFeatured/components/FeaturedArticle/FeaturedArticle.cjs.js +1 -1
- package/dist/modules/ResearchFeatured/components/FeaturedArticle/FeaturedArticle.d.ts +1 -1
- package/dist/modules/ResearchFeatured/components/FeaturedArticle/FeaturedArticle.es.js +58 -33
- package/dist/modules/ResearchFilters/ResearchFilters.cjs.js +1 -1
- package/dist/modules/ResearchFilters/ResearchFilters.d.ts +4 -1
- package/dist/modules/ResearchFilters/ResearchFilters.es.js +40 -17
- package/dist/modules/ResearchStudies/ResearchStudies.cjs.js +1 -1
- package/dist/modules/ResearchStudies/ResearchStudies.d.ts +4 -1
- package/dist/modules/ResearchStudies/ResearchStudies.es.js +11 -9
- package/dist/modules/ResearchStudies/components/StudyCard/StudyCard.cjs.js +1 -1
- package/dist/modules/ResearchStudies/components/StudyCard/StudyCard.d.ts +1 -1
- package/dist/modules/ResearchStudies/components/StudyCard/StudyCard.es.js +38 -14
- package/dist/modules/Studies/Studies.cjs.js +1 -1
- package/dist/modules/Studies/Studies.d.ts +4 -1
- package/dist/modules/Studies/Studies.es.js +26 -11
- package/dist/pageComponents/Footer/Footer.cjs.js +1 -1
- package/dist/pageComponents/Footer/Footer.d.ts +5 -1
- package/dist/pageComponents/Footer/Footer.es.js +46 -26
- package/dist/pageComponents/Footer/components/NewsLetter/NewsLetter.cjs.js +1 -1
- package/dist/pageComponents/Footer/components/NewsLetter/NewsLetter.d.ts +3 -1
- package/dist/pageComponents/Footer/components/NewsLetter/NewsLetter.es.js +39 -30
- package/dist/types/analytics/analytics.cjs.js +1 -0
- package/dist/types/analytics/analytics.es.js +5 -0
- package/dist/types/analytics.d.ts +81 -0
- package/dist/types/articles.d.ts +4 -0
- package/package.json +7 -2
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { HighlightedTitle as
|
|
4
|
-
import { StudyGridCard as
|
|
5
|
-
import { Typography as
|
|
2
|
+
import { Button as c } from "../../components/Button/Button.es.js";
|
|
3
|
+
import { HighlightedTitle as u } from "../../components/HighlightedTitle/HighlightedTitle.es.js";
|
|
4
|
+
import { StudyGridCard as f } from "../../components/StudyGridCard/StudyGridCard.es.js";
|
|
5
|
+
import { Typography as g } from "../../components/Typography/Typography.es.js";
|
|
6
6
|
import i from "./studies.module.css.es.js";
|
|
7
|
-
function
|
|
8
|
-
|
|
7
|
+
function T({
|
|
8
|
+
title: l,
|
|
9
|
+
description: o,
|
|
10
|
+
articles: m,
|
|
11
|
+
allStudiesLink: d,
|
|
12
|
+
trackingEvent: n,
|
|
13
|
+
trackingLocation: h
|
|
14
|
+
}) {
|
|
15
|
+
const p = m.reduce(
|
|
9
16
|
(e, t) => {
|
|
10
17
|
const s = e[e.length - 1];
|
|
11
18
|
return s.length < 2 ? s.push(t) : e.push([t]), e;
|
|
@@ -14,13 +21,21 @@ function x({ title: l, description: o, articles: m, allStudiesLink: d }) {
|
|
|
14
21
|
);
|
|
15
22
|
return /* @__PURE__ */ r("section", { className: i.root, children: /* @__PURE__ */ a("div", { className: i.container, children: [
|
|
16
23
|
/* @__PURE__ */ a("div", { className: i.header, children: [
|
|
17
|
-
/* @__PURE__ */ r(
|
|
18
|
-
o && /* @__PURE__ */ r(
|
|
19
|
-
d && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
24
|
+
/* @__PURE__ */ r(u, { title: l }),
|
|
25
|
+
o && /* @__PURE__ */ r(g, { as: "p", defaultVariant: "bodyLg", className: i.description, children: o }),
|
|
26
|
+
d && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(c, { as: "a", variant: "muted", size: "lg", href: d, children: "view all studies" }) })
|
|
20
27
|
] }),
|
|
21
|
-
/* @__PURE__ */ r("div", { className: i.articles, children:
|
|
28
|
+
/* @__PURE__ */ r("div", { className: i.articles, children: p.map((e, t) => /* @__PURE__ */ r("div", { className: i.row, children: e.map((s) => /* @__PURE__ */ r(
|
|
29
|
+
f,
|
|
30
|
+
{
|
|
31
|
+
...s,
|
|
32
|
+
trackingEvent: n,
|
|
33
|
+
trackingLocation: h
|
|
34
|
+
},
|
|
35
|
+
s.title
|
|
36
|
+
)) }, t)) })
|
|
22
37
|
] }) });
|
|
23
38
|
}
|
|
24
39
|
export {
|
|
25
|
-
|
|
40
|
+
T as Studies
|
|
26
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("../../components/Icon/Icon.cjs.js");const o=require("../../components/Icon/constants.cjs.js"),s=require("../../components/IconButton/IconButton.cjs.js"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("../../components/Icon/Icon.cjs.js");const o=require("../../components/Icon/constants.cjs.js"),s=require("../../components/IconButton/IconButton.cjs.js"),d=require("./components/FooterAbout/FooterAbout.cjs.js"),h=require("./components/FooterLinksBlock/FooterLinksBlock.cjs.js"),j=require("./components/NewsLetter/NewsLetter.cjs.js");require("react");require("../../components/Button/Button.cjs.js");const x=require("./components/TopTreatmentsSlider/TopTreatmentsSlider.cjs.js"),N=require("./components/LinksColumn/LinksColumn.cjs.js"),v=require("./assets/CompanyName.svg.cjs.js"),p=require("../../types/analytics/analytics.cjs.js"),n=require("./footer.module.css.cjs.js"),l={title:"Treatments",content:[{title:"All Treatments",href:"/treatments"},{title:"Personalized Protocols",href:"/personalized-protocols"},{title:"Labs",href:"/labs"},{title:"Medications",href:"/medications"},{title:"Supplements",href:"/supplements"}]},q=({socialMedia:t,products:r,trackingEvent:i,trackingLocation:c})=>{const m=u=>{var a;if(i){const f={event:i,location:c||"",type:p.EAnalyticsEventType.interaction,payload:{email:u,pageTitle:document.title,component:"Footer",element:"NewsLetter"}};(a=window.eventBus)==null||a.emit("analytics",f)}};return e.jsx("footer",{className:n.default.root,children:e.jsxs("div",{className:n.default.container,children:[e.jsxs("div",{className:n.default.content,children:[e.jsx("div",{className:n.default.footerLeft,children:e.jsx(j.NewsLetter,{onSubmit:m})}),e.jsxs("div",{className:n.default.footerRight,children:[e.jsxs("div",{className:n.default.columns,children:[e.jsx(N.LinksColumn,{title:l.title,links:l.content},l.title),r&&(r==null?void 0:r.length)>0&&e.jsx(x.TopTreatmentsSlider,{title:"Top Treatments",products:r})]}),e.jsx("div",{className:n.default.footerLinks,children:e.jsx(h.FooterLinksBlock,{})}),e.jsxs("div",{className:n.default.about,children:[e.jsx(d.FooterAbout,{}),e.jsxs("div",{className:n.default.socials,children:[(t==null?void 0:t.facebook)&&e.jsx("a",{href:t.facebook,target:"_blank",rel:"noopener noreferrer",children:e.jsx(s.IconButton,{iconName:o.EIconName.FACEBOOK,variant:"muted-invert",size:"lg"})}),(t==null?void 0:t.instagram)&&e.jsx("a",{href:t.instagram,target:"_blank",rel:"noopener noreferrer",children:e.jsx(s.IconButton,{iconName:o.EIconName.INSTAGRAM,variant:"muted-invert",size:"lg"})}),(t==null?void 0:t.twitter)&&e.jsx("a",{href:t.twitter,target:"_blank",rel:"noopener noreferrer",children:e.jsx(s.IconButton,{iconName:o.EIconName.X,variant:"muted-invert",size:"lg"})})]})]})]})]}),e.jsx("div",{className:n.default.img,children:e.jsx(v.default,{width:"100%",height:"100%",preserveAspectRatio:"xMidYMid meet"})})]})})};exports.Footer=q;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EAnalyticsEvent } from '../../types/analytics';
|
|
2
|
+
|
|
1
3
|
type TProducts = {
|
|
2
4
|
name: string;
|
|
3
5
|
image: string;
|
|
@@ -12,6 +14,8 @@ type TSocialMedia = {
|
|
|
12
14
|
export type TFooterProps = {
|
|
13
15
|
socialMedia?: TSocialMedia;
|
|
14
16
|
products?: Array<TProducts>;
|
|
17
|
+
trackingEvent?: EAnalyticsEvent.mailchimpSubmitClicked;
|
|
18
|
+
trackingLocation?: string;
|
|
15
19
|
};
|
|
16
|
-
export declare const Footer: ({ socialMedia, products }: TFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const Footer: ({ socialMedia, products, trackingEvent, trackingLocation }: TFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
export {};
|
|
@@ -3,14 +3,15 @@ import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
|
3
3
|
import "../../components/Icon/Icon.es.js";
|
|
4
4
|
import { EIconName as m } from "../../components/Icon/constants.es.js";
|
|
5
5
|
import { IconButton as i } from "../../components/IconButton/IconButton.es.js";
|
|
6
|
-
import { FooterAbout as
|
|
7
|
-
import { FooterLinksBlock as
|
|
8
|
-
import { NewsLetter as
|
|
6
|
+
import { FooterAbout as v } from "./components/FooterAbout/FooterAbout.es.js";
|
|
7
|
+
import { FooterLinksBlock as N } from "./components/FooterLinksBlock/FooterLinksBlock.es.js";
|
|
8
|
+
import { NewsLetter as d } from "./components/NewsLetter/NewsLetter.es.js";
|
|
9
9
|
import "react";
|
|
10
10
|
import "../../components/Button/Button.es.js";
|
|
11
|
-
import { TopTreatmentsSlider as
|
|
12
|
-
import { LinksColumn as
|
|
13
|
-
import
|
|
11
|
+
import { TopTreatmentsSlider as g } from "./components/TopTreatmentsSlider/TopTreatmentsSlider.es.js";
|
|
12
|
+
import { LinksColumn as b } from "./components/LinksColumn/LinksColumn.es.js";
|
|
13
|
+
import u from "./assets/CompanyName.svg.es.js";
|
|
14
|
+
import { EAnalyticsEventType as k } from "../../types/analytics/analytics.es.js";
|
|
14
15
|
import r from "./footer.module.css.es.js";
|
|
15
16
|
const l = {
|
|
16
17
|
title: "Treatments",
|
|
@@ -21,27 +22,46 @@ const l = {
|
|
|
21
22
|
{ title: "Medications", href: "/medications" },
|
|
22
23
|
{ title: "Supplements", href: "/supplements" }
|
|
23
24
|
]
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
}, _ = ({ socialMedia: t, products: o, trackingEvent: s, trackingLocation: c }) => {
|
|
26
|
+
const f = (p) => {
|
|
27
|
+
var a;
|
|
28
|
+
if (s) {
|
|
29
|
+
const h = {
|
|
30
|
+
event: s,
|
|
31
|
+
location: c || "",
|
|
32
|
+
type: k.interaction,
|
|
33
|
+
payload: {
|
|
34
|
+
email: p,
|
|
35
|
+
pageTitle: document.title,
|
|
36
|
+
component: "Footer",
|
|
37
|
+
element: "NewsLetter"
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
(a = window.eventBus) == null || a.emit("analytics", h);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ e("footer", { className: r.root, children: /* @__PURE__ */ n("div", { className: r.container, children: [
|
|
44
|
+
/* @__PURE__ */ n("div", { className: r.content, children: [
|
|
45
|
+
/* @__PURE__ */ e("div", { className: r.footerLeft, children: /* @__PURE__ */ e(d, { onSubmit: f }) }),
|
|
46
|
+
/* @__PURE__ */ n("div", { className: r.footerRight, children: [
|
|
47
|
+
/* @__PURE__ */ n("div", { className: r.columns, children: [
|
|
48
|
+
/* @__PURE__ */ e(b, { title: l.title, links: l.content }, l.title),
|
|
49
|
+
o && (o == null ? void 0 : o.length) > 0 && /* @__PURE__ */ e(g, { title: "Top Treatments", products: o })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ e("div", { className: r.footerLinks, children: /* @__PURE__ */ e(N, {}) }),
|
|
52
|
+
/* @__PURE__ */ n("div", { className: r.about, children: [
|
|
53
|
+
/* @__PURE__ */ e(v, {}),
|
|
54
|
+
/* @__PURE__ */ n("div", { className: r.socials, children: [
|
|
55
|
+
(t == null ? void 0 : t.facebook) && /* @__PURE__ */ e("a", { href: t.facebook, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ e(i, { iconName: m.FACEBOOK, variant: "muted-invert", size: "lg" }) }),
|
|
56
|
+
(t == null ? void 0 : t.instagram) && /* @__PURE__ */ e("a", { href: t.instagram, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ e(i, { iconName: m.INSTAGRAM, variant: "muted-invert", size: "lg" }) }),
|
|
57
|
+
(t == null ? void 0 : t.twitter) && /* @__PURE__ */ e("a", { href: t.twitter, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ e(i, { iconName: m.X, variant: "muted-invert", size: "lg" }) })
|
|
58
|
+
] })
|
|
39
59
|
] })
|
|
40
60
|
] })
|
|
41
|
-
] })
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ e("div", { className: r.img, children: /* @__PURE__ */ e(u, { width: "100%", height: "100%", preserveAspectRatio: "xMidYMid meet" }) })
|
|
63
|
+
] }) });
|
|
64
|
+
};
|
|
45
65
|
export {
|
|
46
|
-
|
|
66
|
+
_ as Footer
|
|
47
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),u=require("../../../../components/Typography/Typography.cjs.js"),v=require("../../../../components/TextInput/TextInput.cjs.js"),T=require("../../../../utils/cn/cn.cjs.js"),j=require("../../../../node_modules/react-mailchimp-subscribe/es/index.cjs.js"),w=require("../../../../utils/isValidEmail.cjs.js"),s=require("./newsLetter.module.css.cjs.js"),q="//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&id=2483a4d606&f_id=0050e6e6f0&tags=239347,239351",E=({status:e,message:c,subscribe:o})=>{const[a,l]=n.useState(""),[p,f]=n.useState(""),[d,r]=n.useState(!1),[g,i]=n.useState(""),[y,h]=n.useState(!1),b=m=>{l(m.target.value),d&&(r(!1),i("")),h(m.target.value.length>0)},x=()=>{if(!a){r(!0),i("Please enter your email address");return}if(!w.isValidEmail(a)){r(!0),i("Please enter a valid email address");return}r(!1),i(""),o({EMAIL:a})};return n.useEffect(()=>{e==="success"&&(f(a),l(""),r(!1),i(""),h(!1)),e==="error"&&typeof c=="string"&&(r(!0),i("Subscription failed. Please try again."))},[e,c]),t.jsxs("div",{className:T.cn(s.default.root,{[s.default.subscribed]:e==="success"}),children:[t.jsxs("div",{className:s.default.container,children:[t.jsx(u.Typography,{defaultVariant:"headingLg",mobileVariant:"headingSm",as:"h2",className:s.default.title,children:e==="success"?"Thanks for subscribing!":"Read the latest research reviews"}),t.jsx(u.Typography,{defaultVariant:"bodySm",mobileVariant:"bodyXs",as:"span",className:s.default.text,children:e==="success"?t.jsxs(t.Fragment,{children:["You will now begin receiving our monthly newsletter at"," ",t.jsx("b",{className:s.default.email,children:p}),". It's a great way to keep up to date on the latest developments in longevity science."]}):"Request The Longevity Blueprint to receive our weekly newsletter containing synopses of the latest clinical research."})]}),e==="sending"&&t.jsx("div",{className:s.default.container,children:t.jsx(u.Typography,{defaultVariant:"bodySm",mobileVariant:"bodyXs",as:"span",className:s.default.text,children:"Subscribing, please wait..."})}),e!=="success"&&e!=="sending"&&t.jsx(v.TextInput,{placeholder:"Your email",variant:"primary-invert",value:a,handleChange:b,onButtonClick:x,showButton:!0,error:d,errorText:g,active:y})]})},S=({onSubmit:e})=>t.jsx(j.default,{url:q,render:({subscribe:c,status:o,message:a})=>t.jsx(E,{status:o,message:a,subscribe:l=>{c(l),e==null||e(l.EMAIL)}})});exports.NewsLetter=S;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as a, jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Typography as
|
|
5
|
-
import { TextInput as
|
|
6
|
-
import { cn as
|
|
7
|
-
import
|
|
8
|
-
import { isValidEmail as
|
|
2
|
+
import { jsx as a, jsxs as m, Fragment as E } from "react/jsx-runtime";
|
|
3
|
+
import { useState as l, useEffect as x } from "react";
|
|
4
|
+
import { Typography as d } from "../../../../components/Typography/Typography.es.js";
|
|
5
|
+
import { TextInput as N } from "../../../../components/TextInput/TextInput.es.js";
|
|
6
|
+
import { cn as V } from "../../../../utils/cn/cn.es.js";
|
|
7
|
+
import T from "../../../../node_modules/react-mailchimp-subscribe/es/index.es.js";
|
|
8
|
+
import { isValidEmail as I } from "../../../../utils/isValidEmail.es.js";
|
|
9
9
|
import r from "./newsLetter.module.css.es.js";
|
|
10
|
-
const
|
|
10
|
+
const L = "//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&id=2483a4d606&f_id=0050e6e6f0&tags=239347,239351", S = ({
|
|
11
11
|
status: e,
|
|
12
|
-
message:
|
|
13
|
-
subscribe:
|
|
12
|
+
message: o,
|
|
13
|
+
subscribe: c
|
|
14
14
|
}) => {
|
|
15
|
-
const [s,
|
|
16
|
-
|
|
15
|
+
const [s, n] = l(""), [f, b] = l(""), [u, i] = l(!1), [g, t] = l(""), [v, h] = l(!1), y = (p) => {
|
|
16
|
+
n(p.target.value), u && (i(!1), t("")), h(p.target.value.length > 0);
|
|
17
17
|
}, w = () => {
|
|
18
18
|
if (!s) {
|
|
19
|
-
|
|
19
|
+
i(!0), t("Please enter your email address");
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
if (!
|
|
23
|
-
|
|
22
|
+
if (!I(s)) {
|
|
23
|
+
i(!0), t("Please enter a valid email address");
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
i(!1), t(""), c({
|
|
27
27
|
EMAIL: s
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
return x(() => {
|
|
31
|
-
e === "success" && (b(s),
|
|
32
|
-
}, [e,
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */ a(
|
|
35
|
-
/* @__PURE__ */ a(
|
|
31
|
+
e === "success" && (b(s), n(""), i(!1), t(""), h(!1)), e === "error" && typeof o == "string" && (i(!0), t("Subscription failed. Please try again."));
|
|
32
|
+
}, [e, o]), /* @__PURE__ */ m("div", { className: V(r.root, { [r.subscribed]: e === "success" }), children: [
|
|
33
|
+
/* @__PURE__ */ m("div", { className: r.container, children: [
|
|
34
|
+
/* @__PURE__ */ a(d, { defaultVariant: "headingLg", mobileVariant: "headingSm", as: "h2", className: r.title, children: e === "success" ? "Thanks for subscribing!" : "Read the latest research reviews" }),
|
|
35
|
+
/* @__PURE__ */ a(d, { defaultVariant: "bodySm", mobileVariant: "bodyXs", as: "span", className: r.text, children: e === "success" ? /* @__PURE__ */ m(E, { children: [
|
|
36
36
|
"You will now begin receiving our monthly newsletter at",
|
|
37
37
|
" ",
|
|
38
38
|
/* @__PURE__ */ a("b", { className: r.email, children: f }),
|
|
39
39
|
". It's a great way to keep up to date on the latest developments in longevity science."
|
|
40
40
|
] }) : "Request The Longevity Blueprint to receive our weekly newsletter containing synopses of the latest clinical research." })
|
|
41
41
|
] }),
|
|
42
|
-
e === "sending" && /* @__PURE__ */ a("div", { className: r.container, children: /* @__PURE__ */ a(
|
|
42
|
+
e === "sending" && /* @__PURE__ */ a("div", { className: r.container, children: /* @__PURE__ */ a(d, { defaultVariant: "bodySm", mobileVariant: "bodyXs", as: "span", className: r.text, children: "Subscribing, please wait..." }) }),
|
|
43
43
|
e !== "success" && e !== "sending" && /* @__PURE__ */ a(
|
|
44
|
-
|
|
44
|
+
N,
|
|
45
45
|
{
|
|
46
46
|
placeholder: "Your email",
|
|
47
47
|
variant: "primary-invert",
|
|
@@ -55,15 +55,24 @@ const k = "//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b35
|
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
] });
|
|
58
|
-
}, R = () => /* @__PURE__ */ a(
|
|
59
|
-
|
|
58
|
+
}, R = ({ onSubmit: e }) => /* @__PURE__ */ a(
|
|
59
|
+
T,
|
|
60
60
|
{
|
|
61
|
-
url:
|
|
61
|
+
url: L,
|
|
62
62
|
render: ({
|
|
63
|
-
subscribe:
|
|
64
|
-
status:
|
|
65
|
-
message:
|
|
66
|
-
}) => /* @__PURE__ */ a(
|
|
63
|
+
subscribe: o,
|
|
64
|
+
status: c,
|
|
65
|
+
message: s
|
|
66
|
+
}) => /* @__PURE__ */ a(
|
|
67
|
+
S,
|
|
68
|
+
{
|
|
69
|
+
status: c,
|
|
70
|
+
message: s,
|
|
71
|
+
subscribe: (n) => {
|
|
72
|
+
o(n), e == null || e(n.EMAIL);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
)
|
|
67
76
|
}
|
|
68
77
|
);
|
|
69
78
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var c=(e=>(e.pageView="Page view",e.featuredArticleClicked="Featured article clicked",e.scienceCardClicked="Science card clicked",e.articleCategoryClicked="Article category clicked",e.userSelectedPlan="User selected plan",e.mailchimpSubmitClicked="Mailchimp submit clicked",e.articleScrolledBy="Article scrolled by",e))(c||{}),r=(e=>(e.view="view",e.appearance="appearance",e.interaction="interaction",e))(r||{});exports.EAnalyticsEvent=c;exports.EAnalyticsEventType=r;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var r = /* @__PURE__ */ ((e) => (e.pageView = "Page view", e.featuredArticleClicked = "Featured article clicked", e.scienceCardClicked = "Science card clicked", e.articleCategoryClicked = "Article category clicked", e.userSelectedPlan = "User selected plan", e.mailchimpSubmitClicked = "Mailchimp submit clicked", e.articleScrolledBy = "Article scrolled by", e))(r || {}), c = /* @__PURE__ */ ((e) => (e.view = "view", e.appearance = "appearance", e.interaction = "interaction", e))(c || {});
|
|
2
|
+
export {
|
|
3
|
+
r as EAnalyticsEvent,
|
|
4
|
+
c as EAnalyticsEventType
|
|
5
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare enum EAnalyticsEvent {
|
|
2
|
+
pageView = "Page view",
|
|
3
|
+
featuredArticleClicked = "Featured article clicked",
|
|
4
|
+
scienceCardClicked = "Science card clicked",
|
|
5
|
+
articleCategoryClicked = "Article category clicked",
|
|
6
|
+
userSelectedPlan = "User selected plan",
|
|
7
|
+
mailchimpSubmitClicked = "Mailchimp submit clicked",
|
|
8
|
+
articleScrolledBy = "Article scrolled by"
|
|
9
|
+
}
|
|
10
|
+
export declare enum EAnalyticsEventType {
|
|
11
|
+
view = "view",
|
|
12
|
+
appearance = "appearance",
|
|
13
|
+
interaction = "interaction"
|
|
14
|
+
}
|
|
15
|
+
export type TBasicAnalyticsEvent = {
|
|
16
|
+
event: EAnalyticsEvent;
|
|
17
|
+
location: string;
|
|
18
|
+
type: EAnalyticsEventType;
|
|
19
|
+
};
|
|
20
|
+
export type TPageViewEvent = TBasicAnalyticsEvent & {
|
|
21
|
+
event: EAnalyticsEvent.pageView;
|
|
22
|
+
payload: {
|
|
23
|
+
pageTitle: string;
|
|
24
|
+
component: string;
|
|
25
|
+
element: string;
|
|
26
|
+
referrer: string;
|
|
27
|
+
userAgent: string;
|
|
28
|
+
viewportWidth: number;
|
|
29
|
+
viewportHeight: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type TFeaturedArticleClickedEvent = TBasicAnalyticsEvent & {
|
|
33
|
+
event: EAnalyticsEvent.featuredArticleClicked;
|
|
34
|
+
payload: {
|
|
35
|
+
articleTitle: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type TScienceCardClickedEvent = TBasicAnalyticsEvent & {
|
|
39
|
+
event: EAnalyticsEvent.scienceCardClicked;
|
|
40
|
+
payload: {
|
|
41
|
+
scienceCardTitle: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type TArticleCategoryClickedEvent = TBasicAnalyticsEvent & {
|
|
45
|
+
event: EAnalyticsEvent.articleCategoryClicked;
|
|
46
|
+
payload: {
|
|
47
|
+
category: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export type TUserSelectedPlanEvent = TBasicAnalyticsEvent & {
|
|
51
|
+
event: EAnalyticsEvent.userSelectedPlan;
|
|
52
|
+
payload: {
|
|
53
|
+
planId: string;
|
|
54
|
+
planPrice?: number;
|
|
55
|
+
planDuration?: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export type TMailchimpSubmitClickedEvent = TBasicAnalyticsEvent & {
|
|
59
|
+
event: EAnalyticsEvent.mailchimpSubmitClicked;
|
|
60
|
+
payload: {
|
|
61
|
+
email: string;
|
|
62
|
+
pageTitle: string;
|
|
63
|
+
component: string;
|
|
64
|
+
element: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type TarticleScrolledByEvent = TBasicAnalyticsEvent & {
|
|
68
|
+
event: EAnalyticsEvent.articleScrolledBy;
|
|
69
|
+
payload: {
|
|
70
|
+
scrollDepth: number;
|
|
71
|
+
articleTitle: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export interface IEventBus {
|
|
75
|
+
emitAsync<T>(event: string, ...args: T[]): Promise<void>;
|
|
76
|
+
emit<T>(event: string, ...args: T[]): boolean;
|
|
77
|
+
on<T>(event: string, listener: (...args: T[]) => void): IEventBus;
|
|
78
|
+
off<T>(event: string, listener: (...args: T[]) => void): IEventBus;
|
|
79
|
+
listeners<T>(event: string): Array<(...args: T[]) => void>;
|
|
80
|
+
}
|
|
81
|
+
export type TAnalyticsEvent = TPageViewEvent | TFeaturedArticleClickedEvent | TScienceCardClickedEvent | TArticleCategoryClickedEvent | TUserSelectedPlanEvent | TMailchimpSubmitClickedEvent | TarticleScrolledByEvent;
|
package/dist/types/articles.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EAnalyticsEvent } from './analytics';
|
|
2
|
+
|
|
1
3
|
export type TResearchArticleView = {
|
|
2
4
|
image: string;
|
|
3
5
|
date: number;
|
|
@@ -5,4 +7,6 @@ export type TResearchArticleView = {
|
|
|
5
7
|
link: string;
|
|
6
8
|
label?: string;
|
|
7
9
|
readTime?: number;
|
|
10
|
+
trackingEvent?: EAnalyticsEvent.featuredArticleClicked;
|
|
11
|
+
trackingLocation?: string;
|
|
8
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenpatient-org/healthspan-marketing-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.166",
|
|
4
4
|
"description": "Design system",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -641,6 +641,11 @@
|
|
|
641
641
|
"import": "./dist/modules/Grid/Grid.es.js",
|
|
642
642
|
"require": "./dist/modules/Grid/Grid.cjs.js"
|
|
643
643
|
},
|
|
644
|
-
"./dist/*.css": "./dist/*.css"
|
|
644
|
+
"./dist/*.css": "./dist/*.css",
|
|
645
|
+
"./analytics": {
|
|
646
|
+
"types": "./dist/types/analytics.d.ts",
|
|
647
|
+
"import": "./dist/types/analytics/analytics.es.js",
|
|
648
|
+
"require": "./dist/types/analytics/analytics.cjs.js"
|
|
649
|
+
}
|
|
645
650
|
}
|
|
646
651
|
}
|