@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"),p=require("../../utils/cn/cn.cjs.js"),C=require("./art/CardArt.cjs.js"),s=require("../../components/AssessmentCard/assessmentCard.module.css"),o=require("../Typography/Typography.cjs.js"),I=require("../Label/Label.cjs.js"),T=require("../Button/Button.cjs.js"),x=require("../Icon/constants.cjs.js"),R=({step:y,title:j,description:c,duration:l,colorScheme:i="dark",colorway:v="indigo",illustration:m,card:e,category:N="hormones",image:t,imagePlacement:g="full",imageAlt:b="",scrim:f=!1,ctaLabel:h,ctaHref:u,onCtaClick:_,locked:r=!1,dimmed:n=!1,className:q})=>{const d=i==="dark",A=r?d?"muted-invert":"muted":d?"primary-invert":"primary";return a.jsxs("article",{className:p.cn(s.root,q),"data-scheme":i,"data-colorway":v,"data-card-art":e||void 0,"data-locked":r||void 0,"data-dimmed":n||void 0,children:[e?a.jsx(C.CardArt,{card:e,category:N,colorScheme:i,image:t}):a.jsxs("div",{className:s.media,"data-placement":g,"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})}),f&&a.jsx("div",{className:s.scrim})]}),a.jsxs("div",{className:s.content,"aria-hidden":n||void 0,inert:n||void 0,children:[a.jsxs("div",{className:s.header,children:[a.jsx(o.Typography,{as:"p",defaultVariant:"labelSm",emphasis:!0,weight:"regular",className:s.step,children:y}),l&&a.jsx(I.Label,{size:"lg",color:d?"alpha-white":"grey",children:l})]}),e&&a.jsx("span",{className:s.artSpace,"aria-hidden":!0}),a.jsxs("div",{className:p.cn(s.body,e&&s.bodyAnchored),children:[a.jsxs("div",{className:s.text,children:[a.jsx(o.Typography,{as:"h3",defaultVariant:"headingMd",className:s.title,children:j}),c&&a.jsx(o.Typography,{as:"p",defaultVariant:"bodyMd",mobileVariant:"bodySm",className:s.description,children:c})]}),h&&a.jsx(T.Button,{as:u?"a":"button",href:u,variant:A,size:"lg",prefixIcon:r?x.EIconName.LOCK:void 0,suffixIcon:r?void 0:x.EIconName.ARROW_FORWARD,onClick:_,style:{width:"100%"},children:h})]})]})]})};exports.AssessmentCard=R;
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 e, jsx as i } from "react/jsx-runtime";
2
- import { cn as v } from "../../utils/cn/cn.es.js";
3
- import { CardArt as R } from "./art/CardArt.es.js";
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 O } from "../Label/Label.es.js";
7
- import { Button as j } from "../Button/Button.es.js";
8
- import { EIconName as N } from "../Icon/constants.es.js";
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: u,
11
- title: y,
10
+ step: g,
11
+ title: b,
12
12
  description: m,
13
13
  duration: c,
14
- colorScheme: d = "dark",
15
- colorway: b = "indigo",
16
- illustration: h,
17
- card: r,
18
- category: g = "hormones",
19
- image: t,
20
- imagePlacement: x = "full",
21
- imageAlt: A = "",
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: p,
24
- ctaHref: f,
25
- onCtaClick: w,
26
- locked: s = !1,
23
+ ctaLabel: v,
24
+ ctaHref: u,
25
+ onCtaClick: k,
26
+ locked: t = !1,
27
27
  dimmed: l = !1,
28
- className: C
28
+ className: w
29
29
  }) => {
30
- const o = d === "dark", I = s ? o ? "muted-invert" : "muted" : o ? "primary-invert" : "primary";
31
- return /* @__PURE__ */ e(
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: v(a.root, C),
35
- "data-scheme": d,
36
- "data-colorway": b,
37
- "data-card-art": r || void 0,
38
- "data-locked": s || void 0,
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
- r ? /* @__PURE__ */ i(R, { card: r, category: g, colorScheme: d, image: t }) : /* @__PURE__ */ e("div", { className: a.media, "data-placement": x, "aria-hidden": !0, children: [
42
- t && /* @__PURE__ */ i("img", { src: t, alt: A, className: a.mediaImage }),
43
- !t && h && /* @__PURE__ */ i("div", { className: a.illustrationBox, children: /* @__PURE__ */ i("div", { className: a.art, "data-illustration": h }) }),
44
- V && /* @__PURE__ */ i("div", { className: a.scrim })
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__ */ e("div", { className: a.content, "aria-hidden": l || void 0, inert: l || void 0, children: [
47
- /* @__PURE__ */ e("div", { className: a.header, children: [
48
- /* @__PURE__ */ i(n, { as: "p", defaultVariant: "labelSm", emphasis: !0, weight: "regular", className: a.step, children: u }),
49
- c && /* @__PURE__ */ i(O, { size: "lg", color: o ? "alpha-white" : "grey", children: c })
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
- r && /* @__PURE__ */ i("span", { className: a.artSpace, "aria-hidden": !0 }),
52
- /* @__PURE__ */ e("div", { className: v(a.body, r && a.bodyAnchored), children: [
53
- /* @__PURE__ */ e("div", { className: a.text, children: [
54
- /* @__PURE__ */ i(n, { as: "h3", defaultVariant: "headingMd", className: a.title, children: y }),
55
- m && /* @__PURE__ */ i(
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
- p && /* @__PURE__ */ i(
67
- j,
66
+ v && /* @__PURE__ */ r(
67
+ O,
68
68
  {
69
- as: f ? "a" : "button",
70
- href: f,
71
- variant: I,
69
+ as: u ? "a" : "button",
70
+ href: u,
71
+ variant: B,
72
72
  size: "lg",
73
- prefixIcon: s ? N.LOCK : void 0,
74
- suffixIcon: s ? void 0 : N.ARROW_FORWARD,
75
- onClick: w,
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: p
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`; with `image` set, the composition keeps its
24
- * design and the image replaces its photo tile. Tinted by `category` in both schemes.
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 that keeps copy legible over photography. */
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",