@bouko/react 2.8.2 → 2.8.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/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/tab.d.ts +7 -0
- package/dist/components/tab.js +8 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/router/params.d.ts +4 -0
- package/dist/hooks/router/params.js +11 -0
- package/package.json +42 -2
|
@@ -5,6 +5,7 @@ export { default as AbsoluteBox } from "./layout/absolute";
|
|
|
5
5
|
export { default as Heading } from "./heading/normal";
|
|
6
6
|
export { default as PageHeading } from "./heading/page";
|
|
7
7
|
export * from "./layout/flex";
|
|
8
|
+
export * from "./tab";
|
|
8
9
|
export { default as Pagination } from "./pagination";
|
|
9
10
|
export { default as Button } from "./button/normal";
|
|
10
11
|
export { default as IconButton } from "./button/icon";
|
package/dist/components/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { default as AbsoluteBox } from "./layout/absolute";
|
|
|
5
5
|
export { default as Heading } from "./heading/normal";
|
|
6
6
|
export { default as PageHeading } from "./heading/page";
|
|
7
7
|
export * from "./layout/flex";
|
|
8
|
+
export * from "./tab";
|
|
8
9
|
export { default as Pagination } from "./pagination";
|
|
9
10
|
export { default as Button } from "./button/normal";
|
|
10
11
|
export { default as IconButton } from "./button/icon";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, css } from "@bouko/style";
|
|
3
|
+
export const TabItem = ({ name, icon, isActive }) => (_jsxs("div", { className: cn(styles, isActive && "bg-background-light text-primary hover:cursor-default"), children: [_jsx("div", { className: cn("duration-200", isActive && "text-accent"), children: icon }), name] }));
|
|
4
|
+
const styles = css({
|
|
5
|
+
base: "flex items-center gap-2 px-2 py-1 rounded-xs duration-200 cursor-pointer",
|
|
6
|
+
color: "bg-background-light/70 hover:bg-background-light/90 border border-border-dark",
|
|
7
|
+
text: "font-semibold text-sm text-primary-darker"
|
|
8
|
+
});
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as useResize } from "./element/resize";
|
|
|
4
4
|
export { default as useInterval } from "./clock/interval";
|
|
5
5
|
export { default as useSound } from "./audio/sound";
|
|
6
6
|
export { withAudio, type DivRef, type AudioRef } from "./element/with-audio";
|
|
7
|
+
export * from "./router/params";
|
package/dist/hooks/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useSearchParams } from "react-router-dom";
|
|
2
|
+
export function usePagination(defaultPage = 1) {
|
|
3
|
+
const [params, setParams] = useSearchParams();
|
|
4
|
+
const raw = params.get("page");
|
|
5
|
+
const page = Math.max(1, Number(raw) || defaultPage);
|
|
6
|
+
const setPage = (nextPage) => {
|
|
7
|
+
params.set("page", String(Math.max(1, nextPage)));
|
|
8
|
+
setParams(params);
|
|
9
|
+
};
|
|
10
|
+
return { page, setPage };
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,48 +1,88 @@
|
|
|
1
1
|
{
|
|
2
2
|
|
|
3
3
|
"name": "@bouko/react",
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
"version": "2.8.4",
|
|
6
|
+
|
|
5
7
|
"main": "./dist/index.js",
|
|
8
|
+
|
|
6
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
|
|
7
11
|
"license": "MIT",
|
|
12
|
+
|
|
8
13
|
"files": [
|
|
14
|
+
|
|
9
15
|
"dist"
|
|
16
|
+
|
|
10
17
|
],
|
|
18
|
+
|
|
11
19
|
"publishConfig": {
|
|
20
|
+
|
|
12
21
|
"access": "public"
|
|
22
|
+
|
|
13
23
|
},
|
|
24
|
+
|
|
14
25
|
"author": "",
|
|
26
|
+
|
|
15
27
|
"description": "",
|
|
28
|
+
|
|
16
29
|
"engines": {},
|
|
17
30
|
|
|
18
31
|
"scripts": {
|
|
32
|
+
|
|
19
33
|
"build": "tsc"
|
|
34
|
+
|
|
20
35
|
},
|
|
21
36
|
|
|
22
37
|
"dependencies": {
|
|
38
|
+
|
|
23
39
|
"@bouko/audio": "^0.1.0",
|
|
40
|
+
|
|
24
41
|
"@bouko/form": "^0.5.7",
|
|
42
|
+
|
|
25
43
|
"@bouko/style": "^0.1.7",
|
|
44
|
+
|
|
26
45
|
"@bouko/time": "^0.1.3",
|
|
46
|
+
|
|
27
47
|
"@bouko/ts": "^0.3.5",
|
|
48
|
+
|
|
28
49
|
"@wavesurfer/react": "^1.0.11",
|
|
50
|
+
|
|
29
51
|
"clsx": "^2.1.1",
|
|
52
|
+
|
|
30
53
|
"file-type": "^21.0.0",
|
|
54
|
+
|
|
31
55
|
"framer-motion": "^12.23.6",
|
|
56
|
+
|
|
32
57
|
"ms": "^2.1.3",
|
|
58
|
+
|
|
33
59
|
"react-dropzone": "^14.3.8",
|
|
60
|
+
|
|
34
61
|
"tailwind-merge": "^3.3.1",
|
|
62
|
+
|
|
35
63
|
"tailwind-variants": "^1.0.0",
|
|
64
|
+
|
|
36
65
|
"wavesurfer.js": "^7.10.1",
|
|
66
|
+
|
|
37
67
|
"zod": "^4.0.13"
|
|
68
|
+
|
|
38
69
|
},
|
|
39
70
|
|
|
40
71
|
"devDependencies": {
|
|
72
|
+
|
|
41
73
|
"@types/node": "^24.3.1",
|
|
74
|
+
|
|
42
75
|
"@types/react": "^19.1.10",
|
|
76
|
+
|
|
43
77
|
"dependency-cruiser": "^17.0.1",
|
|
78
|
+
|
|
44
79
|
"react": "^19.1.1",
|
|
80
|
+
|
|
81
|
+
"react-router-dom": "^7.12.0",
|
|
82
|
+
|
|
45
83
|
"typescript": "^5.9.2"
|
|
84
|
+
|
|
46
85
|
}
|
|
47
86
|
|
|
48
|
-
}
|
|
87
|
+
}
|
|
88
|
+
|