@zenpatient-org/healthspan-marketing-ui 0.2.64 → 0.2.65

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.
Files changed (19) hide show
  1. package/dist/components/AdvancedGallery/AdvancedGallery.cjs.js +1 -1
  2. package/dist/components/AdvancedGallery/AdvancedGallery.es.js +39 -22
  3. package/dist/components/AdvancedGallery/components/ImageGalleryPagination/ImageGalleryPagination.cjs.js +1 -1
  4. package/dist/components/AdvancedGallery/components/ImageGalleryPagination/ImageGalleryPagination.d.ts +1 -0
  5. package/dist/components/AdvancedGallery/components/ImageGalleryPagination/ImageGalleryPagination.es.js +14 -9
  6. package/dist/components/GalleryPagination/GalleryPagination.cjs.js +1 -1
  7. package/dist/components/GalleryPagination/GalleryPagination.d.ts +2 -1
  8. package/dist/components/GalleryPagination/GalleryPagination.es.js +3 -3
  9. package/dist/components/GalleryPagination/galleryPagination.module.css +32 -40
  10. package/dist/components/ImageGallery/ImageGallery.cjs.js +1 -1
  11. package/dist/components/ImageGallery/ImageGallery.d.ts +2 -2
  12. package/dist/components/ImageGallery/ImageGallery.es.js +73 -44
  13. package/dist/components/ImageGallery/components/ImageGalleryPagination/ImageGalleryPagination.cjs.js +1 -1
  14. package/dist/components/ImageGallery/components/ImageGalleryPagination/ImageGalleryPagination.d.ts +1 -0
  15. package/dist/components/ImageGallery/components/ImageGalleryPagination/ImageGalleryPagination.es.js +10 -5
  16. package/dist/components/ImageGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css +0 -3
  17. package/dist/components/ImageGallery/imageGallery.module.css +24 -5
  18. package/dist/styles/utils.module.css +14 -0
  19. package/package.json +1 -1
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),m=require("swiper/modules"),d=require("swiper/react"),q=require("../../utils/useSwiper/useSwiper.cjs.js"),y=require("../../utils/cn/cn.cjs.js");;/* empty css */;/* empty css */;/* empty css */const j=require("../GalleryPagination/GalleryPagination.cjs.js"),r=require("../../src/components/AdvancedGallery/advancedGallery.module.css"),w=require("../Label/Label.cjs.js"),x=require("./components/VideoSlide/VideoSlide.cjs.js"),v=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),P=[m.Navigation],_=({items:a,label:s,className:u})=>{const{activeIndex:l,handleSlideTo:o,handleSlideChange:S,onSwiperInit:p,handleSwiperResize:g,handleUserInteraction:i}=q.useSwiperWithAutoPlay(5e3),c=h.useCallback(n=>{i(),o(n)},[i,o]);return e.jsxs("div",{className:y.cn(r.root,u),children:[s&&e.jsx("div",{className:r.labelWrap,children:e.jsx(w.Label,{color:"black",size:"sm",children:s})}),e.jsx(d.Swiper,{onSwiper:p,onResize:g,onSlideChange:S,onTouchStart:i,onTouchEnd:i,modules:P,spaceBetween:0,slidesPerView:1,className:r.swiper,children:a.map((n,t)=>e.jsxs(d.SwiperSlide,{children:[n.mediaType==="image"&&e.jsx("div",{className:r.imageWrapper,children:e.jsx("img",{src:n.url,alt:"product image",className:r.image,onClick:i})}),n.mediaType==="video"&&e.jsx(x.VideoSlide,{item:n,isActive:l===t,onClick:i})]},t))}),e.jsx(v.ImageGalleryPagination,{items:a,activeIndex:l,onSelect:c}),e.jsx(j.GalleryPagination,{count:a.length,activeIndex:l,onSelect:c})]})};exports.AdvancedGallery=_;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),q=require("swiper/modules"),d=require("swiper/react"),y=require("../../utils/useSwiper/useSwiper.cjs.js"),j=require("../../utils/cn/cn.cjs.js");;/* empty css */;/* empty css */;/* empty css */const w=require("../GalleryPagination/GalleryPagination.cjs.js"),u=require("../../src/styles/utils.module.css"),a=require("../../src/components/AdvancedGallery/advancedGallery.module.css"),x=require("../Label/Label.cjs.js"),v=require("./components/VideoSlide/VideoSlide.cjs.js"),P=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),_=[q.Navigation],b=({items:r,label:l,className:S})=>{const{activeIndex:s,handleSlideTo:o,handleSlideChange:p,onSwiperInit:g,handleSwiperResize:h,handleUserInteraction:i}=y.useSwiperWithAutoPlay(5e3),c=m.useCallback(n=>{i(),o(n)},[i,o]);return e.jsxs("div",{className:j.cn(a.root,S),children:[l&&e.jsx("div",{className:a.labelWrap,children:e.jsx(x.Label,{color:"black",size:"sm",children:l})}),e.jsx(d.Swiper,{onSwiper:g,onResize:h,onSlideChange:p,onTouchStart:i,onTouchEnd:i,modules:_,spaceBetween:0,slidesPerView:1,className:a.swiper,children:r.map((n,t)=>e.jsxs(d.SwiperSlide,{children:[n.mediaType==="image"&&e.jsx("div",{className:a.imageWrapper,children:e.jsx("img",{src:n.url,alt:"product image",className:a.image,onClick:i})}),n.mediaType==="video"&&e.jsx(v.VideoSlide,{item:n,isActive:s===t,onClick:i})]},t))}),e.jsx(P.ImageGalleryPagination,{items:r,activeIndex:s,className:u.hideOnMobile,onSelect:c}),e.jsx(w.GalleryPagination,{count:r.length,activeIndex:s,className:u.hideOnDesktop,onSelect:c})]})};exports.AdvancedGallery=b;
@@ -1,40 +1,41 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
3
- import { useCallback as g } from "react";
4
- import { Navigation as f } from "swiper/modules";
5
- import { Swiper as u, SwiperSlide as w } from "swiper/react";
6
- import { useSwiperWithAutoPlay as v } from "../../utils/useSwiper/useSwiper.es.js";
7
- import { cn as y } from "../../utils/cn/cn.es.js";
2
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
3
+ import { useCallback as f } from "react";
4
+ import { Navigation as u } from "swiper/modules";
5
+ import { Swiper as w, SwiperSlide as v } from "swiper/react";
6
+ import { useSwiperWithAutoPlay as y } 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 { GalleryPagination as N } from "../GalleryPagination/GalleryPagination.es.js";
11
+ import { GalleryPagination as P } from "../GalleryPagination/GalleryPagination.es.js";
12
+ import p from "../../styles/utils.module.css";
12
13
  import r from "../../components/AdvancedGallery/advancedGallery.module.css";
13
- import { Label as P } from "../Label/Label.es.js";
14
+ import { Label as k } from "../Label/Label.es.js";
14
15
  import { VideoSlide as C } from "./components/VideoSlide/VideoSlide.es.js";
15
16
  import { ImageGalleryPagination as I } from "./components/ImageGalleryPagination/ImageGalleryPagination.es.js";
16
- const T = [f], D = ({ items: a, label: n, className: p }) => {
17
- const { activeIndex: l, handleSlideTo: t, handleSlideChange: d, onSwiperInit: h, handleSwiperResize: S, handleUserInteraction: i } = v(5e3), m = g(
17
+ const T = [u], B = ({ items: a, label: n, className: d }) => {
18
+ const { activeIndex: l, handleSlideTo: t, handleSlideChange: h, onSwiperInit: S, handleSwiperResize: g, handleUserInteraction: i } = y(5e3), m = f(
18
19
  (o) => {
19
20
  i(), t(o);
20
21
  },
21
22
  [i, t]
22
23
  );
23
- return /* @__PURE__ */ s("div", { className: y(r.root, p), children: [
24
- n && /* @__PURE__ */ e("div", { className: r.labelWrap, children: /* @__PURE__ */ e(P, { color: "black", size: "sm", children: n }) }),
24
+ return /* @__PURE__ */ c("div", { className: N(r.root, d), children: [
25
+ n && /* @__PURE__ */ e("div", { className: r.labelWrap, children: /* @__PURE__ */ e(k, { color: "black", size: "sm", children: n }) }),
25
26
  /* @__PURE__ */ e(
26
- u,
27
+ w,
27
28
  {
28
- onSwiper: h,
29
- onResize: S,
30
- onSlideChange: d,
29
+ onSwiper: S,
30
+ onResize: g,
31
+ onSlideChange: h,
31
32
  onTouchStart: i,
32
33
  onTouchEnd: i,
33
34
  modules: T,
34
35
  spaceBetween: 0,
35
36
  slidesPerView: 1,
36
37
  className: r.swiper,
37
- children: a.map((o, c) => /* @__PURE__ */ s(w, { children: [
38
+ children: a.map((o, s) => /* @__PURE__ */ c(v, { children: [
38
39
  o.mediaType === "image" && /* @__PURE__ */ e("div", { className: r.imageWrapper, children: /* @__PURE__ */ e(
39
40
  "img",
40
41
  {
@@ -44,14 +45,30 @@ const T = [f], D = ({ items: a, label: n, className: p }) => {
44
45
  onClick: i
45
46
  }
46
47
  ) }),
47
- o.mediaType === "video" && /* @__PURE__ */ e(C, { item: o, isActive: l === c, onClick: i })
48
- ] }, c))
48
+ o.mediaType === "video" && /* @__PURE__ */ e(C, { item: o, isActive: l === s, onClick: i })
49
+ ] }, s))
49
50
  }
50
51
  ),
51
- /* @__PURE__ */ e(I, { items: a, activeIndex: l, onSelect: m }),
52
- /* @__PURE__ */ e(N, { count: a.length, activeIndex: l, onSelect: m })
52
+ /* @__PURE__ */ e(
53
+ I,
54
+ {
55
+ items: a,
56
+ activeIndex: l,
57
+ className: p.hideOnMobile,
58
+ onSelect: m
59
+ }
60
+ ),
61
+ /* @__PURE__ */ e(
62
+ P,
63
+ {
64
+ count: a.length,
65
+ activeIndex: l,
66
+ className: p.hideOnDesktop,
67
+ onSelect: m
68
+ }
69
+ )
53
70
  ] });
54
71
  };
55
72
  export {
56
- D as AdvancedGallery
73
+ B as AdvancedGallery
57
74
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),i=require("../../../../utils/cn/cn.cjs.js"),e=require("../../../../src/components/AdvancedGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css"),l=require("../../../Icon/Icon.cjs.js"),r=require("../../../Icon/constants.cjs.js"),m=({items:s,activeIndex:t,onSelect:c})=>a.jsx("div",{className:e.root,children:s.map((n,o)=>a.jsxs("button",{type:"button",className:i.cn(e.thumbnailButton,{[e.active]:o===t}),onClick:()=>c(o),children:[a.jsx("img",{src:n.mediaType==="image"?n.url:n.preview,alt:`thumbnail ${o+1}`,className:e.thumbnailImage}),n.mediaType==="video"&&n.videoType==="complex"&&a.jsx("div",{className:e.customPlayButton,children:a.jsx(l.Icon,{className:e.icon,name:r.EIconName.ALT_PLAY})})]},o))});exports.ImageGalleryPagination=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("../../../../utils/cn/cn.cjs.js"),e=require("../../../../src/components/AdvancedGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css"),r=require("../../../Icon/Icon.cjs.js"),m=require("../../../Icon/constants.cjs.js"),u=({items:s,activeIndex:t,className:i,onSelect:l})=>a.jsx("div",{className:o.cn(e.root,i),children:s.map((n,c)=>a.jsxs("button",{type:"button",className:o.cn(e.thumbnailButton,{[e.active]:c===t}),onClick:()=>l(c),children:[a.jsx("img",{src:n.mediaType==="image"?n.url:n.preview,alt:`thumbnail ${c+1}`,className:e.thumbnailImage}),n.mediaType==="video"&&n.videoType==="complex"&&a.jsx("div",{className:e.customPlayButton,children:a.jsx(r.Icon,{className:e.icon,name:m.EIconName.ALT_PLAY})})]},c))});exports.ImageGalleryPagination=u;
@@ -3,6 +3,7 @@ import { TAdvancedGalleryView } from '../../types';
3
3
 
4
4
  type ImageGalleryPaginationProps = TAdvancedGalleryView & {
5
5
  activeIndex: number;
6
+ className?: string;
6
7
  onSelect: (index: number) => void;
7
8
  };
8
9
  export declare const ImageGalleryPagination: React.FC<ImageGalleryPaginationProps>;
@@ -1,14 +1,19 @@
1
- import { jsx as m, jsxs as l } from "react/jsx-runtime";
2
- import { cn as c } from "../../../../utils/cn/cn.es.js";
1
+ import { jsx as m, jsxs as i } from "react/jsx-runtime";
2
+ import { cn as t } from "../../../../utils/cn/cn.es.js";
3
3
  import a from "../../../../components/AdvancedGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css";
4
- import { Icon as i } from "../../../Icon/Icon.es.js";
5
- import { EIconName as s } from "../../../Icon/constants.es.js";
6
- const v = ({ items: t, activeIndex: r, onSelect: n }) => /* @__PURE__ */ m("div", { className: a.root, children: t.map((o, e) => /* @__PURE__ */ l(
4
+ import { Icon as s } from "../../../Icon/Icon.es.js";
5
+ import { EIconName as p } from "../../../Icon/constants.es.js";
6
+ const N = ({
7
+ items: r,
8
+ activeIndex: n,
9
+ className: l,
10
+ onSelect: c
11
+ }) => /* @__PURE__ */ m("div", { className: t(a.root, l), children: r.map((o, e) => /* @__PURE__ */ i(
7
12
  "button",
8
13
  {
9
14
  type: "button",
10
- className: c(a.thumbnailButton, { [a.active]: e === r }),
11
- onClick: () => n(e),
15
+ className: t(a.thumbnailButton, { [a.active]: e === n }),
16
+ onClick: () => c(e),
12
17
  children: [
13
18
  /* @__PURE__ */ m(
14
19
  "img",
@@ -18,11 +23,11 @@ const v = ({ items: t, activeIndex: r, onSelect: n }) => /* @__PURE__ */ m("div"
18
23
  className: a.thumbnailImage
19
24
  }
20
25
  ),
21
- o.mediaType === "video" && o.videoType === "complex" && /* @__PURE__ */ m("div", { className: a.customPlayButton, children: /* @__PURE__ */ m(i, { className: a.icon, name: s.ALT_PLAY }) })
26
+ o.mediaType === "video" && o.videoType === "complex" && /* @__PURE__ */ m("div", { className: a.customPlayButton, children: /* @__PURE__ */ m(s, { className: a.icon, name: p.ALT_PLAY }) })
22
27
  ]
23
28
  },
24
29
  e
25
30
  )) });
26
31
  export {
27
- v as ImageGalleryPagination
32
+ N as ImageGalleryPagination
28
33
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("../../utils/cn/cn.cjs.js"),e=require("../../src/components/GalleryPagination/galleryPagination.module.css"),l=({count:s,activeIndex:i,onSelect:r})=>n.jsx("div",{className:e.root,children:Array.from({length:s}).map((c,t)=>n.jsx("button",{type:"button",className:e.lineWrap,onClick:()=>r==null?void 0:r(t),children:n.jsx("div",{className:a.cn(e.line,t===i&&e.active)})},t))});exports.GalleryPagination=l;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("../../utils/cn/cn.cjs.js"),e=require("../../src/components/GalleryPagination/galleryPagination.module.css"),c=({count:i,activeIndex:a,className:l,onSelect:n})=>t.jsx("div",{className:s.cn(e.root,l),children:Array.from({length:i}).map((o,r)=>t.jsx("button",{type:"button",className:e.lineWrap,onClick:()=>n==null?void 0:n(r),children:t.jsx("div",{className:s.cn(e.line,r===a&&e.active)})},r))});exports.GalleryPagination=c;
@@ -1,7 +1,8 @@
1
1
  type GalleryPaginationProps = {
2
2
  count: number;
3
3
  activeIndex: number;
4
+ className?: string;
4
5
  onSelect: (index: number) => void;
5
6
  };
6
- export declare const GalleryPagination: ({ count, activeIndex, onSelect }: GalleryPaginationProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const GalleryPagination: ({ count, activeIndex, className, onSelect }: GalleryPaginationProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
- import { cn as s } from "../../utils/cn/cn.es.js";
3
+ import { cn as m } from "../../utils/cn/cn.es.js";
4
4
  import r from "../../components/GalleryPagination/galleryPagination.module.css";
5
- const c = ({ count: m, activeIndex: o, onSelect: a }) => /* @__PURE__ */ i("div", { className: r.root, children: Array.from({ length: m }).map((n, t) => /* @__PURE__ */ i("button", { type: "button", className: r.lineWrap, onClick: () => a == null ? void 0 : a(t), children: /* @__PURE__ */ i("div", { className: s(r.line, t === o && r.active) }) }, t)) });
5
+ const f = ({ count: o, activeIndex: s, className: n, onSelect: a }) => /* @__PURE__ */ i("div", { className: m(r.root, n), children: Array.from({ length: o }).map((l, t) => /* @__PURE__ */ i("button", { type: "button", className: r.lineWrap, onClick: () => a == null ? void 0 : a(t), children: /* @__PURE__ */ i("div", { className: m(r.line, t === s && r.active) }) }, t)) });
6
6
  export {
7
- c as GalleryPagination
7
+ f as GalleryPagination
8
8
  };
@@ -1,46 +1,38 @@
1
- @media (width <= 768px) {
2
- .root {
3
- display: flex;
4
- gap: 8px;
5
- width: 100%;
6
- max-width: 100%;
7
- justify-content: center;
8
- align-items: center;
9
- flex-wrap: nowrap;
10
- }
11
-
12
- .lineWrap {
13
- width: 32px;
14
- height: 32px;
15
- display: flex;
16
- align-items: center;
17
- justify-content: center;
18
- cursor: pointer;
19
- padding: 0;
20
- background: none;
21
- border: none;
22
- }
1
+ .root {
2
+ display: flex;
3
+ gap: 8px;
4
+ width: 100%;
5
+ max-width: 100%;
6
+ justify-content: center;
7
+ align-items: center;
8
+ flex-wrap: nowrap;
9
+ }
23
10
 
24
- .line {
25
- height: var(--border-width-sm);
26
- width: 100%;
27
- background-color: var(--color-bg-fill-brand-disabled);
28
- border-radius: var(--border-radius-xs);
29
- transition: background-color 0.3s, height 0.3s, opacity 0.3s;
30
- }
11
+ .lineWrap {
12
+ width: 32px;
13
+ height: 32px;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ cursor: pointer;
18
+ padding: 0;
19
+ background: none;
20
+ border: none;
21
+ }
31
22
 
32
- .lineWrap:hover > .line:not(.active) {
33
- opacity: 0.8;
34
- }
23
+ .line {
24
+ height: var(--border-width-sm);
25
+ width: 100%;
26
+ background-color: var(--color-bg-fill-brand-disabled);
27
+ border-radius: var(--border-radius-xs);
28
+ transition: background-color 0.3s, height 0.3s, opacity 0.3s;
29
+ }
35
30
 
36
- .active {
37
- height: var(--border-width-md);
38
- background-color: var(--color-bg-fill-primary);
39
- }
31
+ .lineWrap:hover > .line:not(.active) {
32
+ opacity: 0.8;
40
33
  }
41
34
 
42
- @media (width > 768px) {
43
- .root {
44
- display: none;
45
- }
35
+ .active {
36
+ height: var(--border-width-md);
37
+ background-color: var(--color-bg-fill-primary);
46
38
  }
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("swiper/modules"),u=require("swiper/react"),h=require("react"),q=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"),w=require("../Label/Label.cjs.js"),x=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),y=require("../GalleryPagination/GalleryPagination.cjs.js"),P=[S.Navigation],_=({images:a,label:l,className:d,pagination:I="plain"})=>{const{activeIndex:s,handleSlideTo:t,handleSlideChange:m,onSwiperInit:g,handleSwiperResize:p,handleUserInteraction:n}=q.useSwiperWithAutoPlay(3e3),o=h.useCallback(r=>{n(),t(r)},[n,t]);return e.jsxs("div",{className:j.cn(i.root,d),children:[l&&e.jsx("div",{className:i.labelWrap,children:e.jsx(w.Label,{color:"black",size:"sm",children:l})}),e.jsx(u.Swiper,{onSwiper:g,onResize:p,onSlideChange:m,onTouchStart:n,onTouchEnd:n,modules:P,spaceBetween:0,slidesPerView:1,className:i.swiper,children:a.map((r,c)=>e.jsx(u.SwiperSlide,{children:e.jsx("div",{className:i.imageContainer,children:e.jsx("div",{className:i.imageWrapper,children:e.jsx("img",{src:r,alt:"product image",className:i.image,onClick:n},c)})})},c))}),e.jsx(x.ImageGalleryPagination,{images:a,activeIndex:s,onSelect:o}),e.jsx(y.GalleryPagination,{count:a.length,activeIndex:s,onSelect:o})]})};exports.ImageGallery=_;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),q=require("swiper/modules"),u=require("swiper/react"),x=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"),d=require("../../src/styles/utils.module.css"),P=require("../Label/Label.cjs.js"),N=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),m=require("../GalleryPagination/GalleryPagination.cjs.js"),_=[q.Navigation],b=({images:a,label:c,className:h,type:r="primary"})=>{const{activeIndex:s,handleSlideTo:o,handleSlideChange:g,onSwiperInit:S,handleSwiperResize:p,handleUserInteraction:n}=x.useSwiperWithAutoPlay(3e3),l=j.useCallback(t=>{n(),o(t)},[n,o]);return e.jsxs("div",{className:w.cn(i.root,h,{[i.primary]:r==="primary",[i.secondary]:r==="secondary"}),children:[c&&e.jsx("div",{className:i.labelWrap,children:e.jsx(P.Label,{color:"black",size:"sm",children:c})}),e.jsx(u.Swiper,{onSwiper:S,onResize:p,onSlideChange:g,onTouchStart:n,onTouchEnd:n,modules:_,spaceBetween:0,slidesPerView:1,className:i.swiper,children:a.map((t,y)=>e.jsx(u.SwiperSlide,{children:e.jsx("div",{className:i.imageContainer,children:e.jsx("div",{className:i.imageWrapper,children:e.jsx("img",{src:t,alt:"product image",width:r==="primary"?600:492,height:r==="primary"?600:389,className:i.image,onClick:n})})})},y))}),r==="primary"?e.jsxs(e.Fragment,{children:[e.jsx(N.ImageGalleryPagination,{images:a,className:d.hideOnMobile,activeIndex:s,onSelect:l}),e.jsx(m.GalleryPagination,{count:a.length,activeIndex:s,className:d.hideOnDesktop,onSelect:l})]}):e.jsx(m.GalleryPagination,{count:a.length,activeIndex:s,onSelect:l})]})};exports.ImageGallery=b;
@@ -3,6 +3,6 @@ export type ImageGalleryProps = {
3
3
  images: Array<string>;
4
4
  label?: string;
5
5
  className?: string;
6
- pagination?: 'plain' | 'preview';
6
+ type?: 'primary' | 'secondary';
7
7
  };
8
- export declare const ImageGallery: ({ images, label, className, pagination }: ImageGalleryProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ImageGallery: ({ images, label, className, type }: ImageGalleryProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,54 +1,83 @@
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 f, SwiperSlide as u } 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 s, jsx as e, Fragment as w } from "react/jsx-runtime";
3
+ import { useCallback as y } from "react";
4
+ import { Navigation as N } from "swiper/modules";
5
+ import { Swiper as v, SwiperSlide as I } from "swiper/react";
6
+ import { useSwiperWithAutoPlay as P } from "../../utils/useSwiper/useSwiper.es.js";
7
+ import { cn as C } from "../../utils/cn/cn.es.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  /* empty css */
11
- import i from "../../components/ImageGallery/imageGallery.module.css";
12
- import { Label as I } from "../Label/Label.es.js";
13
- import { ImageGalleryPagination as P } from "./components/ImageGalleryPagination/ImageGalleryPagination.es.js";
14
- import { GalleryPagination as y } from "../GalleryPagination/GalleryPagination.es.js";
15
- const C = [g], D = ({ images: r, label: n, className: s, pagination: W = "plain" }) => {
16
- const { activeIndex: l, handleSlideTo: t, handleSlideChange: p, onSwiperInit: d, handleSwiperResize: h, handleUserInteraction: o } = N(3e3), m = w(
17
- (a) => {
18
- o(), t(a);
11
+ import r from "../../components/ImageGallery/imageGallery.module.css";
12
+ import d from "../../styles/utils.module.css";
13
+ import { Label as b } from "../Label/Label.es.js";
14
+ import { ImageGalleryPagination as k } from "./components/ImageGalleryPagination/ImageGalleryPagination.es.js";
15
+ import { GalleryPagination as p } from "../GalleryPagination/GalleryPagination.es.js";
16
+ const x = [N], F = ({ images: a, label: m, className: h, type: i = "primary" }) => {
17
+ const { activeIndex: n, handleSlideTo: c, handleSlideChange: S, onSwiperInit: g, handleSwiperResize: u, handleUserInteraction: o } = P(3e3), l = y(
18
+ (t) => {
19
+ o(), c(t);
19
20
  },
20
- [o, t]
21
+ [o, c]
21
22
  );
22
- return /* @__PURE__ */ S("div", { className: v(i.root, s), children: [
23
- n && /* @__PURE__ */ e("div", { className: i.labelWrap, children: /* @__PURE__ */ e(I, { color: "black", size: "sm", children: n }) }),
24
- /* @__PURE__ */ e(
25
- f,
26
- {
27
- onSwiper: d,
28
- onResize: h,
29
- onSlideChange: p,
30
- onTouchStart: o,
31
- onTouchEnd: o,
32
- modules: C,
33
- spaceBetween: 0,
34
- slidesPerView: 1,
35
- className: i.swiper,
36
- children: r.map((a, c) => /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: i.imageContainer, children: /* @__PURE__ */ e("div", { className: i.imageWrapper, children: /* @__PURE__ */ e(
37
- "img",
23
+ return /* @__PURE__ */ s(
24
+ "div",
25
+ {
26
+ className: C(r.root, h, {
27
+ [r.primary]: i === "primary",
28
+ [r.secondary]: i === "secondary"
29
+ }),
30
+ children: [
31
+ m && /* @__PURE__ */ e("div", { className: r.labelWrap, children: /* @__PURE__ */ e(b, { color: "black", size: "sm", children: m }) }),
32
+ /* @__PURE__ */ e(
33
+ v,
38
34
  {
39
- src: a,
40
- alt: "product image",
41
- className: i.image,
42
- onClick: o
43
- },
44
- c
45
- ) }) }) }, c))
46
- }
47
- ),
48
- /* @__PURE__ */ e(P, { images: r, activeIndex: l, onSelect: m }),
49
- /* @__PURE__ */ e(y, { count: r.length, activeIndex: l, onSelect: m })
50
- ] });
35
+ onSwiper: g,
36
+ onResize: u,
37
+ onSlideChange: S,
38
+ onTouchStart: o,
39
+ onTouchEnd: o,
40
+ modules: x,
41
+ spaceBetween: 0,
42
+ slidesPerView: 1,
43
+ className: r.swiper,
44
+ children: a.map((t, f) => /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e("div", { className: r.imageContainer, children: /* @__PURE__ */ e("div", { className: r.imageWrapper, children: /* @__PURE__ */ e(
45
+ "img",
46
+ {
47
+ src: t,
48
+ alt: "product image",
49
+ width: i === "primary" ? 600 : 492,
50
+ height: i === "primary" ? 600 : 389,
51
+ className: r.image,
52
+ onClick: o
53
+ }
54
+ ) }) }) }, f))
55
+ }
56
+ ),
57
+ i === "primary" ? /* @__PURE__ */ s(w, { children: [
58
+ /* @__PURE__ */ e(
59
+ k,
60
+ {
61
+ images: a,
62
+ className: d.hideOnMobile,
63
+ activeIndex: n,
64
+ onSelect: l
65
+ }
66
+ ),
67
+ /* @__PURE__ */ e(
68
+ p,
69
+ {
70
+ count: a.length,
71
+ activeIndex: n,
72
+ className: d.hideOnDesktop,
73
+ onSelect: l
74
+ }
75
+ )
76
+ ] }) : /* @__PURE__ */ e(p, { count: a.length, activeIndex: n, onSelect: l })
77
+ ]
78
+ }
79
+ );
51
80
  };
52
81
  export {
53
- D as ImageGallery
82
+ F as ImageGallery
54
83
  };
@@ -1 +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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("../../../../utils/cn/cn.cjs.js"),t=require("../../../../src/components/ImageGallery/components/ImageGalleryPagination/imageGalleryPagination.module.css"),o=({images:l,activeIndex:c,className:i,onSelect:r})=>n.jsx("div",{className:s.cn(t.root,i),children:l.map((a,e)=>n.jsx("button",{type:"button",className:s.cn(t.thumbnailButton,{[t.active]:e===c}),onClick:()=>r(e),children:n.jsx("img",{src:a,alt:`thumbnail ${e+1}`,className:t.thumbnailImage})},a))});exports.ImageGalleryPagination=o;
@@ -3,6 +3,7 @@ import { default as React } from 'react';
3
3
  type ImageGalleryPaginationProps = {
4
4
  images: string[];
5
5
  activeIndex: number;
6
+ className?: string;
6
7
  onSelect: (index: number) => void;
7
8
  };
8
9
  export declare const ImageGalleryPagination: React.FC<ImageGalleryPaginationProps>;
@@ -1,16 +1,21 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { cn as e } from "../../../../utils/cn/cn.es.js";
2
+ import { cn as n } from "../../../../utils/cn/cn.es.js";
3
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(
4
+ const p = ({
5
+ images: r,
6
+ activeIndex: l,
7
+ className: e,
8
+ onSelect: i
9
+ }) => /* @__PURE__ */ m("div", { className: n(t.root, e), children: r.map((o, a) => /* @__PURE__ */ m(
5
10
  "button",
6
11
  {
7
12
  type: "button",
8
- className: e(t.thumbnailButton, { [t.active]: a === r }),
9
- onClick: () => l(a),
13
+ className: n(t.thumbnailButton, { [t.active]: a === l }),
14
+ onClick: () => i(a),
10
15
  children: /* @__PURE__ */ m("img", { src: o, alt: `thumbnail ${a + 1}`, className: t.thumbnailImage })
11
16
  },
12
17
  o
13
18
  )) });
14
19
  export {
15
- u as ImageGalleryPagination
20
+ p as ImageGalleryPagination
16
21
  };
@@ -1,6 +1,3 @@
1
- .root {
2
- display: none;
3
- }
4
1
  @media (width > 768px) {
5
2
  .root {
6
3
  display: flex;
@@ -1,15 +1,24 @@
1
1
  .root {
2
2
  position: relative;
3
- padding: 18px 0 13px 0;
4
3
  display: flex;
5
4
  max-width: 100%;
6
5
  flex-direction: column;
7
6
  align-items: center;
8
7
  justify-content: flex-start;
9
8
  border-radius: var(--border-radius-md);
9
+ }
10
+
11
+ .primary {
12
+ padding: 18px 0 13px 0;
10
13
  background-color: var(--color-bg-neutral-light);
11
14
  }
12
15
 
16
+ .secondary {
17
+ padding: 10px 0 5px;
18
+ background-color: var(--color-bg-base-light);
19
+ border: 1px solid var(--color-neutral-200);
20
+ }
21
+
13
22
  .labelWrap {
14
23
  width: 100%;
15
24
  display: flex;
@@ -26,34 +35,44 @@
26
35
  padding: 18px 0 14px 0;
27
36
  }
28
37
 
38
+ .secondary .imageContainer {
39
+ padding: 0;
40
+ }
41
+
29
42
  .imageWrapper {
30
43
  width: 100%;
31
44
  aspect-ratio: 1;
32
45
  }
33
46
 
47
+ .secondary .imageWrapper {
48
+ aspect-ratio: 1 / 0.8;
49
+ }
50
+
34
51
  .image {
35
52
  width: 100%;
36
53
  height: 100%;
54
+ display: block;
55
+ margin: 0 auto;
37
56
  object-fit: contain;
57
+ object-position: center;
38
58
  }
39
59
 
40
60
  @media (width <= 768px) {
41
61
  .root {
42
62
  padding: 16px 0;
43
63
  }
44
-
64
+ .root.secondary {
65
+ padding: 10px 0 5px;
66
+ }
45
67
  .labelWrap {
46
68
  padding: 0 16px;
47
69
  }
48
-
49
70
  .swiper {
50
71
  margin-bottom: 0;
51
72
  }
52
-
53
73
  .imageWrapper {
54
74
  height: auto;
55
75
  }
56
-
57
76
  .image {
58
77
  aspect-ratio: 1 / 1;
59
78
  }
@@ -0,0 +1,14 @@
1
+ .hideOnDesktop {
2
+ display: none;
3
+ }
4
+ .hideOnMobile {
5
+ display: inherit;
6
+ }
7
+ @media (width <= 768px) {
8
+ .hideOnDesktop {
9
+ display: inherit;
10
+ }
11
+ .hideOnMobile {
12
+ display: none;
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.2.64",
3
+ "version": "0.2.65",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",