@zenpatient-org/healthspan-marketing-ui 0.1.90 → 0.1.91

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),i=require("../../components/Typography/Typography.cjs.js"),g=require("../../components/ProgressButton/ProgressButton.cjs.js"),s=require("./threeItemsPlainCarousel.module.css.cjs.js"),y=require("../../utils/cn/cn.cjs.js"),f=3,j=({title:p,cards:d})=>{const[r,u]=c.useState(0),l=c.useMemo(()=>d.slice(0,f),[d]),b=c.useMemo(()=>l.length===0?[]:[...l,...l].slice(r,r+f),[l,r]),o=l.length,a=o>1,m=()=>{a&&u(t=>t===0?o-1:t-1)},h=()=>{a&&u(t=>t===o-1?0:t+1)};return e.jsxs("section",{className:s.default.root,children:[e.jsxs("div",{className:s.default.topContainer,children:[e.jsx(i.Typography,{defaultVariant:"displayMd",mobileVariant:"headingXl",className:s.default.title,children:p}),e.jsx("div",{className:s.default.topButton,children:e.jsx(g.ProgressButton,{left:{disabled:!a,onClick:m},right:{disabled:!a,onClick:h}})})]}),e.jsx("div",{className:s.default.bottomContainer,children:e.jsx(e.Fragment,{children:b.map((t,n)=>e.jsxs("div",{className:y.cn({[s.default.mainCard]:n===0,[s.default.minorCard]:n!==0}),children:[e.jsx("img",{src:t.image,alt:t.title}),e.jsxs("div",{className:s.default.cardContent,children:[e.jsx(i.Typography,{defaultVariant:"headingMd",mobileVariant:"headingXs",children:t.title}),t.subtitle&&e.jsx(i.Typography,{defaultVariant:"labelLg",mobileVariant:"labelSm",className:s.default.subtitle,children:t.subtitle})]}),t.description&&n===0&&e.jsx(i.Typography,{defaultVariant:"bodyLg",mobileVariant:"bodySm",className:s.default.descriptionText,children:t.description})]},`${t.title}-${n}`))})}),e.jsx("div",{className:s.default.bottomButton,children:e.jsx(g.ProgressButton,{left:{disabled:!a,onClick:m},right:{disabled:!a,onClick:h}})})]})};exports.ThreeItemsPlainCarousel=j;
@@ -0,0 +1,14 @@
1
+ export type Card = {
2
+ title: string;
3
+ description: string;
4
+ };
5
+ export type ThreeItemsPlainCarouselProps = {
6
+ title: string;
7
+ cards: Array<{
8
+ image: string;
9
+ title: string;
10
+ subtitle?: string;
11
+ description: string;
12
+ }>;
13
+ };
14
+ export declare const ThreeItemsPlainCarousel: ({ title, cards: rawCards }: ThreeItemsPlainCarouselProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,81 @@
1
+ import { jsxs as r, jsx as e, Fragment as N } from "react/jsx-runtime";
2
+ import { useState as V, useMemo as b } from "react";
3
+ import { Typography as s } from "../../components/Typography/Typography.es.js";
4
+ import { ProgressButton as f } from "../../components/ProgressButton/ProgressButton.es.js";
5
+ import i from "./threeItemsPlainCarousel.module.css.es.js";
6
+ import { cn as y } from "../../utils/cn/cn.es.js";
7
+ const p = 3, T = ({ title: g, cards: d }) => {
8
+ const [o, m] = V(0), a = b(() => d.slice(0, p), [d]), C = b(() => a.length === 0 ? [] : [...a, ...a].slice(o, o + p), [a, o]), c = a.length, l = c > 1, h = () => {
9
+ l && m((t) => t === 0 ? c - 1 : t - 1);
10
+ }, u = () => {
11
+ l && m((t) => t === c - 1 ? 0 : t + 1);
12
+ };
13
+ return /* @__PURE__ */ r("section", { className: i.root, children: [
14
+ /* @__PURE__ */ r("div", { className: i.topContainer, children: [
15
+ /* @__PURE__ */ e(s, { defaultVariant: "displayMd", mobileVariant: "headingXl", className: i.title, children: g }),
16
+ /* @__PURE__ */ e("div", { className: i.topButton, children: /* @__PURE__ */ e(
17
+ f,
18
+ {
19
+ left: {
20
+ disabled: !l,
21
+ onClick: h
22
+ },
23
+ right: {
24
+ disabled: !l,
25
+ onClick: u
26
+ }
27
+ }
28
+ ) })
29
+ ] }),
30
+ /* @__PURE__ */ e("div", { className: i.bottomContainer, children: /* @__PURE__ */ e(N, { children: C.map((t, n) => /* @__PURE__ */ r(
31
+ "div",
32
+ {
33
+ className: y({
34
+ [i.mainCard]: n === 0,
35
+ [i.minorCard]: n !== 0
36
+ }),
37
+ children: [
38
+ /* @__PURE__ */ e("img", { src: t.image, alt: t.title }),
39
+ /* @__PURE__ */ r("div", { className: i.cardContent, children: [
40
+ /* @__PURE__ */ e(s, { defaultVariant: "headingMd", mobileVariant: "headingXs", children: t.title }),
41
+ t.subtitle && /* @__PURE__ */ e(
42
+ s,
43
+ {
44
+ defaultVariant: "labelLg",
45
+ mobileVariant: "labelSm",
46
+ className: i.subtitle,
47
+ children: t.subtitle
48
+ }
49
+ )
50
+ ] }),
51
+ t.description && n === 0 && /* @__PURE__ */ e(
52
+ s,
53
+ {
54
+ defaultVariant: "bodyLg",
55
+ mobileVariant: "bodySm",
56
+ className: i.descriptionText,
57
+ children: t.description
58
+ }
59
+ )
60
+ ]
61
+ },
62
+ `${t.title}-${n}`
63
+ )) }) }),
64
+ /* @__PURE__ */ e("div", { className: i.bottomButton, children: /* @__PURE__ */ e(
65
+ f,
66
+ {
67
+ left: {
68
+ disabled: !l,
69
+ onClick: h
70
+ },
71
+ right: {
72
+ disabled: !l,
73
+ onClick: u
74
+ }
75
+ }
76
+ ) })
77
+ ] });
78
+ };
79
+ export {
80
+ T as ThreeItemsPlainCarousel
81
+ };
@@ -0,0 +1 @@
1
+ export { ThreeItemsPlainCarousel } from './ThreeItemsPlainCarousel';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t="threeItemsPlainCarousel-module__root___xtgoy",o="threeItemsPlainCarousel-module__topContainer___f6h9T",e="threeItemsPlainCarousel-module__bottomContainer___Pn1eW",n="threeItemsPlainCarousel-module__subtitle___xYJAD",r="threeItemsPlainCarousel-module__mainCard___F40fV",_="threeItemsPlainCarousel-module__minorCard___yYs9x",a="threeItemsPlainCarousel-module__cardContent___93PTA",s="threeItemsPlainCarousel-module__bottomButton___aII2h",i="threeItemsPlainCarousel-module__topButton___kBUHb",l="threeItemsPlainCarousel-module__descriptionText___7gS89",u={root:t,topContainer:o,bottomContainer:e,subtitle:n,mainCard:r,minorCard:_,cardContent:a,bottomButton:s,topButton:i,descriptionText:l};exports.bottomButton=s;exports.bottomContainer=e;exports.cardContent=a;exports.default=u;exports.descriptionText=l;exports.mainCard=r;exports.minorCard=_;exports.root=t;exports.subtitle=n;exports.topButton=i;exports.topContainer=o;
@@ -0,0 +1,25 @@
1
+ const t = "threeItemsPlainCarousel-module__root___xtgoy", o = "threeItemsPlainCarousel-module__topContainer___f6h9T", e = "threeItemsPlainCarousel-module__bottomContainer___Pn1eW", n = "threeItemsPlainCarousel-module__subtitle___xYJAD", _ = "threeItemsPlainCarousel-module__mainCard___F40fV", r = "threeItemsPlainCarousel-module__minorCard___yYs9x", a = "threeItemsPlainCarousel-module__cardContent___93PTA", s = "threeItemsPlainCarousel-module__bottomButton___aII2h", l = "threeItemsPlainCarousel-module__topButton___kBUHb", m = "threeItemsPlainCarousel-module__descriptionText___7gS89", i = {
2
+ root: t,
3
+ topContainer: o,
4
+ bottomContainer: e,
5
+ subtitle: n,
6
+ mainCard: _,
7
+ minorCard: r,
8
+ cardContent: a,
9
+ bottomButton: s,
10
+ topButton: l,
11
+ descriptionText: m
12
+ };
13
+ export {
14
+ s as bottomButton,
15
+ e as bottomContainer,
16
+ a as cardContent,
17
+ i as default,
18
+ m as descriptionText,
19
+ _ as mainCard,
20
+ r as minorCard,
21
+ t as root,
22
+ n as subtitle,
23
+ l as topButton,
24
+ o as topContainer
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.1.90",
3
+ "version": "0.1.91",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -511,6 +511,11 @@
511
511
  "import": "./dist/modules/TextBlockAnimated/TextBlockAnimated.es.js",
512
512
  "require": "./dist/modules/TextBlockAnimated/TextBlockAnimated.cjs.js"
513
513
  },
514
+ "./ThreeItemsPlainCarousel": {
515
+ "types": "./dist/modules/ThreeItemsPlainCarousel/ThreeItemsPlainCarousel.d.ts",
516
+ "import": "./dist/modules/ThreeItemsPlainCarousel/ThreeItemsPlainCarousel.es.js",
517
+ "require": "./dist/modules/ThreeItemsPlainCarousel/ThreeItemsPlainCarousel.cjs.js"
518
+ },
514
519
  "./CallToAction": {
515
520
  "types": "./dist/modules/CallToAction/CallToAction.d.ts",
516
521
  "import": "./dist/modules/CallToAction/CallToAction.es.js",