@gearbox-protocol/ui-kit 4.0.0-next.2 → 4.0.0-next.3
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/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +30 -25
- package/dist/esm/components/base/index.js +40 -39
- package/dist/esm/components/base/values/index.js +8 -7
- package/dist/esm/components/base/values/scalars.js +27 -26
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +14 -13
- package/dist/esm/components/index.js +561 -560
- package/dist/esm/index.js +733 -732
- package/dist/types/components/base/borrow-rate-block/borrow-rate-block.d.ts +10 -5
- package/dist/types/components/base/values/index.d.ts +1 -1
- package/dist/types/components/base/values/scalars.d.ts +9 -0
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BorrowRateBreakdown, Bps } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { BorrowRateBlockTest } from './constants';
|
|
4
4
|
export { BorrowRateBlockTest };
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The SDK's `borrowRate` breakdown, or a bare `Bps` when only the position's
|
|
7
|
+
* plain `borrowApy` is available (offchain mode: no breakdown to split into
|
|
8
|
+
* total / base). A caller never picks a field itself, so `total` and `base`
|
|
9
|
+
* can't drift out of sync the way threading two separately-extracted `Bps`
|
|
10
|
+
* numbers through two props invited.
|
|
11
|
+
*/
|
|
12
|
+
export type BorrowRateValue = BorrowRateBreakdown | Bps;
|
|
6
13
|
export interface BorrowRateBlockProps {
|
|
7
14
|
readonly data: BorrowRateValue | undefined;
|
|
8
15
|
readonly dataTo?: BorrowRateValue;
|
|
9
|
-
/** SDK `borrowRate.base`; omit when the breakdown is missing. */
|
|
10
|
-
readonly base?: BorrowRateValue;
|
|
11
16
|
}
|
|
12
17
|
/**
|
|
13
18
|
* Borrow-rate row: total on the trigger, Base Rate from the SDK, Rates
|
|
14
19
|
* normalization as a dash until the SDK reports it.
|
|
15
20
|
*/
|
|
16
|
-
export declare function BorrowRateBlock({ data, dataTo,
|
|
21
|
+
export declare function BorrowRateBlock({ data, dataTo, }: BorrowRateBlockProps): React.ReactElement;
|
|
@@ -2,4 +2,4 @@ export { ValueTest } from './constants';
|
|
|
2
2
|
export { PnlValue } from './pnl-value';
|
|
3
3
|
export { PositionShortLabel, PositionShortLabelTest, } from './position-short-label';
|
|
4
4
|
export { PositionTypeBadge, type PositionTypeBadgeProps, } from './position-type-badge';
|
|
5
|
-
export { ApyValue, type ApyValueProps, HealthFactorValue, LeverageValue, TokenBigint, UsdValue, UtilizationValue, } from './scalars';
|
|
5
|
+
export { ApyValue, type ApyValueProps, bps, HealthFactorValue, LeverageValue, TokenBigint, UsdValue, UtilizationValue, } from './scalars';
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { ApyBreakdown, Bps, Leverage, Token } from '@gearbox-protocol/sdk/model';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Basis points as a percentage (`10000` = 100%); the model's `Bps` is `number`.
|
|
5
|
+
*
|
|
6
|
+
* Self-contained on purpose: `percentageTemplate` (format-money) carries a
|
|
7
|
+
* same-named, oppositely-scaled twin in `templates.tsx` (already-percent
|
|
8
|
+
* input), so a shared bps→percent step here would inherit that ambiguity.
|
|
9
|
+
* `bps` is the one place that owns the conversion.
|
|
10
|
+
*/
|
|
11
|
+
export declare function bps(value: Bps): string;
|
|
3
12
|
export interface ApyValueProps {
|
|
4
13
|
/** A breakdown (tooltip-able) or a bare rate; `undefined` renders a dash. */
|
|
5
14
|
readonly data: ApyBreakdown | Bps | undefined;
|
|
@@ -10,6 +10,6 @@ export interface PoolAssetsTableRowProps {
|
|
|
10
10
|
readonly last: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Single data row: token + pool name, `
|
|
13
|
+
* Single data row: token + pool name, `bps`-formatted rate, and formatted usage vs limit.
|
|
14
14
|
*/
|
|
15
15
|
export declare function PoolAssetsTableRow({ poolName, token, currentQuota, underlyingToken, last, }: PoolAssetsTableRowProps): React.ReactElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/ui-kit",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.3",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"@commitlint/cli": "^20.1.0",
|
|
117
117
|
"@commitlint/config-conventional": "^20.0.0",
|
|
118
118
|
"@gearbox-protocol/biome-config": "^1.0.2",
|
|
119
|
-
"@gearbox-protocol/sdk": "15.1.0-next.
|
|
119
|
+
"@gearbox-protocol/sdk": "15.1.0-next.8",
|
|
120
120
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
121
121
|
"@storybook/addon-a11y": "^10.0.8",
|
|
122
122
|
"@storybook/addon-docs": "^10.0.8",
|