@zenpatient-org/healthspan-marketing-ui 0.1.123 → 0.1.125
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/StepsCarousel/StepsCarousel.cjs.js +1 -1
- package/dist/components/StepsCarousel/StepsCarousel.d.ts +1 -0
- package/dist/components/StepsCarousel/StepsCarousel.es.js +20 -23
- package/dist/healthspan-marketing-ui.css +1 -1
- package/dist/modules/SlidingTabsGallery/SlidingTabsGallery.cjs.js +1 -1
- package/dist/modules/SlidingTabsGallery/SlidingTabsGallery.es.js +34 -33
- 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"),f=require("react"),y=require("../../node_modules/gsap/index.cjs.js"),p=require("../../node_modules/gsap/Flip.cjs.js"),N=require("../../node_modules/@gsap/react/src/index.cjs.js"),R=require("../../pageComponents/Bubbles/Bubbles.cjs.js"),q=require("../../pageComponents/Gradient/Gradient.cjs.js"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),y=require("../../node_modules/gsap/index.cjs.js"),p=require("../../node_modules/gsap/Flip.cjs.js"),N=require("../../node_modules/@gsap/react/src/index.cjs.js"),R=require("../../pageComponents/Bubbles/Bubbles.cjs.js"),q=require("../../pageComponents/Gradient/Gradient.cjs.js"),b=require("../../components/HighlightedTitle/HighlightedTitle.cjs.js"),C=require("../../utils/cn/cn.cjs.js"),x=require("../../components/Typography/Typography.cjs.js"),_=require("../../components/Icon/Icon.cjs.js"),t=require("./SlidingTabsGallery.module.css.cjs.js");y.gsap.registerPlugin(p.Flip);const S=({title:j,tabs:o,withBubbles:m})=>{const s=f.useRef(null),a=f.useRef(null),[l,h]=f.useState(o[0]);N.useGSAP(()=>{const i=s.current,n=a.current,u=r=>{if(i&&n&&r){const T=n.getBoundingClientRect(),g=r.getBoundingClientRect();y.gsap.set(i,{left:g.left-T.left,top:g.top-T.top,width:g.width,height:g.height})}};if(n&&n.children.length>1){const r=n.children[1];r&&u(r)}let c;const d=()=>{clearTimeout(c),c=setTimeout(()=>{if(i&&n&&n.children.length>1&&o.length>0){const r=n.children[1];r&&(u(r),h(o[0]))}},250)};return window.addEventListener("resize",d),()=>{clearTimeout(c),window.removeEventListener("resize",d)}},{dependencies:[o,h],scope:a});const v=(i,n)=>{if(i===l)return;const u=p.Flip.getState(s.current);if(h(i),s.current&&a.current&&a.current.children.length>n+1){const c=a.current.children[n+1];if(c){const d=a.current.getBoundingClientRect(),r=c.getBoundingClientRect();s.current.style.left=`${r.left-d.left}px`,s.current.style.top=`${r.top-d.top}px`,s.current.style.width=`${r.width}px`,s.current.style.height=`${r.height}px`}}p.Flip.from(u,{targets:s.current,duration:.3,ease:"power1.inOut"})};return e.jsxs("section",{className:t.default.root,children:[m&&e.jsx(R.Bubbles,{className:t.default.bubbles}),e.jsxs("div",{className:t.default.container,children:[e.jsx(b.HighlightedTitle,{as:"div",title:j,className:t.default.header,colorScheme:"dark"}),e.jsxs("div",{className:t.default.content,children:[l.image&&e.jsx("div",{className:t.default.imageWrap,children:e.jsx("img",{src:l.image,alt:"Total Care",className:t.default.image})}),e.jsx("div",{className:t.default.tabsContainer,children:e.jsxs("div",{ref:a,className:t.default.tabs,children:[e.jsx("div",{ref:s,id:"marker",className:t.default.marker}),o.map((i,n)=>e.jsxs("button",{className:C.cn(t.default.tab,{[t.default.active]:l===i}),onClick:()=>v(i,n),children:[i.icon&&e.jsx(x.Typography,{defaultVariant:"displayMd",className:t.default.icon,children:e.jsx(_.Icon,{name:i.icon})}),e.jsx(x.Typography,{defaultVariant:"displayMd",className:t.default.hideMobile,children:i.label})]},i.label))]})}),l.description&&e.jsx("div",{className:t.default.description,children:e.jsx(b.HighlightedTitle,{as:"div",defaultVariant:"bodyXl",mobileVariant:"bodyMd",className:t.default.descriptionText,title:l.description,colorScheme:"dark"})})]})]}),m&&e.jsx(q.Gradient,{variant:"blue"})]})};exports.SlidingTabsGallery=S;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import { useRef as T, useState as k } from "react";
|
|
4
|
-
import { gsap as
|
|
4
|
+
import { gsap as y } from "../../node_modules/gsap/index.es.js";
|
|
5
5
|
import { Flip as f } from "../../node_modules/gsap/Flip.es.js";
|
|
6
6
|
import { useGSAP as w } from "../../node_modules/@gsap/react/src/index.es.js";
|
|
7
7
|
import { Bubbles as S } from "../../pageComponents/Bubbles/Bubbles.es.js";
|
|
8
8
|
import { Gradient as x } from "../../pageComponents/Gradient/Gradient.es.js";
|
|
9
|
-
import { HighlightedTitle as
|
|
9
|
+
import { HighlightedTitle as b } from "../../components/HighlightedTitle/HighlightedTitle.es.js";
|
|
10
10
|
import { cn as B } from "../../utils/cn/cn.es.js";
|
|
11
|
-
import { Typography as
|
|
11
|
+
import { Typography as N } from "../../components/Typography/Typography.es.js";
|
|
12
12
|
import { Icon as M } from "../../components/Icon/Icon.es.js";
|
|
13
13
|
import e from "./SlidingTabsGallery.module.css.es.js";
|
|
14
|
-
|
|
15
|
-
const I = ({ title:
|
|
16
|
-
const
|
|
14
|
+
y.registerPlugin(f);
|
|
15
|
+
const I = ({ title: C, tabs: l, withBubbles: g }) => {
|
|
16
|
+
const o = T(null), a = T(null), [c, p] = k(l[0]);
|
|
17
17
|
w(
|
|
18
18
|
() => {
|
|
19
|
-
const t =
|
|
19
|
+
const t = o.current, r = a.current, u = (i) => {
|
|
20
20
|
if (t && r && i) {
|
|
21
21
|
const v = r.getBoundingClientRect(), h = i.getBoundingClientRect();
|
|
22
|
-
|
|
22
|
+
y.set(t, {
|
|
23
23
|
left: h.left - v.left,
|
|
24
24
|
top: h.top - v.top,
|
|
25
25
|
width: h.width,
|
|
@@ -31,9 +31,9 @@ const I = ({ title: R, tabs: l, withBubbles: g }) => {
|
|
|
31
31
|
const i = r.children[1];
|
|
32
32
|
i && u(i);
|
|
33
33
|
}
|
|
34
|
-
let
|
|
34
|
+
let s;
|
|
35
35
|
const d = () => {
|
|
36
|
-
clearTimeout(
|
|
36
|
+
clearTimeout(s), s = setTimeout(() => {
|
|
37
37
|
if (t && r && r.children.length > 1 && l.length > 0) {
|
|
38
38
|
const i = r.children[1];
|
|
39
39
|
i && (u(i), p(l[0]));
|
|
@@ -41,23 +41,23 @@ const I = ({ title: R, tabs: l, withBubbles: g }) => {
|
|
|
41
41
|
}, 250);
|
|
42
42
|
};
|
|
43
43
|
return window.addEventListener("resize", d), () => {
|
|
44
|
-
clearTimeout(
|
|
44
|
+
clearTimeout(s), window.removeEventListener("resize", d);
|
|
45
45
|
};
|
|
46
46
|
},
|
|
47
|
-
{ dependencies: [l, p], scope:
|
|
47
|
+
{ dependencies: [l, p], scope: a }
|
|
48
48
|
);
|
|
49
|
-
const
|
|
50
|
-
if (t ===
|
|
51
|
-
const u = f.getState(
|
|
52
|
-
if (p(t),
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const d =
|
|
56
|
-
|
|
49
|
+
const R = (t, r) => {
|
|
50
|
+
if (t === c) return;
|
|
51
|
+
const u = f.getState(o.current);
|
|
52
|
+
if (p(t), o.current && a.current && a.current.children.length > r + 1) {
|
|
53
|
+
const s = a.current.children[r + 1];
|
|
54
|
+
if (s) {
|
|
55
|
+
const d = a.current.getBoundingClientRect(), i = s.getBoundingClientRect();
|
|
56
|
+
o.current.style.left = `${i.left - d.left}px`, o.current.style.top = `${i.top - d.top}px`, o.current.style.width = `${i.width}px`, o.current.style.height = `${i.height}px`;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
f.from(u, {
|
|
60
|
-
targets:
|
|
60
|
+
targets: o.current,
|
|
61
61
|
duration: 0.3,
|
|
62
62
|
ease: "power1.inOut"
|
|
63
63
|
});
|
|
@@ -65,33 +65,34 @@ const I = ({ title: R, tabs: l, withBubbles: g }) => {
|
|
|
65
65
|
return /* @__PURE__ */ m("section", { className: e.root, children: [
|
|
66
66
|
g && /* @__PURE__ */ n(S, { className: e.bubbles }),
|
|
67
67
|
/* @__PURE__ */ m("div", { className: e.container, children: [
|
|
68
|
-
/* @__PURE__ */ n(
|
|
68
|
+
/* @__PURE__ */ n(b, { as: "div", title: C, className: e.header, colorScheme: "dark" }),
|
|
69
69
|
/* @__PURE__ */ m("div", { className: e.content, children: [
|
|
70
|
-
|
|
71
|
-
/* @__PURE__ */ n("div", { className: e.tabsContainer, children: /* @__PURE__ */ m("div", { ref:
|
|
72
|
-
/* @__PURE__ */ n("div", { ref:
|
|
70
|
+
c.image && /* @__PURE__ */ n("div", { className: e.imageWrap, children: /* @__PURE__ */ n("img", { src: c.image, alt: "Total Care", className: e.image }) }),
|
|
71
|
+
/* @__PURE__ */ n("div", { className: e.tabsContainer, children: /* @__PURE__ */ m("div", { ref: a, className: e.tabs, children: [
|
|
72
|
+
/* @__PURE__ */ n("div", { ref: o, id: "marker", className: e.marker }),
|
|
73
73
|
l.map((t, r) => /* @__PURE__ */ m(
|
|
74
74
|
"button",
|
|
75
75
|
{
|
|
76
76
|
className: B(e.tab, {
|
|
77
|
-
[e.active]:
|
|
77
|
+
[e.active]: c === t
|
|
78
78
|
}),
|
|
79
|
-
onClick: () =>
|
|
79
|
+
onClick: () => R(t, r),
|
|
80
80
|
children: [
|
|
81
|
-
t.icon && /* @__PURE__ */ n(
|
|
82
|
-
/* @__PURE__ */ n(
|
|
81
|
+
t.icon && /* @__PURE__ */ n(N, { defaultVariant: "displayMd", className: e.icon, children: /* @__PURE__ */ n(M, { name: t.icon }) }),
|
|
82
|
+
/* @__PURE__ */ n(N, { defaultVariant: "displayMd", className: e.hideMobile, children: t.label })
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
85
|
t.label
|
|
86
86
|
))
|
|
87
87
|
] }) }),
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
c.description && /* @__PURE__ */ n("div", { className: e.description, children: /* @__PURE__ */ n(
|
|
89
|
+
b,
|
|
90
90
|
{
|
|
91
91
|
as: "div",
|
|
92
|
-
defaultVariant: "
|
|
92
|
+
defaultVariant: "bodyXl",
|
|
93
|
+
mobileVariant: "bodyMd",
|
|
93
94
|
className: e.descriptionText,
|
|
94
|
-
title:
|
|
95
|
+
title: c.description,
|
|
95
96
|
colorScheme: "dark"
|
|
96
97
|
}
|
|
97
98
|
) })
|