@zenpatient-org/healthspan-marketing-ui 0.1.136 → 0.1.138
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.es.js +3 -1
- package/dist/components/StepsCarousel/stepsCarousel.module.css.cjs.js +1 -1
- package/dist/components/StepsCarousel/stepsCarousel.module.css.es.js +11 -11
- 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 a=require("react/jsx-runtime"),s=require("react"),f=require("../../utils/cn/cn.cjs.js"),g=require("../Label/Label.cjs.js"),k=require("../ProgressButton/ProgressButton.cjs.js"),m=require("../Typography/Typography.cjs.js"),n=require("./stepsCarousel.module.css.cjs.js"),v=50,T=({steps:d,colorScheme:o})=>{const[r,y]=s.useState(0),p=s.useRef(null),b=s.useRef([]),l=s.useRef(null),h=s.useRef(null),j=s.useCallback(e=>{l.current={x:e.touches[0].clientX,y:e.touches[0].clientY}},[]),i=s.useCallback(e=>{var t;y(e),(t=b.current[e])==null||t.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[]),x=s.useCallback(()=>{if(l.current!==null&&h.current!==null){const e=h.current-l.current.x;let t=r;e>v&&r>0?t=r-1:e<-v&&r<d.length-1&&(t=r+1),t!==r&&i(t)}l.current=null,h.current=null},[r,d.length,i]);return s.useEffect(()=>{const e=p.current;if(!e)return;const t=c=>{if(l.current===null)return;const u=c.touches[0].clientX,S=c.touches[0].clientY,C=Math.abs(u-l.current.x),N=Math.abs(S-l.current.y);C>N&&(c.preventDefault(),h.current=u)};return e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchmove",t)}},[]),a.jsxs("div",{className:n.default.root,"data-scheme":o,children:[a.jsx("div",{ref:p,className:n.default.stepsContainer,"data-scheme":o,onTouchStart:j,onTouchEnd:x,children:d.map((e,t)=>{const c=r===t;return a.jsxs("button",{ref:u=>{u&&(b.current[t]=u)},className:f.cn(n.default.card,
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),f=require("../../utils/cn/cn.cjs.js"),g=require("../Label/Label.cjs.js"),k=require("../ProgressButton/ProgressButton.cjs.js"),m=require("../Typography/Typography.cjs.js"),n=require("./stepsCarousel.module.css.cjs.js"),v=50,T=({steps:d,colorScheme:o})=>{const[r,y]=s.useState(0),p=s.useRef(null),b=s.useRef([]),l=s.useRef(null),h=s.useRef(null),j=s.useCallback(e=>{l.current={x:e.touches[0].clientX,y:e.touches[0].clientY}},[]),i=s.useCallback(e=>{var t;y(e),(t=b.current[e])==null||t.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[]),x=s.useCallback(()=>{if(l.current!==null&&h.current!==null){const e=h.current-l.current.x;let t=r;e>v&&r>0?t=r-1:e<-v&&r<d.length-1&&(t=r+1),t!==r&&i(t)}l.current=null,h.current=null},[r,d.length,i]);return s.useEffect(()=>{const e=p.current;if(!e)return;const t=c=>{if(l.current===null)return;const u=c.touches[0].clientX,S=c.touches[0].clientY,C=Math.abs(u-l.current.x),N=Math.abs(S-l.current.y);C>N&&(c.preventDefault(),h.current=u)};return e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchmove",t)}},[]),a.jsxs("div",{className:n.default.root,"data-scheme":o,children:[a.jsx("div",{ref:p,className:n.default.stepsContainer,"data-scheme":o,onTouchStart:j,onTouchEnd:x,children:d.map((e,t)=>{const c=r===t;return a.jsxs("button",{ref:u=>{u&&(b.current[t]=u)},className:f.cn(n.default.card,{[n.default.cardActive]:c}),onClick:()=>i(t),type:"button",children:[a.jsx("div",{className:f.cn(n.default.imageWrapper,c&&n.default.imageWrapperActive),children:a.jsx("img",{src:e.image,alt:e.title,className:n.default.image})}),a.jsx("div",{className:n.default.stepLabel,children:c?a.jsxs(a.Fragment,{children:[a.jsx(g.Label,{size:"lg",className:n.default.desktop,color:o==="dark"?"white":"black",children:e.name||`Step ${t+1}`}),a.jsx(g.Label,{size:"sm",className:n.default.mobile,color:o==="dark"?"white":"black",children:e.name||`Step ${t+1}`})]}):a.jsx(m.Typography,{defaultVariant:"labelSm",mobileVariant:"labelXs",emphasis:!0,className:n.default.labelText,children:e.name||`Step ${t+1}`})}),a.jsxs("div",{className:n.default.textContainer,children:[a.jsx(m.Typography,{as:"h3",defaultVariant:"headingSm",mobileVariant:"headingXxs",children:e.title}),e.description&&a.jsx(m.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:n.default.cardDescription,children:e.description})]})]},`step-${t}`)})}),a.jsx("div",{className:f.cn(n.default.mobile,n.default.progressButtonContainer),children:a.jsx(k.ProgressButton,{invert:o==="dark",left:{disabled:r<=0,onClick:()=>i(r-1)},right:{disabled:r>=d.length-1,onClick:()=>i(r+1)}})})]})};exports.StepsCarousel=T;
|
|
@@ -48,7 +48,9 @@ const S = 50, W = ({ steps: u, colorScheme: i }) => {
|
|
|
48
48
|
ref: (o) => {
|
|
49
49
|
o && (g.current[t] = o);
|
|
50
50
|
},
|
|
51
|
-
className: p(r.card,
|
|
51
|
+
className: p(r.card, {
|
|
52
|
+
[r.cardActive]: l
|
|
53
|
+
}),
|
|
52
54
|
onClick: () => s(t),
|
|
53
55
|
type: "button",
|
|
54
56
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="stepsCarousel-module__root___VidW7",t="stepsCarousel-module__stepsContainer___yWhtm",s="stepsCarousel-module__card___16wd3",o="stepsCarousel-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="stepsCarousel-module__root___VidW7",t="stepsCarousel-module__stepsContainer___yWhtm",s="stepsCarousel-module__card___16wd3",o="stepsCarousel-module__cardActive___xdGR8",_="stepsCarousel-module__image___RY9-R",r="stepsCarousel-module__stepLabel___jnL1f",a="stepsCarousel-module__textContainer___l--dI",l="stepsCarousel-module__imageWrapper___WCmbp",n="stepsCarousel-module__labelText___TC392",p="stepsCarousel-module__cardDescription___oPSgY",i="stepsCarousel-module__mobile___4s-pE",d="stepsCarousel-module__progressButtonContainer___PdL6N",c="stepsCarousel-module__desktop___awZBc",u={root:e,stepsContainer:t,card:s,cardActive:o,image:_,stepLabel:r,textContainer:a,imageWrapper:l,labelText:n,cardDescription:p,mobile:i,progressButtonContainer:d,desktop:c};exports.card=s;exports.cardActive=o;exports.cardDescription=p;exports.default=u;exports.desktop=c;exports.image=_;exports.imageWrapper=l;exports.labelText=n;exports.mobile=i;exports.progressButtonContainer=d;exports.root=e;exports.stepLabel=r;exports.stepsContainer=t;exports.textContainer=a;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const e = "stepsCarousel-module__root___VidW7", s = "stepsCarousel-module__stepsContainer___yWhtm", t = "stepsCarousel-module__card___16wd3", o = "stepsCarousel-
|
|
1
|
+
const e = "stepsCarousel-module__root___VidW7", s = "stepsCarousel-module__stepsContainer___yWhtm", t = "stepsCarousel-module__card___16wd3", o = "stepsCarousel-module__cardActive___xdGR8", _ = "stepsCarousel-module__image___RY9-R", r = "stepsCarousel-module__stepLabel___jnL1f", a = "stepsCarousel-module__textContainer___l--dI", l = "stepsCarousel-module__imageWrapper___WCmbp", n = "stepsCarousel-module__labelText___TC392", p = "stepsCarousel-module__cardDescription___oPSgY", d = "stepsCarousel-module__mobile___4s-pE", c = "stepsCarousel-module__progressButtonContainer___PdL6N", u = "stepsCarousel-module__desktop___awZBc", i = {
|
|
2
2
|
root: e,
|
|
3
3
|
stepsContainer: s,
|
|
4
4
|
card: t,
|
|
5
|
-
|
|
5
|
+
cardActive: o,
|
|
6
6
|
image: _,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
stepLabel: r,
|
|
8
|
+
textContainer: a,
|
|
9
|
+
imageWrapper: l,
|
|
10
|
+
labelText: n,
|
|
11
11
|
cardDescription: p,
|
|
12
12
|
mobile: d,
|
|
13
13
|
progressButtonContainer: c,
|
|
@@ -15,17 +15,17 @@ const e = "stepsCarousel-module__root___VidW7", s = "stepsCarousel-module__steps
|
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
17
|
t as card,
|
|
18
|
-
|
|
18
|
+
o as cardActive,
|
|
19
19
|
p as cardDescription,
|
|
20
20
|
i as default,
|
|
21
21
|
u as desktop,
|
|
22
22
|
_ as image,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
l as imageWrapper,
|
|
24
|
+
n as labelText,
|
|
25
25
|
d as mobile,
|
|
26
26
|
c as progressButtonContainer,
|
|
27
27
|
e as root,
|
|
28
|
-
|
|
28
|
+
r as stepLabel,
|
|
29
29
|
s as stepsContainer,
|
|
30
|
-
|
|
30
|
+
a as textContainer
|
|
31
31
|
};
|