@conboai/storybook.components 0.2.74 → 0.2.76

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,7 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- declare function ImageBox({ images, imgIndex }: {
3
+ interface ImageBoxProps {
4
4
  images: string[];
5
5
  imgIndex?: number;
6
- }): React.JSX.Element;
6
+ isFirstPage: boolean;
7
+ setToFirstPage: (value: boolean) => void;
8
+ }
9
+ declare const ImageBox: React.FC<ImageBoxProps>;
7
10
  export default ImageBox;
@@ -59931,13 +59931,16 @@ const oee = {
59931
59931
  )
59932
59932
  }
59933
59933
  );
59934
- };
59935
- function pre({ images: t, imgIndex: e = 0 }) {
59936
- const [n, r] = je(e), [i, o] = je(!1), s = () => {
59937
- r((c) => (c + 1) % t.length);
59938
- }, l = () => {
59939
- r(
59940
- (c) => c === 0 ? t.length - 1 : c - 1
59934
+ }, pre = ({ images: t, imgIndex: e = 0, isFirstPage: n, setToFirstPage: r }) => {
59935
+ const [i, o] = je(e), [s, l] = je(!1);
59936
+ Le(() => {
59937
+ n && (o(0), r(!1));
59938
+ }, [n, r]);
59939
+ const c = () => {
59940
+ o((d) => (d + 1) % t.length);
59941
+ }, u = () => {
59942
+ o(
59943
+ (d) => d === 0 ? t.length - 1 : d - 1
59941
59944
  );
59942
59945
  };
59943
59946
  return /* @__PURE__ */ te.jsxs(te.Fragment, { children: [
@@ -59960,7 +59963,7 @@ function pre({ images: t, imgIndex: e = 0 }) {
59960
59963
  display: "flex",
59961
59964
  height: "100%",
59962
59965
  transition: "transform 0.2s ease-in-out",
59963
- transform: `translateX(-${n * 100 / t.length}%)`,
59966
+ transform: `translateX(-${i * 100 / t.length}%)`,
59964
59967
  width: `${t.length * 100}%`
59965
59968
  },
59966
59969
  children: [
@@ -59968,18 +59971,18 @@ function pre({ images: t, imgIndex: e = 0 }) {
59968
59971
  vee,
59969
59972
  {
59970
59973
  onModalClose: () => {
59971
- o(!1);
59974
+ l(!1);
59972
59975
  },
59973
- startIndex: n,
59974
- isModalOpen: i,
59976
+ startIndex: i,
59977
+ isModalOpen: s,
59975
59978
  images: t
59976
59979
  }
59977
59980
  ),
59978
- t.map((c, u) => /* @__PURE__ */ te.jsx(
59981
+ t.map((d, h) => /* @__PURE__ */ te.jsx(
59979
59982
  It,
59980
59983
  {
59981
59984
  onClick: () => {
59982
- o(!0);
59985
+ l(!0);
59983
59986
  },
59984
59987
  sx: {
59985
59988
  width: `${100 / t.length}%`,
@@ -59992,7 +59995,7 @@ function pre({ images: t, imgIndex: e = 0 }) {
59992
59995
  It,
59993
59996
  {
59994
59997
  component: "img",
59995
- src: c,
59998
+ src: d,
59996
59999
  sx: {
59997
60000
  width: "100%",
59998
60001
  height: "100%",
@@ -60002,7 +60005,7 @@ function pre({ images: t, imgIndex: e = 0 }) {
60002
60005
  }
60003
60006
  )
60004
60007
  },
60005
- u
60008
+ h
60006
60009
  ))
60007
60010
  ]
60008
60011
  }
@@ -60019,15 +60022,14 @@ function pre({ images: t, imgIndex: e = 0 }) {
60019
60022
  justifyContent: "center",
60020
60023
  gap: 4,
60021
60024
  children: [
60022
- /* @__PURE__ */ te.jsx(Hn, { onClick: l, children: /* @__PURE__ */ te.jsx(In, { icon: "arrowLeft", fill: Ng }) }),
60023
- /* @__PURE__ */ te.jsx(dn, { children: `${n + 1} / ${t.length}` }),
60024
- /* @__PURE__ */ te.jsx(Hn, { onClick: s, children: /* @__PURE__ */ te.jsx(In, { icon: "arrowRight", fill: Ng }) })
60025
+ /* @__PURE__ */ te.jsx(Hn, { onClick: u, children: /* @__PURE__ */ te.jsx(In, { icon: "arrowLeft", fill: Ng }) }),
60026
+ /* @__PURE__ */ te.jsx(dn, { children: `${i + 1} / ${t.length}` }),
60027
+ /* @__PURE__ */ te.jsx(Hn, { onClick: c, children: /* @__PURE__ */ te.jsx(In, { icon: "arrowRight", fill: Ng }) })
60025
60028
  ]
60026
60029
  }
60027
60030
  )
60028
60031
  ] });
60029
- }
60030
- const gre = ({
60032
+ }, gre = ({
60031
60033
  label: t,
60032
60034
  options: e,
60033
60035
  value: n,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conboai/storybook.components",
3
- "version": "0.2.74",
3
+ "version": "0.2.76",
4
4
  "main": "dist/storybook.components.mjs",
5
5
  "types": "dist/build/index.d.ts",
6
6
  "files": [