@zenpatient-org/healthspan-marketing-ui 0.2.4 → 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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",