@gearbox-protocol/ui-kit 3.11.2-next.1 → 3.12.0-next.1
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/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/columns.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/apy-feature/apy-feature.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/apy-feature/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.styles.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/cells/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/feature/feature.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/feature/feature.styles.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/feature/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/not-found-line.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/points-feature/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/points-feature/points-feature.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-view.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/strategies-table.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/cells.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/points-reward.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/rewards-tooltip.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/table.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/test-ids/index.cjs +1 -1
- package/dist/cjs/test-ids/strategies-table.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +8 -6
- package/dist/esm/components/block-sync/block-sync.js +8 -6
- package/dist/esm/components/checkbox/checkbox-labeled.js +6 -4
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +6 -4
- package/dist/esm/components/complex-input/complex-input.js +8 -6
- package/dist/esm/components/composites/index.js +72 -34
- package/dist/esm/components/composites/strategies-table/columns.js +176 -0
- package/dist/esm/components/composites/strategies-table/components/apy-feature/apy-feature.js +39 -0
- package/dist/esm/components/composites/strategies-table/components/apy-feature/index.js +5 -0
- package/dist/esm/components/composites/strategies-table/components/cells/cells.js +168 -0
- package/dist/esm/components/composites/strategies-table/components/cells/cells.styles.js +46 -0
- package/dist/esm/components/composites/strategies-table/components/cells/index.js +11 -0
- package/dist/esm/components/composites/strategies-table/components/feature/feature.js +39 -0
- package/dist/esm/components/composites/strategies-table/components/feature/feature.styles.js +43 -0
- package/dist/esm/components/composites/strategies-table/components/feature/index.js +6 -0
- package/dist/esm/components/composites/strategies-table/components/index.js +35 -0
- package/dist/esm/components/composites/strategies-table/components/not-found-line.js +19 -0
- package/dist/esm/components/composites/strategies-table/components/points-feature/index.js +6 -0
- package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js +69 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/index.js +11 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.js +30 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-view.js +78 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip.js +44 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +263 -0
- package/dist/esm/components/composites/strategies-table/components/strategies-table.js +249 -0
- package/dist/esm/components/composites/strategies-table/index.js +40 -0
- package/dist/esm/components/composites/strategies-table/types/cells.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/index.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/points-reward.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/rewards-tooltip.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/table.js +1 -0
- package/dist/esm/components/compound-apy/compound-apy.js +9 -7
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +6 -4
- package/dist/esm/components/index.js +682 -644
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +8 -6
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +6 -4
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +8 -6
- package/dist/esm/components/with-copy/with-copy.js +8 -6
- package/dist/esm/index.js +888 -848
- package/dist/esm/locale/en.json.js +26 -3
- package/dist/esm/test-ids/index.js +7 -5
- package/dist/esm/test-ids/strategies-table.js +8 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/columns.d.ts +50 -0
- package/dist/types/components/composites/strategies-table/components/apy-feature/apy-feature.d.ts +13 -0
- package/dist/types/components/composites/strategies-table/components/apy-feature/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/components/cells/cells.d.ts +38 -0
- package/dist/types/components/composites/strategies-table/components/cells/cells.styles.d.ts +7 -0
- package/dist/types/components/composites/strategies-table/components/cells/index.d.ts +2 -0
- package/dist/types/components/composites/strategies-table/components/feature/feature.d.ts +11 -0
- package/dist/types/components/composites/strategies-table/components/feature/feature.styles.d.ts +14 -0
- package/dist/types/components/composites/strategies-table/components/feature/index.d.ts +2 -0
- package/dist/types/components/composites/strategies-table/components/index.d.ts +7 -0
- package/dist/types/components/composites/strategies-table/components/not-found-line.d.ts +2 -0
- package/dist/types/components/composites/strategies-table/components/points-feature/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/components/points-feature/points-feature.d.ts +24 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/index.d.ts +4 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.d.ts +17 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-view.d.ts +10 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip.d.ts +7 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.d.ts +14 -0
- package/dist/types/components/composites/strategies-table/components/strategies-table.d.ts +35 -0
- package/dist/types/components/composites/strategies-table/index.d.ts +3 -0
- package/dist/types/components/composites/strategies-table/types/cells.d.ts +10 -0
- package/dist/types/components/composites/strategies-table/types/index.d.ts +4 -0
- package/dist/types/components/composites/strategies-table/types/points-reward.d.ts +11 -0
- package/dist/types/components/composites/strategies-table/types/rewards-tooltip.d.ts +53 -0
- package/dist/types/components/composites/strategies-table/types/table.d.ts +99 -0
- package/dist/types/locale/en.json.d.ts +27 -1
- package/dist/types/test-ids/index.d.ts +1 -0
- package/dist/types/test-ids/strategies-table.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LocaleKeys } from '../../../locale';
|
|
2
|
+
import { TokenMetaInfo } from '../../../types/common';
|
|
3
|
+
import { StrategyDTO, StrategyTableColumnDef } from './types';
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
interface ColumnHeaderOptions {
|
|
6
|
+
readonly header?: React.ReactNode;
|
|
7
|
+
readonly headerMessageId?: LocaleKeys;
|
|
8
|
+
/** Pass `null` to hide the default tip. */
|
|
9
|
+
readonly headerTip?: React.ReactNode | null;
|
|
10
|
+
readonly headerTipMessageId?: LocaleKeys;
|
|
11
|
+
readonly mobileTitle?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Strategy name column — displays network, output token, strategy name, RWA tag
|
|
15
|
+
* and zero-slippage tag.
|
|
16
|
+
*
|
|
17
|
+
* Used by client-v3 strategy list through the app-local StrategiesTable proxy.
|
|
18
|
+
*/
|
|
19
|
+
export declare function strategyColumn<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo, TSort extends string = string>(options?: ColumnHeaderOptions & {
|
|
20
|
+
readonly width?: string;
|
|
21
|
+
readonly mediumWidth?: string;
|
|
22
|
+
readonly sortField?: TSort;
|
|
23
|
+
}): StrategyTableColumnDef<S, T, TSort>;
|
|
24
|
+
/**
|
|
25
|
+
* Strategy rewards column — renders APR, points and rewards with the strategy
|
|
26
|
+
* rewards tooltip.
|
|
27
|
+
*
|
|
28
|
+
* Default sort field is `apy`; pass `sortField` when an app uses a different
|
|
29
|
+
* sort field name for the same column.
|
|
30
|
+
*/
|
|
31
|
+
export declare function strategyRewardsColumn<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo, TSort extends string = string>(options?: ColumnHeaderOptions & {
|
|
32
|
+
readonly width?: string;
|
|
33
|
+
readonly mediumWidth?: string;
|
|
34
|
+
readonly sortField?: TSort;
|
|
35
|
+
}): StrategyTableColumnDef<S, T, TSort>;
|
|
36
|
+
/**
|
|
37
|
+
* Max leverage column — displays formatted strategy max leverage.
|
|
38
|
+
*
|
|
39
|
+
* Widths default to the legacy client-v3 desktop and medium table layout.
|
|
40
|
+
*/
|
|
41
|
+
export declare function strategyLeverageColumn<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo, TSort extends string = string>(options?: ColumnHeaderOptions & {
|
|
42
|
+
readonly width?: string;
|
|
43
|
+
readonly mediumWidth?: string;
|
|
44
|
+
}): StrategyTableColumnDef<S, T, TSort>;
|
|
45
|
+
/**
|
|
46
|
+
* Generic custom strategy column — convenience helper to create a column with
|
|
47
|
+
* minimal boilerplate while preserving StrategiesTable DTO/context typing.
|
|
48
|
+
*/
|
|
49
|
+
export declare function customStrategyColumn<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo, TSort extends string = string>(def: StrategyTableColumnDef<S, T, TSort>): StrategyTableColumnDef<S, T, TSort>;
|
|
50
|
+
export {};
|
package/dist/types/components/composites/strategies-table/components/apy-feature/apy-feature.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FeatureProps } from '../feature';
|
|
3
|
+
export interface APYFeatureProps {
|
|
4
|
+
theme?: FeatureProps["theme"];
|
|
5
|
+
}
|
|
6
|
+
export declare function APYFeature({ theme, children, }: React.PropsWithChildren<APYFeatureProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export interface APYFeatureTooltipProps {
|
|
8
|
+
title?: React.ReactNode;
|
|
9
|
+
value?: React.ReactNode;
|
|
10
|
+
tip?: React.ReactNode;
|
|
11
|
+
theme?: FeatureProps["theme"];
|
|
12
|
+
}
|
|
13
|
+
export declare function APYFeatureTooltip({ theme, title, value, tip, }: APYFeatureTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './apy-feature';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StrategiesTableBonusApy, StrategiesTableTokenTitleSource } from '../../types/cells';
|
|
2
|
+
import { StrategiesTableDebtReward, StrategiesTablePointsReward } from '../../types/points-reward';
|
|
3
|
+
import { PointsFeatureProps } from '../points-feature';
|
|
4
|
+
export interface ZeroSlippageFeatureProps {
|
|
5
|
+
token: StrategiesTableTokenTitleSource;
|
|
6
|
+
disabledStyle: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function ZeroSlippageFeature({ token, disabledStyle, }: ZeroSlippageFeatureProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface RWAFeatureProps {
|
|
10
|
+
disabledStyle: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function RWAFeature({ disabledStyle }: RWAFeatureProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export interface StrategiesRewardsCellProps {
|
|
14
|
+
maxAPY: number;
|
|
15
|
+
bonusAPY: StrategiesTableBonusApy | undefined;
|
|
16
|
+
rewards: ReadonlyArray<StrategiesTablePointsReward>;
|
|
17
|
+
rewardRates: readonly (bigint | "soon")[];
|
|
18
|
+
debtRewards: ReadonlyArray<StrategiesTableDebtReward>;
|
|
19
|
+
debtRewardRates: readonly (bigint | "soon")[];
|
|
20
|
+
hasAPY: boolean;
|
|
21
|
+
hasRewards: boolean;
|
|
22
|
+
hasDebtRewards: boolean;
|
|
23
|
+
disabledStyle: boolean;
|
|
24
|
+
apyLoading: boolean;
|
|
25
|
+
apyFormat?: "feature" | "featureless";
|
|
26
|
+
}
|
|
27
|
+
export declare function StrategiesRewardsCell({ maxAPY, bonusAPY, rewards, rewardRates, debtRewards, debtRewardRates, hasAPY, hasRewards, hasDebtRewards, disabledStyle, apyLoading, apyFormat, }: StrategiesRewardsCellProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export interface StrategyPointsProps {
|
|
29
|
+
rewards: ReadonlyArray<StrategiesTablePointsReward>;
|
|
30
|
+
rewardRates: readonly (bigint | "soon")[];
|
|
31
|
+
debtRewards: ReadonlyArray<StrategiesTableDebtReward>;
|
|
32
|
+
debtRewardRates: readonly (bigint | "soon")[];
|
|
33
|
+
hasRewards: boolean;
|
|
34
|
+
hasDebtRewards: boolean;
|
|
35
|
+
disabledStyle: boolean;
|
|
36
|
+
theme?: PointsFeatureProps["theme"];
|
|
37
|
+
}
|
|
38
|
+
export declare function StrategyPoints({ rewards, rewardRates, debtRewards, debtRewardRates, hasRewards, hasDebtRewards, disabledStyle, theme, }: StrategyPointsProps): (import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[] | undefined)[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes } from 'react';
|
|
2
|
+
export interface DisabledWrapProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const DisabledWrap: ({ disabled, className, ...props }: DisabledWrapProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const Plus: ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const TitleGrid: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FeatureSize, FeatureTheme } from './feature.styles';
|
|
3
|
+
export interface FeatureProps {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
value?: React.ReactNode;
|
|
6
|
+
tip?: React.ReactNode;
|
|
7
|
+
theme?: FeatureTheme;
|
|
8
|
+
size?: FeatureSize;
|
|
9
|
+
padding?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function Feature({ title, value, tip, theme, size, padding, }: FeatureProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/types/components/composites/strategies-table/components/feature/feature.styles.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type FeatureTheme = "empty" | "light" | "dark";
|
|
4
|
+
export type FeatureSize = "sm" | "md";
|
|
5
|
+
declare const featureRootVariants: (props?: ({
|
|
6
|
+
theme?: "dark" | "light" | "empty" | null | undefined;
|
|
7
|
+
size?: "sm" | "md" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export type FeatureRootVariants = VariantProps<typeof featureRootVariants>;
|
|
10
|
+
export interface FeatureRootProps extends React.HTMLAttributes<HTMLDivElement>, FeatureRootVariants {
|
|
11
|
+
readonly padding?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const FeatureRoot: React.ForwardRefExoticComponent<FeatureRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export {};
|
package/dist/types/components/composites/strategies-table/components/points-feature/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './points-feature';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StrategiesTablePointsReward } from '../../types/points-reward';
|
|
3
|
+
import { FeatureProps } from '../feature';
|
|
4
|
+
export interface PointsFeatureProps {
|
|
5
|
+
reward: StrategiesTablePointsReward;
|
|
6
|
+
points: PointsValueProps["points"];
|
|
7
|
+
precision?: number;
|
|
8
|
+
theme?: FeatureProps["theme"];
|
|
9
|
+
}
|
|
10
|
+
export declare function PointsFeature({ reward, points, precision, theme, }: PointsFeatureProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function PointsFeatureTooltip({ reward, points, precision, tip, theme, }: PointsFeatureProps & {
|
|
12
|
+
tip?: React.ReactNode;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
interface PointsLabelProps {
|
|
15
|
+
reward: StrategiesTablePointsReward;
|
|
16
|
+
}
|
|
17
|
+
export declare function PointsLabel({ reward }: PointsLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
interface PointsValueProps {
|
|
19
|
+
points: bigint | "soon";
|
|
20
|
+
precision?: number;
|
|
21
|
+
startWith?: string;
|
|
22
|
+
endWith?: string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { RewardsTooltipTheme } from '../../types/rewards-tooltip';
|
|
3
|
+
declare const rewardsTooltipRootVariants: (props?: ({
|
|
4
|
+
theme?: "box" | "modal" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export type RewardsTooltipRootVariants = VariantProps<typeof rewardsTooltipRootVariants>;
|
|
7
|
+
export interface RewardsTooltipRootProps extends RewardsTooltipRootVariants {
|
|
8
|
+
readonly children: React.ReactNode;
|
|
9
|
+
readonly className?: string;
|
|
10
|
+
readonly theme?: RewardsTooltipTheme;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Root container for rewards tooltip: flex layout, padding, width (mobile-first),
|
|
14
|
+
* theme background, border, rounded, shadow.
|
|
15
|
+
*/
|
|
16
|
+
export declare const RewardsTooltipRoot: import('react').ForwardRefExoticComponent<RewardsTooltipRootProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RewardsTooltipContentProps } from './tooltip-content';
|
|
3
|
+
export interface RewardsTooltipViewProps {
|
|
4
|
+
readonly children: React.ReactElement;
|
|
5
|
+
readonly handleTooltipChangeState: () => void;
|
|
6
|
+
readonly handleTooltipChange: (next: boolean) => void;
|
|
7
|
+
readonly open: boolean;
|
|
8
|
+
readonly props: Omit<RewardsTooltipContentProps, "onClose">;
|
|
9
|
+
}
|
|
10
|
+
export declare function RewardsTooltipView({ children, handleTooltipChangeState, handleTooltipChange, open, props, }: RewardsTooltipViewProps): React.ReactElement | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RewardsTooltipContentProps } from './tooltip-content';
|
|
3
|
+
export interface RewardsTooltipProps extends Omit<RewardsTooltipContentProps, "onClose"> {
|
|
4
|
+
children: React.ReactElement;
|
|
5
|
+
}
|
|
6
|
+
export declare function RewardsTooltip({ children, ...props }: RewardsTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function RewardsTooltipHover({ children, ...props }: RewardsTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { RewardsTooltipCellInfo, RewardsTooltipTheme, RewardsTooltipTokenMeta } from '../../types/rewards-tooltip';
|
|
3
|
+
export interface RewardsTooltipContentProps {
|
|
4
|
+
cellInfo: RewardsTooltipCellInfo;
|
|
5
|
+
targetToken: Address;
|
|
6
|
+
apyList: Partial<Record<Address, number>> | undefined;
|
|
7
|
+
tokensList: Partial<Record<Address, RewardsTooltipTokenMeta>> | undefined;
|
|
8
|
+
strategyCreditManagers: Partial<Record<Address, {
|
|
9
|
+
readonly underlyingToken: Address;
|
|
10
|
+
}>>;
|
|
11
|
+
theme?: RewardsTooltipTheme;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function RewardsTooltipContent({ cellInfo, targetToken, apyList: baseAPYList, tokensList, strategyCreditManagers, onClose, theme, }: RewardsTooltipContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TokenMetaInfo } from '../../../../types/common';
|
|
2
|
+
import { StrategiesTableProps, StrategyDTO, StrategyTableRowDTO } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* StrategiesTable — configurable strategy table constructor component.
|
|
5
|
+
*
|
|
6
|
+
* Accepts an array of column definitions (built-in + custom) and prebuilt row
|
|
7
|
+
* DTOs. Handles loading skeletons, error states, empty state, disabled rows,
|
|
8
|
+
* mobile layout, row click callbacks, stable test ids, and partial loading out
|
|
9
|
+
* of the box.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import {
|
|
14
|
+
* StrategiesTable,
|
|
15
|
+
* strategyColumn,
|
|
16
|
+
* strategyRewardsColumn,
|
|
17
|
+
* strategyLeverageColumn,
|
|
18
|
+
* } from "@gearbox-protocol/ui-kit";
|
|
19
|
+
*
|
|
20
|
+
* const columns = [
|
|
21
|
+
* strategyColumn(),
|
|
22
|
+
* strategyRewardsColumn(),
|
|
23
|
+
* strategyLeverageColumn(),
|
|
24
|
+
* ];
|
|
25
|
+
*
|
|
26
|
+
* <StrategiesTable
|
|
27
|
+
* columns={columns}
|
|
28
|
+
* rows={rows}
|
|
29
|
+
* loading={isLoading}
|
|
30
|
+
* sort={sort}
|
|
31
|
+
* onStrategyClick={row => track(row.strategy)}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function StrategiesTable<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo, TSort extends string = string, R extends StrategyTableRowDTO<S, T> = StrategyTableRowDTO<S, T>>({ columns, rows, loading, partialLoading, error, emptyContent, skeletonRows, rowHeight, size, mobileColumnsXs, mobileColumnsMd, className, wrapperClassName, sort, onStrategyClick, rootTestId, rowTestId, loaderTestId, }: StrategiesTableProps<S, T, TSort, R>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bonus APY chip payload (`bonusAPY.value`) — structurally matches app `BonusAPYInfo`.
|
|
3
|
+
*/
|
|
4
|
+
export interface StrategiesTableBonusApy {
|
|
5
|
+
readonly value: number;
|
|
6
|
+
}
|
|
7
|
+
/** Minimal token shape for 0-slippage tooltip copy (display title only). */
|
|
8
|
+
export type StrategiesTableTokenTitleSource = {
|
|
9
|
+
readonly title?: string;
|
|
10
|
+
} | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DebtReward, PointsReward } from '@gearbox-protocol/sdk/rewards';
|
|
2
|
+
/**
|
|
3
|
+
* SDK points / debt rewards used across strategies-table composites.
|
|
4
|
+
*
|
|
5
|
+
* Use `string` as the reward-kind parameter — matches Gearbox app conventions
|
|
6
|
+
* (`PointsReward<string>`, `DebtReward<string>`).
|
|
7
|
+
*/
|
|
8
|
+
export type StrategiesTablePointsReward = PointsReward<string>;
|
|
9
|
+
export type StrategiesTableDebtReward = DebtReward<string>;
|
|
10
|
+
export type RewardsTooltipPointsReward = StrategiesTablePointsReward;
|
|
11
|
+
export type RewardsTooltipDebtReward = StrategiesTableDebtReward;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NetworkApyData } from '@gearbox-protocol/sdk/plugins/apy';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { StrategiesTableDebtReward, StrategiesTablePointsReward } from './points-reward';
|
|
4
|
+
/** Background variant for {@link RewardsTooltipRoot}. */
|
|
5
|
+
export type RewardsTooltipTheme = "modal" | "box";
|
|
6
|
+
/**
|
|
7
|
+
* Credit manager fields consumed by the tooltip (borrow rate label, extra-collateral lookup).
|
|
8
|
+
* Not replaced by a single SDK human/state type: call sites use app legacy CM shapes.
|
|
9
|
+
*/
|
|
10
|
+
export interface RewardsTooltipCreditManager {
|
|
11
|
+
readonly chainId: number;
|
|
12
|
+
readonly pool: Address;
|
|
13
|
+
readonly underlyingToken: Address;
|
|
14
|
+
readonly baseBorrowRate: number;
|
|
15
|
+
}
|
|
16
|
+
/** Matches Strategy "bonus APY" payloads passed from apps (`bonusAPY.value`). */
|
|
17
|
+
export interface RewardsTooltipBonusApy {
|
|
18
|
+
readonly value: number;
|
|
19
|
+
}
|
|
20
|
+
/** Per-chain APY snapshot from the SDK (`apySnapshot.apy`); tooltip only reads `extraCollateralAPYList`. */
|
|
21
|
+
export type RewardsTooltipApyListByNetwork = Partial<Record<number, NetworkApyData | undefined>> | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Domain-neutral cell payload for the rewards tooltip body (`RewardsTooltipContent`).
|
|
24
|
+
*
|
|
25
|
+
* Call sites may pass richer hook results as long as required fields match
|
|
26
|
+
* (structural typing).
|
|
27
|
+
*/
|
|
28
|
+
export interface RewardsTooltipCellInfo {
|
|
29
|
+
readonly maxAPY: number;
|
|
30
|
+
readonly minCreditManager: RewardsTooltipCreditManager | undefined;
|
|
31
|
+
readonly bonusAPY: RewardsTooltipBonusApy | undefined;
|
|
32
|
+
readonly rewards: readonly StrategiesTablePointsReward[];
|
|
33
|
+
readonly debtRewards: readonly StrategiesTableDebtReward[];
|
|
34
|
+
readonly rewardRates: readonly (bigint | "soon")[];
|
|
35
|
+
readonly debtRewardRates: readonly (bigint | "soon")[];
|
|
36
|
+
readonly apyLoading: boolean;
|
|
37
|
+
readonly hasPoints: boolean;
|
|
38
|
+
readonly isPointsWithAPY: boolean;
|
|
39
|
+
readonly hasAPY?: boolean;
|
|
40
|
+
readonly maxLeverage: bigint;
|
|
41
|
+
readonly apyListByNetwork: RewardsTooltipApyListByNetwork;
|
|
42
|
+
readonly quotaRate: bigint;
|
|
43
|
+
/**
|
|
44
|
+
* Present on some call sites that reuse hook-shaped objects; the tooltip body
|
|
45
|
+
* does not read these fields.
|
|
46
|
+
*/
|
|
47
|
+
readonly hasRewards?: boolean;
|
|
48
|
+
readonly hasDebtRewards?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** Minimal token row used to resolve borrow-label symbols in tips. */
|
|
51
|
+
export interface RewardsTooltipTokenMeta {
|
|
52
|
+
readonly title?: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { TokenMetaInfo } from '../../../../types/common';
|
|
3
|
+
import { RewardsTooltipCellInfo } from './rewards-tooltip';
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
export type StrategiesTableSortFields = "strategyName" | "apy";
|
|
6
|
+
type StrategiesTableSortDirection = "desc" | "asc";
|
|
7
|
+
export interface StrategiesTableSort<S extends string = StrategiesTableSortFields> {
|
|
8
|
+
readonly state: {
|
|
9
|
+
readonly field: S | string;
|
|
10
|
+
readonly sort: StrategiesTableSortDirection;
|
|
11
|
+
} | null;
|
|
12
|
+
readonly set: (field: S, startFromSort?: StrategiesTableSortDirection) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface StrategyDTO {
|
|
15
|
+
readonly chainId: number;
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly tokenOutAddress: Address;
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly network: string | undefined;
|
|
20
|
+
readonly strategyMarketType?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
export interface StrategyTableDelayedConfig {
|
|
23
|
+
readonly withdrawalPhantomToken: Address;
|
|
24
|
+
}
|
|
25
|
+
export interface StrategyTableCreditManager {
|
|
26
|
+
readonly underlyingToken: Address;
|
|
27
|
+
}
|
|
28
|
+
export interface StrategyTableRowDTO<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo> {
|
|
29
|
+
readonly strategy: S;
|
|
30
|
+
readonly href?: string;
|
|
31
|
+
readonly maxLeverage: bigint;
|
|
32
|
+
readonly tokensList: Partial<Record<Address, T>> | undefined;
|
|
33
|
+
readonly apyList: Partial<Record<Address, number>> | undefined;
|
|
34
|
+
readonly strategyCreditManagers: Partial<Record<Address, StrategyTableCreditManager>>;
|
|
35
|
+
readonly disabled?: boolean;
|
|
36
|
+
readonly disabledStyle?: boolean;
|
|
37
|
+
readonly disabledTooltip?: React.ReactNode;
|
|
38
|
+
readonly rewardsCellInfo: RewardsTooltipCellInfo;
|
|
39
|
+
readonly zeroSlippageTokens: Partial<Record<Address, boolean>> | undefined;
|
|
40
|
+
readonly delayedConfigs: ReadonlyArray<StrategyTableDelayedConfig> | undefined;
|
|
41
|
+
readonly loading?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export type StrategyTableRow = StrategyTableRowDTO;
|
|
44
|
+
export interface StrategyTableCellContext<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo> {
|
|
45
|
+
readonly row: StrategyTableRowDTO<S, T>;
|
|
46
|
+
readonly strategy: S;
|
|
47
|
+
readonly tokensList: Partial<Record<Address, T>> | undefined;
|
|
48
|
+
readonly targetToken: T | undefined;
|
|
49
|
+
readonly targetTokenAddress: Address;
|
|
50
|
+
readonly rewardsCellInfo: RewardsTooltipCellInfo;
|
|
51
|
+
readonly isMobile: boolean;
|
|
52
|
+
readonly isDesktop: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface StrategyTableColumnSortDef<S extends string = string> {
|
|
55
|
+
readonly field: S;
|
|
56
|
+
readonly defaultDirection?: StrategiesTableSortDirection;
|
|
57
|
+
}
|
|
58
|
+
export interface StrategyTableColumnSortState {
|
|
59
|
+
readonly direction: StrategiesTableSortDirection | null;
|
|
60
|
+
readonly onSort: () => void;
|
|
61
|
+
}
|
|
62
|
+
export interface StrategyTableColumnDef<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo, TSort extends string = string> {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly header: React.ReactNode | ((sort: StrategyTableColumnSortState | undefined) => React.ReactNode);
|
|
65
|
+
readonly headerTip?: React.ReactNode;
|
|
66
|
+
readonly headerClassName?: string;
|
|
67
|
+
readonly cell: (ctx: StrategyTableCellContext<S, T>) => React.ReactNode;
|
|
68
|
+
readonly mobileCell?: (ctx: StrategyTableCellContext<S, T>) => React.ReactNode;
|
|
69
|
+
readonly mobileTitle?: React.ReactNode;
|
|
70
|
+
readonly hideOnMobile?: boolean;
|
|
71
|
+
readonly width?: string;
|
|
72
|
+
readonly mediumWidth?: string;
|
|
73
|
+
readonly align?: "left" | "right" | "center";
|
|
74
|
+
readonly gapBefore?: "sm" | "md" | "none";
|
|
75
|
+
readonly sort?: StrategyTableColumnSortDef<TSort>;
|
|
76
|
+
readonly hideOnMedium?: boolean;
|
|
77
|
+
readonly className?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface StrategiesTableProps<S extends StrategyDTO = StrategyDTO, T extends TokenMetaInfo = TokenMetaInfo, TSort extends string = string, R extends StrategyTableRowDTO<S, T> = StrategyTableRowDTO<S, T>> {
|
|
80
|
+
readonly columns: ReadonlyArray<StrategyTableColumnDef<S, T, TSort>>;
|
|
81
|
+
readonly rows: ReadonlyArray<R> | null | undefined;
|
|
82
|
+
readonly loading?: boolean;
|
|
83
|
+
readonly partialLoading?: boolean;
|
|
84
|
+
readonly error?: Error | null;
|
|
85
|
+
readonly emptyContent?: React.ReactNode;
|
|
86
|
+
readonly skeletonRows?: number;
|
|
87
|
+
readonly rowHeight?: number;
|
|
88
|
+
readonly size?: "sm" | "default" | "lg";
|
|
89
|
+
readonly mobileColumnsXs?: number;
|
|
90
|
+
readonly mobileColumnsMd?: number;
|
|
91
|
+
readonly className?: string;
|
|
92
|
+
readonly wrapperClassName?: string;
|
|
93
|
+
readonly sort?: StrategiesTableSort<TSort>;
|
|
94
|
+
readonly onStrategyClick?: (row: R) => void;
|
|
95
|
+
readonly rootTestId?: string;
|
|
96
|
+
readonly rowTestId?: string;
|
|
97
|
+
readonly loaderTestId?: string;
|
|
98
|
+
}
|
|
99
|
+
export {};
|
|
@@ -122,7 +122,33 @@ declare const _default: {
|
|
|
122
122
|
"components.poolTable.notFound.list": "No Markets found",
|
|
123
123
|
"components.poolTable.notFound.description.dashboard": "Choose earn above.",
|
|
124
124
|
"components.poolTable.notFound.description.list": "Choose another chain or toggle Show All Markets",
|
|
125
|
-
"components.poolTable.externalApy.tooltipShort": "{value} APY boost when depositing via {name}"
|
|
125
|
+
"components.poolTable.externalApy.tooltipShort": "{value} APY boost when depositing via {name}",
|
|
126
|
+
|
|
127
|
+
"components.rewardsTooltip.without.title": "Without Leverage",
|
|
128
|
+
"components.rewardsTooltip.without.extra": "Extra APY",
|
|
129
|
+
"components.rewardsTooltip.without.extra.tip": "Any deposit through Gearbox",
|
|
130
|
+
"components.rewardsTooltip.with.title": "With {leverage} Leverage",
|
|
131
|
+
"components.rewardsTooltip.with.borrowRate": "{symbol} borrow rate",
|
|
132
|
+
"components.rewardsTooltip.with.quotaRate": "Quota rate",
|
|
133
|
+
"components.rewardsTooltip.with.bonusAPY.title": "Target Bonuses Yield",
|
|
134
|
+
"components.rewardsTooltip.with.bonusAPY.tip": "Expected Bonuses APY is calculated by the Asset Issuer and represents the expected value to be paid out in points.",
|
|
135
|
+
"components.rewardsTooltip.with.extra": "+ Extra APR",
|
|
136
|
+
"components.rewardsTooltip.button": "Click to show rewards details",
|
|
137
|
+
|
|
138
|
+
"components.strategiesTable.head.name": "Strategy",
|
|
139
|
+
"components.strategiesTable.head.rewards": "Rewards",
|
|
140
|
+
"components.strategiesTable.head.leverage": "Max Leverage",
|
|
141
|
+
"components.strategiesTable.head.earn": "You Can Earn",
|
|
142
|
+
"components.strategiesTable.body.notFound": "No strategy found",
|
|
143
|
+
"components.strategiesTable.line.disabled": "This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.",
|
|
144
|
+
"components.strategiesTable.line.name.disabled": "This strategy is currently not available",
|
|
145
|
+
"components.strategiesTable.line.points.tip": "For debt nominated in {symbol}",
|
|
146
|
+
"components.strategiesTable.line.points.tipAny": "For debt",
|
|
147
|
+
|
|
148
|
+
"components.strategiesTable.line.0slippage": "0-slippage",
|
|
149
|
+
"components.strategiesTable.line.0slippage.tip": "Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.",
|
|
150
|
+
"components.strategiesTable.line.rwa": "RWA",
|
|
151
|
+
"components.strategiesTable.line.rwa.tip": "This strategy is available on RWA market."
|
|
126
152
|
}
|
|
127
153
|
;
|
|
128
154
|
|