@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.
- package/dist/components/RatingPreview/RatingPreview.cjs.js +1 -1
- package/dist/components/RatingPreview/RatingPreview.d.ts +1 -1
- package/dist/components/RatingPreview/RatingPreview.es.js +24 -22
- package/dist/modules/IndividualProductCard/IndividualProductCard.cjs.js +1 -1
- package/dist/modules/IndividualProductCard/IndividualProductCard.es.js +36 -36
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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
|
|
2
|
-
import
|
|
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
|
|
5
|
-
import { EIconName as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
for (let
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
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"),
|
|
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
|
|
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
|
|
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:
|
|
25
|
+
ratingText: g,
|
|
26
26
|
plans: o,
|
|
27
|
-
button:
|
|
28
|
-
textButton:
|
|
29
|
-
selectedPlanId:
|
|
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 = (
|
|
36
|
-
if (c == null || c(
|
|
37
|
-
const r = o == null ? void 0 : o.find((z) => z.id ===
|
|
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
|
|
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:
|
|
50
|
+
ctaLabel: t.label,
|
|
51
51
|
productName: d,
|
|
52
|
-
selectedPlanId:
|
|
52
|
+
selectedPlanId: N || "none"
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
(r = window.eventBus) == null || r.emit("analytics",
|
|
55
|
+
(r = window.eventBus) == null || r.emit("analytics", e);
|
|
56
56
|
}, j = () => {
|
|
57
|
-
var
|
|
58
|
-
(
|
|
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:
|
|
65
|
+
ctaLabel: n == null ? void 0 : n.label,
|
|
66
66
|
productName: d
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
return /* @__PURE__ */ i("section", { className:
|
|
71
|
-
/* @__PURE__ */ l("div", { className:
|
|
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(
|
|
74
|
-
f && /* @__PURE__ */ i("div", { className:
|
|
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:
|
|
77
|
-
/* @__PURE__ */ l("div", { className:
|
|
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:
|
|
84
|
+
className: a.infoDescription,
|
|
85
85
|
weight: "regular",
|
|
86
86
|
children: v
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
] }),
|
|
90
|
-
!s && /* @__PURE__ */ l("div", { className:
|
|
91
|
-
/* @__PURE__ */ i(k, { variant: "primary", size: "lg", ...
|
|
92
|
-
|
|
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:
|
|
98
|
-
/* @__PURE__ */ l("div", { className:
|
|
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((
|
|
100
|
+
o.map((e) => /* @__PURE__ */ i(
|
|
101
101
|
P,
|
|
102
102
|
{
|
|
103
|
-
plan:
|
|
103
|
+
plan: e,
|
|
104
104
|
onSelect: F,
|
|
105
|
-
isActive:
|
|
105
|
+
isActive: N === e.id
|
|
106
106
|
},
|
|
107
|
-
|
|
107
|
+
e.id
|
|
108
108
|
))
|
|
109
109
|
] }),
|
|
110
|
-
/* @__PURE__ */ i("div", { className: m(
|
|
111
|
-
/* @__PURE__ */ l("div", { className:
|
|
112
|
-
/* @__PURE__ */ i(k, { variant: "primary", size: "lg", as: "a", href: _ || "#0", ...
|
|
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
|
-
|
|
119
|
+
ai as IndividualProductCard
|
|
120
120
|
};
|