@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.
@@ -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-background-light text-primary hover:cursor-default"), children: [_jsx("div", { className: cn("duration-200", isActive && "text-accent"), children: icon }), name] }));
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-background-light/70 hover:bg-background-light/90 border border-border-dark",
7
- text: "font-semibold text-sm text-primary-darker"
6
+ color: "bg-surface-dark hover:bg-surface border border-border-dark",
7
+ text: "font-medium text-sm text-primary-dark"
8
8
  });
@@ -7,6 +7,7 @@ type PaginationQuery = {
7
7
  pageSize: number;
8
8
  refresh?: boolean;
9
9
  };
10
+ export declare const useSearchParam: (key: string) => string | null;
10
11
  export declare function usePagination<T>({ fetcher, pageSize }: Options<T>): {
11
12
  items: T[];
12
13
  loading: boolean;
@@ -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([]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "2.9.0",
4
+ "version": "2.9.2",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",