@zenpatient-org/healthspan-marketing-ui 0.1.145 → 0.1.146
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/ComplexImageCarousel/ComplexCarousel/ComplexCarousel.cjs.js +1 -1
- package/dist/components/ComplexImageCarousel/ComplexCarousel/ComplexCarousel.es.js +33 -32
- package/dist/components/ComplexImageCarousel/SimpleImageCarousel/SimpleImageCarousel.cjs.js +1 -1
- package/dist/components/ComplexImageCarousel/SimpleImageCarousel/SimpleImageCarousel.es.js +33 -30
- package/dist/components/ComplexImageCarousel/useComplexImageCarousel.cjs.js +1 -1
- package/dist/components/ComplexImageCarousel/useComplexImageCarousel.d.ts +1 -0
- package/dist/components/ComplexImageCarousel/useComplexImageCarousel.es.js +160 -122
- package/dist/components/ContentTabs/ContentTabs.cjs.js +1 -1
- package/dist/components/ContentTabs/ContentTabs.es.js +10 -10
- package/dist/healthspan-marketing-ui.css +1 -1
- 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"),i=require("../../../utils/cn/cn.cjs.js"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../../utils/cn/cn.cjs.js"),v=require("../../ProgressButton/ProgressButton.cjs.js"),u=require("../../Typography/Typography.cjs.js"),b=require("../useComplexImageCarousel.cjs.js"),r=require("./complexImageCarousel.module.css.cjs.js"),I=({images:a})=>{const{MOBILE_BREAKPOINT:n,containerRef:m,carouselRef:f,imageRefs:p,descriptionRef:g,descriptionItemRef:h,progressButtonContainerRef:C,visible:s,cardSizes:o,handleCustomPrevClick:x,handleCustomNextClick:y,current:j,mobileCardIndex:l,xLargeCardIndex:d}=b.useComplexImageCarousel({images:a});return e.jsx("div",{className:r.default.root,children:e.jsxs("div",{ref:m,className:r.default.container,children:[e.jsx("div",{ref:f,className:r.default.carouselArea,children:s.length>0&&s.map((N,t)=>e.jsx("div",{className:i.cn(r.default.slideContainer,r.default[`size-${o[t]}`]),ref:c=>{c&&(p.current[t]=c)},"data-flip-id":`slide-${(j+t)%a.length}`,"data-size":o[t],children:e.jsx("img",{src:N.image,alt:`Slide ${t+1}`,className:r.default.image})},t+1))}),e.jsx("div",{ref:g,className:r.default.description,children:e.jsxs("div",{ref:h,className:i.cn("description-item",r.default.descriptionItem),children:[e.jsx(u.Typography,{as:"h3",defaultVariant:"headingLg",mobileVariant:"headingSm",children:typeof window<"u"&&window.innerWidth<=n?s[l].title:s[d].title}),e.jsx(u.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:r.default.text,children:typeof window<"u"&&window.innerWidth<=n?s[l].description:s[d].description})]})}),e.jsx("div",{ref:C,className:r.default.progressButtonContainer,children:e.jsx(v.ProgressButton,{left:{onClick:x},right:{onClick:y},className:i.cn("progress-buttons",r.default.progressButton)})})]})})};exports.ComplexCarousel=I;
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as i, jsxs as
|
|
2
|
+
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
3
3
|
import { cn as s } from "../../../utils/cn/cn.es.js";
|
|
4
|
-
import { ProgressButton as
|
|
5
|
-
import { Typography as
|
|
4
|
+
import { ProgressButton as I } from "../../ProgressButton/ProgressButton.es.js";
|
|
5
|
+
import { Typography as f } from "../../Typography/Typography.es.js";
|
|
6
6
|
import { useComplexImageCarousel as R } from "../useComplexImageCarousel.es.js";
|
|
7
7
|
import e from "./complexImageCarousel.module.css.es.js";
|
|
8
|
-
const
|
|
8
|
+
const L = ({ images: o }) => {
|
|
9
9
|
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
MOBILE_BREAKPOINT: a,
|
|
11
|
+
containerRef: p,
|
|
12
|
+
carouselRef: h,
|
|
13
|
+
imageRefs: u,
|
|
14
|
+
descriptionRef: g,
|
|
15
|
+
descriptionItemRef: C,
|
|
16
|
+
progressButtonContainerRef: N,
|
|
16
17
|
visible: r,
|
|
17
|
-
cardSizes:
|
|
18
|
-
handleCustomPrevClick:
|
|
19
|
-
handleCustomNextClick:
|
|
20
|
-
current:
|
|
21
|
-
mobileCardIndex:
|
|
22
|
-
xLargeCardIndex:
|
|
18
|
+
cardSizes: n,
|
|
19
|
+
handleCustomPrevClick: v,
|
|
20
|
+
handleCustomNextClick: w,
|
|
21
|
+
current: b,
|
|
22
|
+
mobileCardIndex: d,
|
|
23
|
+
xLargeCardIndex: l
|
|
23
24
|
} = R({ images: o });
|
|
24
|
-
return /* @__PURE__ */ i("div", { className: e.root, children: /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */ i("div", { ref:
|
|
25
|
+
return /* @__PURE__ */ i("div", { className: e.root, children: /* @__PURE__ */ m("div", { ref: p, className: e.container, children: [
|
|
26
|
+
/* @__PURE__ */ i("div", { ref: h, className: e.carouselArea, children: r.length > 0 && r.map((y, t) => /* @__PURE__ */ i(
|
|
26
27
|
"div",
|
|
27
28
|
{
|
|
28
|
-
className: s(e.slideContainer, e[`size-${
|
|
29
|
-
ref: (
|
|
30
|
-
|
|
29
|
+
className: s(e.slideContainer, e[`size-${n[t]}`]),
|
|
30
|
+
ref: (c) => {
|
|
31
|
+
c && (u.current[t] = c);
|
|
31
32
|
},
|
|
32
|
-
"data-flip-id": `slide-${(
|
|
33
|
-
"data-size":
|
|
34
|
-
children: /* @__PURE__ */ i("img", { src:
|
|
33
|
+
"data-flip-id": `slide-${(b + t) % o.length}`,
|
|
34
|
+
"data-size": n[t],
|
|
35
|
+
children: /* @__PURE__ */ i("img", { src: y.image, alt: `Slide ${t + 1}`, className: e.image })
|
|
35
36
|
},
|
|
36
37
|
t + 1
|
|
37
38
|
)) }),
|
|
38
|
-
/* @__PURE__ */ i("div", { ref:
|
|
39
|
-
/* @__PURE__ */ i(
|
|
40
|
-
/* @__PURE__ */ i(
|
|
39
|
+
/* @__PURE__ */ i("div", { ref: g, className: e.description, children: /* @__PURE__ */ m("div", { ref: C, className: s("description-item", e.descriptionItem), children: [
|
|
40
|
+
/* @__PURE__ */ i(f, { as: "h3", defaultVariant: "headingLg", mobileVariant: "headingSm", children: typeof window < "u" && window.innerWidth <= a ? r[d].title : r[l].title }),
|
|
41
|
+
/* @__PURE__ */ i(f, { as: "p", defaultVariant: "bodyMd", mobileVariant: "bodySm", className: e.text, children: typeof window < "u" && window.innerWidth <= a ? r[d].description : r[l].description })
|
|
41
42
|
] }) }),
|
|
42
|
-
/* @__PURE__ */ i("div", { ref:
|
|
43
|
-
|
|
43
|
+
/* @__PURE__ */ i("div", { ref: N, className: e.progressButtonContainer, children: /* @__PURE__ */ i(
|
|
44
|
+
I,
|
|
44
45
|
{
|
|
45
46
|
left: {
|
|
46
|
-
onClick:
|
|
47
|
+
onClick: v
|
|
47
48
|
},
|
|
48
49
|
right: {
|
|
49
|
-
onClick:
|
|
50
|
+
onClick: w
|
|
50
51
|
},
|
|
51
52
|
className: s("progress-buttons", e.progressButton)
|
|
52
53
|
}
|
|
@@ -54,5 +55,5 @@ const z = ({ images: o }) => {
|
|
|
54
55
|
] }) });
|
|
55
56
|
};
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
+
L as ComplexCarousel
|
|
58
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),p=require("react"),m=require("../../../utils/useIsMobile.cjs.js"),u=require("../../ComplexTooltip/ComplexTooltip.cjs.js");require("../../Icon/Icon.cjs.js");const n=require("../../Typography/Typography.cjs.js"),d=require("../../InfiniteScroll/InfiniteScroll.cjs.js"),e=require("./simpleImageCarousel.module.css.cjs.js"),f=({images:a})=>{const[t,i]=p.useState(null),r=m.useIsMobile(930);return l.jsx("div",{className:e.default.simpleContainer,children:l.jsx(d.InfiniteScroll,{items:a,enableManualScroll:r,slowOnTouch:r,renderItem:(s,c)=>l.jsxs("div",{className:e.default.simpleItem,onMouseEnter:o=>{i({x:o.clientX,y:window.scrollY+o.clientY})},onMouseMove:o=>{i({x:o.clientX,y:window.scrollY+o.clientY})},children:[l.jsx(u.ComplexTooltip,{trigger:"hover",title:s.title||"",description:s.description||"",style:"light",transformMode:"absolute",transform:{top:(t==null?void 0:t.y)||0,left:t==null?void 0:t.x},children:l.jsx("img",{src:s.image,alt:s.title,className:e.default.simpleImage})}),l.jsx(n.Typography,{as:"h4",defaultVariant:"headingXs",mobileVariant:"bodyLg",className:e.default.simpleTitle,children:s.title}),l.jsx(n.Typography,{as:"p",defaultVariant:"bodySm",mobileVariant:"bodyXs",className:e.default.simpleDescription,children:s.description})]},c),itemClassName:e.default.simpleItemWrapper,contentClassName:e.default.simpleContent,rootClassName:e.default.simpleRoot})})};exports.SimpleImageCarousel=f;
|
|
@@ -1,69 +1,72 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
2
|
+
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
3
|
+
import { useState as c } from "react";
|
|
4
|
+
import { useIsMobile as d } from "../../../utils/useIsMobile.es.js";
|
|
5
|
+
import { ComplexTooltip as f } from "../../ComplexTooltip/ComplexTooltip.es.js";
|
|
5
6
|
import "../../Icon/Icon.es.js";
|
|
6
|
-
import { Typography as
|
|
7
|
-
import { InfiniteScroll as
|
|
7
|
+
import { Typography as n } from "../../Typography/Typography.es.js";
|
|
8
|
+
import { InfiniteScroll as h } from "../../InfiniteScroll/InfiniteScroll.es.js";
|
|
8
9
|
import e from "./simpleImageCarousel.module.css.es.js";
|
|
9
|
-
const
|
|
10
|
-
const [t, s] =
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
10
|
+
const g = ({ images: a }) => {
|
|
11
|
+
const [t, s] = c(null), r = d(930);
|
|
12
|
+
return /* @__PURE__ */ i("div", { className: e.simpleContainer, children: /* @__PURE__ */ i(
|
|
13
|
+
h,
|
|
13
14
|
{
|
|
14
|
-
items:
|
|
15
|
-
|
|
15
|
+
items: a,
|
|
16
|
+
enableManualScroll: r,
|
|
17
|
+
slowOnTouch: r,
|
|
18
|
+
renderItem: (l, m) => /* @__PURE__ */ p(
|
|
16
19
|
"div",
|
|
17
20
|
{
|
|
18
21
|
className: e.simpleItem,
|
|
19
|
-
onMouseEnter: (
|
|
22
|
+
onMouseEnter: (o) => {
|
|
20
23
|
s({
|
|
21
|
-
x:
|
|
22
|
-
y:
|
|
24
|
+
x: o.clientX,
|
|
25
|
+
y: window.scrollY + o.clientY
|
|
23
26
|
});
|
|
24
27
|
},
|
|
25
|
-
onMouseMove: (
|
|
28
|
+
onMouseMove: (o) => {
|
|
26
29
|
s({
|
|
27
|
-
x:
|
|
28
|
-
y:
|
|
30
|
+
x: o.clientX,
|
|
31
|
+
y: window.scrollY + o.clientY
|
|
29
32
|
});
|
|
30
33
|
},
|
|
31
34
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
35
|
+
/* @__PURE__ */ i(
|
|
36
|
+
f,
|
|
34
37
|
{
|
|
35
38
|
trigger: "hover",
|
|
36
|
-
title:
|
|
37
|
-
description:
|
|
39
|
+
title: l.title || "",
|
|
40
|
+
description: l.description || "",
|
|
38
41
|
style: "light",
|
|
39
42
|
transformMode: "absolute",
|
|
40
43
|
transform: { top: (t == null ? void 0 : t.y) || 0, left: t == null ? void 0 : t.x },
|
|
41
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ i("img", { src: l.image, alt: l.title, className: e.simpleImage })
|
|
42
45
|
}
|
|
43
46
|
),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
47
|
+
/* @__PURE__ */ i(
|
|
48
|
+
n,
|
|
46
49
|
{
|
|
47
50
|
as: "h4",
|
|
48
51
|
defaultVariant: "headingXs",
|
|
49
52
|
mobileVariant: "bodyLg",
|
|
50
53
|
className: e.simpleTitle,
|
|
51
|
-
children:
|
|
54
|
+
children: l.title
|
|
52
55
|
}
|
|
53
56
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
57
|
+
/* @__PURE__ */ i(
|
|
58
|
+
n,
|
|
56
59
|
{
|
|
57
60
|
as: "p",
|
|
58
61
|
defaultVariant: "bodySm",
|
|
59
62
|
mobileVariant: "bodyXs",
|
|
60
63
|
className: e.simpleDescription,
|
|
61
|
-
children:
|
|
64
|
+
children: l.description
|
|
62
65
|
}
|
|
63
66
|
)
|
|
64
67
|
]
|
|
65
68
|
},
|
|
66
|
-
|
|
69
|
+
m
|
|
67
70
|
),
|
|
68
71
|
itemClassName: e.simpleItemWrapper,
|
|
69
72
|
contentClassName: e.simpleContent,
|
|
@@ -72,5 +75,5 @@ const b = ({ images: m }) => {
|
|
|
72
75
|
) });
|
|
73
76
|
};
|
|
74
77
|
export {
|
|
75
|
-
|
|
78
|
+
g as SimpleImageCarousel
|
|
76
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("../../node_modules/@gsap/react/src/index.cjs.js"),r=require("../../node_modules/gsap/index.cjs.js"),P=require("../../node_modules/gsap/Flip.cjs.js"),U=require("../../node_modules/gsap/Draggable.cjs.js"),c=require("react");r.gsap.registerPlugin(P.Flip);r.gsap.registerPlugin(U.Draggable);const F=12,ne=({images:i})=>{if(i.length>0&&i.length<F){const s=[...i];for(;i.length<F;)i.push(...s)}const[a,q]=c.useState(0),x=c.useRef(a);x.current=a;const[C,T]=c.useState(!1),j=c.useRef(null),t=c.useRef(null),R=c.useRef([]),I=c.useRef(null),N=c.useRef(null),S=c.useRef(null),L=c.useRef(null),u=["atom","small","medium","large","medium","small","atom"],_=["atom","small","medium","large","x-large","large","medium","small","atom"],[$,O]=c.useState(0),[g,G]=c.useState(typeof window<"u"&&window.innerWidth<=930?u:_),V=u.indexOf("large"),J=g.indexOf("x-large"),H=r.gsap.matchMedia(),h=c.useCallback(s=>{var p,K,v,D;if(!t.current)return;let o=0;if(window.innerWidth<=930){const l=t.current.querySelector('[data-size="large"]');o=l?l.offsetHeight:0}else{const l=t.current.querySelector('[data-size="x-large"]');o=l?l.offsetHeight:0,r.gsap.set(t.current,{x:0})}if(o>0&&(O(o),r.gsap.set(t.current,{height:o})),r.gsap.set((p=t.current)==null?void 0:p.querySelectorAll("[data-size]"),{y:0}),!R.current.length)return;const n=(K=t.current)==null?void 0:K.querySelector('[data-size="x-large"]'),e=n==null?void 0:n.getBoundingClientRect(),m=(v=t.current)==null?void 0:v.querySelector('[data-size="large"]'),d=m==null?void 0:m.getBoundingClientRect();H.add({isMobile:"(max-width: 930px)",isDesktop:"(min-width: 931px)"},l=>{var k,W;const{isDesktop:z,isMobile:ee}=l.conditions||{};if(O(((k=t.current)==null?void 0:k.offsetHeight)||0),r.gsap.set(t.current,{height:$||((W=t.current)==null?void 0:W.offsetHeight)||"auto"}),ee){if(!d)return;const f=window.innerWidth/2,E=d.right-d.width/2,M=f-E;if(r.gsap.set(t.current,{x:`+=${M}`}),!S.current)return;const A=S.current.querySelector(".progress-buttons");if(A){const w=A.getBoundingClientRect(),B=w.left+w.width/2,b=f-B;r.gsap.set(A,{x:`+=${b}`})}const te=f-d.width/2;r.gsap.set(I.current,{width:d.width,marginLeft:te}),R.current.forEach((w,B)=>{w&&B<u.length&&(u.forEach(b=>{w.classList.remove(`size-${b}`)}),w.classList.add(`size-${u[B]}`))})}z&&(r.gsap.set(I.current,{width:e?e.width:"auto",marginLeft:e?e.left:0}),R.current.forEach((f,E)=>{f&&E<g.length&&(g.forEach(M=>{f.classList.remove(`size-${M}`)}),f.classList.add(`size-${g[E]}`))}))}),(((D=I.current)==null?void 0:D.querySelectorAll(".description-item"))||[]).forEach((l,z)=>{l.style.zIndex=`${i.length-z}`}),T(!0),L.current=P.Flip.getState(R.current,{simple:!0}),q(s),r.gsap.delayedCall(0,()=>{P.Flip.from(L.current,{duration:.3,ease:"power3.out",absolute:!0,onComplete:()=>{T(!1)}}),r.gsap.fromTo(N.current,{opacity:0,y:20},{opacity:1,y:0,duration:.5,ease:"power3.out",onComplete:()=>{L.current=null}})})},[g,u,i.length,$]),Q=()=>{if(C)return;const s=(a-1+i.length)%i.length;h(s)},X=()=>{if(C)return;const s=(a+1)%i.length;h(s)};function Y(s,o){const n=[];if(typeof window<"u"&&window.innerWidth<=930)for(let e=0;e<u.length;e++)n.push(s[(o+e)%s.length]);else for(let e=0;e<g.length;e++)n.push(s[(o+e)%s.length]);return n}const Z=Y(i,a);return re.useGSAP(()=>{h(a);const s=()=>{G(window.innerWidth<=930?u:_),r.gsap.matchMediaRefresh(),q(0),r.gsap.delayedCall(0,()=>{if(!t.current)return;let n=0;if(window.innerWidth<=930){const e=t.current.querySelector('[data-size="large"]');n=e?e.offsetHeight:0}else{const e=t.current.querySelector('[data-size="x-large"]');n=e?e.offsetHeight:0,r.gsap.set(t.current,{x:0})}n>0&&(O(n),r.gsap.set(t.current,{height:n})),h(a)})};window.addEventListener("resize",s);const o=t.current;if(o)return H.add("(max-width: 930px)",()=>{const n={x:0},e=U.Draggable.create(o,{type:"x",onDragStart:()=>{C||(n.x=o.scrollLeft+o.getBoundingClientRect().left)},onDragEnd:()=>{const d=o.scrollLeft+o.getBoundingClientRect().left-n.x,y=20;if(d>y){if(C)return;const p=(x.current-1+i.length)%i.length;h(p)}else if(d<-y){if(C)return;const p=(x.current+1)%i.length;h(p)}}});return()=>{e[0]&&e[0].kill()}}),()=>{window.removeEventListener("resize",s)}},[]),{MOBILE_BREAKPOINT:930,containerRef:j,carouselRef:t,imageRefs:R,descriptionRef:I,descriptionItemRef:N,progressButtonContainerRef:S,visible:Z,cardSizes:g,handleCustomPrevClick:Q,handleCustomNextClick:X,current:a,mobileCardIndex:V,xLargeCardIndex:J}};exports.useComplexImageCarousel=ne;
|
|
@@ -3,6 +3,7 @@ import { TAdvancedImageView } from './types';
|
|
|
3
3
|
export declare const useComplexImageCarousel: ({ images }: {
|
|
4
4
|
images: TAdvancedImageView[];
|
|
5
5
|
}) => {
|
|
6
|
+
MOBILE_BREAKPOINT: number;
|
|
6
7
|
containerRef: import('react').RefObject<HTMLDivElement>;
|
|
7
8
|
carouselRef: import('react').RefObject<HTMLDivElement>;
|
|
8
9
|
imageRefs: import('react').MutableRefObject<HTMLDivElement[]>;
|
|
@@ -1,77 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { useGSAP as ne } from "../../node_modules/@gsap/react/src/index.es.js";
|
|
3
|
+
import { gsap as r } from "../../node_modules/gsap/index.es.js";
|
|
4
|
+
import { Flip as N } from "../../node_modules/gsap/Flip.es.js";
|
|
4
5
|
import { Draggable as G } from "../../node_modules/gsap/Draggable.es.js";
|
|
5
|
-
import { useState as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
31
|
-
if (w) {
|
|
32
|
-
const C = w.getBoundingClientRect(), y = C.left + C.width / 2, q = u - y;
|
|
33
|
-
o.set(w, {
|
|
34
|
-
x: `+=${q}`
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
const k = u - h.width / 2;
|
|
38
|
-
o.set(z.current, {
|
|
39
|
-
width: h.width,
|
|
40
|
-
marginLeft: k
|
|
41
|
-
}), f.current.forEach((C, y) => {
|
|
42
|
-
C && y < l.length && (l.forEach((q) => {
|
|
43
|
-
C.classList.remove(`size-${q}`);
|
|
44
|
-
}), C.classList.add(`size-${l[y]}`));
|
|
45
|
-
});
|
|
46
|
-
}), $.add("(min-width: 769px", () => {
|
|
47
|
-
var u, p;
|
|
48
|
-
I(((u = e.current) == null ? void 0 : u.offsetHeight) || 0), o.set(e.current, {
|
|
49
|
-
height: E || ((p = e.current) == null ? void 0 : p.offsetHeight) || "auto"
|
|
50
|
-
}), o.set(z.current, {
|
|
51
|
-
width: s ? s.width : "auto",
|
|
52
|
-
marginLeft: s ? s.left : 0
|
|
53
|
-
}), f.current.forEach((S, w) => {
|
|
54
|
-
S && w < d.length && (d.forEach((k) => {
|
|
55
|
-
S.classList.remove(`size-${k}`);
|
|
56
|
-
}), S.classList.add(`size-${d[w]}`));
|
|
6
|
+
import { useState as x, useRef as d, useCallback as se } from "react";
|
|
7
|
+
r.registerPlugin(N);
|
|
8
|
+
r.registerPlugin(G);
|
|
9
|
+
const F = 12, de = ({ images: i }) => {
|
|
10
|
+
if (i.length > 0 && i.length < F) {
|
|
11
|
+
const s = [...i];
|
|
12
|
+
for (; i.length < F; )
|
|
13
|
+
i.push(...s);
|
|
14
|
+
}
|
|
15
|
+
const [l, _] = x(0), L = d(l);
|
|
16
|
+
L.current = l;
|
|
17
|
+
const [w, b] = x(!1), V = d(null), t = d(null), C = d([]), I = d(null), H = d(null), O = d(null), S = d(null), u = ["atom", "small", "medium", "large", "medium", "small", "atom"], K = ["atom", "small", "medium", "large", "x-large", "large", "medium", "small", "atom"], [$, y] = x(0), [f, j] = x(
|
|
18
|
+
typeof window < "u" && window.innerWidth <= 930 ? u : K
|
|
19
|
+
), J = u.indexOf("large"), Q = f.indexOf("x-large"), q = r.matchMedia(), h = se(
|
|
20
|
+
(s) => {
|
|
21
|
+
var p, k, v, W;
|
|
22
|
+
if (!t.current) return;
|
|
23
|
+
let o = 0;
|
|
24
|
+
if (window.innerWidth <= 930) {
|
|
25
|
+
const c = t.current.querySelector('[data-size="large"]');
|
|
26
|
+
o = c ? c.offsetHeight : 0;
|
|
27
|
+
} else {
|
|
28
|
+
const c = t.current.querySelector('[data-size="x-large"]');
|
|
29
|
+
o = c ? c.offsetHeight : 0, r.set(t.current, {
|
|
30
|
+
x: 0
|
|
57
31
|
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
}
|
|
33
|
+
if (o > 0 && (y(o), r.set(t.current, {
|
|
34
|
+
height: o
|
|
35
|
+
})), r.set((p = t.current) == null ? void 0 : p.querySelectorAll("[data-size]"), {
|
|
36
|
+
y: 0
|
|
37
|
+
}), !C.current.length) return;
|
|
38
|
+
const n = (k = t.current) == null ? void 0 : k.querySelector('[data-size="x-large"]'), e = n == null ? void 0 : n.getBoundingClientRect(), E = (v = t.current) == null ? void 0 : v.querySelector('[data-size="large"]'), a = E == null ? void 0 : E.getBoundingClientRect();
|
|
39
|
+
q.add(
|
|
40
|
+
{
|
|
41
|
+
isMobile: "(max-width: 930px)",
|
|
42
|
+
isDesktop: "(min-width: 931px)"
|
|
43
|
+
},
|
|
44
|
+
(c) => {
|
|
45
|
+
var D, U;
|
|
46
|
+
const { isDesktop: M, isMobile: te } = c.conditions || {};
|
|
47
|
+
if (y(((D = t.current) == null ? void 0 : D.offsetHeight) || 0), r.set(t.current, {
|
|
48
|
+
height: $ || ((U = t.current) == null ? void 0 : U.offsetHeight) || "auto"
|
|
49
|
+
}), te) {
|
|
50
|
+
if (!a) return;
|
|
51
|
+
const g = window.innerWidth / 2, B = a.right - a.width / 2, A = g - B;
|
|
52
|
+
if (r.set(t.current, {
|
|
53
|
+
x: `+=${A}`
|
|
54
|
+
}), !O.current) return;
|
|
55
|
+
const P = O.current.querySelector(
|
|
56
|
+
".progress-buttons"
|
|
57
|
+
);
|
|
58
|
+
if (P) {
|
|
59
|
+
const m = P.getBoundingClientRect(), R = m.left + m.width / 2, T = g - R;
|
|
60
|
+
r.set(P, {
|
|
61
|
+
x: `+=${T}`
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const re = g - a.width / 2;
|
|
65
|
+
r.set(I.current, {
|
|
66
|
+
width: a.width,
|
|
67
|
+
marginLeft: re
|
|
68
|
+
}), C.current.forEach((m, R) => {
|
|
69
|
+
m && R < u.length && (u.forEach((T) => {
|
|
70
|
+
m.classList.remove(`size-${T}`);
|
|
71
|
+
}), m.classList.add(`size-${u[R]}`));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
M && (r.set(I.current, {
|
|
75
|
+
width: e ? e.width : "auto",
|
|
76
|
+
marginLeft: e ? e.left : 0
|
|
77
|
+
}), C.current.forEach((g, B) => {
|
|
78
|
+
g && B < f.length && (f.forEach((A) => {
|
|
79
|
+
g.classList.remove(`size-${A}`);
|
|
80
|
+
}), g.classList.add(`size-${f[B]}`));
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
), (((W = I.current) == null ? void 0 : W.querySelectorAll(".description-item")) || []).forEach((c, M) => {
|
|
84
|
+
c.style.zIndex = `${i.length - M}`;
|
|
85
|
+
}), b(!0), S.current = N.getState(C.current, {
|
|
62
86
|
simple: !0
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
duration: 0.
|
|
87
|
+
}), _(s), r.delayedCall(0, () => {
|
|
88
|
+
N.from(S.current, {
|
|
89
|
+
duration: 0.3,
|
|
66
90
|
ease: "power3.out",
|
|
67
|
-
|
|
68
|
-
scale: !1,
|
|
69
|
-
nested: !0,
|
|
91
|
+
absolute: !0,
|
|
70
92
|
onComplete: () => {
|
|
71
|
-
|
|
93
|
+
b(!1);
|
|
72
94
|
}
|
|
73
|
-
}),
|
|
74
|
-
|
|
95
|
+
}), r.fromTo(
|
|
96
|
+
H.current,
|
|
75
97
|
{
|
|
76
98
|
opacity: 0,
|
|
77
99
|
y: 20
|
|
@@ -82,82 +104,98 @@ const st = ({ images: i }) => {
|
|
|
82
104
|
duration: 0.5,
|
|
83
105
|
ease: "power3.out",
|
|
84
106
|
onComplete: () => {
|
|
85
|
-
|
|
107
|
+
S.current = null;
|
|
86
108
|
}
|
|
87
109
|
}
|
|
88
110
|
);
|
|
89
111
|
});
|
|
90
112
|
},
|
|
91
|
-
[
|
|
92
|
-
),
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
|
|
113
|
+
[f, u, i.length, $]
|
|
114
|
+
), X = () => {
|
|
115
|
+
if (w) return;
|
|
116
|
+
const s = (l - 1 + i.length) % i.length;
|
|
117
|
+
h(s);
|
|
118
|
+
}, Y = () => {
|
|
119
|
+
if (w) return;
|
|
120
|
+
const s = (l + 1) % i.length;
|
|
121
|
+
h(s);
|
|
100
122
|
};
|
|
101
|
-
function
|
|
102
|
-
const
|
|
103
|
-
if (typeof window < "u" && window.innerWidth <=
|
|
104
|
-
for (let
|
|
105
|
-
|
|
123
|
+
function Z(s, o) {
|
|
124
|
+
const n = [];
|
|
125
|
+
if (typeof window < "u" && window.innerWidth <= 930)
|
|
126
|
+
for (let e = 0; e < u.length; e++)
|
|
127
|
+
n.push(s[(o + e) % s.length]);
|
|
106
128
|
else
|
|
107
|
-
for (let
|
|
108
|
-
|
|
109
|
-
return
|
|
129
|
+
for (let e = 0; e < f.length; e++)
|
|
130
|
+
n.push(s[(o + e) % s.length]);
|
|
131
|
+
return n;
|
|
110
132
|
}
|
|
111
|
-
const
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
133
|
+
const ee = Z(i, l);
|
|
134
|
+
return ne(() => {
|
|
135
|
+
h(l);
|
|
136
|
+
const s = () => {
|
|
137
|
+
j(window.innerWidth <= 930 ? u : K), r.matchMediaRefresh(), _(0), r.delayedCall(0, () => {
|
|
138
|
+
if (!t.current) return;
|
|
139
|
+
let n = 0;
|
|
140
|
+
if (window.innerWidth <= 930) {
|
|
141
|
+
const e = t.current.querySelector('[data-size="large"]');
|
|
142
|
+
n = e ? e.offsetHeight : 0;
|
|
143
|
+
} else {
|
|
144
|
+
const e = t.current.querySelector('[data-size="x-large"]');
|
|
145
|
+
n = e ? e.offsetHeight : 0, r.set(t.current, {
|
|
146
|
+
x: 0
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
n > 0 && (y(n), r.set(t.current, {
|
|
150
|
+
height: n
|
|
151
|
+
})), h(l);
|
|
152
|
+
});
|
|
116
153
|
};
|
|
117
|
-
window.addEventListener("resize",
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
return
|
|
121
|
-
const
|
|
154
|
+
window.addEventListener("resize", s);
|
|
155
|
+
const o = t.current;
|
|
156
|
+
if (o)
|
|
157
|
+
return q.add("(max-width: 930px)", () => {
|
|
158
|
+
const n = { x: 0 }, e = G.create(o, {
|
|
122
159
|
type: "x",
|
|
123
160
|
onDragStart: () => {
|
|
124
|
-
|
|
161
|
+
w || (n.x = o.scrollLeft + o.getBoundingClientRect().left);
|
|
125
162
|
},
|
|
126
163
|
onDragEnd: () => {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
} else if (
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
|
|
164
|
+
const a = o.scrollLeft + o.getBoundingClientRect().left - n.x, z = 20;
|
|
165
|
+
if (a > z) {
|
|
166
|
+
if (w) return;
|
|
167
|
+
const p = (L.current - 1 + i.length) % i.length;
|
|
168
|
+
h(p);
|
|
169
|
+
} else if (a < -z) {
|
|
170
|
+
if (w) return;
|
|
171
|
+
const p = (L.current + 1) % i.length;
|
|
172
|
+
h(p);
|
|
136
173
|
}
|
|
137
174
|
}
|
|
138
175
|
});
|
|
139
176
|
return () => {
|
|
140
|
-
|
|
177
|
+
e[0] && e[0].kill();
|
|
141
178
|
};
|
|
142
179
|
}), () => {
|
|
143
|
-
window.removeEventListener("resize",
|
|
180
|
+
window.removeEventListener("resize", s);
|
|
144
181
|
};
|
|
145
182
|
}, []), {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
183
|
+
MOBILE_BREAKPOINT: 930,
|
|
184
|
+
containerRef: V,
|
|
185
|
+
carouselRef: t,
|
|
186
|
+
imageRefs: C,
|
|
187
|
+
descriptionRef: I,
|
|
188
|
+
descriptionItemRef: H,
|
|
189
|
+
progressButtonContainerRef: O,
|
|
190
|
+
visible: ee,
|
|
191
|
+
cardSizes: f,
|
|
192
|
+
handleCustomPrevClick: X,
|
|
193
|
+
handleCustomNextClick: Y,
|
|
194
|
+
current: l,
|
|
195
|
+
mobileCardIndex: J,
|
|
196
|
+
xLargeCardIndex: Q
|
|
159
197
|
};
|
|
160
198
|
};
|
|
161
199
|
export {
|
|
162
|
-
|
|
200
|
+
de as useComplexImageCarousel
|
|
163
201
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../utils/cn/cn.cjs.js"),s=require("../Typography/Typography.cjs.js"),d=require("../IconBracket/IconBracket.cjs.js"),u=require("../Icon/Icon.cjs.js"),n=require("./contentTabs.module.css.cjs.js");function m({tabs:c,activeTab:t,colorScheme:r,activeWithArrow:o,onTabClick:i}){return e.jsx("div",{className:l.cn(n.default.root,n.default[r]),children:c.map(a=>e.jsxs("div",{className:n.default.tabWrap,children:[e.jsxs("button",{className:l.cn(n.default.tab,{[n.default.activeTab]:t.label===a.label}),onClick:()=>i(a),children:[t.label===a.label&&o&&e.jsx("div",{className:n.default.arrow,children:e.jsx(d.IconBracket,{variant:"arrow",size:"md",colorScheme:r})}),a.icon&&e.jsx(u.Icon,{name:a.icon,className:n.default.icon}),e.jsx(s.Typography,{defaultVariant:"headingXxs",children:a.label})]}),e.jsx("div",{className:l.cn(n.default.itemContent,{[n.default.itemContentOpen]:t.label===a.label}),children:e.jsx("div",{className:n.default.itemContentInner,children:e.jsx(s.Typography,{as:"
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../utils/cn/cn.cjs.js"),s=require("../Typography/Typography.cjs.js"),d=require("../IconBracket/IconBracket.cjs.js"),u=require("../Icon/Icon.cjs.js"),n=require("./contentTabs.module.css.cjs.js");function m({tabs:c,activeTab:t,colorScheme:r,activeWithArrow:o,onTabClick:i}){return e.jsx("div",{className:l.cn(n.default.root,n.default[r]),children:c.map(a=>e.jsxs("div",{className:n.default.tabWrap,children:[e.jsxs("button",{className:l.cn(n.default.tab,{[n.default.activeTab]:t.label===a.label}),onClick:()=>i(a),children:[t.label===a.label&&o&&e.jsx("div",{className:n.default.arrow,children:e.jsx(d.IconBracket,{variant:"arrow",size:"md",colorScheme:r})}),a.icon&&e.jsx(u.Icon,{name:a.icon,className:n.default.icon}),e.jsx(s.Typography,{defaultVariant:"headingXxs",children:a.label})]}),e.jsx("div",{className:l.cn(n.default.itemContent,{[n.default.itemContentOpen]:t.label===a.label}),children:e.jsx("div",{className:n.default.itemContentInner,children:e.jsx(s.Typography,{as:"div",defaultVariant:"bodySm",children:a.description})})})]},String(a.label)))})}exports.ContentTabs=m;
|