@zenpatient-org/healthspan-marketing-ui 0.1.134 → 0.1.135
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/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 +11 -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 +2 -1
- package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.es.js +41 -38
- package/dist/modules/HSModal/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../../components/Typography/Typography.cjs.js"),c=require("../../../../utils/cn/cn.cjs.js"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../../components/Typography/Typography.cjs.js"),c=require("../../../../utils/cn/cn.cjs.js"),f=require("./components/Newsletter/Newsletter.cjs.js"),a=require("./mailchimpModal.module.css.cjs.js"),j=({title:n,description:t,buttonText:d,image:s,layout:i="plain-column",colorScheme:l="light",onCloseCallback:o,onClickCallback:u,cancelButtonText:p="no, thanks",tags:m,placeholder:h})=>{const g=y=>{y.stopPropagation()};return e.jsxs("div",{className:c.cn(a.default.contentWrapper,a.default[l]),"data-image-position":i,onClick:g,children:[e.jsxs("div",{className:c.cn(a.default.content,a.default[l]),children:[(n||t)&&e.jsxs("div",{className:a.default.text,children:[n&&e.jsx(r.Typography,{defaultVariant:"headingLg",children:n}),t&&e.jsx(r.Typography,{defaultVariant:"bodySm",children:t})]}),e.jsx(f.Newsletter,{buttonText:d,cancelButtonText:p,colorScheme:l,onCloseCallback:o,onClickCallback:u,tags:m,placeholder:h})]}),s&&i!=="plain-column"&&e.jsx("div",{className:a.default.imageWrapper,children:e.jsx("div",{style:{backgroundImage:`url(${s})`},className:a.default.image})})]})};exports.MailchimpModal=j;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TMailchimpModal } from '../../types';
|
|
2
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;
|
|
3
|
+
export declare const MailchimpModal: ({ title, description, buttonText, image, layout, colorScheme, onCloseCallback, onClickCallback, cancelButtonText, tags, placeholder, }: Omit<TMailchimpModal, "id" | "type">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { jsxs as t, jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import { Typography as s } from "../../../../components/Typography/Typography.es.js";
|
|
4
4
|
import { cn as m } from "../../../../utils/cn/cn.es.js";
|
|
5
|
-
import { Newsletter as
|
|
5
|
+
import { Newsletter as v } from "./components/Newsletter/Newsletter.es.js";
|
|
6
6
|
import a from "./mailchimpModal.module.css.es.js";
|
|
7
|
-
const
|
|
7
|
+
const j = ({
|
|
8
8
|
title: i,
|
|
9
9
|
description: r,
|
|
10
10
|
buttonText: c,
|
|
@@ -14,17 +14,18 @@ const b = ({
|
|
|
14
14
|
onCloseCallback: d,
|
|
15
15
|
onClickCallback: p,
|
|
16
16
|
cancelButtonText: h = "no, thanks",
|
|
17
|
-
tags: g
|
|
17
|
+
tags: g,
|
|
18
|
+
placeholder: f
|
|
18
19
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
20
|
+
const u = (N) => {
|
|
21
|
+
N.stopPropagation();
|
|
21
22
|
};
|
|
22
23
|
return /* @__PURE__ */ t(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
26
|
className: m(a.contentWrapper, a[e]),
|
|
26
27
|
"data-image-position": o,
|
|
27
|
-
onClick:
|
|
28
|
+
onClick: u,
|
|
28
29
|
children: [
|
|
29
30
|
/* @__PURE__ */ t("div", { className: m(a.content, a[e]), children: [
|
|
30
31
|
(i || r) && /* @__PURE__ */ t("div", { className: a.text, children: [
|
|
@@ -32,14 +33,15 @@ const b = ({
|
|
|
32
33
|
r && /* @__PURE__ */ n(s, { defaultVariant: "bodySm", children: r })
|
|
33
34
|
] }),
|
|
34
35
|
/* @__PURE__ */ n(
|
|
35
|
-
|
|
36
|
+
v,
|
|
36
37
|
{
|
|
37
38
|
buttonText: c,
|
|
38
39
|
cancelButtonText: h,
|
|
39
40
|
colorScheme: e,
|
|
40
41
|
onCloseCallback: d,
|
|
41
42
|
onClickCallback: p,
|
|
42
|
-
tags: g
|
|
43
|
+
tags: g,
|
|
44
|
+
placeholder: f
|
|
43
45
|
}
|
|
44
46
|
)
|
|
45
47
|
] }),
|
|
@@ -49,5 +51,5 @@ const b = ({
|
|
|
49
51
|
);
|
|
50
52
|
};
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
j as MailchimpModal
|
|
53
55
|
};
|
package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),I=require("../../../../../../components/TextInput/TextInput.cjs.js"),B=require("../../../../../../node_modules/react-mailchimp-subscribe/es/index.cjs.js"),M=require("../../../../../../utils/isValidEmail.cjs.js"),x=require("../../../../../../components/Button/Button.cjs.js"),y=require("./newsletter.module.css.cjs.js"),N=e=>`//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&id=2483a4d606&f_id=0050e6e6f0&tags=${e}`,P=({status:e,message:o,subscribe:c,buttonText:l,colorScheme:d,onCloseCallback:r,cancelButtonText:m,onClickCallback:a,placeholder:f})=>{const[i,p]=u.useState(""),[g,s]=u.useState(!1),[j,n]=u.useState(""),[q,h]=u.useState(!1),E=v=>{p(v.target.value),g&&(s(!1),n("")),h(v.target.value.length>0)},S=()=>{if(!i){s(!0),n("Please enter your email address");return}if(!M.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"&&(p(""),s(!1),n(""),h(!1),r==null||r()),e==="error"&&typeof o=="string"&&(s(!0),n("Subscription failed. Please try again."))},[e,o]);const T=d==="light"?"primary":"primary-invert",_=d==="light"?"primary":"primary-invert";return t.jsxs("div",{className:y.default.interface,children:[t.jsx(I.TextInput,{placeholder:f||"Email",variant:T,value:i,handleChange:E,error:g,errorText:j,active:q}),t.jsxs("div",{className:y.default.buttonContainer,children:[t.jsx(x.Button,{size:"md",variant:_,onClick:S,children:e==="sending"?"submitting…":l}),t.jsx(x.Button,{size:"md",variant:"ghost",onClick:r,children:m})]})]})},V=({buttonText:e,colorScheme:o,onCloseCallback:c,cancelButtonText:l,tags:d,onClickCallback:r,placeholder:m})=>t.jsx(B.default,{url:N(d),render:({subscribe:a,status:f,message:i})=>t.jsx(P,{status:f,message:i,subscribe:a,buttonText:e,colorScheme:o,onCloseCallback:c,onClickCallback:r,cancelButtonText:l,placeholder:m})});exports.Newsletter=V;
|
package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare const Newsletter: ({ buttonText, colorScheme, onCloseCallback, cancelButtonText, tags, onClickCallback, }: {
|
|
1
|
+
export declare const Newsletter: ({ buttonText, colorScheme, onCloseCallback, cancelButtonText, tags, onClickCallback, placeholder, }: {
|
|
2
2
|
buttonText: string;
|
|
3
3
|
colorScheme: "light" | "dark";
|
|
4
4
|
onCloseCallback?: () => void;
|
|
5
5
|
cancelButtonText: string;
|
|
6
6
|
tags: string;
|
|
7
7
|
onClickCallback?: () => void;
|
|
8
|
+
placeholder?: string;
|
|
8
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import { useState as u, useEffect as
|
|
4
|
-
import { TextInput as
|
|
5
|
-
import
|
|
6
|
-
import { isValidEmail as
|
|
7
|
-
import { Button as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
2
|
+
import { jsx as n, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import { useState as u, useEffect as V } from "react";
|
|
4
|
+
import { TextInput as j } from "../../../../../../components/TextInput/TextInput.es.js";
|
|
5
|
+
import z from "../../../../../../node_modules/react-mailchimp-subscribe/es/index.es.js";
|
|
6
|
+
import { isValidEmail as A } from "../../../../../../utils/isValidEmail.es.js";
|
|
7
|
+
import { Button as E } from "../../../../../../components/Button/Button.es.js";
|
|
8
|
+
import x from "./newsletter.module.css.es.js";
|
|
9
|
+
const b = (e) => `//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54ec243b3582164cf116&id=2483a4d606&f_id=0050e6e6f0&tags=${e}`, w = ({
|
|
10
10
|
status: e,
|
|
11
11
|
message: m,
|
|
12
12
|
subscribe: f,
|
|
@@ -14,16 +14,17 @@ const A = (e) => `//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54e
|
|
|
14
14
|
colorScheme: o,
|
|
15
15
|
onCloseCallback: r,
|
|
16
16
|
cancelButtonText: p,
|
|
17
|
-
onClickCallback: a
|
|
17
|
+
onClickCallback: a,
|
|
18
|
+
placeholder: c
|
|
18
19
|
}) => {
|
|
19
|
-
const [t,
|
|
20
|
-
|
|
21
|
-
},
|
|
20
|
+
const [t, l] = u(""), [h, i] = u(!1), [M, s] = u(""), [I, g] = u(!1), N = (v) => {
|
|
21
|
+
l(v.target.value), h && (i(!1), s("")), g(v.target.value.length > 0);
|
|
22
|
+
}, P = () => {
|
|
22
23
|
if (!t) {
|
|
23
24
|
i(!0), s("Please enter your email address");
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
if (!
|
|
27
|
+
if (!A(t)) {
|
|
27
28
|
i(!0), s("Please enter a valid email address");
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
@@ -31,58 +32,60 @@ const A = (e) => `//gethealthspan.us21.list-manage.com/subscribe/post?u=664ad54e
|
|
|
31
32
|
EMAIL: t
|
|
32
33
|
}), a == null || a();
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
-
e === "success" && (
|
|
35
|
+
V(() => {
|
|
36
|
+
e === "success" && (l(""), i(!1), s(""), g(!1), r == null || r()), e === "error" && typeof m == "string" && (i(!0), s("Subscription failed. Please try again."));
|
|
36
37
|
}, [e, m]);
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
const S = o === "light" ? "primary" : "primary-invert", T = o === "light" ? "primary" : "primary-invert";
|
|
39
|
+
return /* @__PURE__ */ y("div", { className: x.interface, children: [
|
|
39
40
|
/* @__PURE__ */ n(
|
|
40
|
-
|
|
41
|
+
j,
|
|
41
42
|
{
|
|
42
|
-
placeholder: "Email",
|
|
43
|
-
variant:
|
|
43
|
+
placeholder: c || "Email",
|
|
44
|
+
variant: S,
|
|
44
45
|
value: t,
|
|
45
|
-
handleChange:
|
|
46
|
-
error:
|
|
47
|
-
errorText:
|
|
48
|
-
active:
|
|
46
|
+
handleChange: N,
|
|
47
|
+
error: h,
|
|
48
|
+
errorText: M,
|
|
49
|
+
active: I
|
|
49
50
|
}
|
|
50
51
|
),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */ n(
|
|
53
|
-
/* @__PURE__ */ n(
|
|
52
|
+
/* @__PURE__ */ y("div", { className: x.buttonContainer, children: [
|
|
53
|
+
/* @__PURE__ */ n(E, { size: "md", variant: T, onClick: P, children: e === "sending" ? "submitting…" : d }),
|
|
54
|
+
/* @__PURE__ */ n(E, { size: "md", variant: "ghost", onClick: r, children: p })
|
|
54
55
|
] })
|
|
55
56
|
] });
|
|
56
|
-
},
|
|
57
|
+
}, D = ({
|
|
57
58
|
buttonText: e,
|
|
58
59
|
colorScheme: m,
|
|
59
60
|
onCloseCallback: f,
|
|
60
61
|
cancelButtonText: d,
|
|
61
62
|
tags: o,
|
|
62
|
-
onClickCallback: r
|
|
63
|
+
onClickCallback: r,
|
|
64
|
+
placeholder: p
|
|
63
65
|
}) => /* @__PURE__ */ n(
|
|
64
|
-
|
|
66
|
+
z,
|
|
65
67
|
{
|
|
66
|
-
url:
|
|
68
|
+
url: b(o),
|
|
67
69
|
render: ({
|
|
68
|
-
subscribe:
|
|
69
|
-
status:
|
|
70
|
+
subscribe: a,
|
|
71
|
+
status: c,
|
|
70
72
|
message: t
|
|
71
73
|
}) => /* @__PURE__ */ n(
|
|
72
|
-
|
|
74
|
+
w,
|
|
73
75
|
{
|
|
74
|
-
status:
|
|
76
|
+
status: c,
|
|
75
77
|
message: t,
|
|
76
|
-
subscribe:
|
|
78
|
+
subscribe: a,
|
|
77
79
|
buttonText: e,
|
|
78
80
|
colorScheme: m,
|
|
79
81
|
onCloseCallback: f,
|
|
80
82
|
onClickCallback: r,
|
|
81
|
-
cancelButtonText: d
|
|
83
|
+
cancelButtonText: d,
|
|
84
|
+
placeholder: p
|
|
82
85
|
}
|
|
83
86
|
)
|
|
84
87
|
}
|
|
85
88
|
);
|
|
86
89
|
export {
|
|
87
|
-
|
|
90
|
+
D as Newsletter
|
|
88
91
|
};
|