@gearbox-protocol/ui-kit 3.10.0 → 3.10.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.
@@ -16,63 +16,63 @@ interface ColumnHeaderOptions {
16
16
  *
17
17
  * Used in both charts and client-v3.
18
18
  */
19
- export declare function poolColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
19
+ export declare function poolColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
20
20
  renderDescription?: (ctx: PoolTableCellContext<P, T>) => React.ReactNode;
21
21
  /** Custom pool name formatter. Defaults to "TOKEN vN" for v3 pools. */
22
22
  getPoolName?: (ctx: PoolTableCellContext<P, T>) => string;
23
23
  width?: string;
24
- }): PoolTableColumnDef<P, T>;
24
+ }): PoolTableColumnDef<P, T, S>;
25
25
  /**
26
26
  * Total supply column — shows total expected liquidity in USD and native token.
27
27
  *
28
28
  * Used in both charts and client-v3.
29
29
  */
30
- export declare function supplyColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
30
+ export declare function supplyColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
31
31
  width?: string;
32
- sortField?: string;
32
+ sortField?: S;
33
33
  hideOnMedium?: boolean;
34
- }): PoolTableColumnDef<P, T>;
34
+ }): PoolTableColumnDef<P, T, S>;
35
35
  /**
36
36
  * Supply APY column — shows compound APY with tooltip breakdown.
37
37
  *
38
38
  * Used in both charts and client-v3.
39
39
  */
40
- export declare function supplyApyColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
40
+ export declare function supplyApyColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
41
41
  width?: string;
42
- sortField?: string;
43
- }): PoolTableColumnDef<P, T>;
42
+ sortField?: S;
43
+ }): PoolTableColumnDef<P, T, S>;
44
44
  /**
45
45
  * Total borrowed column — shows total borrowed in USD and native token.
46
46
  *
47
47
  * Used in both charts and client-v3.
48
48
  */
49
- export declare function borrowedColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
49
+ export declare function borrowedColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
50
50
  width?: string;
51
- }): PoolTableColumnDef<P, T>;
51
+ }): PoolTableColumnDef<P, T, S>;
52
52
  /**
53
53
  * Borrow APY column — formatted borrow rate (`percentageTemplate`: **basis points**, 10_000 = 100%).
54
54
  *
55
55
  * Prefer `pool.borrowAPY` when the backend (or adapter) fills it; otherwise pass `getBorrowRate`.
56
56
  */
57
- export declare function borrowApyColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
57
+ export declare function borrowApyColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
58
58
  width?: string;
59
59
  /** Custom getter for borrow rate (basis points). Used when `pool.borrowAPY` is undefined. */
60
60
  getBorrowRate?: (pool: P) => number;
61
- }): PoolTableColumnDef<P, T>;
61
+ }): PoolTableColumnDef<P, T, S>;
62
62
  /**
63
63
  * Utilization column — `pool.utilization` (0–100) with a progress bar.
64
64
  */
65
- export declare function utilizationColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
65
+ export declare function utilizationColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
66
66
  width?: string;
67
- sortField?: string;
68
- }): PoolTableColumnDef<P, T>;
67
+ sortField?: S;
68
+ }): PoolTableColumnDef<P, T, S>;
69
69
  /**
70
70
  * Collateral / assets column — shows a list of collateral asset icons.
71
71
  *
72
72
  * Default: reads `pool.collateralTokens` and renders {@link AssetsListCell}.
73
73
  * Override with `cell` / `mobileCell` for custom asset shapes (e.g. client-v3 quota objects).
74
74
  */
75
- export declare function collateralColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
75
+ export declare function collateralColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
76
76
  width?: string;
77
77
  gapBefore?: "sm" | "md" | "none";
78
78
  cell?: (ctx: PoolTableCellContext<P, T>) => React.ReactNode;
@@ -81,21 +81,21 @@ export declare function collateralColumn<P extends PoolDTO = PoolDTO, T extends
81
81
  /** @default 5 */
82
82
  maxAssets?: number;
83
83
  options?: MultiAssetCellProps["options"];
84
- }): PoolTableColumnDef<P, T>;
84
+ }): PoolTableColumnDef<P, T, S>;
85
85
  /**
86
86
  * User balance column (client-v3 style) — USD + amount in pool token.
87
87
  *
88
88
  * Default: `pool.userBalanceInUSD`, `pool.userBalance`, `pool.poolTokenSymbol` (and underlying decimals for formatting).
89
89
  */
90
- export declare function balanceColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(options?: ColumnHeaderOptions & {
90
+ export declare function balanceColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(options?: ColumnHeaderOptions & {
91
91
  width?: string;
92
92
  className?: string;
93
93
  headerClassName?: string;
94
- sortField?: string;
94
+ sortField?: S;
95
95
  cell?: (ctx: PoolTableCellContext<P, T>) => React.ReactNode;
96
- }): PoolTableColumnDef<P, T>;
96
+ }): PoolTableColumnDef<P, T, S>;
97
97
  /**
98
98
  * Generic custom column — convenience helper to create a column with minimal boilerplate.
99
99
  */
100
- export declare function customColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>(def: PoolTableColumnDef<P, T>): PoolTableColumnDef<P, T>;
100
+ export declare function customColumn<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>(def: PoolTableColumnDef<P, T, S>): PoolTableColumnDef<P, T, S>;
101
101
  export {};
@@ -30,4 +30,4 @@ import { PoolDTO, PoolTableProps } from './types';
30
30
  * <PoolTable columns={columns} rows={rows} loading={isLoading} sort={sort} />
31
31
  * ```
32
32
  */
33
- export declare function PoolTable<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo>({ columns, rows, loading, partialLoading, error, emptyContent, skeletonRows, rowHeight, size, mobileColumnsXs, mobileColumnsMd, className, wrapperClassName, sort, rowTestId, loaderTestId, }: PoolTableProps<P, T>): import("react/jsx-runtime").JSX.Element | null;
33
+ export declare function PoolTable<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string>({ columns, rows, loading, partialLoading, error, emptyContent, skeletonRows, rowHeight, size, mobileColumnsXs, mobileColumnsMd, className, wrapperClassName, sort, rowTestId, loaderTestId, }: PoolTableProps<P, T, S>): import("react/jsx-runtime").JSX.Element | null;
@@ -68,11 +68,11 @@ export interface PoolTableCellContext<P extends PoolDTO = PoolDTO, T extends Tok
68
68
  /** Whether the current viewport is mobile. */
69
69
  isMobile?: boolean;
70
70
  }
71
- export interface PoolTableColumnSortDef {
72
- field: string;
71
+ export interface PoolTableColumnSortDef<S extends string = string> {
72
+ field: S;
73
73
  defaultDirection?: "asc" | "desc";
74
74
  }
75
- export interface PoolTableColumnDef<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo> {
75
+ export interface PoolTableColumnDef<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string> {
76
76
  id: string;
77
77
  header: React.ReactNode | ((sort: PoolTableColumnSortState | undefined) => React.ReactNode);
78
78
  headerTip?: React.ReactNode;
@@ -84,7 +84,7 @@ export interface PoolTableColumnDef<P extends PoolDTO = PoolDTO, T extends Token
84
84
  width?: string;
85
85
  align?: "left" | "right" | "center";
86
86
  gapBefore?: "sm" | "md" | "none";
87
- sort?: PoolTableColumnSortDef;
87
+ sort?: PoolTableColumnSortDef<S>;
88
88
  hideOnMedium?: boolean;
89
89
  className?: string;
90
90
  }
@@ -101,8 +101,8 @@ export interface PoolTableRowDTO<P extends PoolDTO = PoolDTO, T extends TokenMet
101
101
  href?: string;
102
102
  loading?: boolean;
103
103
  }
104
- export interface PoolTableProps<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo> {
105
- columns: Array<PoolTableColumnDef<P, T>>;
104
+ export interface PoolTableProps<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo, S extends string = string> {
105
+ columns: Array<PoolTableColumnDef<P, T, S>>;
106
106
  rows: Array<PoolTableRowDTO<P, T>> | undefined;
107
107
  loading?: boolean;
108
108
  partialLoading?: boolean;
@@ -119,10 +119,10 @@ export interface PoolTableProps<P extends PoolDTO = PoolDTO, T extends TokenMeta
119
119
  wrapperClassName?: string;
120
120
  sort?: {
121
121
  state: {
122
- field: string;
122
+ field: S;
123
123
  sort: "asc" | "desc";
124
124
  } | null;
125
- set: (field: string, startFromSort?: "asc" | "desc") => void;
125
+ set: (field: S, startFromSort?: "asc" | "desc") => void;
126
126
  };
127
127
  /** `data-testid` on each data row. Defaults to `pool-line` (see `poolTableTestIds`). */
128
128
  rowTestId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.10.0",
3
+ "version": "3.10.2",
4
4
  "description": "Internal UI components",
5
5
  "repository": "https://github.com/gearbox-protocol/ui-kit",
6
6
  "license": "MIT",