@zenpatient-org/healthspan-marketing-ui 0.2.22 → 0.2.23

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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),o=require("../../src/components/RatingPreview/ratingPreview.module.css"),t=require("../Typography/Typography.cjs.js"),c=require("../Icon/Icon.cjs.js"),l=require("../Icon/constants.cjs.js"),u=s=>{const a=Math.round(s*2)/2,r=[];for(let n=0;n<Math.floor(a);n++)r.push(e.jsx(c.Icon,{name:l.EIconName.STAR_FILL,className:o.starIcon},`full-${n}`));return a%1===.5&&r.push(e.jsx(c.Icon,{name:l.EIconName.STAR_HALF,className:o.starIcon},"half")),r},i=({rating:s,text:a})=>e.jsxs("div",{className:o.ratingPreview,children:[s!==void 0&&s.stars!==void 0&&e.jsxs(t.Typography,{as:"p",defaultVariant:"labelMd",children:[s.stars," ",u(s.stars)]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(t.Typography,{as:"p",defaultVariant:"labelSm",children:"|"}),e.jsx(t.Typography,{as:"p",defaultVariant:"labelSm",emphasis:!0,children:a})]})]});exports.RatingPreview=i;exports.default=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),t=require("../../src/components/RatingPreview/ratingPreview.module.css"),n=require("../Typography/Typography.cjs.js"),c=require("../Icon/Icon.cjs.js"),l=require("../Icon/constants.cjs.js"),p=s=>{const e=Math.round(s*2)/2,a=[];for(let r=0;r<Math.floor(e);r++)a.push(o.jsx(c.Icon,{name:l.EIconName.STAR_FILL,className:t.starIcon},`full-${r}`));return e%1===.5&&a.push(o.jsx(c.Icon,{name:l.EIconName.STAR_HALF,className:t.starIcon},"half")),a},u=({rating:s,text:e})=>{if(!(s!=null&&s.stars)&&!e)return null;const a=!!(s!=null&&s.stars)&&!!e;return o.jsxs("div",{className:t.ratingPreview,children:[s!==void 0&&s.stars!==void 0&&o.jsxs(n.Typography,{as:"p",defaultVariant:"labelMd",children:[s.stars," ",p(s.stars)]}),a&&o.jsx(n.Typography,{as:"p",defaultVariant:"labelSm",children:"|"}),e&&o.jsx(n.Typography,{as:"p",defaultVariant:"labelSm",emphasis:!0,children:e})]})};exports.RatingPreview=u;exports.default=u;
@@ -5,5 +5,5 @@ export type TRatingPreviewProps = {
5
5
  };
6
6
  text?: string;
7
7
  };
8
- export declare const RatingPreview: ({ rating, text }: TRatingPreviewProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const RatingPreview: ({ rating, text }: TRatingPreviewProps) => import("react/jsx-runtime").JSX.Element | null;
9
9
  export default RatingPreview;
@@ -1,25 +1,27 @@
1
- import { jsxs as o, Fragment as c, jsx as s } from "react/jsx-runtime";
2
- import n from "../../components/RatingPreview/ratingPreview.module.css";
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import t from "../../components/RatingPreview/ratingPreview.module.css";
3
3
  import { Typography as l } from "../Typography/Typography.es.js";
4
- import { Icon as i } from "../Icon/Icon.es.js";
5
- import { EIconName as m } from "../Icon/constants.es.js";
6
- const d = (a) => {
7
- const r = Math.round(a * 2) / 2, e = [];
8
- for (let t = 0; t < Math.floor(r); t++)
9
- e.push(/* @__PURE__ */ s(i, { name: m.STAR_FILL, className: n.starIcon }, `full-${t}`));
10
- return r % 1 === 0.5 && e.push(/* @__PURE__ */ s(i, { name: m.STAR_HALF, className: n.starIcon }, "half")), e;
11
- }, I = ({ rating: a, text: r }) => /* @__PURE__ */ o("div", { className: n.ratingPreview, children: [
12
- a !== void 0 && a.stars !== void 0 && /* @__PURE__ */ o(l, { as: "p", defaultVariant: "labelMd", children: [
13
- a.stars,
14
- " ",
15
- d(a.stars)
16
- ] }),
17
- r && /* @__PURE__ */ o(c, { children: [
18
- /* @__PURE__ */ s(l, { as: "p", defaultVariant: "labelSm", children: "|" }),
19
- /* @__PURE__ */ s(l, { as: "p", defaultVariant: "labelSm", emphasis: !0, children: r })
20
- ] })
21
- ] });
4
+ import { Icon as c } from "../Icon/Icon.es.js";
5
+ import { EIconName as d } from "../Icon/constants.es.js";
6
+ const f = (s) => {
7
+ const a = Math.round(s * 2) / 2, r = [];
8
+ for (let o = 0; o < Math.floor(a); o++)
9
+ r.push(/* @__PURE__ */ e(c, { name: d.STAR_FILL, className: t.starIcon }, `full-${o}`));
10
+ return a % 1 === 0.5 && r.push(/* @__PURE__ */ e(c, { name: d.STAR_HALF, className: t.starIcon }, "half")), r;
11
+ }, v = ({ rating: s, text: a }) => {
12
+ if (!(s != null && s.stars) && !a) return null;
13
+ const r = !!(s != null && s.stars) && !!a;
14
+ return /* @__PURE__ */ m("div", { className: t.ratingPreview, children: [
15
+ s !== void 0 && s.stars !== void 0 && /* @__PURE__ */ m(l, { as: "p", defaultVariant: "labelMd", children: [
16
+ s.stars,
17
+ " ",
18
+ f(s.stars)
19
+ ] }),
20
+ r && /* @__PURE__ */ e(l, { as: "p", defaultVariant: "labelSm", children: "|" }),
21
+ a && /* @__PURE__ */ e(l, { as: "p", defaultVariant: "labelSm", emphasis: !0, children: a })
22
+ ] });
23
+ };
22
24
  export {
23
- I as RatingPreview,
24
- I as default
25
+ v as RatingPreview,
26
+ v as default
25
27
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../../utils/cn/cn.cjs.js"),c=require("../../types/analytics/analytics.cjs.js"),a=require("../../src/modules/IndividualProductCard/individualProductCard.module.css"),k=require("../../components/PlainFeaturesGroup/PlainFeaturesGroup.cjs.js"),I=require("../../components/ImageGallery/ImageGallery.cjs.js"),_=require("../../components/RatingPreview/RatingPreview.cjs.js"),F=require("../../components/Quote/Quote.cjs.js"),y=require("../../components/Typography/Typography.cjs.js"),C=require("../../components/Button/Button.cjs.js"),G=require("../../components/TextButton/TextButton.cjs.js"),R=require("./components/Features/Features.cjs.js"),B=require("./components/PlanCard/PlanCard.cjs.js"),V=require("../../components/SmartCallout/SmartCallout.cjs.js"),O=({zenpatientId:N,name:o,description:m,features:b,featuresGroup:p,images:q,quote:h,label:w,rating:v,ratingText:j,plans:s,button:t,textButton:r,selectedPlanId:g,onSelectPlan:l,trackingEvent:E,trackingLocation:x,signupUrl:T})=>{const d=s&&s.length>0&&l,f=i=>{if(l==null||l(i),E){const n=s==null?void 0:s.find(A=>A.id===i);c.EAnalyticsEventType.interaction,n==null||n.price,n==null||n.duration}},P=()=>{var n;const i={event:c.EAnalyticsEvent.ctaClicked,location:x||"not_set",type:c.EAnalyticsEventType.interaction,component:"IndividualProductCard",element:"primary_button",payload:{productId:N,ctaLabel:t.label,productName:o,selectedPlanId:g||"none"}};(n=window.eventBus)==null||n.emit("analytics",i)},S=()=>{var i;(i=window.eventBus)==null||i.emit("analytics",{event:c.EAnalyticsEvent.ctaClicked,location:x||"not_set",type:c.EAnalyticsEventType.interaction,component:"IndividualProductCard",element:"secondary_button",payload:{ctaLabel:r==null?void 0:r.label,productName:o}})};return e.jsx("section",{className:a.root,children:e.jsxs("div",{className:u.cn(a.container,!d&&a.noPlans),children:[e.jsxs("div",{className:a.gallery,children:[e.jsx(I.ImageGallery,{images:q,label:w}),e.jsx("div",{className:u.cn(a.ratingContainer,a.mobileOnly),children:e.jsx(_.RatingPreview,{rating:v,text:j||"No reviews yet"})}),h&&e.jsx("div",{className:a.quoteWrapper,children:e.jsx(F.Quote,{...h})})]}),e.jsxs("div",{className:a.info,children:[e.jsxs("div",{className:a.infoHeader,children:[e.jsx(y.Typography,{as:"h3",defaultVariant:"displayXs",mobileVariant:"headingLg",weight:"regular",children:o}),!!m&&e.jsx(y.Typography,{as:"p",defaultVariant:"bodySm",className:a.infoDescription,weight:"regular",children:m})]}),!d&&e.jsxs("div",{className:a.actions,children:[e.jsx(C.Button,{variant:"primary",size:"lg",...t,onClick:P,children:t.label}),r&&e.jsx(G.TextButton,{...r,onClick:S,children:r.label})]}),e.jsx(R.Features,{features:b}),p&&e.jsx(k.PlainFeaturesGroup,{...p})]}),d&&e.jsxs("div",{className:a.plansSection,children:[e.jsxs("div",{className:a.plans,children:[e.jsx(y.Typography,{as:"h4",defaultVariant:"labelSm",emphasis:!0,weight:"regular",children:"Subscribe & Save"}),s.map(i=>e.jsx(B.PlanCard,{plan:i,onSelect:f,isActive:g===i.id},i.id))]}),e.jsx("div",{className:u.cn(a.ratingContainer,a.desktopOnly),children:e.jsx(_.RatingPreview,{rating:v,text:j||"No reviews yet"})}),e.jsxs("div",{className:a.actions,children:[e.jsx(C.Button,{variant:"primary",size:"lg",as:"a",href:T||"#0",...t,children:t.label}),e.jsx(V.SmartCallout,{label:"HSA/FSA Eligible"})]})]})]})})};exports.IndividualProductCard=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../../utils/cn/cn.cjs.js"),c=require("../../types/analytics/analytics.cjs.js"),a=require("../../src/modules/IndividualProductCard/individualProductCard.module.css"),k=require("../../components/PlainFeaturesGroup/PlainFeaturesGroup.cjs.js"),I=require("../../components/ImageGallery/ImageGallery.cjs.js"),_=require("../../components/RatingPreview/RatingPreview.cjs.js"),F=require("../../components/Quote/Quote.cjs.js"),m=require("../../components/Typography/Typography.cjs.js"),C=require("../../components/Button/Button.cjs.js"),G=require("../../components/TextButton/TextButton.cjs.js"),R=require("./components/Features/Features.cjs.js"),B=require("./components/PlanCard/PlanCard.cjs.js"),V=require("../../components/SmartCallout/SmartCallout.cjs.js"),O=({zenpatientId:b,name:o,description:y,features:N,featuresGroup:p,images:q,quote:h,label:E,rating:v,ratingText:j,plans:s,button:t,textButton:r,selectedPlanId:g,onSelectPlan:l,trackingEvent:T,trackingLocation:x,signupUrl:w})=>{const d=s&&s.length>0&&l,f=i=>{if(l==null||l(i),T){const n=s==null?void 0:s.find(A=>A.id===i);c.EAnalyticsEventType.interaction,n==null||n.price,n==null||n.duration}},P=()=>{var n;const i={event:c.EAnalyticsEvent.ctaClicked,location:x||"not_set",type:c.EAnalyticsEventType.interaction,component:"IndividualProductCard",element:"primary_button",payload:{productId:b,ctaLabel:t.label,productName:o,selectedPlanId:g||"none"}};(n=window.eventBus)==null||n.emit("analytics",i)},S=()=>{var i;(i=window.eventBus)==null||i.emit("analytics",{event:c.EAnalyticsEvent.ctaClicked,location:x||"not_set",type:c.EAnalyticsEventType.interaction,component:"IndividualProductCard",element:"secondary_button",payload:{ctaLabel:r==null?void 0:r.label,productName:o}})};return e.jsx("section",{className:a.root,children:e.jsxs("div",{className:u.cn(a.container,!d&&a.noPlans),children:[e.jsxs("div",{className:a.gallery,children:[e.jsx(I.ImageGallery,{images:q,label:E}),e.jsx("div",{className:u.cn(a.ratingContainer,a.mobileOnly),children:e.jsx(_.RatingPreview,{rating:v,text:j})}),h&&e.jsx("div",{className:a.quoteWrapper,children:e.jsx(F.Quote,{...h})})]}),e.jsxs("div",{className:a.info,children:[e.jsxs("div",{className:a.infoHeader,children:[e.jsx(m.Typography,{as:"h3",defaultVariant:"displayXs",mobileVariant:"headingLg",weight:"regular",children:o}),!!y&&e.jsx(m.Typography,{as:"p",defaultVariant:"bodySm",className:a.infoDescription,weight:"regular",children:y})]}),!d&&e.jsxs("div",{className:a.actions,children:[e.jsx(C.Button,{variant:"primary",size:"lg",...t,onClick:P,children:t.label}),r&&e.jsx(G.TextButton,{...r,onClick:S,children:r.label})]}),e.jsx(R.Features,{features:N}),p&&e.jsx(k.PlainFeaturesGroup,{...p})]}),d&&e.jsxs("div",{className:a.plansSection,children:[e.jsxs("div",{className:a.plans,children:[e.jsx(m.Typography,{as:"h4",defaultVariant:"labelSm",emphasis:!0,weight:"regular",children:"Subscribe & Save"}),s.map(i=>e.jsx(B.PlanCard,{plan:i,onSelect:f,isActive:g===i.id},i.id))]}),e.jsx("div",{className:u.cn(a.ratingContainer,a.desktopOnly),children:e.jsx(_.RatingPreview,{rating:v,text:j})}),e.jsxs("div",{className:a.actions,children:[e.jsx(C.Button,{variant:"primary",size:"lg",as:"a",href:w||"#0",...t,children:t.label}),e.jsx(V.SmartCallout,{label:"HSA/FSA Eligible"})]})]})]})})};exports.IndividualProductCard=O;
@@ -1,7 +1,7 @@
1
1
  import { jsx as i, jsxs as l } from "react/jsx-runtime";
2
2
  import { cn as m } from "../../utils/cn/cn.es.js";
3
3
  import { EAnalyticsEventType as p, EAnalyticsEvent as b } from "../../types/analytics/analytics.es.js";
4
- import e from "../../modules/IndividualProductCard/individualProductCard.module.css";
4
+ import a from "../../modules/IndividualProductCard/individualProductCard.module.css";
5
5
  import { PlainFeaturesGroup as D } from "../../components/PlainFeaturesGroup/PlainFeaturesGroup.es.js";
6
6
  import { ImageGallery as G } from "../../components/ImageGallery/ImageGallery.es.js";
7
7
  import { RatingPreview as w } from "../../components/RatingPreview/RatingPreview.es.js";
@@ -12,7 +12,7 @@ import { TextButton as L } from "../../components/TextButton/TextButton.es.js";
12
12
  import { Features as O } from "./components/Features/Features.es.js";
13
13
  import { PlanCard as P } from "./components/PlanCard/PlanCard.es.js";
14
14
  import { SmartCallout as Q } from "../../components/SmartCallout/SmartCallout.es.js";
15
- const ei = ({
15
+ const ai = ({
16
16
  zenpatientId: E,
17
17
  name: d,
18
18
  description: v,
@@ -22,24 +22,24 @@ const ei = ({
22
22
  quote: f,
23
23
  label: I,
24
24
  rating: u,
25
- ratingText: N,
25
+ ratingText: g,
26
26
  plans: o,
27
- button: n,
28
- textButton: t,
29
- selectedPlanId: g,
27
+ button: t,
28
+ textButton: n,
29
+ selectedPlanId: N,
30
30
  onSelectPlan: c,
31
31
  trackingEvent: V,
32
32
  trackingLocation: C,
33
33
  signupUrl: _
34
34
  }) => {
35
- const s = o && o.length > 0 && c, F = (a) => {
36
- if (c == null || c(a), V) {
37
- const r = o == null ? void 0 : o.find((z) => z.id === a);
35
+ const s = o && o.length > 0 && c, F = (e) => {
36
+ if (c == null || c(e), V) {
37
+ const r = o == null ? void 0 : o.find((z) => z.id === e);
38
38
  p.interaction, r == null || r.price, r == null || r.duration;
39
39
  }
40
40
  }, T = () => {
41
41
  var r;
42
- const a = {
42
+ const e = {
43
43
  event: b.ctaClicked,
44
44
  location: C || "not_set",
45
45
  type: p.interaction,
@@ -47,74 +47,74 @@ const ei = ({
47
47
  element: "primary_button",
48
48
  payload: {
49
49
  productId: E,
50
- ctaLabel: n.label,
50
+ ctaLabel: t.label,
51
51
  productName: d,
52
- selectedPlanId: g || "none"
52
+ selectedPlanId: N || "none"
53
53
  }
54
54
  };
55
- (r = window.eventBus) == null || r.emit("analytics", a);
55
+ (r = window.eventBus) == null || r.emit("analytics", e);
56
56
  }, j = () => {
57
- var a;
58
- (a = window.eventBus) == null || a.emit("analytics", {
57
+ var e;
58
+ (e = window.eventBus) == null || e.emit("analytics", {
59
59
  event: b.ctaClicked,
60
60
  location: C || "not_set",
61
61
  type: p.interaction,
62
62
  component: "IndividualProductCard",
63
63
  element: "secondary_button",
64
64
  payload: {
65
- ctaLabel: t == null ? void 0 : t.label,
65
+ ctaLabel: n == null ? void 0 : n.label,
66
66
  productName: d
67
67
  }
68
68
  });
69
69
  };
70
- return /* @__PURE__ */ i("section", { className: e.root, children: /* @__PURE__ */ l("div", { className: m(e.container, !s && e.noPlans), children: [
71
- /* @__PURE__ */ l("div", { className: e.gallery, children: [
70
+ return /* @__PURE__ */ i("section", { className: a.root, children: /* @__PURE__ */ l("div", { className: m(a.container, !s && a.noPlans), children: [
71
+ /* @__PURE__ */ l("div", { className: a.gallery, children: [
72
72
  /* @__PURE__ */ i(G, { images: S, label: I }),
73
- /* @__PURE__ */ i("div", { className: m(e.ratingContainer, e.mobileOnly), children: /* @__PURE__ */ i(w, { rating: u, text: N || "No reviews yet" }) }),
74
- f && /* @__PURE__ */ i("div", { className: e.quoteWrapper, children: /* @__PURE__ */ i(H, { ...f }) })
73
+ /* @__PURE__ */ i("div", { className: m(a.ratingContainer, a.mobileOnly), children: /* @__PURE__ */ i(w, { rating: u, text: g }) }),
74
+ f && /* @__PURE__ */ i("div", { className: a.quoteWrapper, children: /* @__PURE__ */ i(H, { ...f }) })
75
75
  ] }),
76
- /* @__PURE__ */ l("div", { className: e.info, children: [
77
- /* @__PURE__ */ l("div", { className: e.infoHeader, children: [
76
+ /* @__PURE__ */ l("div", { className: a.info, children: [
77
+ /* @__PURE__ */ l("div", { className: a.infoHeader, children: [
78
78
  /* @__PURE__ */ i(h, { as: "h3", defaultVariant: "displayXs", mobileVariant: "headingLg", weight: "regular", children: d }),
79
79
  !!v && /* @__PURE__ */ i(
80
80
  h,
81
81
  {
82
82
  as: "p",
83
83
  defaultVariant: "bodySm",
84
- className: e.infoDescription,
84
+ className: a.infoDescription,
85
85
  weight: "regular",
86
86
  children: v
87
87
  }
88
88
  )
89
89
  ] }),
90
- !s && /* @__PURE__ */ l("div", { className: e.actions, children: [
91
- /* @__PURE__ */ i(k, { variant: "primary", size: "lg", ...n, onClick: T, children: n.label }),
92
- t && /* @__PURE__ */ i(L, { ...t, onClick: j, children: t.label })
90
+ !s && /* @__PURE__ */ l("div", { className: a.actions, children: [
91
+ /* @__PURE__ */ i(k, { variant: "primary", size: "lg", ...t, onClick: T, children: t.label }),
92
+ n && /* @__PURE__ */ i(L, { ...n, onClick: j, children: n.label })
93
93
  ] }),
94
94
  /* @__PURE__ */ i(O, { features: A }),
95
95
  y && /* @__PURE__ */ i(D, { ...y })
96
96
  ] }),
97
- s && /* @__PURE__ */ l("div", { className: e.plansSection, children: [
98
- /* @__PURE__ */ l("div", { className: e.plans, children: [
97
+ s && /* @__PURE__ */ l("div", { className: a.plansSection, children: [
98
+ /* @__PURE__ */ l("div", { className: a.plans, children: [
99
99
  /* @__PURE__ */ i(h, { as: "h4", defaultVariant: "labelSm", emphasis: !0, weight: "regular", children: "Subscribe & Save" }),
100
- o.map((a) => /* @__PURE__ */ i(
100
+ o.map((e) => /* @__PURE__ */ i(
101
101
  P,
102
102
  {
103
- plan: a,
103
+ plan: e,
104
104
  onSelect: F,
105
- isActive: g === a.id
105
+ isActive: N === e.id
106
106
  },
107
- a.id
107
+ e.id
108
108
  ))
109
109
  ] }),
110
- /* @__PURE__ */ i("div", { className: m(e.ratingContainer, e.desktopOnly), children: /* @__PURE__ */ i(w, { rating: u, text: N || "No reviews yet" }) }),
111
- /* @__PURE__ */ l("div", { className: e.actions, children: [
112
- /* @__PURE__ */ i(k, { variant: "primary", size: "lg", as: "a", href: _ || "#0", ...n, children: n.label }),
110
+ /* @__PURE__ */ i("div", { className: m(a.ratingContainer, a.desktopOnly), children: /* @__PURE__ */ i(w, { rating: u, text: g }) }),
111
+ /* @__PURE__ */ l("div", { className: a.actions, children: [
112
+ /* @__PURE__ */ i(k, { variant: "primary", size: "lg", as: "a", href: _ || "#0", ...t, children: t.label }),
113
113
  /* @__PURE__ */ i(Q, { label: "HSA/FSA Eligible" })
114
114
  ] })
115
115
  ] })
116
116
  ] }) });
117
117
  };
118
118
  export {
119
- ei as IndividualProductCard
119
+ ai as IndividualProductCard
120
120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",