@bbki.ng/components 1.5.34 → 1.5.37
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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -8
- package/dist/index.mjs +15 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -257,6 +257,7 @@ interface RandomRowsLayoutProps {
|
|
|
257
257
|
|
|
258
258
|
declare type ImageRenderer = (Img: ReactElement, index: number, col: number, randBool: boolean) => ReactNode;
|
|
259
259
|
interface GalleryProps extends Omit<RandomRowsLayoutProps, "classNames" | "cellsCount" | "cellRenderer"> {
|
|
260
|
+
className?: string;
|
|
260
261
|
images: ImgProps[];
|
|
261
262
|
children?: ReactNode;
|
|
262
263
|
imageRenderer?: ImageRenderer;
|
package/dist/index.js
CHANGED
|
@@ -376,7 +376,9 @@ var Error2 = (props) => {
|
|
|
376
376
|
return /* @__PURE__ */ import_react10.default.createElement(NoiseCover, {
|
|
377
377
|
color: "#ef4444",
|
|
378
378
|
className: "flex justify-center items-center text-white"
|
|
379
|
-
}, /* @__PURE__ */ import_react10.default.createElement("code",
|
|
379
|
+
}, /* @__PURE__ */ import_react10.default.createElement("code", {
|
|
380
|
+
className: "p-32"
|
|
381
|
+
}, error.name, ": ", error.message));
|
|
380
382
|
};
|
|
381
383
|
var ErrorBoundary = class extends import_react10.default.Component {
|
|
382
384
|
constructor(props) {
|
|
@@ -931,7 +933,8 @@ var Img = (props) => {
|
|
|
931
933
|
})
|
|
932
934
|
}), /* @__PURE__ */ import_react19.default.createElement("img", {
|
|
933
935
|
src: emptyDataURL,
|
|
934
|
-
className: (0, import_classnames10.default)("lqip-blur", "absolute", "h-full", "w-full", "transition-opacity",
|
|
936
|
+
className: (0, import_classnames10.default)("lqip-blur", "absolute", "h-full", "w-full", "transition-opacity", {
|
|
937
|
+
"opacity-100": !decoded,
|
|
935
938
|
"opacity-0": decoded
|
|
936
939
|
}),
|
|
937
940
|
style: { top: 0, left: 0 }
|
|
@@ -972,7 +975,7 @@ var generateRandomColNum = (total) => {
|
|
|
972
975
|
}
|
|
973
976
|
return colNumArr;
|
|
974
977
|
};
|
|
975
|
-
var RandomRowsLayout = (props) => {
|
|
978
|
+
var RandomRowsLayout = import_react20.default.memo((props) => {
|
|
976
979
|
const {
|
|
977
980
|
cellsCount,
|
|
978
981
|
cellRenderer,
|
|
@@ -983,7 +986,7 @@ var RandomRowsLayout = (props) => {
|
|
|
983
986
|
const indexRef = import_react20.default.useRef(0);
|
|
984
987
|
import_react20.default.useEffect(() => {
|
|
985
988
|
indexRef.current = 0;
|
|
986
|
-
});
|
|
989
|
+
}, []);
|
|
987
990
|
return /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
988
991
|
className: classNames8
|
|
989
992
|
}, colNums.map((colNum, row) => {
|
|
@@ -1002,7 +1005,9 @@ var RandomRowsLayout = (props) => {
|
|
|
1002
1005
|
}, cellRenderer(indexRef.current - 1, randBoolArr[col], col));
|
|
1003
1006
|
}));
|
|
1004
1007
|
}));
|
|
1005
|
-
}
|
|
1008
|
+
}, (prevProps, nextProps) => {
|
|
1009
|
+
return prevProps.cellsCount === nextProps.cellsCount;
|
|
1010
|
+
});
|
|
1006
1011
|
|
|
1007
1012
|
// src/img/Gallery.tsx
|
|
1008
1013
|
var defaultImageRenderer = (img, index, col) => {
|
|
@@ -1017,11 +1022,13 @@ var Gallery = (props) => {
|
|
|
1017
1022
|
const _a = props, {
|
|
1018
1023
|
images,
|
|
1019
1024
|
children,
|
|
1020
|
-
imageRenderer = defaultImageRenderer
|
|
1025
|
+
imageRenderer = defaultImageRenderer,
|
|
1026
|
+
className = ""
|
|
1021
1027
|
} = _a, rest = __objRest(_a, [
|
|
1022
1028
|
"images",
|
|
1023
1029
|
"children",
|
|
1024
|
-
"imageRenderer"
|
|
1030
|
+
"imageRenderer",
|
|
1031
|
+
"className"
|
|
1025
1032
|
]);
|
|
1026
1033
|
const renderImage = (index, isLargeImage, col) => {
|
|
1027
1034
|
const image = images[index];
|
|
@@ -1033,7 +1040,7 @@ var Gallery = (props) => {
|
|
|
1033
1040
|
})), index, col, isLargeImage);
|
|
1034
1041
|
};
|
|
1035
1042
|
return /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1036
|
-
className: "w-full flex justify-center"
|
|
1043
|
+
className: (0, import_classnames12.default)("w-full flex justify-center", className)
|
|
1037
1044
|
}, /* @__PURE__ */ import_react21.default.createElement(RandomRowsLayout, __spreadValues({
|
|
1038
1045
|
classNames: "mx-32 mt-128 max-w-screen-xl",
|
|
1039
1046
|
cellsCount: images.length,
|
package/dist/index.mjs
CHANGED
|
@@ -315,7 +315,9 @@ var Error2 = (props) => {
|
|
|
315
315
|
return /* @__PURE__ */ React11.createElement(NoiseCover, {
|
|
316
316
|
color: "#ef4444",
|
|
317
317
|
className: "flex justify-center items-center text-white"
|
|
318
|
-
}, /* @__PURE__ */ React11.createElement("code",
|
|
318
|
+
}, /* @__PURE__ */ React11.createElement("code", {
|
|
319
|
+
className: "p-32"
|
|
320
|
+
}, error.name, ": ", error.message));
|
|
319
321
|
};
|
|
320
322
|
var ErrorBoundary = class extends React11.Component {
|
|
321
323
|
constructor(props) {
|
|
@@ -873,7 +875,8 @@ var Img = (props) => {
|
|
|
873
875
|
})
|
|
874
876
|
}), /* @__PURE__ */ React18.createElement("img", {
|
|
875
877
|
src: emptyDataURL,
|
|
876
|
-
className: classnames("lqip-blur", "absolute", "h-full", "w-full", "transition-opacity",
|
|
878
|
+
className: classnames("lqip-blur", "absolute", "h-full", "w-full", "transition-opacity", {
|
|
879
|
+
"opacity-100": !decoded,
|
|
877
880
|
"opacity-0": decoded
|
|
878
881
|
}),
|
|
879
882
|
style: { top: 0, left: 0 }
|
|
@@ -914,7 +917,7 @@ var generateRandomColNum = (total) => {
|
|
|
914
917
|
}
|
|
915
918
|
return colNumArr;
|
|
916
919
|
};
|
|
917
|
-
var RandomRowsLayout = (props) => {
|
|
920
|
+
var RandomRowsLayout = React19.memo((props) => {
|
|
918
921
|
const {
|
|
919
922
|
cellsCount,
|
|
920
923
|
cellRenderer,
|
|
@@ -925,7 +928,7 @@ var RandomRowsLayout = (props) => {
|
|
|
925
928
|
const indexRef = React19.useRef(0);
|
|
926
929
|
React19.useEffect(() => {
|
|
927
930
|
indexRef.current = 0;
|
|
928
|
-
});
|
|
931
|
+
}, []);
|
|
929
932
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
930
933
|
className: classNames8
|
|
931
934
|
}, colNums.map((colNum, row) => {
|
|
@@ -944,7 +947,9 @@ var RandomRowsLayout = (props) => {
|
|
|
944
947
|
}, cellRenderer(indexRef.current - 1, randBoolArr[col], col));
|
|
945
948
|
}));
|
|
946
949
|
}));
|
|
947
|
-
}
|
|
950
|
+
}, (prevProps, nextProps) => {
|
|
951
|
+
return prevProps.cellsCount === nextProps.cellsCount;
|
|
952
|
+
});
|
|
948
953
|
|
|
949
954
|
// src/img/Gallery.tsx
|
|
950
955
|
var defaultImageRenderer = (img, index, col) => {
|
|
@@ -959,11 +964,13 @@ var Gallery = (props) => {
|
|
|
959
964
|
const _a = props, {
|
|
960
965
|
images,
|
|
961
966
|
children,
|
|
962
|
-
imageRenderer = defaultImageRenderer
|
|
967
|
+
imageRenderer = defaultImageRenderer,
|
|
968
|
+
className = ""
|
|
963
969
|
} = _a, rest = __objRest(_a, [
|
|
964
970
|
"images",
|
|
965
971
|
"children",
|
|
966
|
-
"imageRenderer"
|
|
972
|
+
"imageRenderer",
|
|
973
|
+
"className"
|
|
967
974
|
]);
|
|
968
975
|
const renderImage = (index, isLargeImage, col) => {
|
|
969
976
|
const image = images[index];
|
|
@@ -975,7 +982,7 @@ var Gallery = (props) => {
|
|
|
975
982
|
})), index, col, isLargeImage);
|
|
976
983
|
};
|
|
977
984
|
return /* @__PURE__ */ React20.createElement("div", {
|
|
978
|
-
className: "w-full flex justify-center"
|
|
985
|
+
className: classnames3("w-full flex justify-center", className)
|
|
979
986
|
}, /* @__PURE__ */ React20.createElement(RandomRowsLayout, __spreadValues({
|
|
980
987
|
classNames: "mx-32 mt-128 max-w-screen-xl",
|
|
981
988
|
cellsCount: images.length,
|