@bonprix-ds/react-show-more-list 1.1.2 → 1.1.4
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.js +1 -2
- package/dist/src/ShowMoreList.js +1 -2
- package/dist/src/ShowMoreListItem/ShowMoreListItem.js +1 -2
- package/dist/src/ShowMoreListItem/index.js +1 -2
- package/dist/src/ShowMoreListRoot.js +1 -2
- package/dist/src/useShowMoreListHeight.js +1 -2
- package/dist/src/useShowMoreListItems.js +1 -2
- package/dist/src/useShowMoreListStates.js +1 -2
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as default };
|
|
1
|
+
export { default } from "./src/ShowMoreList.js";
|
package/dist/src/ShowMoreList.js
CHANGED
|
@@ -2,10 +2,9 @@ import e from "./ShowMoreListItem/index.js";
|
|
|
2
2
|
import t from "./ShowMoreListRoot.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/ShowMoreList.tsx
|
|
6
6
|
var r = (e) => /* @__PURE__ */ n(t, { ...e });
|
|
7
7
|
r.displayName = "ShowMoreList", r.Item = e;
|
|
8
|
-
//#endregion
|
|
9
8
|
export { r as default };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=ShowMoreList.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx as e } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/ShowMoreListItem/ShowMoreListItem.tsx
|
|
5
5
|
var t = "bpds-show-more-list-item", n = ({ children: n }) => /* @__PURE__ */ e("li", {
|
|
6
6
|
"data-id": t,
|
|
7
7
|
children: n
|
|
8
8
|
});
|
|
9
9
|
n.displayName = "ShowMoreList.Item";
|
|
10
|
-
//#endregion
|
|
11
10
|
export { t as ITEM_DATA_ID, n as default };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=ShowMoreListItem.js.map
|
|
@@ -9,7 +9,7 @@ import { tv as s } from "tailwind-variants";
|
|
|
9
9
|
import c from "@bonprix-ds/react-button";
|
|
10
10
|
import { usePrefersReducedMotion as l, useTransitionAfterInitialRender as u } from "@bonprix-ds/utils";
|
|
11
11
|
import { warnDeprecated as d } from "@bonprix-ds/utils/deprecation";
|
|
12
|
-
|
|
12
|
+
// src/ShowMoreListRoot.tsx
|
|
13
13
|
var f = s({
|
|
14
14
|
slots: {
|
|
15
15
|
root: "preflight overflow-hidden",
|
|
@@ -101,7 +101,6 @@ var f = s({
|
|
|
101
101
|
});
|
|
102
102
|
};
|
|
103
103
|
p.displayName = "ShowMoreList";
|
|
104
|
-
//#endregion
|
|
105
104
|
export { p as default };
|
|
106
105
|
|
|
107
106
|
//# sourceMappingURL=ShowMoreListRoot.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as e, useLayoutEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
-
|
|
2
|
+
// src/useShowMoreListHeight.ts
|
|
3
3
|
var i = (e, t) => typeof e == "number" ? e : e?.includes("px") ? parseInt(e) : e?.includes("%") && t ? parseInt(e) / 100 * t : 0, a = ({ listRef: a, items: o, shownItems: s, previewHeight: c }) => {
|
|
4
4
|
let l = n(0), [u, d] = r("auto"), f = e(() => {
|
|
5
5
|
if (!a.current) return d("auto");
|
|
@@ -24,7 +24,6 @@ var i = (e, t) => typeof e == "number" ? e : e?.includes("px") ? parseInt(e) : e
|
|
|
24
24
|
return t.observe(e), () => t.disconnect();
|
|
25
25
|
}, [f, a]), { height: u };
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { i as calculatePreviewHeightInPx, a as default };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=useShowMoreListHeight.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITEM_DATA_ID as e } from "./ShowMoreListItem/ShowMoreListItem.js";
|
|
2
2
|
import { useEffect as t, useMemo as n, useState as r } from "react";
|
|
3
|
-
|
|
3
|
+
// src/useShowMoreListItems.ts
|
|
4
4
|
var i = ({ listRef: i, children: a }) => {
|
|
5
5
|
let [o, s] = r(), c = n(() => o?.length ?? 0, [o]);
|
|
6
6
|
return t(() => {
|
|
@@ -10,7 +10,6 @@ var i = ({ listRef: i, children: a }) => {
|
|
|
10
10
|
totalItems: c
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { i as default };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=useShowMoreListItems.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "react";
|
|
2
2
|
import { useInView as i } from "motion/react";
|
|
3
|
-
|
|
3
|
+
// src/useShowMoreListStates.ts
|
|
4
4
|
var a = ({ initiallyShownItems: e, totalItems: t }) => {
|
|
5
5
|
if (e >= t) return [t];
|
|
6
6
|
let n = Math.ceil(t / 2);
|
|
@@ -48,7 +48,6 @@ var a = ({ initiallyShownItems: e, totalItems: t }) => {
|
|
|
48
48
|
triggerNextState: b
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { a as calculateStates, o as default };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=useShowMoreListStates.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonprix-ds/react-show-more-list",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "ShowMoreList component, implemented in React, for the Bonprix Design System.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"provenance": true
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"
|
|
36
|
-
"@bonprix-ds/
|
|
37
|
-
"
|
|
35
|
+
"@bonprix-ds/react-button": "1.1.6",
|
|
36
|
+
"@bonprix-ds/utils": "0.6.0",
|
|
37
|
+
"motion": "14.6.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
+
"@bonprix-ds/vite-config": "0.0.0",
|
|
40
41
|
"@testing-library/dom": "10.4.2",
|
|
41
42
|
"@testing-library/react": "16.3.3",
|
|
42
43
|
"@types/react": "19.3.0",
|
|
43
|
-
"vite": "8.3.
|
|
44
|
-
"vitest": "5.0.5"
|
|
45
|
-
"@bonprix-ds/vite-config": "0.0.0"
|
|
44
|
+
"vite": "8.3.5",
|
|
45
|
+
"vitest": "5.0.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": "^19",
|