@zenpatient-org/healthspan-marketing-ui 1.1.21 → 1.1.22
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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),y=require("../../utils/cn/cn.cjs.js"),B=require("./art/CardArt.cjs.js"),s=require("../../components/AssessmentCard/assessmentCard.module.css"),d=require("../Typography/Typography.cjs.js"),C=require("../Label/Label.cjs.js"),T=require("../Button/Button.cjs.js"),j=require("../Icon/constants.cjs.js"),R=({step:v,title:N,description:l,duration:c,colorScheme:h="dark",colorway:g="indigo",illustration:m,card:e,category:f="hormones",image:t,imagePlacement:u="full",imageAlt:b="",scrim:_=!1,ctaLabel:p,ctaHref:x,onCtaClick:q,locked:r=!1,dimmed:i=!1,className:A})=>{const o=!!(e&&t&&u==="full"),n=o||h==="dark",I=r?n?"muted-invert":"muted":n?"primary-invert":"primary";return a.jsxs("article",{className:y.cn(s.root,A),"data-scheme":n?"dark":"light","data-colorway":g,"data-card-art":e||void 0,"data-locked":r||void 0,"data-dimmed":i||void 0,children:[e&&!o?a.jsx(B.CardArt,{card:e,category:f,colorScheme:h,image:t}):a.jsxs("div",{className:s.media,"data-placement":u,"aria-hidden":!0,children:[t&&a.jsx("img",{src:t,alt:b,className:s.mediaImage}),!t&&m&&a.jsx("div",{className:s.illustrationBox,children:a.jsx("div",{className:s.art,"data-illustration":m})}),(_||o)&&a.jsx("div",{className:s.scrim})]}),a.jsxs("div",{className:s.content,"aria-hidden":i||void 0,inert:i||void 0,children:[a.jsxs("div",{className:s.header,children:[a.jsx(d.Typography,{as:"p",defaultVariant:"labelSm",emphasis:!0,weight:"regular",className:s.step,children:v}),c&&a.jsx(C.Label,{size:"lg",color:n?"alpha-white":"grey",children:c})]}),e&&a.jsx("span",{className:s.artSpace,"aria-hidden":!0}),a.jsxs("div",{className:y.cn(s.body,e&&s.bodyAnchored),children:[a.jsxs("div",{className:s.text,children:[a.jsx(d.Typography,{as:"h3",defaultVariant:"headingMd",className:s.title,children:N}),l&&a.jsx(d.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:s.description,children:l})]}),p&&a.jsx(T.Button,{as:x?"a":"button",href:x,variant:I,size:"lg",prefixIcon:r?j.EIconName.LOCK:void 0,suffixIcon:r?void 0:j.EIconName.ARROW_FORWARD,onClick:q,style:{width:"100%"},children:p})]})]})]})};exports.AssessmentCard=R;
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { CardArt as
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as N } from "../../utils/cn/cn.es.js";
|
|
3
|
+
import { CardArt as C } from "./art/CardArt.es.js";
|
|
4
4
|
import a from "../../components/AssessmentCard/assessmentCard.module.css";
|
|
5
5
|
import { Typography as n } from "../Typography/Typography.es.js";
|
|
6
|
-
import { Label as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { EIconName as
|
|
6
|
+
import { Label as R } from "../Label/Label.es.js";
|
|
7
|
+
import { Button as O } from "../Button/Button.es.js";
|
|
8
|
+
import { EIconName as y } from "../Icon/constants.es.js";
|
|
9
9
|
const K = ({
|
|
10
|
-
step:
|
|
11
|
-
title:
|
|
10
|
+
step: g,
|
|
11
|
+
title: b,
|
|
12
12
|
description: m,
|
|
13
13
|
duration: c,
|
|
14
|
-
colorScheme:
|
|
15
|
-
colorway:
|
|
16
|
-
illustration:
|
|
17
|
-
card:
|
|
18
|
-
category:
|
|
19
|
-
image:
|
|
20
|
-
imagePlacement:
|
|
21
|
-
imageAlt:
|
|
14
|
+
colorScheme: h = "dark",
|
|
15
|
+
colorway: x = "indigo",
|
|
16
|
+
illustration: p,
|
|
17
|
+
card: e,
|
|
18
|
+
category: A = "hormones",
|
|
19
|
+
image: s,
|
|
20
|
+
imagePlacement: f = "full",
|
|
21
|
+
imageAlt: I = "",
|
|
22
22
|
scrim: V = !1,
|
|
23
|
-
ctaLabel:
|
|
24
|
-
ctaHref:
|
|
25
|
-
onCtaClick:
|
|
26
|
-
locked:
|
|
23
|
+
ctaLabel: v,
|
|
24
|
+
ctaHref: u,
|
|
25
|
+
onCtaClick: k,
|
|
26
|
+
locked: t = !1,
|
|
27
27
|
dimmed: l = !1,
|
|
28
|
-
className:
|
|
28
|
+
className: w
|
|
29
29
|
}) => {
|
|
30
|
-
const o = d === "dark",
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
const o = !!(e && s && f === "full"), d = o || h === "dark", B = t ? d ? "muted-invert" : "muted" : d ? "primary-invert" : "primary";
|
|
31
|
+
return /* @__PURE__ */ i(
|
|
32
32
|
"article",
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
35
|
-
"data-scheme": d,
|
|
36
|
-
"data-colorway":
|
|
37
|
-
"data-card-art":
|
|
38
|
-
"data-locked":
|
|
34
|
+
className: N(a.root, w),
|
|
35
|
+
"data-scheme": d ? "dark" : "light",
|
|
36
|
+
"data-colorway": x,
|
|
37
|
+
"data-card-art": e || void 0,
|
|
38
|
+
"data-locked": t || void 0,
|
|
39
39
|
"data-dimmed": l || void 0,
|
|
40
40
|
children: [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
!
|
|
44
|
-
V && /* @__PURE__ */
|
|
41
|
+
e && !o ? /* @__PURE__ */ r(C, { card: e, category: A, colorScheme: h, image: s }) : /* @__PURE__ */ i("div", { className: a.media, "data-placement": f, "aria-hidden": !0, children: [
|
|
42
|
+
s && /* @__PURE__ */ r("img", { src: s, alt: I, className: a.mediaImage }),
|
|
43
|
+
!s && p && /* @__PURE__ */ r("div", { className: a.illustrationBox, children: /* @__PURE__ */ r("div", { className: a.art, "data-illustration": p }) }),
|
|
44
|
+
(V || o) && /* @__PURE__ */ r("div", { className: a.scrim })
|
|
45
45
|
] }),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
c && /* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ i("div", { className: a.content, "aria-hidden": l || void 0, inert: l || void 0, children: [
|
|
47
|
+
/* @__PURE__ */ i("div", { className: a.header, children: [
|
|
48
|
+
/* @__PURE__ */ r(n, { as: "p", defaultVariant: "labelSm", emphasis: !0, weight: "regular", className: a.step, children: g }),
|
|
49
|
+
c && /* @__PURE__ */ r(R, { size: "lg", color: d ? "alpha-white" : "grey", children: c })
|
|
50
50
|
] }),
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
m && /* @__PURE__ */
|
|
51
|
+
e && /* @__PURE__ */ r("span", { className: a.artSpace, "aria-hidden": !0 }),
|
|
52
|
+
/* @__PURE__ */ i("div", { className: N(a.body, e && a.bodyAnchored), children: [
|
|
53
|
+
/* @__PURE__ */ i("div", { className: a.text, children: [
|
|
54
|
+
/* @__PURE__ */ r(n, { as: "h3", defaultVariant: "headingMd", className: a.title, children: b }),
|
|
55
|
+
m && /* @__PURE__ */ r(
|
|
56
56
|
n,
|
|
57
57
|
{
|
|
58
58
|
as: "p",
|
|
@@ -63,18 +63,18 @@ const K = ({
|
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
] }),
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
v && /* @__PURE__ */ r(
|
|
67
|
+
O,
|
|
68
68
|
{
|
|
69
|
-
as:
|
|
70
|
-
href:
|
|
71
|
-
variant:
|
|
69
|
+
as: u ? "a" : "button",
|
|
70
|
+
href: u,
|
|
71
|
+
variant: B,
|
|
72
72
|
size: "lg",
|
|
73
|
-
prefixIcon:
|
|
74
|
-
suffixIcon:
|
|
75
|
-
onClick:
|
|
73
|
+
prefixIcon: t ? y.LOCK : void 0,
|
|
74
|
+
suffixIcon: t ? void 0 : y.ARROW_FORWARD,
|
|
75
|
+
onClick: k,
|
|
76
76
|
style: { width: "100%" },
|
|
77
|
-
children:
|
|
77
|
+
children: v
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
80
|
] })
|
|
@@ -57,6 +57,10 @@
|
|
|
57
57
|
object-fit: cover;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.media[data-placement='full'] .mediaImage {
|
|
61
|
+
object-position: center top;
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
/* Art-zone placement: below the 28px step row (32px padding + 16px gap), above the copy block,
|
|
61
65
|
* whose Figma top edge sits 199px off the card bottom (plus the same 16px gap). */
|
|
62
66
|
.media[data-placement='contained'] {
|
|
@@ -20,8 +20,9 @@ export type AssessmentCardProps = {
|
|
|
20
20
|
illustration?: AssessmentCardIllustration;
|
|
21
21
|
/**
|
|
22
22
|
* Canonical card art (background composition + widget) from the How-it-works spec.
|
|
23
|
-
* Takes precedence over `illustration`;
|
|
24
|
-
*
|
|
23
|
+
* Takes precedence over `illustration`; a full background `image` replaces the art.
|
|
24
|
+
* With `imagePlacement="contained"`, the image replaces its photo tile instead.
|
|
25
|
+
* Tinted by `category` in both schemes when no full background image is set.
|
|
25
26
|
*/
|
|
26
27
|
card?: AssessmentCardKind;
|
|
27
28
|
category?: AssessmentCardCategory;
|
|
@@ -34,7 +35,7 @@ export type AssessmentCardProps = {
|
|
|
34
35
|
*/
|
|
35
36
|
imagePlacement?: 'full' | 'contained';
|
|
36
37
|
imageAlt?: string;
|
|
37
|
-
/** Bottom-up black scrim
|
|
38
|
+
/** Bottom-up black scrim; always applied to full background images on canonical cards. */
|
|
38
39
|
scrim?: boolean;
|
|
39
40
|
/** CTA copy. Omitted → the card renders without a button. */
|
|
40
41
|
ctaLabel?: string;
|