@gearbox-protocol/permissionless-ui 1.22.0-next.28 → 1.22.0-next.29

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.
Files changed (26) hide show
  1. package/dist/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
  2. package/dist/cjs/components/grid-td-cell/grid-td-cell.cjs +1 -1
  3. package/dist/cjs/components/layout/footer/footer.cjs +1 -1
  4. package/dist/cjs/components/layout/header/header.cjs +1 -1
  5. package/dist/cjs/components/network-icon/network-icon.cjs +1 -1
  6. package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
  7. package/dist/cjs/components/table/grid-table.cjs +1 -1
  8. package/dist/cjs/components/table/table-sm.cjs +1 -1
  9. package/dist/cjs/components/table/table.cjs +1 -1
  10. package/dist/esm/components/assets-list-cell/assets-list-cell.js +99 -24
  11. package/dist/esm/components/grid-td-cell/grid-td-cell.js +5 -5
  12. package/dist/esm/components/layout/footer/footer.js +1 -1
  13. package/dist/esm/components/layout/header/header.js +16 -16
  14. package/dist/esm/components/network-icon/network-icon.js +58 -38
  15. package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +72 -46
  16. package/dist/esm/components/table/grid-table.js +101 -84
  17. package/dist/esm/components/table/table-sm.js +9 -9
  18. package/dist/esm/components/table/table.js +4 -4
  19. package/dist/globals.css +1 -1
  20. package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +70 -6
  21. package/dist/types/components/network-icon/network-icon.d.ts +8 -1
  22. package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +27 -1
  23. package/dist/types/components/table/grid-table.d.ts +4 -0
  24. package/dist/types/components/typed-intl/index.d.ts +0 -2
  25. package/dist/types/utils/network-icons.d.ts +3 -1
  26. package/package.json +6 -6
@@ -1,5 +1,16 @@
1
+ import { default as React } from 'react';
1
2
  import { Address } from 'viem';
2
- export interface AssetsListCellProps {
3
+ type Mode = "default" | "cascade";
4
+ interface CommonOptions {
5
+ mode?: Mode;
6
+ showIconTooltip?: boolean;
7
+ otherTooltip?: React.ReactNode;
8
+ onOtherClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
9
+ }
10
+ /**
11
+ * Single asset cell props (new API)
12
+ */
13
+ export interface SingleAssetCellProps {
3
14
  /**
4
15
  * The asset address
5
16
  */
@@ -18,7 +29,6 @@ export interface AssetsListCellProps {
18
29
  explorerUrl?: string;
19
30
  /**
20
31
  * Icon symbol to use if it doesn't match the asset symbol
21
- * e.g., pool tokens don't have their own symbol and use underlying symbol
22
32
  */
23
33
  iconSymbol?: string;
24
34
  /**
@@ -30,19 +40,73 @@ export interface AssetsListCellProps {
30
40
  * Additional CSS classes
31
41
  */
32
42
  className?: string;
43
+ balances?: undefined;
44
+ tokensList?: undefined;
45
+ }
46
+ /**
47
+ * Multi-asset list cell props (legacy API, compatible with @gearbox-protocol/interface)
48
+ */
49
+ export interface MultiAssetCellProps {
50
+ /**
51
+ * List of asset balances (either objects with token address or plain addresses)
52
+ */
53
+ balances: Array<{
54
+ token: Address;
55
+ }> | Array<Address>;
56
+ /**
57
+ * Token data keyed by address
58
+ */
59
+ tokensList: Record<Address, {
60
+ symbol: string;
61
+ title?: string;
62
+ }>;
63
+ /**
64
+ * Maximum number of assets to display before showing "+N"
65
+ * @default 3
66
+ */
67
+ maxAssets?: number;
68
+ /**
69
+ * Size of token icons
70
+ * @default 24
71
+ */
72
+ iconSize?: number;
73
+ /**
74
+ * Display and interaction options
75
+ */
76
+ options?: CommonOptions;
77
+ /**
78
+ * Additional CSS classes
79
+ */
80
+ className?: string;
81
+ assetAddress?: undefined;
82
+ symbol?: undefined;
33
83
  }
84
+ export type AssetsListCellProps = SingleAssetCellProps | MultiAssetCellProps;
34
85
  /**
35
- * AssetsListCell component for displaying asset information in list views
36
- * Similar to TableCellAsset but without table cell wrapper, suitable for list/grid layouts
86
+ * AssetsListCell displays asset icons in a list/grid layout
87
+ *
88
+ * Supports two APIs:
89
+ * 1. Single asset (new): `<AssetsListCell assetAddress="0x..." symbol="ETH" />`
90
+ * 2. Multi-asset list (legacy): `<AssetsListCell balances={[...]} tokensList={...} />`
37
91
  *
38
92
  * @example
39
93
  * ```tsx
94
+ * // Single asset
40
95
  * <AssetsListCell
41
96
  * assetAddress="0x1234..."
42
97
  * symbol="ETH"
43
98
  * comment="Ethereum"
44
- * explorerUrl="https://etherscan.io"
99
+ * />
100
+ *
101
+ * // Multi-asset list (cascade mode)
102
+ * <AssetsListCell
103
+ * balances={[{ token: "0x1234..." }, { token: "0x5678..." }]}
104
+ * tokensList={{ "0x1234...": { symbol: "ETH" }, "0x5678...": { symbol: "USDC" } }}
105
+ * maxAssets={5}
106
+ * iconSize={24}
107
+ * options={{ mode: "cascade" }}
45
108
  * />
46
109
  * ```
47
110
  */
48
- export declare function AssetsListCell({ assetAddress, symbol, iconSymbol, comment, explorerUrl, iconSize, className, }: AssetsListCellProps): import("react/jsx-runtime").JSX.Element;
111
+ export declare function AssetsListCell(props: AssetsListCellProps): import("react/jsx-runtime").JSX.Element;
112
+ export {};
@@ -8,6 +8,9 @@
8
8
  * Props:
9
9
  * - `network` — network name (required).
10
10
  * - `size` — icon size in pixels (defaults to 20).
11
+ * - `isTest` — whether this is a test network (shows test badge).
12
+ * - `suffixSize` — size of the test badge (defaults to 12).
13
+ * - `showTooltip` — whether to show a tooltip with the network name.
11
14
  *
12
15
  * Note: Fetches icon from Gearbox static CDN based on network name.
13
16
  * Automatically falls back to default icon if network icon is not found.
@@ -16,6 +19,10 @@
16
19
  export interface NetworkIconProps {
17
20
  network: string | undefined;
18
21
  size?: number;
22
+ isTest?: boolean;
23
+ suffixSize?: number;
24
+ showTooltip?: boolean;
25
+ rounded?: boolean;
19
26
  className?: string;
20
27
  }
21
- export declare function NetworkIcon({ network, size, className, }: NetworkIconProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function NetworkIcon({ network, size, isTest, suffixSize, showTooltip, rounded, className, }: NetworkIconProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,17 @@
1
1
  import type * as React from "react";
2
+ /**
3
+ * Pool points tip for displaying points/rewards info
4
+ */
5
+ export interface PoolAPYPointsTip {
6
+ reward?: {
7
+ duration?: string;
8
+ condition?: string;
9
+ };
10
+ amount: string;
11
+ name: string;
12
+ tokenTitle?: string;
13
+ fullTip: string;
14
+ }
2
15
  export interface PoolAPYTooltipProps {
3
16
  /**
4
17
  * Trigger element
@@ -35,6 +48,10 @@ export interface PoolAPYTooltipProps {
35
48
  apy: number;
36
49
  token?: string;
37
50
  }>;
51
+ /**
52
+ * Pool points data
53
+ */
54
+ points?: Array<PoolAPYPointsTip>;
38
55
  /**
39
56
  * APY 7 days ago (for comparison)
40
57
  */
@@ -42,6 +59,15 @@ export interface PoolAPYTooltipProps {
42
59
  value?: number;
43
60
  loading?: boolean;
44
61
  };
62
+ /**
63
+ * External APY data
64
+ */
65
+ externalAPY?: {
66
+ totalValue: number;
67
+ apy: number;
68
+ name: string;
69
+ tooltip: string;
70
+ };
45
71
  /**
46
72
  * Tokens list for displaying token names
47
73
  */
@@ -56,4 +82,4 @@ export interface PoolAPYTooltipProps {
56
82
  /**
57
83
  * PoolAPYTooltip — a tooltip showing pool APY breakdown
58
84
  */
59
- export declare function PoolAPYTooltip({ children, totalAPY, extraAPYTotal, loading7DAgo, loading, baseAPY, extraAPY, apy7DAgo, tokensList, className, }: PoolAPYTooltipProps): import("react/jsx-runtime").JSX.Element;
85
+ export declare function PoolAPYTooltip({ children, totalAPY, extraAPYTotal, loading7DAgo, loading, baseAPY, extraAPY, points, apy7DAgo, externalAPY, tokensList, className, }: PoolAPYTooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -163,6 +163,7 @@ declare const GridTableRow: React.ForwardRefExoticComponent<GridTableRowProps &
163
163
  declare const gridTableHeadVariants: (props?: ({
164
164
  size?: "default" | "sm" | "lg" | null | undefined;
165
165
  justify?: "center" | "start" | "end" | null | undefined;
166
+ gapBefore?: "none" | "sm" | "md" | null | undefined;
166
167
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
167
168
  interface GridTableHeadProps extends ColProps, VariantProps<typeof gridTableHeadVariants> {
168
169
  children?: React.ReactNode;
@@ -179,6 +180,7 @@ interface GridTableHeadProps extends ColProps, VariantProps<typeof gridTableHead
179
180
  * - `span` — number of columns to span (defaults to 1).
180
181
  * - `size` — cell size variant: "sm", "default", "lg" (defaults to "default").
181
182
  * - `justify` — content alignment: "start", "center", "end" (defaults to "start").
183
+ * - `gapBefore` — extra left padding for visual separation ("sm" | "md" | "none"). Uses padding so hover covers the gap.
182
184
  *
183
185
  * Note: Automatically applies border, muted text color, and medium font weight.
184
186
  */
@@ -186,6 +188,7 @@ declare const GridTableHead: React.ForwardRefExoticComponent<GridTableHeadProps
186
188
  declare const gridTableCellVariants: (props?: ({
187
189
  size?: "default" | "sm" | "lg" | null | undefined;
188
190
  textAlign?: "left" | "center" | "right" | null | undefined;
191
+ gapBefore?: "none" | "sm" | "md" | null | undefined;
189
192
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
190
193
  interface GridTableCellProps extends ColProps, VariantProps<typeof gridTableCellVariants> {
191
194
  children?: React.ReactNode;
@@ -202,6 +205,7 @@ interface GridTableCellProps extends ColProps, VariantProps<typeof gridTableCell
202
205
  * - `span` — number of columns to span (defaults to 1).
203
206
  * - `size` — cell size variant: "sm", "default", "lg" (defaults to "default").
204
207
  * - `textAlign` — text alignment: "left", "center", "right".
208
+ * - `gapBefore` — extra left padding for visual separation ("sm" | "md" | "none"). Uses padding so hover covers the gap.
205
209
  *
206
210
  * Note: Automatically applies appropriate padding based on size variant.
207
211
  *
@@ -6,8 +6,6 @@ export type Values = FormattedMessageProps["values"];
6
6
  export type LocaleKeys = string;
7
7
  export interface FormattedMessageTypedProps {
8
8
  messageId: LocaleKeys;
9
- /** @deprecated Use messageId instead */
10
- id?: LocaleKeys;
11
9
  values?: Values;
12
10
  defaultMessage?: string;
13
11
  }
@@ -1,6 +1,8 @@
1
1
  import { NetworkType } from '@gearbox-protocol/sdk';
2
2
  /**
3
- * Alias for backward compatibility
3
+ * Known network icons type.
4
+ * Accepts any NetworkType from SDK plus "AllNetworks" and arbitrary strings
5
+ * for forward compatibility with new networks.
4
6
  */
5
7
  export type NetworkIcons = NetworkType | "AllNetworks";
6
8
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.22.0-next.28",
3
+ "version": "1.22.0-next.29",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",
@@ -82,10 +82,10 @@
82
82
  "react-markdown": "^9.0.3",
83
83
  "react-markdown-math": "^1.0.2",
84
84
  "react-slick": "^0.31.0",
85
- "slick-carousel": "^1.8.1",
86
85
  "remark-gfm": "^4.0.0",
86
+ "slick-carousel": "^1.8.1",
87
87
  "sonner": "^2.0.7",
88
- "tailwind-merge": "^2.6.0",
88
+ "tailwind-merge": "^3.4.0",
89
89
  "tailwindcss-animate": "^1.0.7"
90
90
  },
91
91
  "peerDependencies": {
@@ -127,7 +127,7 @@
127
127
  "@commitlint/cli": "^20.1.0",
128
128
  "@commitlint/config-conventional": "^20.0.0",
129
129
  "@gearbox-protocol/biome-config": "^1.0.2",
130
- "@gearbox-protocol/sdk": "*",
130
+ "@gearbox-protocol/sdk": "^12.6.7",
131
131
  "@rollup/plugin-typescript": "^12.3.0",
132
132
  "@storybook/addon-a11y": "^10.0.8",
133
133
  "@storybook/addon-docs": "^10.0.8",
@@ -139,9 +139,9 @@
139
139
  "@tanstack/react-query": "^5.64.1",
140
140
  "@types/cross-spawn": "^6.0.6",
141
141
  "@types/luxon": "^3.4.2",
142
- "@types/react-slick": "^0.23.13",
143
142
  "@types/react": "^19.1.16",
144
143
  "@types/react-dom": "^19.1.9",
144
+ "@types/react-slick": "^0.23.13",
145
145
  "@vitejs/plugin-react": "^5.1.1",
146
146
  "@vitest/browser-playwright": "^4.0.14",
147
147
  "@vitest/coverage-v8": "^4.0.14",
@@ -168,7 +168,7 @@
168
168
  "tailwind-scrollbar": "^4.0.2",
169
169
  "tailwindcss": "^4.1.14",
170
170
  "typescript": "^5.9.3",
171
- "viem": "^2.39.0",
171
+ "viem": "^2.45.3",
172
172
  "vite": "^6.3.5",
173
173
  "vite-plugin-dts": "^4.5.4",
174
174
  "vite-tsconfig-paths": "^5.1.4",