@zenpatient-org/healthspan-marketing-ui 0.2.32 → 0.2.34

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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("../../src/modules/Citation/citation.module.css"),i=require("../../utils/cn/cn.cjs.js"),u=require("../../components/Typography/Typography.cjs.js");function l({orderPadding:r,items:n,className:c}){const e=isNaN(Number(r))?0:r;return!n||n.length===0?null:t.jsx("section",{className:i.cn(a.root,c),children:n==null?void 0:n.map((o,s)=>t.jsxs(u.Typography,{as:"p",className:a.text,defaultVariant:"bodySm",mobileVariant:"bodyXs",children:[t.jsx("sup",{children:e?e+s:s+1})," ",o.item]},o.id))})}exports.Citation=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("../../src/modules/Citation/citation.module.css"),u=require("../../utils/cn/cn.cjs.js"),i=require("../../components/Typography/Typography.cjs.js");function l({orderPadding:e,items:t,className:a}){const o=isNaN(Number(e))?0:e;return!t||t.length===0?null:r.jsx("section",{className:u.cn(s.root,a),children:t==null?void 0:t.map((c,n)=>r.jsxs(i.Typography,{as:"p",className:s.text,defaultVariant:"bodySm",mobileVariant:"bodyXs",children:[r.jsx("sup",{children:o?o+n:n+1})," ",c.item]},n))})}exports.Citation=l;
@@ -1,7 +1,6 @@
1
1
  export type CitationProps = {
2
2
  orderPadding?: number;
3
3
  items?: Array<{
4
- id: string | number;
5
4
  item: string;
6
5
  }>;
7
6
  className?: string;
@@ -1,14 +1,14 @@
1
- import { jsx as l, jsxs as c } from "react/jsx-runtime";
2
- import p from "../../modules/Citation/citation.module.css";
3
- import { cn as i } from "../../utils/cn/cn.es.js";
1
+ import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
+ import l from "../../modules/Citation/citation.module.css";
3
+ import { cn as m } from "../../utils/cn/cn.es.js";
4
4
  import { Typography as e } from "../../components/Typography/Typography.es.js";
5
- function y({ orderPadding: o, items: r, className: s }) {
6
- const t = isNaN(Number(o)) ? 0 : o;
7
- return !r || r.length === 0 ? null : /* @__PURE__ */ l("section", { className: i(p.root, s), children: r == null ? void 0 : r.map((a, n) => /* @__PURE__ */ c(e, { as: "p", className: p.text, defaultVariant: "bodySm", mobileVariant: "bodyXs", children: [
8
- /* @__PURE__ */ l("sup", { children: t ? t + n : n + 1 }),
5
+ function y({ orderPadding: t, items: r, className: p }) {
6
+ const a = isNaN(Number(t)) ? 0 : t;
7
+ return !r || r.length === 0 ? null : /* @__PURE__ */ n("section", { className: m(l.root, p), children: r == null ? void 0 : r.map((s, o) => /* @__PURE__ */ c(e, { as: "p", className: l.text, defaultVariant: "bodySm", mobileVariant: "bodyXs", children: [
8
+ /* @__PURE__ */ n("sup", { children: a ? a + o : o + 1 }),
9
9
  " ",
10
- a.item
11
- ] }, a.id)) });
10
+ s.item
11
+ ] }, o)) });
12
12
  }
13
13
  export {
14
14
  y as Citation
@@ -34,8 +34,8 @@
34
34
  }
35
35
 
36
36
  .dot {
37
- height: 8px;
38
- width: 8px;
37
+ height: var(--spacing-16, 16px);
38
+ width: var(--spacing-16, 16px);
39
39
  color: var(--color-text-primary-disabled);
40
40
  border-radius: 50%;
41
41
  display: inline-block;
@@ -93,7 +93,6 @@
93
93
  }
94
94
 
95
95
  .alternativeContent, .featuredContent {
96
- cursor: pointer;
97
96
  width: 100%;
98
97
  display: grid;
99
98
  grid-template-columns: 1fr;
@@ -258,8 +257,8 @@
258
257
  }
259
258
 
260
259
  .closeIcon {
261
- width: 1.5rem;
262
- height: 1.5rem;
260
+ width: var(--spacing-28, 28px);
261
+ height: var(--spacing-28, 28px);
263
262
  padding-inline: 8px;
264
263
  color: inherit;
265
264
  }
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("react"),w=require("react-mailchimp-subscribe"),N=require("../../../../../../utils/isValidEmail.cjs.js"),P=require("../../../../../../types/analytics/analytics.cjs.js"),j=require("../../../../../../src/modules/HSModal/components/MailchimpModal/components/Newsletter/newsletter.module.css"),V=require("../../../../../../components/TextInput/TextInput.cjs.js"),E=require("../../../../../../components/Button/Button.cjs.js"),b=e=>`//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&amp;id=2483a4d606&amp;f_id=0050e6e6f0&tags=${e}`,A=({status:e,message:c,subscribe:d,buttonText:p,colorScheme:l,onCloseCallback:r,cancelButtonText:f,onClickCallback:a,placeholder:h,trackingEvent:m,trackingLocation:y})=>{const[t,g]=o.useState(""),[v,n]=o.useState(!1),[S,s]=o.useState(""),[q,x]=o.useState(!1),T=u=>{g(u.target.value),v&&(n(!1),s("")),x(u.target.value.length>0)},M=()=>{var u;if(!t){n(!0),s("Please enter your email address");return}if(!N.isValidEmail(t)){n(!0),s("Please enter a valid email address");return}if(n(!1),s(""),d({EMAIL:t}),a==null||a(),m){const I={event:m,location:y||"",type:P.EAnalyticsEventType.interaction,payload:{email:t,component:"HSModal",element:"MailchimpCustomForm",pageTitle:document.title}};(u=window.eventBus)==null||u.emit("analytics",I)}};o.useEffect(()=>{e==="success"&&(g(""),n(!1),s(""),x(!1),r==null||r()),e==="error"&&typeof c=="string"&&(n(!0),s("Subscription failed. Please try again."))},[e,c]);const _=l==="light"?"primary":"primary-invert",B=l==="light"?"primary":"primary-invert";return i.jsxs("div",{className:j.interface,children:[i.jsx(V.TextInput,{placeholder:h||"Email",variant:_,value:t,handleChange:T,error:v,errorText:S,active:q}),i.jsxs("div",{className:j.buttonContainer,children:[i.jsx(E.Button,{size:"md",variant:B,onClick:M,children:e==="sending"?"submitting…":p}),i.jsx(E.Button,{size:"md",variant:"ghost",onClick:r,children:f})]})]})},z=({buttonText:e,colorScheme:c,onCloseCallback:d,cancelButtonText:p,tags:l,onClickCallback:r,placeholder:f,trackingEvent:a,trackingLocation:h})=>i.jsx(w,{url:b(l),render:({subscribe:m,status:y,message:t})=>i.jsx(A,{status:y,message:t,subscribe:m,buttonText:e,colorScheme:c,onCloseCallback:d,onClickCallback:r,cancelButtonText:p,placeholder:f,trackingEvent:a,trackingLocation:h})});exports.Newsletter=z;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),O=require("../../../../../../utils/isValidEmail.cjs.js"),I=require("../../../../../../types/analytics/analytics.cjs.js"),h=require("../../../../../../src/modules/HSModal/components/MailchimpModal/components/Newsletter/newsletter.module.css"),V=require("../../../../../../components/TextInput/TextInput.cjs.js"),f=require("../../../../../../components/Button/Button.cjs.js"),M="https://hook.us2.make.com/1pdxfhs8945s62ritw768u66p2weqoq6",R=({buttonText:g,colorScheme:l,onCloseCallback:a,cancelButtonText:v,tags:S,onClickCallback:c,placeholder:x,trackingEvent:d,trackingLocation:T})=>{const[s,m]=i.useState(""),[p,t]=i.useState(!1),[q,e]=i.useState(""),[j,y]=i.useState(!1),[E,o]=i.useState(null),w=n=>{m(n.target.value),p&&(t(!1),e("")),y(n.target.value.length>0)},P=async()=>{var n;if(!s){t(!0),e("Please enter your email address");return}if(!O.isValidEmail(s)){t(!0),e("Please enter a valid email address");return}t(!1),e(""),o("sending");try{const u=S.split(",").map(N=>({name:N,status:"active"}));(await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s,tags:u})})).ok?(o("success"),m(""),t(!1),e(""),y(!1),a==null||a()):(o("error"),t(!0),e("Subscription failed. Please try again."))}catch{o("error"),t(!0),e("Subscription failed. Please try again.")}if(c==null||c(),d){const u={event:d,location:T||"",type:I.EAnalyticsEventType.interaction,payload:{email:s,component:"HSModal",element:"MailchimpCustomForm",pageTitle:document.title}};(n=window.eventBus)==null||n.emit("analytics",u)}},_=l==="light"?"primary":"primary-invert",B=l==="light"?"primary":"primary-invert";return r.jsxs("div",{className:h.interface,children:[r.jsx(V.TextInput,{placeholder:x||"Email",variant:_,value:s,handleChange:w,error:p,errorText:q,active:j}),r.jsxs("div",{className:h.buttonContainer,children:[r.jsx(f.Button,{size:"md",variant:B,onClick:P,children:E==="sending"?"submitting…":g}),r.jsx(f.Button,{size:"md",variant:"ghost",onClick:a,children:v})]})]})};exports.Newsletter=R;
@@ -1,112 +1,87 @@
1
1
  "use client";
2
- import { jsx as m, jsxs as x } from "react/jsx-runtime";
3
- import { useState as d, useEffect as j } from "react";
4
- import z from "react-mailchimp-subscribe";
5
- import { isValidEmail as B } from "../../../../../../utils/isValidEmail.es.js";
6
- import { EAnalyticsEventType as F } from "../../../../../../types/analytics/analytics.es.js";
7
- import M from "../../../../../../modules/HSModal/components/MailchimpModal/components/Newsletter/newsletter.module.css";
8
- import { TextInput as b } from "../../../../../../components/TextInput/TextInput.es.js";
9
- import { Button as T } from "../../../../../../components/Button/Button.es.js";
10
- const H = (e) => `//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&amp;id=2483a4d606&amp;f_id=0050e6e6f0&tags=${e}`, L = ({
11
- status: e,
12
- message: o,
13
- subscribe: c,
14
- buttonText: f,
15
- colorScheme: p,
16
- onCloseCallback: r,
17
- cancelButtonText: l,
18
- onClickCallback: a,
19
- placeholder: h,
20
- trackingEvent: u,
21
- trackingLocation: v
2
+ import { jsxs as h, jsx as p } from "react/jsx-runtime";
3
+ import { useState as s } from "react";
4
+ import { isValidEmail as z } from "../../../../../../utils/isValidEmail.es.js";
5
+ import { EAnalyticsEventType as A } from "../../../../../../types/analytics/analytics.es.js";
6
+ import y from "../../../../../../modules/HSModal/components/MailchimpModal/components/Newsletter/newsletter.module.css";
7
+ import { TextInput as H } from "../../../../../../components/TextInput/TextInput.es.js";
8
+ import { Button as v } from "../../../../../../components/Button/Button.es.js";
9
+ const I = "https://hook.us2.make.com/1pdxfhs8945s62ritw768u66p2weqoq6", _ = ({
10
+ buttonText: g,
11
+ colorScheme: u,
12
+ onCloseCallback: n,
13
+ cancelButtonText: x,
14
+ tags: E,
15
+ onClickCallback: m,
16
+ placeholder: S,
17
+ trackingEvent: d,
18
+ trackingLocation: T
22
19
  }) => {
23
- const [t, g] = d(""), [y, i] = d(!1), [S, n] = d(""), [w, E] = d(!1), A = (s) => {
24
- g(s.target.value), y && (i(!1), n("")), E(s.target.value.length > 0);
25
- }, I = () => {
26
- var s;
27
- if (!t) {
28
- i(!0), n("Please enter your email address");
20
+ const [r, c] = s(""), [l, t] = s(!1), [w, e] = s(""), [P, f] = s(!1), [N, a] = s(null), O = (i) => {
21
+ c(i.target.value), l && (t(!1), e("")), f(i.target.value.length > 0);
22
+ }, j = async () => {
23
+ var i;
24
+ if (!r) {
25
+ t(!0), e("Please enter your email address");
29
26
  return;
30
27
  }
31
- if (!B(t)) {
32
- i(!0), n("Please enter a valid email address");
28
+ if (!z(r)) {
29
+ t(!0), e("Please enter a valid email address");
33
30
  return;
34
31
  }
35
- if (i(!1), n(""), c({
36
- EMAIL: t
37
- }), a == null || a(), u) {
38
- const V = {
39
- event: u,
40
- location: v || "",
41
- type: F.interaction,
32
+ t(!1), e(""), a("sending");
33
+ try {
34
+ const o = E.split(",").map((q) => ({
35
+ name: q,
36
+ status: "active"
37
+ }));
38
+ (await fetch(I, {
39
+ method: "POST",
40
+ headers: {
41
+ "Content-Type": "application/json"
42
+ },
43
+ body: JSON.stringify({
44
+ email: r,
45
+ tags: o
46
+ })
47
+ })).ok ? (a("success"), c(""), t(!1), e(""), f(!1), n == null || n()) : (a("error"), t(!0), e("Subscription failed. Please try again."));
48
+ } catch {
49
+ a("error"), t(!0), e("Subscription failed. Please try again.");
50
+ }
51
+ if (m == null || m(), d) {
52
+ const o = {
53
+ event: d,
54
+ location: T || "",
55
+ type: A.interaction,
42
56
  payload: {
43
- email: t,
57
+ email: r,
44
58
  component: "HSModal",
45
59
  element: "MailchimpCustomForm",
46
60
  pageTitle: document.title
47
61
  }
48
62
  };
49
- (s = window.eventBus) == null || s.emit("analytics", V);
63
+ (i = window.eventBus) == null || i.emit("analytics", o);
50
64
  }
51
- };
52
- j(() => {
53
- e === "success" && (g(""), i(!1), n(""), E(!1), r == null || r()), e === "error" && typeof o == "string" && (i(!0), n("Subscription failed. Please try again."));
54
- }, [e, o]);
55
- const N = p === "light" ? "primary" : "primary-invert", P = p === "light" ? "primary" : "primary-invert";
56
- return /* @__PURE__ */ x("div", { className: M.interface, children: [
57
- /* @__PURE__ */ m(
58
- b,
65
+ }, B = u === "light" ? "primary" : "primary-invert", V = u === "light" ? "primary" : "primary-invert";
66
+ return /* @__PURE__ */ h("div", { className: y.interface, children: [
67
+ /* @__PURE__ */ p(
68
+ H,
59
69
  {
60
- placeholder: h || "Email",
61
- variant: N,
62
- value: t,
63
- handleChange: A,
64
- error: y,
65
- errorText: S,
66
- active: w
70
+ placeholder: S || "Email",
71
+ variant: B,
72
+ value: r,
73
+ handleChange: O,
74
+ error: l,
75
+ errorText: w,
76
+ active: P
67
77
  }
68
78
  ),
69
- /* @__PURE__ */ x("div", { className: M.buttonContainer, children: [
70
- /* @__PURE__ */ m(T, { size: "md", variant: P, onClick: I, children: e === "sending" ? "submitting…" : f }),
71
- /* @__PURE__ */ m(T, { size: "md", variant: "ghost", onClick: r, children: l })
79
+ /* @__PURE__ */ h("div", { className: y.buttonContainer, children: [
80
+ /* @__PURE__ */ p(v, { size: "md", variant: V, onClick: j, children: N === "sending" ? "submitting…" : g }),
81
+ /* @__PURE__ */ p(v, { size: "md", variant: "ghost", onClick: n, children: x })
72
82
  ] })
73
83
  ] });
74
- }, O = ({
75
- buttonText: e,
76
- colorScheme: o,
77
- onCloseCallback: c,
78
- cancelButtonText: f,
79
- tags: p,
80
- onClickCallback: r,
81
- placeholder: l,
82
- trackingEvent: a,
83
- trackingLocation: h
84
- }) => /* @__PURE__ */ m(
85
- z,
86
- {
87
- url: H(p),
88
- render: ({
89
- subscribe: u,
90
- status: v,
91
- message: t
92
- }) => /* @__PURE__ */ m(
93
- L,
94
- {
95
- status: v,
96
- message: t,
97
- subscribe: u,
98
- buttonText: e,
99
- colorScheme: o,
100
- onCloseCallback: c,
101
- onClickCallback: r,
102
- cancelButtonText: f,
103
- placeholder: l,
104
- trackingEvent: a,
105
- trackingLocation: h
106
- }
107
- )
108
- }
109
- );
84
+ };
110
85
  export {
111
- O as Newsletter
86
+ _ as Newsletter
112
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",