@zenpatient-org/healthspan-marketing-ui 0.1.134 → 0.1.136

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 (22) hide show
  1. package/dist/components/ImageGallery/ImageGallery.cjs.js +1 -1
  2. package/dist/components/ImageGallery/ImageGallery.es.js +36 -19
  3. package/dist/components/InfiniteScroll/InfiniteScroll.cjs.js +1 -1
  4. package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +2 -0
  5. package/dist/components/InfiniteScroll/InfiniteScroll.es.js +138 -67
  6. package/dist/components/InfiniteScroll/infiniteScroll.module.css.cjs.js +1 -1
  7. package/dist/components/InfiniteScroll/infiniteScroll.module.css.es.js +8 -6
  8. package/dist/healthspan-marketing-ui.css +1 -1
  9. package/dist/lib/useSwiper.d.ts +9 -2
  10. package/dist/modules/Curiosity/Curiosity.cjs.js +1 -1
  11. package/dist/modules/Curiosity/Curiosity.es.js +15 -12
  12. package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.cjs.js +1 -1
  13. package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.d.ts +1 -1
  14. package/dist/modules/HSModal/components/MailchimpModal/MailchimpModal.es.js +11 -9
  15. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.cjs.js +1 -1
  16. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.d.ts +2 -1
  17. package/dist/modules/HSModal/components/MailchimpModal/components/Newsletter/Newsletter.es.js +41 -38
  18. package/dist/modules/HSModal/types.d.ts +1 -0
  19. package/dist/modules/HowItWorks/components/Content/Content.d.ts +2 -2
  20. package/dist/utils/useSwiper/useSwiper.cjs.js +1 -1
  21. package/dist/utils/useSwiper/useSwiper.es.js +66 -36
  22. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { Swiper as SwiperType } from 'swiper';
3
3
 
4
- export type UseSwiperReturnProps = {
4
+ export type BaseSwiperReturnProps = {
5
5
  swiper: SwiperType | null;
6
6
  setSwiper: React.Dispatch<React.SetStateAction<SwiperType | null>>;
7
7
  activeIndex: number;
@@ -20,4 +20,11 @@ export type UseSwiperReturnProps = {
20
20
  onSwiperInit: (swiper: SwiperType) => void;
21
21
  handleSwiperResize: (swiper: SwiperType) => void;
22
22
  };
23
- export declare const useSwiper: () => UseSwiperReturnProps;
23
+ export type AutoPlaySwiperReturnProps = BaseSwiperReturnProps & {
24
+ isAutoPlay: boolean;
25
+ stopAutoPlay: () => void;
26
+ startAutoPlay: () => void;
27
+ handleUserInteraction: () => void;
28
+ };
29
+ export declare const useSwiper: () => BaseSwiperReturnProps;
30
+ export declare const useSwiperWithAutoPlay: (autoPlayInterval?: number) => AutoPlaySwiperReturnProps;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../../components/Button/Button.cjs.js"),m=require("../../components/HighlightedTitle/HighlightedTitle.cjs.js"),o=require("../../components/InfiniteScroll/InfiniteScroll.cjs.js"),n=require("../../components/Typography/Typography.cjs.js"),d=require("../../components/StudyGridCard/StudyGridCard.cjs.js"),t=require("./curiosity.module.css.cjs.js"),f=require("../../utils/cn/cn.cjs.js"),h=({title:c,description:r,studies:s,indexed:i})=>e.jsxs("div",{className:f.cn(t.default.root,{[t.default.notIndexed]:!i}),children:[e.jsxs("div",{className:t.default.contentContainer,children:[e.jsxs("div",{className:t.default.containerHeader,children:[e.jsx(m.HighlightedTitle,{title:c,className:t.default.title,defaultVariant:"displayXl",mobileVariant:"displayXs"}),e.jsxs("div",{className:t.default.contentTextContainer,children:[r&&e.jsx(n.Typography,{defaultVariant:"bodyLg",mobileVariant:"bodySm",className:t.default.contentText,children:r}),e.jsx("div",{className:t.default.buttonContainer,children:e.jsx(u.Button,{as:"a",href:"/research",variant:"muted",size:"lg",children:"View all studies"})})]})]}),i&&e.jsxs("div",{className:t.default.dividerContainer,children:[e.jsx(n.Typography,{defaultVariant:"labelMd",children:i.number}),e.jsx("div",{className:t.default.divider}),e.jsx(n.Typography,{defaultVariant:"labelMd",emphasis:!0,children:i.label})]})]}),e.jsxs("div",{className:t.default.containerBottom,children:[e.jsx(o.InfiniteScroll,{items:s,speed:50,contentClassName:t.default.infiniteScrollContent,itemClassName:t.default.infiniteScrollItem,rootClassName:t.default.infiniteScrollRoot,renderItem:(a,l)=>e.jsx(d.StudyGridCard,{...a,compressed:!0},l)}),e.jsx(o.InfiniteScroll,{items:s,speed:50,direction:"right",contentClassName:t.default.infiniteScrollContent,itemClassName:t.default.infiniteScrollItemTwo,rootClassName:t.default.infiniteScrollRoot,renderItem:(a,l)=>e.jsx(d.StudyGridCard,{...a,compressed:!0},l)})]})]});exports.Curiosity=h;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../../components/Button/Button.cjs.js"),m=require("../../components/HighlightedTitle/HighlightedTitle.cjs.js"),o=require("../../components/InfiniteScroll/InfiniteScroll.cjs.js"),a=require("../../components/Typography/Typography.cjs.js"),d=require("../../components/StudyGridCard/StudyGridCard.cjs.js"),f=require("../../utils/cn/cn.cjs.js"),t=require("./curiosity.module.css.cjs.js"),h=({title:c,description:r,studies:s,indexed:i})=>e.jsxs("div",{className:f.cn(t.default.root,{[t.default.notIndexed]:!i}),children:[e.jsxs("div",{className:t.default.contentContainer,children:[e.jsxs("div",{className:t.default.containerHeader,children:[e.jsx(m.HighlightedTitle,{title:c,className:t.default.title,defaultVariant:"displayXl",mobileVariant:"displayXs"}),e.jsxs("div",{className:t.default.contentTextContainer,children:[r&&e.jsx(a.Typography,{defaultVariant:"bodyLg",mobileVariant:"bodySm",className:t.default.contentText,children:r}),e.jsx("div",{className:t.default.buttonContainer,children:e.jsx(u.Button,{as:"a",href:"/research",variant:"muted",size:"lg",children:"View all studies"})})]})]}),i&&e.jsxs("div",{className:t.default.dividerContainer,children:[e.jsx(a.Typography,{defaultVariant:"labelMd",children:i.number}),e.jsx("div",{className:t.default.divider}),e.jsx(a.Typography,{defaultVariant:"labelMd",emphasis:!0,children:i.label})]})]}),e.jsxs("div",{className:t.default.containerBottom,children:[e.jsx(o.InfiniteScroll,{items:s,speed:50,slowOnTouch:!0,enableManualScroll:!0,contentClassName:t.default.infiniteScrollContent,itemClassName:t.default.infiniteScrollItem,rootClassName:t.default.infiniteScrollRoot,renderItem:(l,n)=>e.jsx(d.StudyGridCard,{...l,compressed:!0},n)}),e.jsx(o.InfiniteScroll,{items:s,speed:50,direction:"right",slowOnTouch:!0,enableManualScroll:!0,contentClassName:t.default.infiniteScrollContent,itemClassName:t.default.infiniteScrollItemTwo,renderItem:(l,n)=>e.jsx(d.StudyGridCard,{...l,compressed:!0},n)})]})]});exports.Curiosity=h;
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as t } from "react/jsx-runtime";
3
- import { Button as f } from "../../components/Button/Button.es.js";
3
+ import { Button as u } from "../../components/Button/Button.es.js";
4
4
  import { HighlightedTitle as h } from "../../components/HighlightedTitle/HighlightedTitle.es.js";
5
5
  import { InfiniteScroll as m } from "../../components/InfiniteScroll/InfiniteScroll.es.js";
6
- import { Typography as l } from "../../components/Typography/Typography.es.js";
6
+ import { Typography as n } from "../../components/Typography/Typography.es.js";
7
7
  import { StudyGridCard as c } from "../../components/StudyGridCard/StudyGridCard.es.js";
8
+ import { cn as f } from "../../utils/cn/cn.es.js";
8
9
  import e from "./curiosity.module.css.es.js";
9
- import { cn as p } from "../../utils/cn/cn.es.js";
10
- const g = ({ title: d, description: o, studies: s, indexed: r }) => /* @__PURE__ */ i("div", { className: p(e.root, { [e.notIndexed]: !r }), children: [
10
+ const V = ({ title: d, description: o, studies: s, indexed: r }) => /* @__PURE__ */ i("div", { className: f(e.root, { [e.notIndexed]: !r }), children: [
11
11
  /* @__PURE__ */ i("div", { className: e.contentContainer, children: [
12
12
  /* @__PURE__ */ i("div", { className: e.containerHeader, children: [
13
13
  /* @__PURE__ */ t(
@@ -20,14 +20,14 @@ const g = ({ title: d, description: o, studies: s, indexed: r }) => /* @__PURE__
20
20
  }
21
21
  ),
22
22
  /* @__PURE__ */ i("div", { className: e.contentTextContainer, children: [
23
- o && /* @__PURE__ */ t(l, { defaultVariant: "bodyLg", mobileVariant: "bodySm", className: e.contentText, children: o }),
24
- /* @__PURE__ */ t("div", { className: e.buttonContainer, children: /* @__PURE__ */ t(f, { as: "a", href: "/research", variant: "muted", size: "lg", children: "View all studies" }) })
23
+ o && /* @__PURE__ */ t(n, { defaultVariant: "bodyLg", mobileVariant: "bodySm", className: e.contentText, children: o }),
24
+ /* @__PURE__ */ t("div", { className: e.buttonContainer, children: /* @__PURE__ */ t(u, { as: "a", href: "/research", variant: "muted", size: "lg", children: "View all studies" }) })
25
25
  ] })
26
26
  ] }),
27
27
  r && /* @__PURE__ */ i("div", { className: e.dividerContainer, children: [
28
- /* @__PURE__ */ t(l, { defaultVariant: "labelMd", children: r.number }),
28
+ /* @__PURE__ */ t(n, { defaultVariant: "labelMd", children: r.number }),
29
29
  /* @__PURE__ */ t("div", { className: e.divider }),
30
- /* @__PURE__ */ t(l, { defaultVariant: "labelMd", emphasis: !0, children: r.label })
30
+ /* @__PURE__ */ t(n, { defaultVariant: "labelMd", emphasis: !0, children: r.label })
31
31
  ] })
32
32
  ] }),
33
33
  /* @__PURE__ */ i("div", { className: e.containerBottom, children: [
@@ -36,10 +36,12 @@ const g = ({ title: d, description: o, studies: s, indexed: r }) => /* @__PURE__
36
36
  {
37
37
  items: s,
38
38
  speed: 50,
39
+ slowOnTouch: !0,
40
+ enableManualScroll: !0,
39
41
  contentClassName: e.infiniteScrollContent,
40
42
  itemClassName: e.infiniteScrollItem,
41
43
  rootClassName: e.infiniteScrollRoot,
42
- renderItem: (a, n) => /* @__PURE__ */ t(c, { ...a, compressed: !0 }, n)
44
+ renderItem: (a, l) => /* @__PURE__ */ t(c, { ...a, compressed: !0 }, l)
43
45
  }
44
46
  ),
45
47
  /* @__PURE__ */ t(
@@ -48,14 +50,15 @@ const g = ({ title: d, description: o, studies: s, indexed: r }) => /* @__PURE__
48
50
  items: s,
49
51
  speed: 50,
50
52
  direction: "right",
53
+ slowOnTouch: !0,
54
+ enableManualScroll: !0,
51
55
  contentClassName: e.infiniteScrollContent,
52
56
  itemClassName: e.infiniteScrollItemTwo,
53
- rootClassName: e.infiniteScrollRoot,
54
- renderItem: (a, n) => /* @__PURE__ */ t(c, { ...a, compressed: !0 }, n)
57
+ renderItem: (a, l) => /* @__PURE__ */ t(c, { ...a, compressed: !0 }, l)
55
58
  }
56
59
  )
57
60
  ] })
58
61
  ] });
59
62
  export {
60
- g as Curiosity
63
+ V as Curiosity
61
64
  };
@@ -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"),y=require("./components/Newsletter/Newsletter.cjs.js"),a=require("./mailchimpModal.module.css.cjs.js"),f=({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})=>{const h=g=>{g.stopPropagation()};return e.jsxs("div",{className:c.cn(a.default.contentWrapper,a.default[l]),"data-image-position":i,onClick:h,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(y.Newsletter,{buttonText:d,cancelButtonText:p,colorScheme:l,onCloseCallback:o,onClickCallback:u,tags:m})]}),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=f;
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 N } from "./components/Newsletter/Newsletter.es.js";
5
+ import { Newsletter as v } from "./components/Newsletter/Newsletter.es.js";
6
6
  import a from "./mailchimpModal.module.css.es.js";
7
- const b = ({
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 f = (u) => {
20
- u.stopPropagation();
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: f,
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
- N,
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
- b as MailchimpModal
54
+ j as MailchimpModal
53
55
  };
@@ -1 +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;
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&amp;id=2483a4d606&amp;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;
@@ -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;
@@ -1,12 +1,12 @@
1
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 = ({
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&amp;id=2483a4d606&amp;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, 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 = () => {
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 (!z(t)) {
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
- 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."));
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 P = o === "light" ? "primary" : "primary-invert", S = o === "light" ? "primary" : "primary-invert";
38
- return /* @__PURE__ */ v("div", { className: E.interface, children: [
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
- V,
41
+ j,
41
42
  {
42
- placeholder: "Email",
43
- variant: P,
43
+ placeholder: c || "Email",
44
+ variant: S,
44
45
  value: t,
45
- handleChange: I,
46
- error: l,
47
- errorText: x,
48
- active: M
46
+ handleChange: N,
47
+ error: h,
48
+ errorText: M,
49
+ active: I
49
50
  }
50
51
  ),
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 })
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
- }, q = ({
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
- j,
66
+ z,
65
67
  {
66
- url: A(o),
68
+ url: b(o),
67
69
  render: ({
68
- subscribe: p,
69
- status: a,
70
+ subscribe: a,
71
+ status: c,
70
72
  message: t
71
73
  }) => /* @__PURE__ */ n(
72
- b,
74
+ w,
73
75
  {
74
- status: a,
76
+ status: c,
75
77
  message: t,
76
- subscribe: p,
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
- q as Newsletter
90
+ D as Newsletter
88
91
  };
@@ -19,5 +19,6 @@ type THSModal = {
19
19
  export type TMailchimpModal = THSModal & {
20
20
  type: 'mailchimp';
21
21
  tags: string;
22
+ placeholder?: string;
22
23
  };
23
24
  export type { THSModal };
@@ -1,4 +1,4 @@
1
- import { UseSwiperReturnProps } from '../../../../lib/useSwiper';
1
+ import { BaseSwiperReturnProps } from '../../../../lib/useSwiper';
2
2
 
3
3
  type ContentProps = {
4
4
  items: Array<{
@@ -8,7 +8,7 @@ type ContentProps = {
8
8
  }>;
9
9
  colorScheme: 'light' | 'dark';
10
10
  showBottomNav: boolean;
11
- swiper: UseSwiperReturnProps;
11
+ swiper: BaseSwiperReturnProps;
12
12
  };
13
13
  export declare const Content: ({ items, colorScheme, showBottomNav, swiper }: ContentProps) => import("react/jsx-runtime").JSX.Element;
14
14
  export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),x=()=>{const[n,c]=t.useState(null),[o,i]=t.useState(0),[u,l]=t.useState(!0),[S,s]=t.useState(!1),[g,d]=t.useState(!1),a=t.useCallback(e=>{i(e.activeIndex),s(e.isEnd),l(e.isBeginning)},[]),h=t.useCallback(()=>{n&&(n.slidePrev(),a(n))},[n,a]),k=t.useCallback(()=>{n&&(n.slideNext(),a(n))},[n,a]),C=t.useCallback(e=>{n&&(n.slideTo(e),a(n))},[n,a]),b=e=>{c(e),d(e==null?void 0:e.isLocked),a(e)},f=t.useCallback(e=>{s(e.isEnd),d(e==null?void 0:e.isLocked),a(e)},[a]),v=t.useCallback(()=>{s(!0),l(!1)},[]),r=t.useCallback(()=>{l(!0),s(!1)},[]);return{swiper:n,setSwiper:c,activeIndex:o,setActiveIndex:i,isEnd:S,setIsEnd:s,hideNav:g,handleSlideChange:a,handlePrevClick:h,handleNextClick:k,handleSlideTo:C,onSwiperInit:b,handleSwiperResize:f,isBeginning:u,setIsBeginning:l,handleReachEnd:v,handleReachBeginning:r}};exports.useSwiper=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),h=()=>{const[n,s]=e.useState(null),[u,r]=e.useState(0),[a,l]=e.useState(!0),[f,c]=e.useState(!1),[d,o]=e.useState(!1),i=e.useCallback(t=>{r(t.activeIndex),c(t.isEnd),l(t.isBeginning)},[]),b=e.useCallback(()=>{n&&(n.slidePrev(),i(n))},[n,i]),v=e.useCallback(()=>{n&&(n.slideNext(),i(n))},[n,i]),S=e.useCallback(t=>{n&&(n.slideTo(t),i(n))},[n,i]),g=t=>{s(t),o(t==null?void 0:t.isLocked),i(t)},k=e.useCallback(t=>{c(t.isEnd),o(t==null?void 0:t.isLocked),i(t)},[i]),C=e.useCallback(()=>{c(!0),l(!1)},[]),E=e.useCallback(()=>{l(!0),c(!1)},[]);return{swiper:n,setSwiper:s,activeIndex:u,setActiveIndex:r,isEnd:f,setIsEnd:c,hideNav:d,handleSlideChange:i,handlePrevClick:b,handleNextClick:v,handleSlideTo:S,onSwiperInit:g,handleSwiperResize:k,isBeginning:a,setIsBeginning:l,handleReachEnd:C,handleReachBeginning:E}},y=(n=3e3)=>{const s=h(),[u,r]=e.useState(!0),a=e.useRef(null),l=e.useCallback(()=>{r(!1),a.current&&(clearInterval(a.current),a.current=null)},[]),f=e.useCallback(()=>{r(!0)},[]),c=e.useCallback(()=>{l()},[l]);return e.useEffect(()=>{if(!(!u||!s.swiper||s.swiper.slides.length<=1))return a.current=setInterval(()=>{s.swiper&&(s.isEnd?s.swiper.slideTo(0):s.swiper.slideNext())},n),()=>{a.current&&(clearInterval(a.current),a.current=null)}},[u,s.swiper,s.isEnd,n]),e.useEffect(()=>{const d=()=>l(),o=()=>{document.hidden&&l()};return window.addEventListener("beforeunload",d),document.addEventListener("visibilitychange",o),()=>{window.removeEventListener("beforeunload",d),document.removeEventListener("visibilitychange",o)}},[l]),{...s,isAutoPlay:u,stopAutoPlay:l,startAutoPlay:f,handleUserInteraction:c}};exports.useSwiper=h;exports.useSwiperWithAutoPlay=y;
@@ -1,48 +1,78 @@
1
- import { useState as s, useCallback as d } from "react";
2
- const N = () => {
3
- const [n, l] = s(null), [h, o] = s(0), [g, c] = s(!0), [u, i] = s(!1), [f, a] = s(!1), t = d((e) => {
4
- o(e.activeIndex), i(e.isEnd), c(e.isBeginning);
5
- }, []), v = d(() => {
6
- n && (n.slidePrev(), t(n));
7
- }, [n, t]), S = d(() => {
8
- n && (n.slideNext(), t(n));
9
- }, [n, t]), x = d(
1
+ import { useState as c, useCallback as r, useRef as y, useEffect as v } from "react";
2
+ const A = () => {
3
+ const [n, t] = c(null), [d, a] = c(0), [l, i] = c(!0), [h, o] = c(!1), [f, u] = c(!1), s = r((e) => {
4
+ a(e.activeIndex), o(e.isEnd), i(e.isBeginning);
5
+ }, []), g = r(() => {
6
+ n && (n.slidePrev(), s(n));
7
+ }, [n, s]), E = r(() => {
8
+ n && (n.slideNext(), s(n));
9
+ }, [n, s]), S = r(
10
10
  (e) => {
11
- n && (n.slideTo(e), t(n));
11
+ n && (n.slideTo(e), s(n));
12
12
  },
13
- [n, t]
14
- ), k = (e) => {
15
- l(e), a(e == null ? void 0 : e.isLocked), t(e);
16
- }, E = d(
13
+ [n, s]
14
+ ), m = (e) => {
15
+ t(e), u(e == null ? void 0 : e.isLocked), s(e);
16
+ }, I = r(
17
17
  (e) => {
18
- i(e.isEnd), a(e == null ? void 0 : e.isLocked), t(e);
18
+ o(e.isEnd), u(e == null ? void 0 : e.isLocked), s(e);
19
19
  },
20
- [t]
21
- ), B = d(() => {
22
- i(!0), c(!1);
23
- }, []), C = d(() => {
24
- c(!0), i(!1);
20
+ [s]
21
+ ), b = r(() => {
22
+ o(!0), i(!1);
23
+ }, []), x = r(() => {
24
+ i(!0), o(!1);
25
25
  }, []);
26
26
  return {
27
27
  swiper: n,
28
- setSwiper: l,
29
- activeIndex: h,
30
- setActiveIndex: o,
31
- isEnd: u,
32
- setIsEnd: i,
28
+ setSwiper: t,
29
+ activeIndex: d,
30
+ setActiveIndex: a,
31
+ isEnd: h,
32
+ setIsEnd: o,
33
33
  hideNav: f,
34
- handleSlideChange: t,
35
- handlePrevClick: v,
36
- handleNextClick: S,
37
- handleSlideTo: x,
38
- onSwiperInit: k,
39
- handleSwiperResize: E,
40
- isBeginning: g,
41
- setIsBeginning: c,
42
- handleReachEnd: B,
43
- handleReachBeginning: C
34
+ handleSlideChange: s,
35
+ handlePrevClick: g,
36
+ handleNextClick: E,
37
+ handleSlideTo: S,
38
+ onSwiperInit: m,
39
+ handleSwiperResize: I,
40
+ isBeginning: l,
41
+ setIsBeginning: i,
42
+ handleReachEnd: b,
43
+ handleReachBeginning: x
44
+ };
45
+ }, P = (n = 3e3) => {
46
+ const t = A(), [d, a] = c(!0), l = y(null), i = r(() => {
47
+ a(!1), l.current && (clearInterval(l.current), l.current = null);
48
+ }, []), h = r(() => {
49
+ a(!0);
50
+ }, []), o = r(() => {
51
+ i();
52
+ }, [i]);
53
+ return v(() => {
54
+ if (!(!d || !t.swiper || t.swiper.slides.length <= 1))
55
+ return l.current = setInterval(() => {
56
+ t.swiper && (t.isEnd ? t.swiper.slideTo(0) : t.swiper.slideNext());
57
+ }, n), () => {
58
+ l.current && (clearInterval(l.current), l.current = null);
59
+ };
60
+ }, [d, t.swiper, t.isEnd, n]), v(() => {
61
+ const f = () => i(), u = () => {
62
+ document.hidden && i();
63
+ };
64
+ return window.addEventListener("beforeunload", f), document.addEventListener("visibilitychange", u), () => {
65
+ window.removeEventListener("beforeunload", f), document.removeEventListener("visibilitychange", u);
66
+ };
67
+ }, [i]), {
68
+ ...t,
69
+ isAutoPlay: d,
70
+ stopAutoPlay: i,
71
+ startAutoPlay: h,
72
+ handleUserInteraction: o
44
73
  };
45
74
  };
46
75
  export {
47
- N as useSwiper
76
+ A as useSwiper,
77
+ P as useSwiperWithAutoPlay
48
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.1.134",
3
+ "version": "0.1.136",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",