@zenpatient-org/healthspan-marketing-ui 0.2.3 → 0.2.5

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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("swiper/modules"),c=require("swiper/react"),g=require("react"),q=require("../../utils/useSwiper/useSwiper.cjs.js"),w=require("../../utils/cn/cn.cjs.js");;/* empty css */;/* empty css */;/* empty css */const i=require("../../src/components/ImageGallery/imageGallery.module.css"),j=require("../Label/Label.cjs.js"),x=require("../GalleryPagination/GalleryPagination.cjs.js"),y=[m.Navigation],_=({images:r,label:a,className:o})=>{const{activeIndex:u,handleSlideTo:l,handleSlideChange:d,onSwiperInit:S,handleSwiperResize:h,handleUserInteraction:n}=q.useSwiperWithAutoPlay(3e3),p=g.useCallback(s=>{n(),l(s)},[n,l]);return e.jsxs("div",{className:w.cn(i.root,o),children:[a&&e.jsx("div",{className:i.labelWrap,children:e.jsx(j.Label,{color:"black",size:"sm",children:a})}),e.jsx(c.Swiper,{onSwiper:S,onResize:h,onSlideChange:d,onTouchStart:n,onTouchEnd:n,modules:y,spaceBetween:0,slidesPerView:1,className:i.swiper,children:r.map((s,t)=>e.jsx(c.SwiperSlide,{children:e.jsx("div",{className:i.imageWrapper,children:e.jsx("img",{src:s,alt:"product image",className:i.image,onClick:n},t)})},t))}),r.length>1&&e.jsx(x.GalleryPagination,{count:r.length,activeIndex:u,onSelect:p})]})};exports.ImageGallery=_;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("swiper/modules"),d=require("swiper/react"),q=require("react"),w=require("../../utils/useSwiper/useSwiper.cjs.js"),j=require("../../utils/cn/cn.cjs.js");;/* empty css */;/* empty css */;/* empty css */const i=require("../../src/components/ImageGallery/imageGallery.module.css"),y=require("../Label/Label.cjs.js"),x=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),P=require("../GalleryPagination/GalleryPagination.cjs.js"),_=[m.Navigation],v=({images:n,label:a,className:p,pagination:s="preview"})=>{const{activeIndex:t,handleSlideTo:c,handleSlideChange:S,onSwiperInit:h,handleSwiperResize:g,handleUserInteraction:r}=w.useSwiperWithAutoPlay(3e3),o=q.useCallback(l=>{r(),c(l)},[r,c]);return e.jsxs("div",{className:j.cn(i.root,p),children:[a&&e.jsx("div",{className:i.labelWrap,children:e.jsx(y.Label,{color:"black",size:"sm",children:a})}),e.jsx(d.Swiper,{onSwiper:h,onResize:g,onSlideChange:S,onTouchStart:r,onTouchEnd:r,modules:_,spaceBetween:0,slidesPerView:1,className:i.swiper,children:n.map((l,u)=>e.jsx(d.SwiperSlide,{children:e.jsx("div",{className:i.imageWrapper,children:e.jsx("img",{src:l,alt:"product image",className:i.image,onClick:r},u)})},u))}),s==="preview"&&n.length>1&&e.jsx(x.ImageGalleryPagination,{images:n,activeIndex:t,onSelect:o}),s==="plain"&&n.length>1&&e.jsx(P.GalleryPagination,{count:n.length,activeIndex:t,onSelect:o})]})};exports.ImageGallery=v;
@@ -3,6 +3,7 @@ type ImageGalleryProps = {
3
3
  images: Array<string>;
4
4
  label?: string;
5
5
  className?: string;
6
+ pagination?: 'plain' | 'preview';
6
7
  };
7
- export declare const ImageGallery: ({ images, label, className }: ImageGalleryProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ImageGallery: ({ images, label, className, pagination }: ImageGalleryProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,52 +1,54 @@
1
1
  "use client";
2
- import { jsxs as S, jsx as e } from "react/jsx-runtime";
3
- import { Navigation as g } from "swiper/modules";
4
- import { Swiper as u, SwiperSlide as f } from "swiper/react";
5
- import { useCallback as w } from "react";
6
- import { useSwiperWithAutoPlay as N } from "../../utils/useSwiper/useSwiper.es.js";
7
- import { cn as v } from "../../utils/cn/cn.es.js";
2
+ import { jsxs as w, jsx as e } from "react/jsx-runtime";
3
+ import { Navigation as f } from "swiper/modules";
4
+ import { Swiper as g, SwiperSlide as u } from "swiper/react";
5
+ import { useCallback as v } from "react";
6
+ import { useSwiperWithAutoPlay as I } from "../../utils/useSwiper/useSwiper.es.js";
7
+ import { cn as N } from "../../utils/cn/cn.es.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  /* empty css */
11
- import r from "../../components/ImageGallery/imageGallery.module.css";
12
- import { Label as I } from "../Label/Label.es.js";
13
- import { GalleryPagination as P } from "../GalleryPagination/GalleryPagination.es.js";
14
- const y = [g], U = ({ images: o, label: a, className: m }) => {
15
- const { activeIndex: c, handleSlideTo: l, handleSlideChange: s, onSwiperInit: p, handleSwiperResize: d, handleUserInteraction: i } = N(3e3), h = w(
16
- (n) => {
17
- i(), l(n);
11
+ import o from "../../components/ImageGallery/imageGallery.module.css";
12
+ import { Label as P } from "../Label/Label.es.js";
13
+ import { ImageGalleryPagination as y } from "./components/ImageGalleryPagination/ImageGalleryPagination.es.js";
14
+ import { GalleryPagination as C } from "../GalleryPagination/GalleryPagination.es.js";
15
+ const W = [f], D = ({ images: r, label: n, className: s, pagination: t = "preview" }) => {
16
+ const { activeIndex: a, handleSlideTo: m, handleSlideChange: d, onSwiperInit: h, handleSwiperResize: S, handleUserInteraction: i } = I(3e3), c = v(
17
+ (l) => {
18
+ i(), m(l);
18
19
  },
19
- [i, l]
20
+ [i, m]
20
21
  );
21
- return /* @__PURE__ */ S("div", { className: v(r.root, m), children: [
22
- a && /* @__PURE__ */ e("div", { className: r.labelWrap, children: /* @__PURE__ */ e(I, { color: "black", size: "sm", children: a }) }),
22
+ return /* @__PURE__ */ w("div", { className: N(o.root, s), children: [
23
+ n && /* @__PURE__ */ e("div", { className: o.labelWrap, children: /* @__PURE__ */ e(P, { color: "black", size: "sm", children: n }) }),
23
24
  /* @__PURE__ */ e(
24
- u,
25
+ g,
25
26
  {
26
- onSwiper: p,
27
- onResize: d,
28
- onSlideChange: s,
27
+ onSwiper: h,
28
+ onResize: S,
29
+ onSlideChange: d,
29
30
  onTouchStart: i,
30
31
  onTouchEnd: i,
31
- modules: y,
32
+ modules: W,
32
33
  spaceBetween: 0,
33
34
  slidesPerView: 1,
34
- className: r.swiper,
35
- children: o.map((n, t) => /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e("div", { className: r.imageWrapper, children: /* @__PURE__ */ e(
35
+ className: o.swiper,
36
+ children: r.map((l, p) => /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: o.imageWrapper, children: /* @__PURE__ */ e(
36
37
  "img",
37
38
  {
38
- src: n,
39
+ src: l,
39
40
  alt: "product image",
40
- className: r.image,
41
+ className: o.image,
41
42
  onClick: i
42
43
  },
43
- t
44
- ) }) }, t))
44
+ p
45
+ ) }) }, p))
45
46
  }
46
47
  ),
47
- o.length > 1 && /* @__PURE__ */ e(P, { count: o.length, activeIndex: c, onSelect: h })
48
+ t === "preview" && r.length > 1 && /* @__PURE__ */ e(y, { images: r, activeIndex: a, onSelect: c }),
49
+ t === "plain" && r.length > 1 && /* @__PURE__ */ e(C, { count: r.length, activeIndex: a, onSelect: c })
48
50
  ] });
49
51
  };
50
52
  export {
51
- U as ImageGallery
53
+ D as ImageGallery
52
54
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("../../../../utils/cn/cn.cjs.js"),t=require("../../../../src/components/ImageGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css"),c=({images:s,activeIndex:l,onSelect:i})=>n.jsx("div",{className:t.root,children:s.map((a,e)=>n.jsx("button",{type:"button",className:r.cn(t.thumbnailButton,{[t.active]:e===l}),onClick:()=>i(e),children:n.jsx("img",{src:a,alt:`thumbnail ${e+1}`,className:t.thumbnailImage})},a))});exports.ImageGalleryPagination=c;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ type ImageGalleryPaginationProps = {
4
+ images: string[];
5
+ activeIndex: number;
6
+ onSelect: (index: number) => void;
7
+ };
8
+ export declare const ImageGalleryPagination: React.FC<ImageGalleryPaginationProps>;
9
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { cn as e } from "../../../../utils/cn/cn.es.js";
3
+ import t from "../../../../components/ImageGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css";
4
+ const u = ({ images: n, activeIndex: r, onSelect: l }) => /* @__PURE__ */ m("div", { className: t.root, children: n.map((o, a) => /* @__PURE__ */ m(
5
+ "button",
6
+ {
7
+ type: "button",
8
+ className: e(t.thumbnailButton, { [t.active]: a === r }),
9
+ onClick: () => l(a),
10
+ children: /* @__PURE__ */ m("img", { src: o, alt: `thumbnail ${a + 1}`, className: t.thumbnailImage })
11
+ },
12
+ o
13
+ )) });
14
+ export {
15
+ u as ImageGalleryPagination
16
+ };
@@ -0,0 +1,30 @@
1
+ .root {
2
+ display: flex;
3
+ justify-content: center;
4
+ gap: 12px;
5
+ padding: 0 24px;
6
+ }
7
+
8
+ .thumbnailButton {
9
+ width: 64px;
10
+ height: 64px;
11
+ padding: 0;
12
+ border: 1px solid var(--color-neutral-200);
13
+ border-radius: var(--border-radius-xs);
14
+ background: none;
15
+ cursor: pointer;
16
+ opacity: 0.5;
17
+ transition: opacity 0.3s ease;
18
+ overflow: hidden;
19
+ }
20
+
21
+ .thumbnailButton.active {
22
+ opacity: 1;
23
+ border-color: var(--color-neutral-200);
24
+ }
25
+
26
+ .thumbnailImage {
27
+ width: 100%;
28
+ height: 100%;
29
+ object-fit: cover;
30
+ }
@@ -0,0 +1 @@
1
+ export * from './ImageGalleryPagination';
@@ -0,0 +1 @@
1
+ export * from './ImageGalleryPagination';
@@ -9,13 +9,13 @@
9
9
  overflow: hidden;
10
10
  border-radius: var(--border-radius-md);
11
11
  background-color: var(--color-bg-neutral-light);
12
+ gap: 24px;
12
13
  }
13
14
 
14
15
  .labelWrap {
15
16
  width: 100%;
16
17
  display: flex;
17
18
  align-items: flex-start;
18
- margin-bottom: 12px;
19
19
  padding: 0 24px;
20
20
  }
21
21
 
@@ -43,15 +43,15 @@
43
43
  @media (width <= 768px) {
44
44
  .root {
45
45
  padding: 16px 0;
46
+ gap: 16px;
46
47
  }
47
48
 
48
49
  .labelWrap {
49
50
  padding: 0 16px;
50
- margin-bottom: 14px;
51
51
  }
52
52
 
53
53
  .swiper {
54
- margin-bottom: 14px;
54
+ margin-bottom: 0;
55
55
  }
56
56
 
57
57
  .imageWrapper {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../src/modules/ScrollingText/scrollingText.module.css"),l=require("../../components/InfiniteScroll/InfiniteScroll.cjs.js"),i=require("../../components/Typography/Typography.cjs.js"),o=({label:r,url:n})=>e.jsx("a",{href:n,className:t.label,children:e.jsx(i.Typography,{defaultVariant:"labelMd",emphasis:!0,mobileVariant:"labelSm",weight:"regular",children:r})}),s=({labels:r})=>e.jsx("section",{className:t.root,children:r.length>0&&e.jsx("div",{className:t.footer,children:e.jsx(l.InfiniteScroll,{items:r,renderItem:o})})});exports.ScrollingText=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../src/modules/ScrollingText/scrollingText.module.css"),i=require("../../utils/cn/cn.cjs.js"),a=require("../../components/InfiniteScroll/InfiniteScroll.cjs.js"),l=require("../../components/Typography/Typography.cjs.js"),s=({label:r,url:n})=>n?e.jsx("a",{href:n,className:t.label,children:e.jsx(l.Typography,{defaultVariant:"labelMd",emphasis:!0,mobileVariant:"labelSm",weight:"regular",children:r})}):e.jsx("div",{className:i.cn(t.label,t.default),children:e.jsx(l.Typography,{defaultVariant:"labelMd",emphasis:!0,mobileVariant:"labelSm",weight:"regular",children:r})}),o=({labels:r})=>e.jsx("section",{className:t.root,children:r.length>0&&e.jsx("div",{className:t.footer,children:e.jsx(a.InfiniteScroll,{items:r,renderItem:s})})});exports.ScrollingText=o;
@@ -1,7 +1,7 @@
1
1
  export type TScrollingText = {
2
2
  labels: ReadonlyArray<{
3
3
  label: string;
4
- url: string;
4
+ url?: string;
5
5
  }>;
6
6
  };
7
7
  export declare const ScrollingText: ({ labels }: TScrollingText) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import t from "../../modules/ScrollingText/scrollingText.module.css";
3
- import { InfiniteScroll as o } from "../../components/InfiniteScroll/InfiniteScroll.es.js";
4
- import { Typography as i } from "../../components/Typography/Typography.es.js";
5
- const a = ({ label: r, url: l }) => /* @__PURE__ */ e("a", { href: l, className: t.label, children: /* @__PURE__ */ e(i, { defaultVariant: "labelMd", emphasis: !0, mobileVariant: "labelSm", weight: "regular", children: r }) }), d = ({ labels: r }) => /* @__PURE__ */ e("section", { className: t.root, children: r.length > 0 && /* @__PURE__ */ e("div", { className: t.footer, children: /* @__PURE__ */ e(o, { items: r, renderItem: a }) }) });
2
+ import l from "../../modules/ScrollingText/scrollingText.module.css";
3
+ import { cn as i } from "../../utils/cn/cn.es.js";
4
+ import { InfiniteScroll as n } from "../../components/InfiniteScroll/InfiniteScroll.es.js";
5
+ import { Typography as a } from "../../components/Typography/Typography.es.js";
6
+ const o = ({ label: r, url: t }) => t ? /* @__PURE__ */ e("a", { href: t, className: l.label, children: /* @__PURE__ */ e(a, { defaultVariant: "labelMd", emphasis: !0, mobileVariant: "labelSm", weight: "regular", children: r }) }) : /* @__PURE__ */ e("div", { className: i(l.label, l.default), children: /* @__PURE__ */ e(a, { defaultVariant: "labelMd", emphasis: !0, mobileVariant: "labelSm", weight: "regular", children: r }) }), f = ({ labels: r }) => /* @__PURE__ */ e("section", { className: l.root, children: r.length > 0 && /* @__PURE__ */ e("div", { className: l.footer, children: /* @__PURE__ */ e(n, { items: r, renderItem: o }) }) });
6
7
  export {
7
- d as ScrollingText
8
+ f as ScrollingText
8
9
  };
@@ -42,6 +42,10 @@
42
42
  }
43
43
  }
44
44
 
45
+ .default {
46
+ cursor: default;
47
+ }
48
+
45
49
  @media screen and (width <= 768px) {
46
50
  .root {
47
51
  padding: 40px 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",