@gearbox-protocol/ui-kit 4.0.0-next.34 → 4.0.0-next.36

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.
@@ -5,6 +5,7 @@ export declare class ValueTest {
5
5
  static utilization: string;
6
6
  static healthFactor: string;
7
7
  static pnl: string;
8
+ static priceImpact: string;
8
9
  static tokenBigint: string;
9
10
  static points: string;
10
11
  static placeholder: string;
@@ -4,4 +4,5 @@ export { PointsValue, type PointsValueProps } from './points-value';
4
4
  export { PositionShortLabel, PositionShortLabelTest, } from './position-short-label';
5
5
  export { type PositionStatus, PositionStatusBadge, type PositionStatusBadgeProps, } from './position-status-badge';
6
6
  export { PositionTypeBadge, type PositionTypeBadgeProps, } from './position-type-badge';
7
+ export { PriceImpactValue, priceImpact } from './price-impact-value';
7
8
  export { ApyValue, type ApyValueProps, bps, HealthFactorValue, LeverageValue, TokenBigint, UsdValue, UtilizationValue, } from './scalars';
@@ -1,6 +1,12 @@
1
1
  import { PnlBreakdown } from '@gearbox-protocol/sdk/model';
2
2
  import { default as React } from 'react';
3
- /** Realised + unrealised PnL of a position, signed. */
3
+ /**
4
+ * Realised + unrealised PnL, signed.
5
+ *
6
+ * A breakdown (a position's own) or a bare USD figure (a wallet's total, which
7
+ * the model carries as a plain number) — the same pairing {@link ApyValue}
8
+ * makes between a breakdown and a bare rate.
9
+ */
4
10
  export declare function PnlValue({ data, }: {
5
- readonly data: PnlBreakdown | undefined;
11
+ readonly data: PnlBreakdown | number | null | undefined;
6
12
  }): React.ReactElement;
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * A price impact as a percentage.
4
+ *
5
+ * The scale is `PERCENTAGE_FACTOR_1KK` — `1_000_000` is 100%, so `-10_000` is
6
+ * -1% — the legacy price-impact scale, a hundred times finer than the `Bps`
7
+ * the rest of this module speaks. The conversion is owned here for the same
8
+ * reason `bps` owns its own: `percentageTemplate` carries a same-named,
9
+ * differently-scaled twin, so a shared step would inherit that ambiguity.
10
+ *
11
+ * A loss is what this figure almost always is, and it prints its own minus.
12
+ * Only the rare route that beat the marginal price needs its sign spelled out,
13
+ * or a gain would read as a loss of the same size.
14
+ */
15
+ export declare function priceImpact(value: bigint): string;
16
+ /**
17
+ * What a routed operation gave up to market depth.
18
+ *
19
+ * Which of the three rates a caller shows — against the routed output, the
20
+ * equity or the position — is the caller's choice; this renders the one it is
21
+ * handed.
22
+ */
23
+ export declare function PriceImpactValue({ data, }: {
24
+ readonly data: bigint | undefined;
25
+ }): 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.34",
3
+ "version": "4.0.0-next.36",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",