@zenpatient-org/healthspan-marketing-ui 0.2.48 → 0.2.49
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/AdvancedGallery/AdvancedGallery.cjs.js +1 -0
- package/dist/components/AdvancedGallery/AdvancedGallery.d.ts +7 -0
- package/dist/components/AdvancedGallery/AdvancedGallery.es.js +75 -0
- package/dist/components/AdvancedGallery/advancedGallery.module.css +64 -0
- package/dist/components/AdvancedGallery/components/ImageGalleryPagination/ImageGalleryPagination.cjs.js +1 -0
- package/dist/components/AdvancedGallery/components/ImageGalleryPagination/ImageGalleryPagination.d.ts +9 -0
- package/dist/components/AdvancedGallery/components/ImageGalleryPagination/ImageGalleryPagination.es.js +28 -0
- package/dist/components/AdvancedGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css +58 -0
- package/dist/components/AdvancedGallery/components/ImageGalleryPagination/index.d.ts +1 -0
- package/dist/components/AdvancedGallery/components/VideoSlide/VideoSlide.cjs.js +1 -0
- package/dist/components/AdvancedGallery/components/VideoSlide/VideoSlide.d.ts +13 -0
- package/dist/components/AdvancedGallery/components/VideoSlide/VideoSlide.es.js +53 -0
- package/dist/components/AdvancedGallery/components/VideoSlide/videoSlide.module.css +49 -0
- package/dist/components/AdvancedGallery/components/index.d.ts +1 -0
- package/dist/components/AdvancedGallery/index.d.ts +2 -0
- package/dist/components/AdvancedGallery/types.d.ts +14 -0
- package/dist/components/AudioButton/AudioButton.cjs.js +1 -0
- package/dist/components/AudioButton/AudioButton.d.ts +7 -0
- package/dist/components/AudioButton/AudioButton.es.js +10 -0
- package/dist/components/AudioButton/audioButton.module.css +37 -0
- package/dist/components/AudioButton/index.d.ts +1 -0
- package/dist/components/Icon/constants.cjs.js +1 -1
- package/dist/components/Icon/constants.d.ts +3 -0
- package/dist/components/Icon/constants.es.js +4 -1
- package/dist/components/Icon/iconsMap.cjs.js +1 -1
- package/dist/components/Icon/iconsMap.es.js +150 -144
- package/dist/icons/action/alt-play.svg +3 -0
- package/dist/icons/action/alt-play.svg.cjs.js +1 -0
- package/dist/icons/action/alt-play.svg.es.js +5 -0
- package/dist/icons/action/audio.svg +15 -0
- package/dist/icons/action/audio.svg.cjs.js +7 -0
- package/dist/icons/action/audio.svg.es.js +11 -0
- package/dist/icons/action/mute.svg +16 -0
- package/dist/icons/action/mute.svg.cjs.js +7 -0
- package/dist/icons/action/mute.svg.es.js +11 -0
- package/dist/lib/useSwiper.d.ts +1 -0
- package/dist/modules/IndividualProductCardV2/IndividualProductCardV2.cjs.js +1 -1
- package/dist/modules/IndividualProductCardV2/IndividualProductCardV2.es.js +44 -42
- package/dist/modules/IndividualProductCardV2/types.d.ts +2 -0
- package/dist/utils/useSwiper/useSwiper.cjs.js +1 -1
- package/dist/utils/useSwiper/useSwiper.es.js +49 -48
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),S=()=>{const[n,s]=t.useState(null),[u,o]=t.useState(0),[c,l]=t.useState(!0),[f,i]=t.useState(!1),[r,d]=t.useState(!1),[b,h]=t.useState(!1),a=t.useCallback(e=>{o(e.activeIndex),i(e.isEnd),l(e.isBeginning)},[]),k=t.useCallback(()=>{n&&(n.slidePrev(),a(n))},[n,a]),v=t.useCallback(()=>{n&&(n.slideNext(),a(n))},[n,a]),g=t.useCallback(e=>{n&&(n.slideTo(e),a(n))},[n,a]),C=e=>{s(e),d(e==null?void 0:e.isLocked),h(e==null?void 0:e.isLocked),a(e)},E=t.useCallback(e=>{i(e.isEnd),d(e==null?void 0:e.isLocked),h(e==null?void 0:e.isLocked),a(e)},[a]),y=t.useCallback(()=>{i(!0),l(!1)},[]),L=t.useCallback(()=>{l(!0),i(!1)},[]);return{swiper:n,setSwiper:s,activeIndex:u,setActiveIndex:o,isEnd:f,setIsEnd:i,hideNav:r,handleSlideChange:a,handlePrevClick:k,handleNextClick:v,handleSlideTo:g,onSwiperInit:C,handleSwiperResize:E,isBeginning:c,isLocked:b,setIsBeginning:l,handleReachEnd:y,handleReachBeginning:L}},I=(n=3e3)=>{const s=S(),[u,o]=t.useState(!0),c=t.useRef(null),l=t.useCallback(()=>{o(!1),c.current&&(clearInterval(c.current),c.current=null)},[]),f=t.useCallback(()=>{o(!0)},[]),i=t.useCallback(()=>{l()},[l]);return t.useEffect(()=>{if(!(!u||!s.swiper||s.swiper.slides.length<=1))return c.current=setInterval(()=>{s.swiper&&(s.isEnd?s.swiper.slideTo(0):s.swiper.slideNext())},n),()=>{c.current&&(clearInterval(c.current),c.current=null)}},[u,s.swiper,s.isEnd,n]),t.useEffect(()=>{const r=()=>l(),d=()=>{document.hidden&&l()};return window.addEventListener("beforeunload",r),document.addEventListener("visibilitychange",d),()=>{window.removeEventListener("beforeunload",r),document.removeEventListener("visibilitychange",d)}},[l]),{...s,isAutoPlay:u,stopAutoPlay:l,startAutoPlay:f,handleUserInteraction:i}};exports.useSwiper=S;exports.useSwiperWithAutoPlay=I;
|
|
@@ -1,78 +1,79 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as d, useCallback as o, useRef as y, useEffect as g } from "react";
|
|
2
2
|
const A = () => {
|
|
3
|
-
const [n, t] =
|
|
4
|
-
a(e.activeIndex),
|
|
5
|
-
}, []),
|
|
6
|
-
n && (n.slidePrev(),
|
|
7
|
-
}, [n,
|
|
8
|
-
n && (n.slideNext(),
|
|
9
|
-
}, [n,
|
|
3
|
+
const [n, t] = d(null), [r, a] = d(0), [c, s] = d(!0), [h, l] = d(!1), [f, u] = d(!1), [E, v] = d(!1), i = o((e) => {
|
|
4
|
+
a(e.activeIndex), l(e.isEnd), s(e.isBeginning);
|
|
5
|
+
}, []), L = o(() => {
|
|
6
|
+
n && (n.slidePrev(), i(n));
|
|
7
|
+
}, [n, i]), k = o(() => {
|
|
8
|
+
n && (n.slideNext(), i(n));
|
|
9
|
+
}, [n, i]), I = o(
|
|
10
10
|
(e) => {
|
|
11
|
-
n && (n.slideTo(e),
|
|
11
|
+
n && (n.slideTo(e), i(n));
|
|
12
12
|
},
|
|
13
|
-
[n,
|
|
14
|
-
),
|
|
15
|
-
t(e), u(e == null ? void 0 : e.isLocked),
|
|
16
|
-
},
|
|
13
|
+
[n, i]
|
|
14
|
+
), S = (e) => {
|
|
15
|
+
t(e), u(e == null ? void 0 : e.isLocked), v(e == null ? void 0 : e.isLocked), i(e);
|
|
16
|
+
}, m = o(
|
|
17
17
|
(e) => {
|
|
18
|
-
|
|
18
|
+
l(e.isEnd), u(e == null ? void 0 : e.isLocked), v(e == null ? void 0 : e.isLocked), i(e);
|
|
19
19
|
},
|
|
20
|
-
[
|
|
21
|
-
), b =
|
|
22
|
-
|
|
23
|
-
}, []), x =
|
|
24
|
-
|
|
20
|
+
[i]
|
|
21
|
+
), b = o(() => {
|
|
22
|
+
l(!0), s(!1);
|
|
23
|
+
}, []), x = o(() => {
|
|
24
|
+
s(!0), l(!1);
|
|
25
25
|
}, []);
|
|
26
26
|
return {
|
|
27
27
|
swiper: n,
|
|
28
28
|
setSwiper: t,
|
|
29
|
-
activeIndex:
|
|
29
|
+
activeIndex: r,
|
|
30
30
|
setActiveIndex: a,
|
|
31
31
|
isEnd: h,
|
|
32
|
-
setIsEnd:
|
|
32
|
+
setIsEnd: l,
|
|
33
33
|
hideNav: f,
|
|
34
|
-
handleSlideChange:
|
|
35
|
-
handlePrevClick:
|
|
36
|
-
handleNextClick:
|
|
37
|
-
handleSlideTo:
|
|
38
|
-
onSwiperInit:
|
|
39
|
-
handleSwiperResize:
|
|
40
|
-
isBeginning:
|
|
41
|
-
|
|
34
|
+
handleSlideChange: i,
|
|
35
|
+
handlePrevClick: L,
|
|
36
|
+
handleNextClick: k,
|
|
37
|
+
handleSlideTo: I,
|
|
38
|
+
onSwiperInit: S,
|
|
39
|
+
handleSwiperResize: m,
|
|
40
|
+
isBeginning: c,
|
|
41
|
+
isLocked: E,
|
|
42
|
+
setIsBeginning: s,
|
|
42
43
|
handleReachEnd: b,
|
|
43
44
|
handleReachBeginning: x
|
|
44
45
|
};
|
|
45
|
-
},
|
|
46
|
-
const t = A(), [
|
|
47
|
-
a(!1),
|
|
48
|
-
}, []), h =
|
|
46
|
+
}, B = (n = 3e3) => {
|
|
47
|
+
const t = A(), [r, a] = d(!0), c = y(null), s = o(() => {
|
|
48
|
+
a(!1), c.current && (clearInterval(c.current), c.current = null);
|
|
49
|
+
}, []), h = o(() => {
|
|
49
50
|
a(!0);
|
|
50
|
-
}, []),
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
return
|
|
54
|
-
if (!(!
|
|
55
|
-
return
|
|
51
|
+
}, []), l = o(() => {
|
|
52
|
+
s();
|
|
53
|
+
}, [s]);
|
|
54
|
+
return g(() => {
|
|
55
|
+
if (!(!r || !t.swiper || t.swiper.slides.length <= 1))
|
|
56
|
+
return c.current = setInterval(() => {
|
|
56
57
|
t.swiper && (t.isEnd ? t.swiper.slideTo(0) : t.swiper.slideNext());
|
|
57
58
|
}, n), () => {
|
|
58
|
-
|
|
59
|
+
c.current && (clearInterval(c.current), c.current = null);
|
|
59
60
|
};
|
|
60
|
-
}, [
|
|
61
|
-
const f = () =>
|
|
62
|
-
document.hidden &&
|
|
61
|
+
}, [r, t.swiper, t.isEnd, n]), g(() => {
|
|
62
|
+
const f = () => s(), u = () => {
|
|
63
|
+
document.hidden && s();
|
|
63
64
|
};
|
|
64
65
|
return window.addEventListener("beforeunload", f), document.addEventListener("visibilitychange", u), () => {
|
|
65
66
|
window.removeEventListener("beforeunload", f), document.removeEventListener("visibilitychange", u);
|
|
66
67
|
};
|
|
67
|
-
}, [
|
|
68
|
+
}, [s]), {
|
|
68
69
|
...t,
|
|
69
|
-
isAutoPlay:
|
|
70
|
-
stopAutoPlay:
|
|
70
|
+
isAutoPlay: r,
|
|
71
|
+
stopAutoPlay: s,
|
|
71
72
|
startAutoPlay: h,
|
|
72
|
-
handleUserInteraction:
|
|
73
|
+
handleUserInteraction: l
|
|
73
74
|
};
|
|
74
75
|
};
|
|
75
76
|
export {
|
|
76
77
|
A as useSwiper,
|
|
77
|
-
|
|
78
|
+
B as useSwiperWithAutoPlay
|
|
78
79
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenpatient-org/healthspan-marketing-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.49",
|
|
4
4
|
"description": "Design system",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -261,6 +261,11 @@
|
|
|
261
261
|
"import": "./dist/components/Accordion/Accordion.es.js",
|
|
262
262
|
"require": "./dist/components/Accordion/Accordion.cjs.js"
|
|
263
263
|
},
|
|
264
|
+
"./AdvancedGallery": {
|
|
265
|
+
"types": "./dist/components/AdvancedGallery/AdvancedGallery.d.ts",
|
|
266
|
+
"import": "./dist/components/AdvancedGallery/AdvancedGallery.es.js",
|
|
267
|
+
"require": "./dist/components/AdvancedGallery/AdvancedGallery.cjs.js"
|
|
268
|
+
},
|
|
264
269
|
"./FAQComponent": {
|
|
265
270
|
"types": "./dist/components/FAQComponent/FAQComponent.d.ts",
|
|
266
271
|
"import": "./dist/components/FAQComponent/FAQComponent.es.js",
|