@gearbox-protocol/ui-kit 4.0.0-next.4 → 4.0.0-next.6
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/badge/badge.cjs +1 -1
- package/dist/cjs/components/badge/chip.cjs +1 -0
- package/dist/cjs/components/badge/index.cjs +1 -1
- package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
- package/dist/cjs/components/base/chart-with-side-card/chart-with-side-card.cjs +1 -1
- package/dist/cjs/components/base/history-chart/history-chart.cjs +1 -1
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/leverage-input/leverage-input.cjs +1 -1
- package/dist/cjs/components/base/leverage-preset-chips/constants.cjs +1 -0
- package/dist/cjs/components/base/leverage-preset-chips/index.cjs +1 -0
- package/dist/cjs/components/base/leverage-preset-chips/leverage-preset-chips.cjs +1 -0
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/constants.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/title-meta/constants.cjs +1 -1
- package/dist/cjs/components/base/title-meta/title-meta.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/position-status-badge.cjs +1 -0
- package/dist/cjs/components/base/values/position-type-badge.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -0
- package/dist/cjs/components/base-table/base-table.cjs +1 -0
- package/dist/cjs/components/base-table/constants.cjs +1 -0
- package/dist/cjs/components/base-table/index.cjs +1 -0
- package/dist/cjs/components/base-table/types.cjs +1 -0
- package/dist/cjs/components/block-sync-pill/block-sync-pill.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/collateral-allocation-tooltip/allocation-wheel.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/collateral-allocation-tooltip.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/constants.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/index.cjs +1 -0
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/constants.cjs +1 -0
- package/dist/cjs/components/composites/pool-assets-table/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/index.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/filter/filter-chip.cjs +1 -1
- package/dist/cjs/components/graph/default-config.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/hf-indicator/hf-indicator.cjs +1 -0
- package/dist/cjs/components/hf-indicator/index.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/infinite-scroll/index.cjs +1 -0
- package/dist/cjs/components/infinite-scroll/infinite-scroll-wrapper.cjs +1 -0
- package/dist/cjs/components/name-cell/index.cjs +1 -0
- package/dist/cjs/components/name-cell/name-cell.cjs +1 -0
- package/dist/cjs/components/network-icon/index.cjs +1 -1
- package/dist/cjs/components/network-icon/network-indicator.cjs +1 -0
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
- package/dist/cjs/configs/tailwind-preset.cjs +1 -1
- package/dist/cjs/hooks/index.cjs +1 -1
- package/dist/cjs/hooks/use-observed-width-key.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/utils/format-money.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/leverage-presets.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +161 -159
- package/dist/esm/components/badge/badge.js +14 -8
- package/dist/esm/components/badge/chip.js +47 -0
- package/dist/esm/components/badge/index.js +8 -3
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
- package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +6 -6
- package/dist/esm/components/base/history-chart/history-chart.js +86 -46
- package/dist/esm/components/base/index.js +144 -138
- package/dist/esm/components/base/info-list/info-list.js +7 -8
- package/dist/esm/components/base/leverage-input/leverage-input.js +1 -1
- package/dist/esm/components/base/leverage-preset-chips/constants.js +7 -0
- package/dist/esm/components/base/leverage-preset-chips/index.js +6 -0
- package/dist/esm/components/base/leverage-preset-chips/leverage-preset-chips.js +39 -0
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +23 -30
- package/dist/esm/components/base/strategy-apy-breakdown-card/constants.js +3 -2
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +194 -32
- package/dist/esm/components/base/title-meta/constants.js +1 -0
- package/dist/esm/components/base/title-meta/title-meta.js +53 -33
- package/dist/esm/components/base/values/index.js +16 -14
- package/dist/esm/components/base/values/position-status-badge.js +26 -0
- package/dist/esm/components/base/values/position-type-badge.js +7 -6
- package/dist/esm/components/base-table/base-table-line.js +117 -0
- package/dist/esm/components/base-table/base-table.js +110 -0
- package/dist/esm/components/base-table/constants.js +12 -0
- package/dist/esm/components/base-table/index.js +9 -0
- package/dist/esm/components/base-table/types.js +1 -0
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +9 -6
- package/dist/esm/components/checkbox/checkbox-labeled.js +7 -4
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +7 -4
- package/dist/esm/components/collateral-allocation-tooltip/allocation-wheel.js +71 -0
- package/dist/esm/components/collateral-allocation-tooltip/collateral-allocation-tooltip.js +102 -0
- package/dist/esm/components/collateral-allocation-tooltip/constants.js +12 -0
- package/dist/esm/components/collateral-allocation-tooltip/index.js +9 -0
- package/dist/esm/components/composites/index.js +31 -31
- package/dist/esm/components/composites/pool-assets-table/constants.js +9 -0
- package/dist/esm/components/composites/pool-assets-table/index.js +8 -6
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +52 -30
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +108 -76
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +44 -26
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +109 -52
- package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +8 -10
- package/dist/esm/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.js +1 -0
- package/dist/esm/components/composites/tx-preview/confirm/index.js +24 -26
- package/dist/esm/components/composites/tx-preview/index.js +24 -26
- package/dist/esm/components/compound-apy/compound-apy.js +85 -80
- package/dist/esm/components/filter/filter-chip.js +1 -0
- package/dist/esm/components/graph/default-config.js +20 -18
- package/dist/esm/components/graph/graph-view.js +32 -31
- package/dist/esm/components/graph/graph.js +459 -458
- package/dist/esm/components/hf-indicator/hf-indicator.js +33 -0
- package/dist/esm/components/hf-indicator/index.js +4 -0
- package/dist/esm/components/index.js +732 -701
- package/dist/esm/components/infinite-scroll/index.js +4 -0
- package/dist/esm/components/infinite-scroll/infinite-scroll-wrapper.js +30 -0
- package/dist/esm/components/name-cell/index.js +4 -0
- package/dist/esm/components/name-cell/name-cell.js +35 -0
- package/dist/esm/components/network-icon/index.js +4 -2
- package/dist/esm/components/network-icon/network-indicator.js +82 -0
- package/dist/esm/components/trading-view/trading-view.js +193 -155
- package/dist/esm/components/with-copy/with-copy.js +7 -4
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +112 -169
- package/dist/esm/configs/tailwind-preset.js +13 -1
- package/dist/esm/hooks/index.js +20 -18
- package/dist/esm/hooks/use-observed-width-key.js +24 -0
- package/dist/esm/index.js +881 -842
- package/dist/esm/locale/en.json.js +21 -18
- package/dist/esm/utils/format-money.js +59 -41
- package/dist/esm/utils/index.js +87 -83
- package/dist/esm/utils/leverage-presets.js +13 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +3 -0
- package/dist/types/components/badge/badge.d.ts +2 -1
- package/dist/types/components/badge/chip.d.ts +22 -0
- package/dist/types/components/badge/index.d.ts +1 -0
- package/dist/types/components/base/history-chart/history-chart.d.ts +13 -3
- package/dist/types/components/base/index.d.ts +1 -0
- package/dist/types/components/base/leverage-input/leverage-input.d.ts +1 -1
- package/dist/types/components/base/leverage-preset-chips/constants.d.ts +4 -0
- package/dist/types/components/base/leverage-preset-chips/index.d.ts +2 -0
- package/dist/types/components/base/leverage-preset-chips/leverage-preset-chips.d.ts +13 -0
- package/dist/types/components/base/liquidation-params-table/liquidation-params-table.d.ts +2 -2
- package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +4 -5
- package/dist/types/components/base/strategy-apy-breakdown-card/constants.d.ts +1 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -4
- package/dist/types/components/base/title-meta/constants.d.ts +1 -0
- package/dist/types/components/base/title-meta/title-meta.d.ts +9 -1
- package/dist/types/components/base/values/index.d.ts +1 -0
- package/dist/types/components/base/values/position-status-badge.d.ts +7 -0
- package/dist/types/components/base/values/position-type-badge.d.ts +1 -1
- package/dist/types/components/base-table/base-table-line.d.ts +21 -0
- package/dist/types/components/base-table/base-table.d.ts +19 -0
- package/dist/types/components/base-table/constants.d.ts +8 -0
- package/dist/types/components/base-table/index.d.ts +3 -0
- package/dist/types/components/base-table/types.d.ts +37 -0
- package/dist/types/components/collateral-allocation-tooltip/allocation-wheel.d.ts +10 -0
- package/dist/types/components/collateral-allocation-tooltip/collateral-allocation-tooltip.d.ts +23 -0
- package/dist/types/components/collateral-allocation-tooltip/constants.d.ts +8 -0
- package/dist/types/components/collateral-allocation-tooltip/index.d.ts +3 -0
- package/dist/types/components/composites/pool-assets-table/constants.d.ts +6 -0
- package/dist/types/components/composites/pool-assets-table/index.d.ts +1 -0
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-head.d.ts +1 -2
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +8 -8
- package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +7 -20
- package/dist/types/components/composites/pool-assets-table/types.d.ts +4 -12
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.d.ts +23 -19
- package/dist/types/components/composites/tx-preview/confirm/dialog/index.d.ts +2 -2
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.d.ts +0 -3
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.d.ts +97 -0
- package/dist/types/components/graph/graph-view.d.ts +1 -1
- package/dist/types/components/graph/graph.d.ts +4 -0
- package/dist/types/components/hf-indicator/hf-indicator.d.ts +8 -0
- package/dist/types/components/hf-indicator/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/components/infinite-scroll/index.d.ts +1 -0
- package/dist/types/components/infinite-scroll/infinite-scroll-wrapper.d.ts +11 -0
- package/dist/types/components/name-cell/index.d.ts +1 -0
- package/dist/types/components/name-cell/name-cell.d.ts +13 -0
- package/dist/types/components/network-icon/index.d.ts +1 -0
- package/dist/types/components/network-icon/network-indicator.d.ts +23 -0
- package/dist/types/components/trading-view/trading-view.d.ts +10 -3
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +6 -8
- package/dist/types/configs/tailwind-preset.d.ts +12 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-observed-width-key.d.ts +8 -0
- package/dist/types/index.d.ts +6 -1
- package/dist/types/locale/en.json.d.ts +23 -18
- package/dist/types/utils/format-money.d.ts +11 -5
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/leverage-presets.d.ts +7 -0
- package/package.json +1 -1
- package/src/styles/base.css +30 -0
- package/src/styles/theme.css +16 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +0 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.cjs +0 -1
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +0 -177
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.js +0 -54
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.d.ts +0 -17
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.d.ts +0 -16
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Token } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { Address } from 'viem';
|
|
4
|
+
import { CollateralAllocation } from '../collateral-allocation-tooltip';
|
|
4
5
|
type Mode = "default" | "cascade";
|
|
5
6
|
interface CommonOptions {
|
|
6
7
|
mode?: Mode;
|
|
7
8
|
showIconTooltip?: boolean;
|
|
8
9
|
otherTooltip?: React.ReactNode;
|
|
9
10
|
onOtherClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
11
|
+
/** When set, hover on the cascade shows the allocation mix instead of per-icon symbols. */
|
|
12
|
+
allocation?: CollateralAllocation;
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* Single asset cell props (new API)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type * as React from "react";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "destructive" | "secondary" | "outline" | null | undefined;
|
|
4
|
+
variant?: "default" | "success" | "warning" | "destructive" | "secondary" | "info" | "outline" | "neutral" | "danger" | "accent" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
/**
|
|
7
7
|
* Badge — component for displaying labels, tags, or status indicators.
|
|
@@ -15,6 +15,7 @@ declare const badgeVariants: (props?: ({
|
|
|
15
15
|
* - `secondary` — secondary badge with muted background.
|
|
16
16
|
* - `destructive` — destructive badge with red background for errors/warnings.
|
|
17
17
|
* - `outline` — outlined badge with border only.
|
|
18
|
+
* - `success` / `info` / `warning` / `danger` / `accent` / `neutral` — tinted chips.
|
|
18
19
|
*
|
|
19
20
|
* Note: Prefer using this component instead of native HTML div element for badges.
|
|
20
21
|
*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export declare class ChipTest {
|
|
3
|
+
static root: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class ChipsTest {
|
|
6
|
+
static root: string;
|
|
7
|
+
static chip: string;
|
|
8
|
+
}
|
|
9
|
+
export type ChipTone = "success" | "info" | "neutral" | "warning" | "danger" | "accent";
|
|
10
|
+
export interface ChipProps {
|
|
11
|
+
readonly children?: ReactNode;
|
|
12
|
+
readonly tone?: ChipTone;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Tinted {@link Badge} for table/status chips. */
|
|
16
|
+
export declare function Chip({ children, tone, className, }: ChipProps): React.ReactElement;
|
|
17
|
+
export interface ChipsProps {
|
|
18
|
+
readonly children: ReactNode;
|
|
19
|
+
readonly className?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Horizontal row of {@link Chip} (or other badge nodes). */
|
|
22
|
+
export declare function Chips({ children, className }: ChipsProps): React.ReactElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HistoryRange, HistorySeries } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
+
import { TitleText } from '../text';
|
|
3
4
|
import { PriceLineConfig, PriceZoneConfig } from '../../graph';
|
|
4
5
|
import { YMeasureUnits } from '../../graph/formatters';
|
|
5
6
|
import { HistoryChartTest } from './constants';
|
|
@@ -28,10 +29,19 @@ export interface HistoryChartProps {
|
|
|
28
29
|
readonly showCurrentValue?: boolean;
|
|
29
30
|
/** Y-axis floor when the series has data. */
|
|
30
31
|
readonly yScaleMin?: number;
|
|
32
|
+
/** Heading to the left of the range dropdown, above the chart frame. */
|
|
33
|
+
readonly title?: TitleText;
|
|
34
|
+
/** Controls to the left of the range dropdown (e.g. leverage chips). */
|
|
35
|
+
readonly trailing?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Force a second Y-axis. When omitted, the chart splits axes only if
|
|
38
|
+
* `yMeasureUnit` lists more than one distinct unit.
|
|
39
|
+
*/
|
|
40
|
+
readonly dualYAxis?: boolean;
|
|
31
41
|
}
|
|
32
42
|
/**
|
|
33
|
-
* Design-only history chart on the TradingView engine: range
|
|
34
|
-
* tooltips, optional reference lines and zones. Takes the SDK's
|
|
43
|
+
* Design-only history chart on the TradingView engine: range dropdown, legend
|
|
44
|
+
* below the frame, tooltips, optional reference lines and zones. Takes the SDK's
|
|
35
45
|
* `HistorySeries` as it comes — points are mapped 1:1, no fetching.
|
|
36
46
|
*/
|
|
37
|
-
export declare function HistoryChart({ data, range, onRange, isLoading, error, yMeasureUnit, height, seriesTitles, priceLines, zones, showCurrentValue, yScaleMin, }: HistoryChartProps): React.ReactElement;
|
|
47
|
+
export declare function HistoryChart({ data, range, onRange, isLoading, error, yMeasureUnit, height, seriesTitles, priceLines, zones, showCurrentValue, yScaleMin, title, trailing, dualYAxis: dualYAxisProp, }: HistoryChartProps): React.ReactElement;
|
|
@@ -8,6 +8,7 @@ export * from './history-chart';
|
|
|
8
8
|
export * from './info-list';
|
|
9
9
|
export * from './info-portal';
|
|
10
10
|
export * from './leverage-input';
|
|
11
|
+
export * from './leverage-preset-chips';
|
|
11
12
|
export * from './liquidation-params-table';
|
|
12
13
|
export * from './liquidation-price-block';
|
|
13
14
|
export * from './manage-pane';
|
|
@@ -35,7 +35,7 @@ export interface LeverageInputProps {
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Target leverage of a position, bounded by what the strategy allows.
|
|
38
|
-
* Title row carries an inline-editable value (
|
|
38
|
+
* Title row carries an inline-editable value (`N.NNx`) and an optional reset;
|
|
39
39
|
* the slider below can show risk bands via `colorIntervals`.
|
|
40
40
|
*/
|
|
41
41
|
export declare function LeverageInput({ value, onChange, max, min, title, hint, reset, colorIntervals, colorIntervalLabel, size, }: LeverageInputProps): React.ReactElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LeveragePresetChipsTest } from './constants';
|
|
3
|
+
export { LeveragePresetChipsTest };
|
|
4
|
+
export interface LeveragePresetChipsProps {
|
|
5
|
+
readonly options: readonly number[];
|
|
6
|
+
readonly value?: number;
|
|
7
|
+
readonly onChange: (value: number) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Leverage step pills for the yield-chart toolbar. Selected leverage only
|
|
11
|
+
* drives the APY breakdown card, not the chart series.
|
|
12
|
+
*/
|
|
13
|
+
export declare function LeveragePresetChips({ options, value, onChange, }: LeveragePresetChipsProps): React.ReactElement | null;
|
|
@@ -6,7 +6,7 @@ export interface LiquidationParamsTableProps {
|
|
|
6
6
|
readonly data: Pick<StrategyOpportunity, "liquidationThreshold" | "liquidationPremium" | "liquidationFee">;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Single-row liquidation parameters.
|
|
10
|
-
* of two SDK values.
|
|
9
|
+
* Single-row liquidation parameters. Discount is premium + fee, a
|
|
10
|
+
* presentation of two SDK values.
|
|
11
11
|
*/
|
|
12
12
|
export declare function LiquidationParamsTable({ data, }: LiquidationParamsTableProps): React.ReactElement;
|
|
@@ -3,12 +3,11 @@ import { default as React } from 'react';
|
|
|
3
3
|
import { PoolApyBreakdownCardTest } from './constants';
|
|
4
4
|
export { PoolApyBreakdownCardTest };
|
|
5
5
|
export interface PoolApyBreakdownCardProps {
|
|
6
|
-
/**
|
|
6
|
+
/** Organic and incentive APYs in basis points; a missing value renders a dash. */
|
|
7
7
|
readonly data?: {
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly apy30d?: Bps;
|
|
8
|
+
readonly organicApy?: Bps;
|
|
9
|
+
readonly incentiveApy?: Bps;
|
|
11
10
|
};
|
|
12
11
|
}
|
|
13
|
-
/**
|
|
12
|
+
/** Organic vs incentive APY next to the pool APY chart. Missing values render as dashes. */
|
|
14
13
|
export declare function PoolApyBreakdownCard({ data, }: PoolApyBreakdownCardProps): React.ReactElement;
|
package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApyBreakdown, Bps, Leverage } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { StrategyApyBreakdownCardTest } from './constants';
|
|
4
4
|
export { StrategyApyBreakdownCardTest };
|
|
5
|
+
export interface StrategyApyBreakdownData {
|
|
6
|
+
readonly collateralApy?: ApyBreakdown;
|
|
7
|
+
readonly borrowApy?: Bps;
|
|
8
|
+
readonly additionalBorrowApy?: Bps;
|
|
9
|
+
readonly maxLeverage?: Leverage;
|
|
10
|
+
}
|
|
5
11
|
export interface StrategyApyBreakdownCardProps {
|
|
6
|
-
readonly data:
|
|
12
|
+
readonly data: StrategyApyBreakdownData;
|
|
13
|
+
/** Selected leverage from the chart toolbar chips. Falls back to max. */
|
|
14
|
+
readonly leverage?: Leverage;
|
|
7
15
|
}
|
|
8
|
-
/** APY
|
|
9
|
-
export declare function StrategyApyBreakdownCard({ data, }: StrategyApyBreakdownCardProps): React.ReactElement;
|
|
16
|
+
/** Net APY formula beside the strategy yield chart. Chart itself is unchanged. */
|
|
17
|
+
export declare function StrategyApyBreakdownCard({ data, leverage: leverageProp, }: StrategyApyBreakdownCardProps): React.ReactElement;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
+
import { Token } from '@gearbox-protocol/sdk/model';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
3
|
import { NetworkIcons } from '../../../utils/network-icons';
|
|
3
4
|
import { TitleMetaTest } from './constants';
|
|
4
5
|
export { TitleMetaTest };
|
|
6
|
+
export interface TitleMetaLink {
|
|
7
|
+
readonly href: string;
|
|
8
|
+
readonly token?: Token;
|
|
9
|
+
readonly label?: string;
|
|
10
|
+
readonly onClick?: () => void;
|
|
11
|
+
}
|
|
5
12
|
export interface TitleMetaProps {
|
|
6
13
|
readonly network: NetworkIcons;
|
|
7
14
|
readonly curatorName: string | undefined;
|
|
8
15
|
readonly curatorLink: string | undefined;
|
|
9
16
|
readonly onCuratorLinkClick?: () => void;
|
|
17
|
+
readonly links?: ReadonlyArray<TitleMetaLink>;
|
|
10
18
|
readonly testId?: string;
|
|
11
19
|
readonly networkTestId?: string;
|
|
12
20
|
readonly curatorTestId?: string;
|
|
13
21
|
}
|
|
14
22
|
/** Network + curator row under a detail-page title. */
|
|
15
|
-
export declare function TitleMeta({ network, curatorName, curatorLink, onCuratorLinkClick, testId, networkTestId, curatorTestId, }: TitleMetaProps): React.ReactElement;
|
|
23
|
+
export declare function TitleMeta({ network, curatorName, curatorLink, onCuratorLinkClick, links, testId, networkTestId, curatorTestId, }: TitleMetaProps): React.ReactElement;
|
|
@@ -2,5 +2,6 @@ export { ValueTest } from './constants';
|
|
|
2
2
|
export { PnlValue } from './pnl-value';
|
|
3
3
|
export { PointsValue, type PointsValueProps } from './points-value';
|
|
4
4
|
export { PositionShortLabel, PositionShortLabelTest, } from './position-short-label';
|
|
5
|
+
export { type PositionStatus, PositionStatusBadge, type PositionStatusBadgeProps, } from './position-status-badge';
|
|
5
6
|
export { PositionTypeBadge, type PositionTypeBadgeProps, } from './position-type-badge';
|
|
6
7
|
export { ApyValue, type ApyValueProps, bps, HealthFactorValue, LeverageValue, TokenBigint, UsdValue, UtilizationValue, } from './scalars';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type PositionStatus = "active" | "repaid";
|
|
3
|
+
export interface PositionStatusBadgeProps {
|
|
4
|
+
readonly data: PositionStatus;
|
|
5
|
+
}
|
|
6
|
+
/** Lifecycle chip of a strategy position: Active or Repaid. */
|
|
7
|
+
export declare function PositionStatusBadge({ data, }: PositionStatusBadgeProps): React.ReactElement;
|
|
@@ -6,6 +6,6 @@ export interface PositionTypeBadgeProps {
|
|
|
6
6
|
readonly size?: "table" | "aside" | "title";
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Colored kind label of a position row: "
|
|
9
|
+
* Colored kind label of a position row: "LP" / "Strategy" / "Liquidation".
|
|
10
10
|
*/
|
|
11
11
|
export declare function PositionTypeBadge({ data, size, }: PositionTypeBadgeProps): React.ReactElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { BaseTableColumn } from './types';
|
|
3
|
+
export { BaseTableLineTest } from './constants';
|
|
4
|
+
export interface BaseTableLineProps<TSort extends string = never> {
|
|
5
|
+
readonly columns: ReadonlyArray<BaseTableColumn<TSort>>;
|
|
6
|
+
readonly cells: Readonly<Record<string, ReactNode>>;
|
|
7
|
+
readonly last: boolean;
|
|
8
|
+
readonly href?: string;
|
|
9
|
+
readonly disabled?: boolean;
|
|
10
|
+
readonly disabledStyle?: boolean;
|
|
11
|
+
/** Extra row className, e.g. RWA accent tint. */
|
|
12
|
+
readonly accentClassName?: string;
|
|
13
|
+
readonly onRowClick?: () => void;
|
|
14
|
+
readonly "data-testid"?: string;
|
|
15
|
+
readonly minHeightClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One row of {@link BaseTable}: desktop cells from the column model, or a
|
|
19
|
+
* stacked mobile card driven by each column's `mobile` role.
|
|
20
|
+
*/
|
|
21
|
+
export declare function BaseTableLine<TSort extends string = never>({ columns, cells, last, href, disabled, disabledStyle, accentClassName, onRowClick, "data-testid": testId, minHeightClassName, }: BaseTableLineProps<TSort>): React.ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { BaseTableColumn, BaseTableSortApi } from './types';
|
|
3
|
+
export { BaseTableTest } from './constants';
|
|
4
|
+
export type { BaseTableColumn, BaseTableSortApi } from './types';
|
|
5
|
+
export interface BaseTableProps<TSort extends string = never> {
|
|
6
|
+
readonly columns: ReadonlyArray<BaseTableColumn<TSort>>;
|
|
7
|
+
readonly isLoading: boolean;
|
|
8
|
+
readonly emptyMessage: ReactNode;
|
|
9
|
+
readonly sort?: BaseTableSortApi<TSort>;
|
|
10
|
+
readonly rowHeight?: string;
|
|
11
|
+
readonly loaderRows?: number;
|
|
12
|
+
readonly className?: string;
|
|
13
|
+
readonly wrapperClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Declarative data table over {@link GridTable}: column model, sort headers,
|
|
17
|
+
* loading skeleton and empty state. Mobile collapses to a single track.
|
|
18
|
+
*/
|
|
19
|
+
export declare function BaseTable<TSort extends string = never>({ columns, isLoading, emptyMessage, sort, rowHeight, loaderRows, className, wrapperClassName, children, }: PropsWithChildren<BaseTableProps<TSort>>): React.ReactElement;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type BaseTableColumnJustify = "start" | "end";
|
|
3
|
+
/**
|
|
4
|
+
* Mobile placement for a column inside {@link BaseTableLine}:
|
|
5
|
+
* - `title` — primary identity block (name / tokens)
|
|
6
|
+
* - `badge` — compact chip next to the title (also unclipped on desktop)
|
|
7
|
+
* - `stat` — labeled metric in the stats grid
|
|
8
|
+
* - `block` — full-width labeled block under the stats
|
|
9
|
+
* - `hidden` — desktop-only
|
|
10
|
+
*/
|
|
11
|
+
type BaseTableColumnMobile = "title" | "badge" | "stat" | "block" | "hidden";
|
|
12
|
+
interface BaseTableColumnSort<TSort extends string = never> {
|
|
13
|
+
readonly field: TSort;
|
|
14
|
+
readonly defaultDirection: "asc" | "desc";
|
|
15
|
+
/** Plain string for HeadCell `sortField` (a11y / tooltip). */
|
|
16
|
+
readonly label: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Column model shared by {@link BaseTable} (tracks + header) and
|
|
20
|
+
* {@link BaseTableLine} (desktop cells + mobile labels).
|
|
21
|
+
*/
|
|
22
|
+
export interface BaseTableColumn<TSort extends string = never> {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly title: ReactNode;
|
|
25
|
+
/** CSS grid track, e.g. `"minmax(320px,3fr)"`. */
|
|
26
|
+
readonly track: string;
|
|
27
|
+
readonly justify?: BaseTableColumnJustify;
|
|
28
|
+
readonly sort?: BaseTableColumnSort<TSort>;
|
|
29
|
+
readonly headClassName?: string;
|
|
30
|
+
readonly cellClassName?: string;
|
|
31
|
+
readonly mobile?: BaseTableColumnMobile;
|
|
32
|
+
}
|
|
33
|
+
export interface BaseTableSortApi<TSort extends string> {
|
|
34
|
+
readonly getSortDirection: (field: TSort) => "asc" | "desc" | undefined;
|
|
35
|
+
readonly onSort: (field: TSort, defaultDirection: "asc" | "desc") => void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface AllocationWheelProps {
|
|
3
|
+
/** Slice share in 0..1 of the total allocation. */
|
|
4
|
+
readonly share: number;
|
|
5
|
+
/** Palette index for token slices; ignored when {@link idle}. */
|
|
6
|
+
readonly colorIndex: number;
|
|
7
|
+
readonly idle?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** 20px donut showing one slice's share of the total. */
|
|
10
|
+
export declare function AllocationWheel({ share, colorIndex, idle, }: AllocationWheelProps): React.ReactElement;
|
package/dist/types/components/collateral-allocation-tooltip/collateral-allocation-tooltip.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Amount, Token } from '@gearbox-protocol/sdk/model';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export type CollateralAllocationSlice = {
|
|
4
|
+
kind: "token";
|
|
5
|
+
token: Token;
|
|
6
|
+
amount: Amount;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "idle";
|
|
9
|
+
amount: Amount;
|
|
10
|
+
};
|
|
11
|
+
export interface CollateralAllocation {
|
|
12
|
+
slices: ReadonlyArray<CollateralAllocationSlice>;
|
|
13
|
+
}
|
|
14
|
+
export interface CollateralAllocationTooltipProps {
|
|
15
|
+
readonly data: CollateralAllocation;
|
|
16
|
+
readonly children?: React.ReactNode;
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Pool collateral mix for Earn table hover — token rows plus an Idle remainder.
|
|
21
|
+
* Slice shares are derived from `amount.valueUsd`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function CollateralAllocationTooltip({ data, children, className, }: CollateralAllocationTooltipProps): React.ReactElement;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { PoolAssetsTableSort } from './types';
|
|
3
|
-
/** Props for {@link PoolAssetsTableHead}. */
|
|
4
3
|
export interface PoolAssetsTableHeadProps {
|
|
5
4
|
readonly sort: PoolAssetsTableSort;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
|
-
* Header row: sortable
|
|
7
|
+
* Header row: sortable Name / Exposure / Cap / Cap utilization.
|
|
9
8
|
*/
|
|
10
9
|
export declare function PoolAssetsTableHead({ sort, }: PoolAssetsTableHeadProps): React.ReactElement;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuotaAsset, Token } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
-
import { PoolAssetsTableQuotaRow } from './types';
|
|
4
|
-
/** Props for {@link PoolAssetsTableRow}. */
|
|
5
3
|
export interface PoolAssetsTableRowProps {
|
|
6
4
|
readonly poolName: string;
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly underlyingToken: TokenData;
|
|
5
|
+
readonly asset: QuotaAsset;
|
|
6
|
+
readonly underlyingToken: Token;
|
|
10
7
|
readonly last: boolean;
|
|
8
|
+
readonly isCompact: boolean;
|
|
9
|
+
readonly totalUsed: bigint;
|
|
10
|
+
readonly colorIndex: number;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Single data row: token
|
|
13
|
+
* Single data row: token name, exposure (amount + pie), cap, and cap utilization.
|
|
14
14
|
*/
|
|
15
|
-
export declare function PoolAssetsTableRow({ poolName,
|
|
15
|
+
export declare function PoolAssetsTableRow({ poolName, asset, underlyingToken, last, isCompact, totalUsed, colorIndex, }: PoolAssetsTableRowProps): React.ReactElement;
|
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuotaAsset, Token } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { PoolAssetsTableQuotaRow, PoolAssetsTableSort } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Props for {@link PoolAssetsTable}.
|
|
7
|
-
*/
|
|
3
|
+
import { PoolAssetsTableSort } from './types';
|
|
8
4
|
export interface PoolAssetsTableProps {
|
|
9
|
-
|
|
10
|
-
readonly list: ReadonlyArray<PoolAssetsTableQuotaRow>;
|
|
11
|
-
/** Pool name shown under the asset title. */
|
|
5
|
+
readonly list: ReadonlyArray<QuotaAsset>;
|
|
12
6
|
readonly poolName: string;
|
|
13
7
|
readonly sort: PoolAssetsTableSort;
|
|
14
|
-
|
|
15
|
-
readonly tokensList: Partial<Record<Address, TokenData>>;
|
|
16
|
-
/** Underlying asset used for `TokenTemplate` amounts in the usage column. */
|
|
17
|
-
readonly underlyingToken: TokenData;
|
|
8
|
+
readonly underlyingToken: Token;
|
|
18
9
|
}
|
|
19
10
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Do not add a third table in this pass — next-stage `table/` absorbs this.
|
|
23
|
-
*
|
|
24
|
-
* On viewports below the mobile breakpoint the header is hidden and each row
|
|
25
|
-
* uses the compact `TableLineSm` layout.
|
|
11
|
+
* Grid table of pool asset quotas: exposure, cap, and cap utilization.
|
|
12
|
+
* Collapses into stacked cards below {@link COMPACT_WIDTH_THRESHOLD}.
|
|
26
13
|
*/
|
|
27
|
-
export declare function PoolAssetsTable({ list, poolName, sort,
|
|
14
|
+
export declare function PoolAssetsTable({ list, poolName, sort, underlyingToken, }: PoolAssetsTableProps): React.ReactElement | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuotaAsset } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { SortField, SortSetterFunction } from '../../../hooks';
|
|
3
3
|
/** Column identifiers used by the pool assets table header sort controls. */
|
|
4
|
-
export type PoolAssetsSortFields = "name" | "
|
|
4
|
+
export type PoolAssetsSortFields = "name" | "exposure" | "cap" | "capUtilization";
|
|
5
5
|
/**
|
|
6
6
|
* Sort state + setter wired to `HeadCell` / `useSort` (same pattern as `PoolTable`).
|
|
7
7
|
*/
|
|
@@ -13,13 +13,5 @@ export interface PoolAssetsTableSort {
|
|
|
13
13
|
export interface PoolAssetsFilterState {
|
|
14
14
|
readonly sort: PoolAssetsTableSort;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
* Shape aligns with Gearbox SDK quota / QuotaInfo-style data.
|
|
19
|
-
*/
|
|
20
|
-
export interface PoolAssetsTableQuotaRow {
|
|
21
|
-
readonly token: Address;
|
|
22
|
-
readonly limit: bigint;
|
|
23
|
-
readonly totalQuoted: bigint;
|
|
24
|
-
readonly rate: bigint;
|
|
25
|
-
}
|
|
16
|
+
/** One quota row — the SDK's {@link QuotaAsset}. */
|
|
17
|
+
export type PoolAssetsTableQuotaRow = QuotaAsset;
|
package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.d.ts
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TransactionConfirmPhase } from './transactionConfirmPhase';
|
|
4
|
-
export interface TransactionConfirmShellProps {
|
|
5
|
-
readonly phase?: TransactionConfirmPhase;
|
|
6
|
-
readonly header?: React.ReactNode;
|
|
7
|
-
readonly preview: React.ReactNode;
|
|
8
|
-
readonly previewLoading?: boolean;
|
|
9
|
-
readonly previewError?: Error | null;
|
|
10
|
-
readonly previewErrorTitle?: string;
|
|
11
|
-
readonly previewClassName?: string;
|
|
12
|
-
readonly execution: React.ReactNode;
|
|
13
|
-
readonly progressSteps?: ReadonlyArray<TransactionExecutionStepView>;
|
|
14
|
-
readonly renderProgressStepLabel?: (step: TransactionExecutionStepView) => React.ReactNode;
|
|
15
|
-
readonly result?: React.ReactNode;
|
|
16
|
-
readonly className?: string;
|
|
17
|
-
readonly "data-testid"?: string;
|
|
18
|
-
}
|
|
2
|
+
import { TransactionConfirmShellProps } from './transactionConfirmShellTypes';
|
|
19
3
|
/**
|
|
4
|
+
* The one card every transaction confirmation renders, on every surface.
|
|
20
5
|
*
|
|
21
|
-
*
|
|
6
|
+
* Callers describe *what the card shows* (`body`) and *how it is framed*
|
|
7
|
+
* (`mode`); everything else is decided here. This replaces the former
|
|
8
|
+
* `TransactionConfirmPageView` / `TransactionConfirmModalView` pair, which
|
|
9
|
+
* differed only in the frame yet each restated the whole prop list.
|
|
10
|
+
*
|
|
11
|
+
* Two traps from that pair are closed here rather than left to callers.
|
|
12
|
+
*
|
|
13
|
+
* The modal's height clamp is composed with `className` instead of being
|
|
14
|
+
* replaced by it, so a caller adding a class no longer drops the viewport
|
|
15
|
+
* clamp and the flex context the scrollable preview depends on by accident.
|
|
16
|
+
* `cn` is tailwind-merge, so a utility deliberately targeting the same
|
|
17
|
+
* property still wins — though arbitrary-property syntax such as
|
|
18
|
+
* `[max-height:50vh]` sits in a different group and will not displace it.
|
|
19
|
+
*
|
|
20
|
+
* And a `placeholder` or `error` body pins the phase to `confirm`, so those
|
|
21
|
+
* two can never be asked for a result view they were never given. Note the
|
|
22
|
+
* limit of that guarantee: a `ready` body driven to a terminal phase without a
|
|
23
|
+
* `result` still draws a header and nothing else, exactly as the views it
|
|
24
|
+
* replaces did. Requiring both halves of `result` is what keeps the promise
|
|
25
|
+
* whole once a caller opts into one.
|
|
22
26
|
*/
|
|
23
|
-
export declare function TransactionConfirmShell(
|
|
27
|
+
export declare function TransactionConfirmShell(props: TransactionConfirmShellProps): React.ReactElement | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './computeTransactionConfirmDialogLayout';
|
|
2
2
|
export * from './constants';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './TransactionConfirmPageView';
|
|
3
|
+
export * from './TransactionConfirmShell';
|
|
5
4
|
export * from './transactionConfirmPhase';
|
|
5
|
+
export * from './transactionConfirmShellTypes';
|