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