@bouko/react 2.9.0 → 2.9.2
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/tab.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn, css } from "@bouko/style";
|
|
3
|
-
export const TabItem = ({ name, icon, isActive }) => (_jsxs("div", { className: cn(styles, isActive && "bg-
|
|
3
|
+
export const TabItem = ({ name, icon, isActive }) => (_jsxs("div", { className: cn(styles, isActive && "!bg-surface-light text-primary hover:cursor-default"), children: [_jsx("div", { className: cn("duration-200", isActive && "text-accent"), children: icon }), name] }));
|
|
4
4
|
const styles = css({
|
|
5
5
|
base: "flex items-center gap-2 px-2 py-1 rounded-xs duration-200 cursor-pointer",
|
|
6
|
-
color: "bg-
|
|
7
|
-
text: "font-
|
|
6
|
+
color: "bg-surface-dark hover:bg-surface border border-border-dark",
|
|
7
|
+
text: "font-medium text-sm text-primary-dark"
|
|
8
8
|
});
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect } from "react";
|
|
2
2
|
import { useSearchParams } from "react-router-dom";
|
|
3
|
+
export const useSearchParam = (key) => {
|
|
4
|
+
const [params] = useSearchParams();
|
|
5
|
+
return params.get(key);
|
|
6
|
+
};
|
|
3
7
|
export function usePagination({ fetcher, pageSize }) {
|
|
4
8
|
const [params, setParams] = useSearchParams();
|
|
5
9
|
const [items, setItems] = useState([]);
|