@zenpatient-org/healthspan-marketing-ui 0.2.50 → 0.2.52

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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("react"),q=require("swiper/modules"),d=require("swiper/react"),j=require("../../utils/useSwiper/useSwiper.cjs.js"),P=require("../../utils/cn/cn.cjs.js");;/* empty css */;/* empty css */;/* empty css */const w=require("../GalleryPagination/GalleryPagination.cjs.js"),a=require("../../src/components/AdvancedGallery/advancedGallery.module.css"),x=require("../Label/Label.cjs.js"),v=require("./components/VideoSlide/VideoSlide.cjs.js"),_=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),b=[q.Navigation],G=({items:r,label:s,className:u})=>{const{activeIndex:l,handleSlideTo:o,handleSlideChange:S,onSwiperInit:p,handleSwiperResize:g,handleUserInteraction:i,startAutoPlay:h,stopAutoPlay:m}=j.useSwiperWithAutoPlay(3e3),t=y.useCallback(n=>{i(),o(n)},[i,o]);return e.jsxs("div",{className:P.cn(a.root,u),children:[s&&e.jsx("div",{className:a.labelWrap,children:e.jsx(x.Label,{color:"black",size:"sm",children:s})}),e.jsx(d.Swiper,{onSwiper:p,onResize:g,onSlideChange:S,onTouchStart:i,onTouchEnd:i,modules:b,spaceBetween:0,slidesPerView:1,className:a.swiper,children:r.map((n,c)=>e.jsxs(d.SwiperSlide,{children:[n.mediaType==="image"&&e.jsx("div",{className:a.imageWrapper,children:e.jsx("img",{src:n.url,alt:"product image",className:a.image,onClick:i})}),n.mediaType==="video"&&e.jsx(v.VideoSlide,{item:n,isActive:l===c,onClick:i,startAutoPlay:h,stopAutoPlay:m})]},c))}),e.jsx(_.ImageGalleryPagination,{items:r,activeIndex:l,onSelect:t}),e.jsx(w.GalleryPagination,{count:r.length,activeIndex:l,onSelect:t})]})};exports.AdvancedGallery=G;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),m=require("swiper/modules"),d=require("swiper/react"),q=require("../../utils/useSwiper/useSwiper.cjs.js"),y=require("../../utils/cn/cn.cjs.js");;/* empty css */;/* empty css */;/* empty css */const j=require("../GalleryPagination/GalleryPagination.cjs.js"),r=require("../../src/components/AdvancedGallery/advancedGallery.module.css"),w=require("../Label/Label.cjs.js"),x=require("./components/VideoSlide/VideoSlide.cjs.js"),v=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),P=[m.Navigation],_=({items:a,label:s,className:u})=>{const{activeIndex:l,handleSlideTo:o,handleSlideChange:S,onSwiperInit:p,handleSwiperResize:g,handleUserInteraction:i}=q.useSwiperWithAutoPlay(5e3),c=h.useCallback(n=>{i(),o(n)},[i,o]);return e.jsxs("div",{className:y.cn(r.root,u),children:[s&&e.jsx("div",{className:r.labelWrap,children:e.jsx(w.Label,{color:"black",size:"sm",children:s})}),e.jsx(d.Swiper,{onSwiper:p,onResize:g,onSlideChange:S,onTouchStart:i,onTouchEnd:i,modules:P,spaceBetween:0,slidesPerView:1,className:r.swiper,children:a.map((n,t)=>e.jsxs(d.SwiperSlide,{children:[n.mediaType==="image"&&e.jsx("div",{className:r.imageWrapper,children:e.jsx("img",{src:n.url,alt:"product image",className:r.image,onClick:i})}),n.mediaType==="video"&&e.jsx(x.VideoSlide,{item:n,isActive:l===t,onClick:i})]},t))}),e.jsx(v.ImageGalleryPagination,{items:a,activeIndex:l,onSelect:c}),e.jsx(j.GalleryPagination,{count:a.length,activeIndex:l,onSelect:c})]})};exports.AdvancedGallery=_;
@@ -1,75 +1,57 @@
1
1
  "use client";
2
2
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
3
- import { useCallback as f } from "react";
4
- import { Navigation as w } from "swiper/modules";
5
- import { Swiper as y, SwiperSlide as v } from "swiper/react";
6
- import { useSwiperWithAutoPlay as P } from "../../utils/useSwiper/useSwiper.es.js";
7
- import { cn as N } from "../../utils/cn/cn.es.js";
3
+ import { useCallback as g } from "react";
4
+ import { Navigation as f } from "swiper/modules";
5
+ import { Swiper as u, SwiperSlide as w } from "swiper/react";
6
+ import { useSwiperWithAutoPlay as v } from "../../utils/useSwiper/useSwiper.es.js";
7
+ import { cn as y } from "../../utils/cn/cn.es.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  /* empty css */
11
- import { GalleryPagination as A } from "../GalleryPagination/GalleryPagination.es.js";
11
+ import { GalleryPagination as N } from "../GalleryPagination/GalleryPagination.es.js";
12
12
  import r from "../../components/AdvancedGallery/advancedGallery.module.css";
13
- import { Label as C } from "../Label/Label.es.js";
14
- import { VideoSlide as I } from "./components/VideoSlide/VideoSlide.es.js";
15
- import { ImageGalleryPagination as T } from "./components/ImageGalleryPagination/ImageGalleryPagination.es.js";
16
- const k = [w], O = ({ items: a, label: n, className: p }) => {
17
- const {
18
- activeIndex: l,
19
- handleSlideTo: t,
20
- handleSlideChange: d,
21
- onSwiperInit: h,
22
- handleSwiperResize: S,
23
- handleUserInteraction: o,
24
- startAutoPlay: g,
25
- stopAutoPlay: u
26
- } = P(3e3), m = f(
27
- (i) => {
28
- o(), t(i);
13
+ import { Label as P } from "../Label/Label.es.js";
14
+ import { VideoSlide as C } from "./components/VideoSlide/VideoSlide.es.js";
15
+ import { ImageGalleryPagination as I } from "./components/ImageGalleryPagination/ImageGalleryPagination.es.js";
16
+ const T = [f], D = ({ items: a, label: n, className: p }) => {
17
+ const { activeIndex: l, handleSlideTo: t, handleSlideChange: d, onSwiperInit: h, handleSwiperResize: S, handleUserInteraction: i } = v(5e3), m = g(
18
+ (o) => {
19
+ i(), t(o);
29
20
  },
30
- [o, t]
21
+ [i, t]
31
22
  );
32
- return /* @__PURE__ */ s("div", { className: N(r.root, p), children: [
33
- n && /* @__PURE__ */ e("div", { className: r.labelWrap, children: /* @__PURE__ */ e(C, { color: "black", size: "sm", children: n }) }),
23
+ return /* @__PURE__ */ s("div", { className: y(r.root, p), children: [
24
+ n && /* @__PURE__ */ e("div", { className: r.labelWrap, children: /* @__PURE__ */ e(P, { color: "black", size: "sm", children: n }) }),
34
25
  /* @__PURE__ */ e(
35
- y,
26
+ u,
36
27
  {
37
28
  onSwiper: h,
38
29
  onResize: S,
39
30
  onSlideChange: d,
40
- onTouchStart: o,
41
- onTouchEnd: o,
42
- modules: k,
31
+ onTouchStart: i,
32
+ onTouchEnd: i,
33
+ modules: T,
43
34
  spaceBetween: 0,
44
35
  slidesPerView: 1,
45
36
  className: r.swiper,
46
- children: a.map((i, c) => /* @__PURE__ */ s(v, { children: [
47
- i.mediaType === "image" && /* @__PURE__ */ e("div", { className: r.imageWrapper, children: /* @__PURE__ */ e(
37
+ children: a.map((o, c) => /* @__PURE__ */ s(w, { children: [
38
+ o.mediaType === "image" && /* @__PURE__ */ e("div", { className: r.imageWrapper, children: /* @__PURE__ */ e(
48
39
  "img",
49
40
  {
50
- src: i.url,
41
+ src: o.url,
51
42
  alt: "product image",
52
43
  className: r.image,
53
- onClick: o
44
+ onClick: i
54
45
  }
55
46
  ) }),
56
- i.mediaType === "video" && /* @__PURE__ */ e(
57
- I,
58
- {
59
- item: i,
60
- isActive: l === c,
61
- onClick: o,
62
- startAutoPlay: g,
63
- stopAutoPlay: u
64
- }
65
- )
47
+ o.mediaType === "video" && /* @__PURE__ */ e(C, { item: o, isActive: l === c, onClick: i })
66
48
  ] }, c))
67
49
  }
68
50
  ),
69
- /* @__PURE__ */ e(T, { items: a, activeIndex: l, onSelect: m }),
70
- /* @__PURE__ */ e(A, { count: a.length, activeIndex: l, onSelect: m })
51
+ /* @__PURE__ */ e(I, { items: a, activeIndex: l, onSelect: m }),
52
+ /* @__PURE__ */ e(N, { count: a.length, activeIndex: l, onSelect: m })
71
53
  ] });
72
54
  };
73
55
  export {
74
- O as AdvancedGallery
56
+ D as AdvancedGallery
75
57
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("react"),y=require("../../../../utils/cn/cn.cjs.js"),r=require("../../../../src/components/AdvancedGallery/components/VideoSlide/videoSlide.module.css"),I=require("../../../Icon/Icon.cjs.js"),N=require("../../../Icon/constants.cjs.js"),q=require("../../../AudioButton/AudioButton.cjs.js"),R=({item:c,isActive:a,onClick:d,startAutoPlay:l,stopAutoPlay:o})=>{const[i,u]=t.useState(!1),[p,f]=t.useState(!0),e=t.useRef(null),v=t.useRef(null);t.useEffect(()=>{const n=e.current;if(!n)return;const m=()=>{u(!1),l()};return a?(n.muted=!0,f(!0),n.play().then(()=>{u(!0),o()})):(n.pause(),n.currentTime=0,u(!1)),n.addEventListener("ended",m),()=>{n.removeEventListener("ended",m)}},[a,l,o]);const x=t.useCallback(n=>{n.stopPropagation(),e.current&&(e.current.play(),u(!0),o()),d()},[d,o]),h=t.useCallback(n=>{n.stopPropagation(),e.current&&(e.current.muted=!e.current.muted,f(e.current.muted))},[]),j=t.useCallback(()=>{e.current&&c.videoType==="complex"&&(i?(e.current.pause(),u(!1),l()):(e.current.play(),u(!0),o())),d()},[c.videoType,i,d,l,o]);return s.jsx("div",{className:r.root,ref:v,onClick:j,children:s.jsxs("div",{className:r.videoContainer,children:[s.jsx("video",{ref:e,src:c.url,playsInline:!0,autoPlay:!0,muted:!0,controls:!1,poster:c.preview,className:y.cn(r.video,!i&&r.mediaHidden)}),c.videoType==="complex"&&!i&&s.jsx("div",{className:r.playButton,children:s.jsx("button",{className:r.customPlayButton,onClick:x,children:s.jsx(I.Icon,{className:r.icon,name:N.EIconName.ALT_PLAY})})}),c.videoType==="complex"&&i&&s.jsx("div",{className:r.audioButton,children:s.jsx(q.AudioButton,{isMuted:p,onClick:h})})]})})};exports.VideoSlide=R;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("react"),x=require("../../../../utils/cn/cn.cjs.js"),r=require("../../../../src/components/AdvancedGallery/components/VideoSlide/videoSlide.module.css"),h=require("../../../Icon/Icon.cjs.js"),j=require("../../../Icon/constants.cjs.js"),P=require("../../../AudioButton/AudioButton.cjs.js"),I=({item:o,isActive:l,onClick:a})=>{const[c,u]=s.useState(!1),[p,i]=s.useState(!0),e=s.useRef(null),f=s.useRef(null);s.useEffect(()=>{const t=e.current;if(!t)return;const d=()=>{u(!1)};return l?(t.muted=!0,i(!0),t.play().then(()=>{u(!0)})):(t.pause(),t.currentTime=0,u(!1)),t.addEventListener("ended",d),()=>{t.removeEventListener("ended",d)}},[l]);const m=s.useCallback(t=>{t.stopPropagation(),e.current&&(e.current.play(),u(!0)),a()},[a]),v=s.useCallback(t=>{t.stopPropagation(),e.current&&(e.current.muted=!e.current.muted,i(e.current.muted))},[]),y=s.useCallback(()=>{e.current&&o.videoType==="complex"&&(c?(e.current.pause(),u(!1)):(e.current.play(),u(!0))),a()},[o.videoType,c,a]);return n.jsx("div",{className:r.root,ref:f,onClick:y,children:n.jsxs("div",{className:r.videoContainer,children:[n.jsx("video",{ref:e,src:o.url,playsInline:!0,autoPlay:!0,muted:!0,controls:!1,poster:o.preview,className:x.cn(r.video,!c&&r.mediaHidden)}),o.videoType==="complex"&&!c&&n.jsx("div",{className:r.playButton,children:n.jsx("button",{className:r.customPlayButton,onClick:m,children:n.jsx(h.Icon,{className:r.icon,name:j.EIconName.ALT_PLAY})})}),o.videoType==="complex"&&c&&n.jsx("div",{className:r.audioButton,children:n.jsx(P.AudioButton,{isMuted:p,onClick:v})})]})})};exports.VideoSlide=I;
@@ -6,8 +6,6 @@ type VideoSlideProps = {
6
6
  };
7
7
  isActive: boolean;
8
8
  onClick: () => void;
9
- startAutoPlay: () => void;
10
- stopAutoPlay: () => void;
11
9
  };
12
- export declare const VideoSlide: ({ item, isActive, onClick, startAutoPlay, stopAutoPlay }: VideoSlideProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const VideoSlide: ({ item, isActive, onClick }: VideoSlideProps) => import("react/jsx-runtime").JSX.Element;
13
11
  export {};
@@ -1,53 +1,53 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as E } from "react/jsx-runtime";
3
- import { useState as p, useRef as v, useEffect as I, useCallback as l } from "react";
4
- import { cn as g } from "../../../../utils/cn/cn.es.js";
5
- import n from "../../../../components/AdvancedGallery/components/VideoSlide/videoSlide.module.css";
6
- import { Icon as B } from "../../../Icon/Icon.es.js";
7
- import { EIconName as L } from "../../../Icon/constants.es.js";
8
- import { AudioButton as R } from "../../../AudioButton/AudioButton.es.js";
9
- const w = ({ item: o, isActive: a, onClick: d, startAutoPlay: u, stopAutoPlay: s }) => {
10
- const [i, c] = p(!1), [h, m] = p(!0), e = v(null), N = v(null);
11
- I(() => {
12
- const r = e.current;
13
- if (!r) return;
14
- const f = () => {
15
- c(!1), u();
2
+ import { jsx as o, jsxs as P } from "react/jsx-runtime";
3
+ import { useState as m, useRef as p, useEffect as x, useCallback as l } from "react";
4
+ import { cn as T } from "../../../../utils/cn/cn.es.js";
5
+ import r from "../../../../components/AdvancedGallery/components/VideoSlide/videoSlide.module.css";
6
+ import { Icon as E } from "../../../Icon/Icon.es.js";
7
+ import { EIconName as I } from "../../../Icon/constants.es.js";
8
+ import { AudioButton as g } from "../../../AudioButton/AudioButton.es.js";
9
+ const k = ({ item: n, isActive: c, onClick: u }) => {
10
+ const [a, s] = m(!1), [f, i] = m(!0), e = p(null), v = p(null);
11
+ x(() => {
12
+ const t = e.current;
13
+ if (!t) return;
14
+ const d = () => {
15
+ s(!1);
16
16
  };
17
- return a ? (r.muted = !0, m(!0), r.play().then(() => {
18
- c(!0), s();
19
- })) : (r.pause(), r.currentTime = 0, c(!1)), r.addEventListener("ended", f), () => {
20
- r.removeEventListener("ended", f);
17
+ return c ? (t.muted = !0, i(!0), t.play().then(() => {
18
+ s(!0);
19
+ })) : (t.pause(), t.currentTime = 0, s(!1)), t.addEventListener("ended", d), () => {
20
+ t.removeEventListener("ended", d);
21
21
  };
22
- }, [a, u, s]);
22
+ }, [c]);
23
23
  const y = l(
24
- (r) => {
25
- r.stopPropagation(), e.current && (e.current.play(), c(!0), s()), d();
24
+ (t) => {
25
+ t.stopPropagation(), e.current && (e.current.play(), s(!0)), u();
26
26
  },
27
- [d, s]
28
- ), x = l((r) => {
29
- r.stopPropagation(), e.current && (e.current.muted = !e.current.muted, m(e.current.muted));
30
- }, []), T = l(() => {
31
- e.current && o.videoType === "complex" && (i ? (e.current.pause(), c(!1), u()) : (e.current.play(), c(!0), s())), d();
32
- }, [o.videoType, i, d, u, s]);
33
- return /* @__PURE__ */ t("div", { className: n.root, ref: N, onClick: T, children: /* @__PURE__ */ E("div", { className: n.videoContainer, children: [
34
- /* @__PURE__ */ t(
27
+ [u]
28
+ ), h = l((t) => {
29
+ t.stopPropagation(), e.current && (e.current.muted = !e.current.muted, i(e.current.muted));
30
+ }, []), N = l(() => {
31
+ e.current && n.videoType === "complex" && (a ? (e.current.pause(), s(!1)) : (e.current.play(), s(!0))), u();
32
+ }, [n.videoType, a, u]);
33
+ return /* @__PURE__ */ o("div", { className: r.root, ref: v, onClick: N, children: /* @__PURE__ */ P("div", { className: r.videoContainer, children: [
34
+ /* @__PURE__ */ o(
35
35
  "video",
36
36
  {
37
37
  ref: e,
38
- src: o.url,
38
+ src: n.url,
39
39
  playsInline: !0,
40
40
  autoPlay: !0,
41
41
  muted: !0,
42
42
  controls: !1,
43
- poster: o.preview,
44
- className: g(n.video, !i && n.mediaHidden)
43
+ poster: n.preview,
44
+ className: T(r.video, !a && r.mediaHidden)
45
45
  }
46
46
  ),
47
- o.videoType === "complex" && !i && /* @__PURE__ */ t("div", { className: n.playButton, children: /* @__PURE__ */ t("button", { className: n.customPlayButton, onClick: y, children: /* @__PURE__ */ t(B, { className: n.icon, name: L.ALT_PLAY }) }) }),
48
- o.videoType === "complex" && i && /* @__PURE__ */ t("div", { className: n.audioButton, children: /* @__PURE__ */ t(R, { isMuted: h, onClick: x }) })
47
+ n.videoType === "complex" && !a && /* @__PURE__ */ o("div", { className: r.playButton, children: /* @__PURE__ */ o("button", { className: r.customPlayButton, onClick: y, children: /* @__PURE__ */ o(E, { className: r.icon, name: I.ALT_PLAY }) }) }),
48
+ n.videoType === "complex" && a && /* @__PURE__ */ o("div", { className: r.audioButton, children: /* @__PURE__ */ o(g, { isMuted: f, onClick: h }) })
49
49
  ] }) });
50
50
  };
51
51
  export {
52
- w as VideoSlide
52
+ k as VideoSlide
53
53
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e={StillHaveQuestions:{title:t.jsxs(t.Fragment,{children:["Still have ",t.jsx("b",{children:"questions?"})]}),button:{text:"Contact Us",link:"https://www.gethealthspan.com/contact-us"},image:"https://methodical-vitality-96814f361f.media.strapiapp.com/still_Have_Questions_e6cfc3cba3.jpg",titleHighlight:"light",description:"",buttonColor:"secondary",colorScheme:"light"},JoinOurTeam:{title:t.jsxs(t.Fragment,{children:["Have a passion for ",t.jsx("b",{children:"longevity science?"})]}),button:{text:"Join Our Team",link:"https://careers.gethealthspan.com/"},image:"https://methodical-vitality-96814f361f.media.strapiapp.com/join_Our_Team_32a787012e.jpg",titleHighlight:"light",description:"",buttonColor:"secondary",colorScheme:"light"}};exports.LEGACY_CONFIG=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e={StillHaveQuestions:{title:t.jsxs(t.Fragment,{children:["Still have ",t.jsx("b",{children:"questions?"})]}),button:{text:"Contact Us",link:"https://www.gethealthspan.com/contact-us"},image:"https://methodical-vitality-96814f361f.media.strapiapp.com/still_Have_Questions_e6cfc3cba3.jpg",titleHighlight:"dark",description:"",buttonColor:"secondary",colorScheme:"light"},JoinOurTeam:{title:t.jsxs(t.Fragment,{children:["Have a passion for ",t.jsx("b",{children:"longevity science?"})]}),button:{text:"Join Our Team",link:"https://careers.gethealthspan.com/"},image:"https://methodical-vitality-96814f361f.media.strapiapp.com/join_Our_Team_32a787012e.jpg",titleHighlight:"light",description:"",buttonColor:"secondary",colorScheme:"light"}};exports.LEGACY_CONFIG=e;
@@ -10,7 +10,7 @@ const a = {
10
10
  link: "https://www.gethealthspan.com/contact-us"
11
11
  },
12
12
  image: "https://methodical-vitality-96814f361f.media.strapiapp.com/still_Have_Questions_e6cfc3cba3.jpg",
13
- titleHighlight: "light",
13
+ titleHighlight: "dark",
14
14
  description: "",
15
15
  buttonColor: "secondary",
16
16
  colorScheme: "light"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",