@gearbox-protocol/ui-kit 4.0.0-next.3 → 4.0.0-next.5
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/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/base/health-factor-block/health-factor-block.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/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/liquidation-price-block/liquidation-price-block.cjs +1 -1
- package/dist/cjs/components/base/manage-pane/constants.cjs +1 -1
- package/dist/cjs/components/base/manage-pane/manage-pane.cjs +1 -1
- package/dist/cjs/components/base/page-title/index.cjs +1 -1
- package/dist/cjs/components/base/page-title/page-title.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/stat-badge/stat-badge.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/time-to-liquidation-block/time-to-liquidation-block.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/token-amount/token-amount.cjs +1 -1
- package/dist/cjs/components/base/values/constants.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/points-value.cjs +1 -0
- 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/values/scalars.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/TransactionConfirmModalView.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-leverage.cjs +1 -0
- 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 +4 -2
- package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +6 -6
- package/dist/esm/components/base/detailed-page-title/detailed-page-title.js +26 -27
- package/dist/esm/components/base/health-factor-block/health-factor-block.js +25 -25
- package/dist/esm/components/base/history-chart/history-chart.js +86 -46
- package/dist/esm/components/base/index.js +148 -138
- package/dist/esm/components/base/info-list/index.js +5 -4
- package/dist/esm/components/base/info-list/info-list.js +51 -27
- package/dist/esm/components/base/leverage-input/leverage-input.js +18 -20
- 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/liquidation-price-block/liquidation-price-block.js +33 -28
- package/dist/esm/components/base/manage-pane/constants.js +3 -2
- package/dist/esm/components/base/manage-pane/manage-pane.js +154 -113
- package/dist/esm/components/base/page-title/index.js +5 -4
- package/dist/esm/components/base/page-title/page-title.js +31 -23
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +23 -30
- package/dist/esm/components/base/stat-badge/stat-badge.js +18 -9
- 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 -31
- package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +31 -31
- 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/token-amount/token-amount.js +17 -16
- package/dist/esm/components/base/values/constants.js +1 -0
- package/dist/esm/components/base/values/index.js +20 -16
- package/dist/esm/components/base/values/points-value.js +30 -0
- 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/values/scalars.js +18 -17
- 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 +24 -20
- package/dist/esm/components/checkbox/checkbox-labeled.js +22 -18
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +22 -18
- 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 +46 -44
- 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 +109 -76
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +44 -26
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +31 -27
- 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 +72 -88
- 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 +734 -697
- 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 +22 -18
- 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 +888 -841
- package/dist/esm/locale/en.json.js +21 -18
- package/dist/esm/utils/format-leverage.js +6 -0
- package/dist/esm/utils/format-money.js +59 -41
- package/dist/esm/utils/index.js +91 -85
- 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/detailed-page-title/detailed-page-title.d.ts +1 -3
- package/dist/types/components/base/health-factor-block/health-factor-block.d.ts +6 -6
- 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/info-list/info-list.d.ts +7 -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/liquidation-price-block/liquidation-price-block.d.ts +6 -4
- package/dist/types/components/base/manage-pane/constants.d.ts +1 -0
- package/dist/types/components/base/manage-pane/manage-pane.d.ts +3 -1
- package/dist/types/components/base/page-title/page-title.d.ts +12 -6
- 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/time-to-liquidation-block/time-to-liquidation-block.d.ts +5 -6
- 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/token-amount/token-amount.d.ts +8 -2
- package/dist/types/components/base/values/constants.d.ts +1 -0
- package/dist/types/components/base/values/index.d.ts +2 -0
- package/dist/types/components/base/values/points-value.d.ts +11 -0
- package/dist/types/components/base/values/position-short-label.d.ts +1 -1
- 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/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-leverage.d.ts +5 -0
- package/dist/types/utils/format-money.d.ts +11 -5
- package/dist/types/utils/index.d.ts +3 -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
|
@@ -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;
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import { GraphProps } from './graph';
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
declare const graphViewVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "outlined" | "ghost" | "elevated" | null | undefined;
|
|
5
|
+
variant?: "default" | "outlined" | "ghost" | "elevated" | "plain" | null | undefined;
|
|
6
6
|
size?: "full" | "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
7
7
|
padding?: "none" | "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -30,6 +30,10 @@ export type VerticalLineOptions = Partial<{
|
|
|
30
30
|
width: number;
|
|
31
31
|
labelBackgroundColor: string;
|
|
32
32
|
labelTextColor: string;
|
|
33
|
+
/**
|
|
34
|
+
* Time-axis (bottom) badge. Independent of the top overlay, which renders
|
|
35
|
+
* whenever `labelText`, `value`, or `tooltipText` is set.
|
|
36
|
+
*/
|
|
33
37
|
showLabel: boolean;
|
|
34
38
|
/**
|
|
35
39
|
* Text shown only on hover of the line's badge (not rendered inline). Use it
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface HFIndicatorProps {
|
|
3
|
+
readonly value?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Concentric rings around a health-factor value. Presentation only.
|
|
7
|
+
*/
|
|
8
|
+
export declare function HFIndicator({ value, }: HFIndicatorProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hf-indicator';
|
|
@@ -6,6 +6,7 @@ export * from './assets-list-cell';
|
|
|
6
6
|
export * from './badge';
|
|
7
7
|
export * from './base';
|
|
8
8
|
export * from './base-link';
|
|
9
|
+
export * from './base-table';
|
|
9
10
|
export * from './block-sync-pill';
|
|
10
11
|
export * from './breadcrumbs';
|
|
11
12
|
export * from './breakpoint-provider';
|
|
@@ -14,6 +15,7 @@ export * from './cards';
|
|
|
14
15
|
export * from './checkbox';
|
|
15
16
|
export * from './checkbox-item';
|
|
16
17
|
export * from './client-adapters';
|
|
18
|
+
export * from './collateral-allocation-tooltip';
|
|
17
19
|
export * from './composites';
|
|
18
20
|
export * from './compound-apy';
|
|
19
21
|
export * from './confirm-menu';
|
|
@@ -33,8 +35,10 @@ export * from './guard';
|
|
|
33
35
|
export * from './head-cell';
|
|
34
36
|
export * from './health-factor';
|
|
35
37
|
export * from './help-tip';
|
|
38
|
+
export * from './hf-indicator';
|
|
36
39
|
export * from './icon-button';
|
|
37
40
|
export * from './icons';
|
|
41
|
+
export * from './infinite-scroll';
|
|
38
42
|
export * from './input';
|
|
39
43
|
export * from './label';
|
|
40
44
|
export * from './layout';
|
|
@@ -44,6 +48,7 @@ export * from './loader';
|
|
|
44
48
|
export * from './loading';
|
|
45
49
|
export * from './loading-bar';
|
|
46
50
|
export * from './modal';
|
|
51
|
+
export * from './name-cell';
|
|
47
52
|
export * from './navbar-logo';
|
|
48
53
|
export * from './navigation-context';
|
|
49
54
|
export * from './points-icon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './infinite-scroll-wrapper';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
2
|
+
export interface InfiniteScrollWrapperProps {
|
|
3
|
+
readonly dataLength: number;
|
|
4
|
+
readonly hasMore: boolean;
|
|
5
|
+
readonly onNextLoad: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* List footer that asks for the next page. Presentation only: the caller
|
|
9
|
+
* owns paging state and `onNextLoad`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function InfiniteScrollWrapper({ hasMore, dataLength, children, onNextLoad, }: PropsWithChildren<InfiniteScrollWrapperProps>): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './name-cell';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface NameCellProps {
|
|
3
|
+
readonly title: ReactNode;
|
|
4
|
+
readonly subtitle?: ReactNode;
|
|
5
|
+
readonly chips?: ReactNode;
|
|
6
|
+
readonly caption?: ReactNode;
|
|
7
|
+
readonly leading?: ReactNode;
|
|
8
|
+
readonly disabledStyle?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Table-name layout: optional leading slot, title + chips, subtitle, caption.
|
|
12
|
+
*/
|
|
13
|
+
export declare function NameCell({ title, subtitle, chips, caption, leading, disabledStyle, }: NameCellProps): React.ReactElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ButtonProps } from '../buttons';
|
|
2
|
+
import { NetworkIcons } from '../../utils/network-icons';
|
|
3
|
+
type IndicatorSize = "sm" | "md" | "default" | "lg";
|
|
4
|
+
export interface NetworkIndicatorProps extends Omit<ButtonProps, "size" | "children"> {
|
|
5
|
+
network: NetworkIcons | undefined;
|
|
6
|
+
chainId: number | undefined;
|
|
7
|
+
size?: IndicatorSize;
|
|
8
|
+
iconSize?: number;
|
|
9
|
+
chevronSize?: number;
|
|
10
|
+
showTitle?: boolean;
|
|
11
|
+
opened: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* When true, button appears enabled and shows chevron even without onClick.
|
|
14
|
+
* Useful when the component is used as a dropdown trigger that handles clicks externally.
|
|
15
|
+
* Defaults to true when onClick is provided.
|
|
16
|
+
*/
|
|
17
|
+
interactive?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Network picker trigger: optional "Network:" label, icon, and chevron.
|
|
21
|
+
*/
|
|
22
|
+
export declare const NetworkIndicator: import('react').ForwardRefExoticComponent<NetworkIndicatorProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
export {};
|
|
@@ -37,7 +37,7 @@ export interface GraphData {
|
|
|
37
37
|
/**
|
|
38
38
|
* TradingView component props
|
|
39
39
|
*/
|
|
40
|
-
export interface TradingViewProps<T extends string = string> extends Omit<GraphViewWithDataProps, "series" | "loading" | "toolbar" | "size" | "showLegend" | "onUnselectSeries" | "yMeasureUnit" | "currentValueDecimals" | "data"> {
|
|
40
|
+
export interface TradingViewProps<T extends string = string> extends Omit<GraphViewWithDataProps, "series" | "loading" | "toolbar" | "size" | "showLegend" | "onUnselectSeries" | "yMeasureUnit" | "currentValueDecimals" | "data" | "title"> {
|
|
41
41
|
/** Graph data - single or array of series */
|
|
42
42
|
data: GraphData | Array<GraphData> | undefined;
|
|
43
43
|
/** Y-axis unit for single or multiple series */
|
|
@@ -110,11 +110,18 @@ export interface TradingViewProps<T extends string = string> extends Omit<GraphV
|
|
|
110
110
|
seriesColorPersistenceKey?: string;
|
|
111
111
|
/**
|
|
112
112
|
* When true, all user-initiated zoom and pan interactions are disabled.
|
|
113
|
-
* The time range can only be changed via the range
|
|
113
|
+
* The time range can only be changed via the range dropdown.
|
|
114
114
|
* Disables: mouse-wheel zoom, pinch zoom, axis drag, axis double-click reset,
|
|
115
115
|
* and scroll/drag panning.
|
|
116
116
|
*/
|
|
117
117
|
disableZoom?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Controls rendered to the left of the range dropdown (e.g. leverage chips).
|
|
120
|
+
* A divider is shown between this slot and the dropdown when both are present.
|
|
121
|
+
*/
|
|
122
|
+
trailing?: React.ReactNode;
|
|
123
|
+
/** Heading to the left of the chart controls, outside the chart frame. */
|
|
124
|
+
title?: React.ReactNode;
|
|
118
125
|
}
|
|
119
126
|
/**
|
|
120
127
|
* TradingView — comprehensive charting component with graph selection and time range controls.
|
|
@@ -171,4 +178,4 @@ export interface TradingViewProps<T extends string = string> extends Omit<GraphV
|
|
|
171
178
|
* />
|
|
172
179
|
* ```
|
|
173
180
|
*/
|
|
174
|
-
export declare function TradingView<T extends string = string>({ data, yMeasureUnit, height, defaultGraph, onGraphSelected, graphs, isMultipleSelect, range, rangeList, setRange, onGraphExpanded, isGraphExpanded, onUnselectSeries, graphsWithNoData, loadingGraphs, isLoading: isLoadingProp, noDataMessage, currentValueDecimals, containerClassName, useSharedPriceScale, showCurrentValue, yScaleMin, yScaleMinMultiple, seriesColorPersistenceKey, ...restProps }: TradingViewProps<T>): React.ReactElement;
|
|
181
|
+
export declare function TradingView<T extends string = string>({ data, yMeasureUnit, height, defaultGraph, onGraphSelected, graphs, isMultipleSelect, range, rangeList, setRange, onGraphExpanded, isGraphExpanded, onUnselectSeries, graphsWithNoData, loadingGraphs, isLoading: isLoadingProp, noDataMessage, currentValueDecimals, containerClassName, useSharedPriceScale, showCurrentValue, yScaleMin, yScaleMinMultiple, seriesColorPersistenceKey, title, trailing, ...restProps }: TradingViewProps<T>): React.ReactElement;
|
|
@@ -8,25 +8,23 @@ export interface YieldBreakdownTooltipProps {
|
|
|
8
8
|
supplyApy: ApyBreakdown;
|
|
9
9
|
/**
|
|
10
10
|
* Strategy-only plain leverage multiplier (e.g. `13.6` for 13.6x). When set,
|
|
11
|
-
* the header
|
|
11
|
+
* the header is "Net APY at Nx Leverage" and a Borrow Rate row is shown.
|
|
12
12
|
*/
|
|
13
13
|
maxLeverage?: Leverage;
|
|
14
14
|
/**
|
|
15
|
-
* Strategy collateral yield used for
|
|
16
|
-
* {@link supplyApy} when omitted.
|
|
15
|
+
* Strategy collateral yield used for Collateral / Incentive rows. Falls back
|
|
16
|
+
* to {@link supplyApy} when omitted.
|
|
17
17
|
*/
|
|
18
18
|
collateralApy?: ApyBreakdown;
|
|
19
19
|
/** Strategy base borrow cost in bps (shown as a negative rate). */
|
|
20
20
|
borrowApy?: Bps;
|
|
21
|
-
/** Strategy additional (quota) borrow cost in bps (
|
|
21
|
+
/** Strategy additional (quota) borrow cost in bps (folded into Borrow Rate). */
|
|
22
22
|
additionalBorrowApy?: Bps;
|
|
23
23
|
children?: React.ReactNode;
|
|
24
24
|
className?: string;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* `
|
|
29
|
-
*
|
|
30
|
-
* Visuals follow Figma «Yield Details Surface» (400px card, always expanded).
|
|
27
|
+
* Earn APY tooltip — strategy (`Net APY at Nx Leverage`) and pool
|
|
28
|
+
* (`Overall APY`) layouts from SDK `ApyBreakdown`.
|
|
31
29
|
*/
|
|
32
30
|
export declare function YieldBreakdownTooltip({ supplyApy, maxLeverage, collateralApy, borrowApy, additionalBorrowApy, children, className, }: YieldBreakdownTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -63,9 +63,14 @@ export declare const preset: {
|
|
|
63
63
|
"success-foreground": string;
|
|
64
64
|
"success-hover": string;
|
|
65
65
|
warning: string;
|
|
66
|
+
info: {
|
|
67
|
+
DEFAULT: string;
|
|
68
|
+
foreground: string;
|
|
69
|
+
};
|
|
66
70
|
liquidation: string;
|
|
67
71
|
"liquidation-line": string;
|
|
68
72
|
border: string;
|
|
73
|
+
divider: string;
|
|
69
74
|
input: string;
|
|
70
75
|
ring: string;
|
|
71
76
|
"text-secondary": string;
|
|
@@ -91,6 +96,13 @@ export declare const preset: {
|
|
|
91
96
|
"3": string;
|
|
92
97
|
"4": string;
|
|
93
98
|
"5": string;
|
|
99
|
+
"6": string;
|
|
100
|
+
"7": string;
|
|
101
|
+
"8": string;
|
|
102
|
+
"9": string;
|
|
103
|
+
"10": string;
|
|
104
|
+
"11": string;
|
|
105
|
+
"12": string;
|
|
94
106
|
};
|
|
95
107
|
};
|
|
96
108
|
fontFamily: {
|
|
@@ -5,6 +5,7 @@ export * from './use-debounce-call';
|
|
|
5
5
|
export * from './use-filter';
|
|
6
6
|
export * from './use-hf';
|
|
7
7
|
export * from './use-media-query';
|
|
8
|
+
export * from './use-observed-width-key';
|
|
8
9
|
export * from './use-opened-state';
|
|
9
10
|
export * from './use-previous';
|
|
10
11
|
export * from './use-smart-number-input';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks the rounded CSS-pixel width of an element via ResizeObserver.
|
|
3
|
+
* Useful when a layout should collapse by container width, not viewport.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useObservedWidthKey<T extends HTMLElement>(): {
|
|
6
|
+
ref: import('react').RefObject<T | null>;
|
|
7
|
+
widthKey: number;
|
|
8
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './components/app-bar';
|
|
|
8
8
|
export * from './components/assets-list-cell';
|
|
9
9
|
export * from './components/badge';
|
|
10
10
|
export * from './components/base-link';
|
|
11
|
+
export * from './components/base-table';
|
|
11
12
|
export * from './components/block-sync-pill';
|
|
12
13
|
export * from './components/breadcrumbs';
|
|
13
14
|
export * from './components/breakpoint-provider';
|
|
@@ -15,6 +16,7 @@ export * from './components/buttons';
|
|
|
15
16
|
export * from './components/cards';
|
|
16
17
|
export * from './components/checkbox';
|
|
17
18
|
export * from './components/client-adapters';
|
|
19
|
+
export * from './components/collateral-allocation-tooltip';
|
|
18
20
|
export * from './components/composites';
|
|
19
21
|
export * from './components/compound-apy';
|
|
20
22
|
export * from './components/confirm-menu';
|
|
@@ -34,8 +36,10 @@ export * from './components/guard';
|
|
|
34
36
|
export * from './components/head-cell';
|
|
35
37
|
export * from './components/health-factor';
|
|
36
38
|
export * from './components/help-tip';
|
|
39
|
+
export * from './components/hf-indicator';
|
|
37
40
|
export * from './components/icon-button';
|
|
38
41
|
export * from './components/icons';
|
|
42
|
+
export * from './components/infinite-scroll';
|
|
39
43
|
export * from './components/input';
|
|
40
44
|
export * from './components/label';
|
|
41
45
|
export * from './components/layout';
|
|
@@ -45,6 +49,7 @@ export * from './components/loader';
|
|
|
45
49
|
export * from './components/loading';
|
|
46
50
|
export * from './components/loading-bar';
|
|
47
51
|
export * from './components/modal';
|
|
52
|
+
export * from './components/name-cell';
|
|
48
53
|
export * from './components/navbar-logo';
|
|
49
54
|
export * from './components/navigation-context';
|
|
50
55
|
export * from './components/network-icon';
|
|
@@ -98,5 +103,5 @@ export * from './utils/a11y';
|
|
|
98
103
|
export { cn } from './utils/cn';
|
|
99
104
|
export * from './utils/copy';
|
|
100
105
|
export * from './utils/format';
|
|
101
|
-
export { formatMoney, formatPercentAmount, percentageTemplate, percentTemplate, } from './utils/format-money';
|
|
106
|
+
export { formatCompactPercent, formatMoney, formatPercentAmount, percentageTemplate, percentTemplate, } from './utils/format-money';
|
|
102
107
|
export * from './utils/templates';
|
|
@@ -6,6 +6,8 @@ declare const _default: {
|
|
|
6
6
|
"errors.tooManyRequests": "Too many requests",
|
|
7
7
|
"errors.incorrectAddress": "Incorrect address",
|
|
8
8
|
"components.errorMessage.oops": "Oops...",
|
|
9
|
+
"components.networkIndicator.title": "Network",
|
|
10
|
+
"components.infiniteScrollWrapper.showMore": "Show more",
|
|
9
11
|
|
|
10
12
|
"components.alertModal.ok": "Ok",
|
|
11
13
|
|
|
@@ -84,21 +86,20 @@ declare const _default: {
|
|
|
84
86
|
"components.apyParts.points": "{symbol} Incentive",
|
|
85
87
|
"components.apyParts.points.condition.crossDeposit": "For cross-chain deposits made via Omni",
|
|
86
88
|
|
|
87
|
-
"components.yieldBreakdown.
|
|
88
|
-
"components.yieldBreakdown.
|
|
89
|
-
"components.yieldBreakdown.
|
|
90
|
-
"components.yieldBreakdown.incentiveYield": "Incentive Yield",
|
|
89
|
+
"components.yieldBreakdown.titleNetAtLeverage": "Net APY at {leverage}× Leverage",
|
|
90
|
+
"components.yieldBreakdown.collateralApy": "Collateral APY",
|
|
91
|
+
"components.yieldBreakdown.incentive": "Incentive",
|
|
91
92
|
"components.yieldBreakdown.borrowRate": "Borrow Rate",
|
|
92
|
-
"components.yieldBreakdown.
|
|
93
|
-
"components.yieldBreakdown.additionalRate": "Additional Rate",
|
|
94
|
-
"components.yieldBreakdown.netYield": "Net Yield",
|
|
93
|
+
"components.yieldBreakdown.programPoints": "{name} Points",
|
|
95
94
|
"components.yieldBreakdown.points": "Points",
|
|
96
95
|
|
|
97
96
|
"components.openCopyButtons.copy": "Copy to clipboard",
|
|
98
97
|
|
|
99
|
-
"components.poolAssetsTable.asset": "
|
|
98
|
+
"components.poolAssetsTable.asset": "Name",
|
|
100
99
|
"components.poolAssetsTable.rate": "Effective rate",
|
|
101
|
-
"components.poolAssetsTable.
|
|
100
|
+
"components.poolAssetsTable.exposure": "Exposure",
|
|
101
|
+
"components.poolAssetsTable.cap": "Cap",
|
|
102
|
+
"components.poolAssetsTable.capUtilization": "Cap utilization",
|
|
102
103
|
"components.poolAssetsTable.usage": "{amount} of {total}",
|
|
103
104
|
"components.poolAssetsTable.head.name": "Credit Manager",
|
|
104
105
|
"components.poolAssetsTable.head.currentDebt": "Current Debt",
|
|
@@ -198,28 +199,32 @@ declare const _default: {
|
|
|
198
199
|
"components.historyChart.error": "Couldn't load chart data",
|
|
199
200
|
"components.historyChart.empty": "No data",
|
|
200
201
|
|
|
201
|
-
"components.positionTypeBadge.pool": "
|
|
202
|
+
"components.positionTypeBadge.pool": "LP",
|
|
202
203
|
"components.positionTypeBadge.strategy": "Strategy",
|
|
203
204
|
"components.positionTypeBadge.liquidation": "Liquidation",
|
|
204
205
|
|
|
206
|
+
"components.positionStatusBadge.active": "Active",
|
|
207
|
+
"components.positionStatusBadge.repaid": "Repaid",
|
|
208
|
+
|
|
205
209
|
"components.titleMeta.unknownCurator": "Curator",
|
|
206
210
|
|
|
207
211
|
"components.moreAccordion.more": "More details",
|
|
208
212
|
"components.moreAccordion.less": "Less details",
|
|
209
213
|
|
|
210
214
|
"components.poolApyBreakdownCard.title": "APY Breakdown",
|
|
211
|
-
"components.poolApyBreakdownCard.
|
|
212
|
-
"components.poolApyBreakdownCard.
|
|
213
|
-
"components.poolApyBreakdownCard.apy30d": "APY 30d",
|
|
215
|
+
"components.poolApyBreakdownCard.organicApy": "Pool organic APY",
|
|
216
|
+
"components.poolApyBreakdownCard.incentiveApy": "Incentive APY",
|
|
214
217
|
|
|
215
|
-
"components.strategyApyBreakdownCard.
|
|
216
|
-
"components.strategyApyBreakdownCard.formula": "How strategy APY is calculated: Collateral APY x Leverage - Base borrow rate x (Leverage - 1) - Additional borrow rate x Leverage x 1.05",
|
|
218
|
+
"components.strategyApyBreakdownCard.titleAtLeverage": "APY at {leverage}× Leverage",
|
|
217
219
|
"components.strategyApyBreakdownCard.collateralApy": "Collateral APY",
|
|
218
|
-
"components.strategyApyBreakdownCard.
|
|
219
|
-
"components.strategyApyBreakdownCard.
|
|
220
|
+
"components.strategyApyBreakdownCard.incentiveApy": "Incentive APY",
|
|
221
|
+
"components.strategyApyBreakdownCard.borrowRate": "Borrow Rate",
|
|
222
|
+
"components.strategyApyBreakdownCard.formula": "{base} × {leverage} Lev.",
|
|
223
|
+
|
|
224
|
+
"components.leveragePresetChips.label": "Leverage:",
|
|
220
225
|
|
|
221
226
|
"components.liquidationParamsTable.lt": "Liquidation threshold",
|
|
222
|
-
"components.liquidationParamsTable.penalty": "Liquidation
|
|
227
|
+
"components.liquidationParamsTable.penalty": "Liquidation discount",
|
|
223
228
|
"components.liquidationParamsTable.premium": "Liquidation premium",
|
|
224
229
|
"components.liquidationParamsTable.fee": "Liquidation fee",
|
|
225
230
|
|
|
@@ -14,21 +14,27 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function formatMoney(money: number | bigint, precision?: number): string;
|
|
16
16
|
/**
|
|
17
|
-
* Formats a percentage
|
|
17
|
+
* Formats a percentage with compact suffixes (`K` / `M` / `B` / `T`) instead
|
|
18
|
+
* of scientific notation. Input is already in percent form (`14000` → `14K%`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatCompactPercent(value: number, decimals?: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* Formats a percentage amount. Values of 1,000% and above use compact
|
|
23
|
+
* suffixes (`14K`) instead of exponential notation.
|
|
18
24
|
*
|
|
19
25
|
* @param value - The percentage value (already in percent form, e.g., 2.81 for 2.81%)
|
|
20
26
|
* @param decimals - Number of decimal places (default: 2)
|
|
21
|
-
* @param
|
|
27
|
+
* @param compact - Whether to compact large values (default: true)
|
|
22
28
|
* @returns Formatted number (without % sign)
|
|
23
29
|
*
|
|
24
30
|
* @example
|
|
25
31
|
* ```ts
|
|
26
32
|
* formatPercentAmount(2.81, 2) // "2.81"
|
|
27
|
-
* formatPercentAmount(
|
|
28
|
-
* formatPercentAmount(
|
|
33
|
+
* formatPercentAmount(14000, 2) // "14K"
|
|
34
|
+
* formatPercentAmount(14000, 2, false) // "14000.00"
|
|
29
35
|
* ```
|
|
30
36
|
*/
|
|
31
|
-
export declare function formatPercentAmount(value: number, decimals: number,
|
|
37
|
+
export declare function formatPercentAmount(value: number, decimals: number, compact?: boolean): string | number;
|
|
32
38
|
/**
|
|
33
39
|
* Formats a percentage value that is already in percent form
|
|
34
40
|
* Use this when your value is already 2.81 (meaning 2.81%), not 0.0281
|
|
@@ -9,10 +9,12 @@ export * from './colors';
|
|
|
9
9
|
export * from './copy';
|
|
10
10
|
export * from './format';
|
|
11
11
|
export * from './format-asset-amount';
|
|
12
|
-
export
|
|
12
|
+
export * from './format-leverage';
|
|
13
|
+
export { formatCompactPercent, formatMoney, formatMoneyAmount, formatPercentAmount, percentageTemplate, percentTemplate, } from './format-money';
|
|
13
14
|
export { FORMAT_CONSTANTS, type FormatNumberOptions, formatNumberWithSuffix, formatPrice, getAdaptiveDecimals, isBelowDisplayThreshold, isEffectivelyZero, toSignificantDigits, } from './format-number';
|
|
14
15
|
export * from './format-slippage';
|
|
15
16
|
export * from './interface';
|
|
17
|
+
export * from './leverage-presets';
|
|
16
18
|
export * from './loading';
|
|
17
19
|
export * from './math';
|
|
18
20
|
export * from './network-icons';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leverage chips beside the strategy yield chart: 30% and 70% of the
|
|
3
|
+
* (1 → max) span, rounded to 0.5, plus max itself.
|
|
4
|
+
*/
|
|
5
|
+
export declare function leveragePresets(max: number): number[];
|
|
6
|
+
/** Chip / subtitle leverage without trailing zeros: `5`, `5.5`, `9.54`. */
|
|
7
|
+
export declare function formatChipLeverage(leverage: number): string;
|
package/package.json
CHANGED
package/src/styles/base.css
CHANGED
|
@@ -71,6 +71,8 @@ html.dark {
|
|
|
71
71
|
--success-foreground: 0 0% 0%;
|
|
72
72
|
--success-hover: 136.58 100% 85.1%;
|
|
73
73
|
--warning: 38 95% 45%;
|
|
74
|
+
--info: 214 80% 46%;
|
|
75
|
+
--info-foreground: 0 0% 100%;
|
|
74
76
|
--liquidation: 274 67% 48%;
|
|
75
77
|
--liquidation-line: 38 92% 50%;
|
|
76
78
|
--input: 225 10% 88%;
|
|
@@ -93,6 +95,19 @@ html.dark {
|
|
|
93
95
|
--white-foreground: 240 2.56% 7.65%;
|
|
94
96
|
--black: 0 0% 0%;
|
|
95
97
|
--border: 225 10% 88%;
|
|
98
|
+
--divider: 225 10% 88%;
|
|
99
|
+
--chart-1: 18 83.05% 65.29%;
|
|
100
|
+
--chart-2: 188 62.26% 58.43%;
|
|
101
|
+
--chart-3: 326 73.71% 65.69%;
|
|
102
|
+
--chart-4: 130 44.33% 61.96%;
|
|
103
|
+
--chart-5: 257 88.96% 68.04%;
|
|
104
|
+
--chart-6: 40 72.04% 63.53%;
|
|
105
|
+
--chart-7: 212 92.43% 63.73%;
|
|
106
|
+
--chart-8: 347 78.53% 65.29%;
|
|
107
|
+
--chart-9: 167 44.1% 55.1%;
|
|
108
|
+
--chart-10: 288 64.32% 63.73%;
|
|
109
|
+
--chart-11: 76 57.14% 61.57%;
|
|
110
|
+
--chart-12: 235 89.54% 70%;
|
|
96
111
|
}
|
|
97
112
|
|
|
98
113
|
.dark {
|
|
@@ -119,6 +134,8 @@ html.dark {
|
|
|
119
134
|
--success-hover: 136.58 100% 85.1%;
|
|
120
135
|
--destructive-foreground: 0 0% 100%;
|
|
121
136
|
--warning: 43.12 100% 68.63%;
|
|
137
|
+
--info: 215 88% 67%;
|
|
138
|
+
--info-foreground: 0 0% 100%;
|
|
122
139
|
--liquidation: 277.22 74.53% 58.43%;
|
|
123
140
|
--liquidation-line: 38 92% 50%;
|
|
124
141
|
--input: 225 6% 19%;
|
|
@@ -140,6 +157,19 @@ html.dark {
|
|
|
140
157
|
--white-foreground: 240 2.56% 7.65%;
|
|
141
158
|
--black: 0 0% 0%;
|
|
142
159
|
--border: 0 0% 100% / 0.07;
|
|
160
|
+
--divider: 218 8% 19%;
|
|
161
|
+
--chart-1: 18 83.05% 65.29%;
|
|
162
|
+
--chart-2: 188 62.26% 58.43%;
|
|
163
|
+
--chart-3: 326 73.71% 65.69%;
|
|
164
|
+
--chart-4: 130 44.33% 61.96%;
|
|
165
|
+
--chart-5: 257 88.96% 68.04%;
|
|
166
|
+
--chart-6: 40 72.04% 63.53%;
|
|
167
|
+
--chart-7: 212 92.43% 63.73%;
|
|
168
|
+
--chart-8: 347 78.53% 65.29%;
|
|
169
|
+
--chart-9: 167 44.1% 55.1%;
|
|
170
|
+
--chart-10: 288 64.32% 63.73%;
|
|
171
|
+
--chart-11: 76 57.14% 61.57%;
|
|
172
|
+
--chart-12: 235 89.54% 70%;
|
|
143
173
|
}
|
|
144
174
|
}
|
|
145
175
|
|