@gearbox-protocol/ui-kit 4.0.0-next.42 → 4.0.0-next.44
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/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.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/no-value.cjs +1 -0
- package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
- package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/link/link.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
- package/dist/esm/components/base/index.js +63 -61
- package/dist/esm/components/base/info-list/info-list.js +8 -7
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
- package/dist/esm/components/base/position-assets/position-assets.js +4 -3
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
- package/dist/esm/components/base/token-amount/token-amount.js +32 -16
- package/dist/esm/components/base/values/constants.js +1 -0
- package/dist/esm/components/base/values/index.js +21 -19
- package/dist/esm/components/base/values/no-value.js +34 -0
- package/dist/esm/components/base/values/pnl-value.js +10 -9
- package/dist/esm/components/base/values/price-impact-value.js +6 -5
- package/dist/esm/components/base/values/scalars.js +23 -26
- package/dist/esm/components/base-table/base-table-line.js +44 -36
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +5 -11
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
- package/dist/esm/components/compound-apy/compound-apy.js +48 -40
- package/dist/esm/components/help-tip/help-tip.js +64 -59
- package/dist/esm/components/index.js +624 -622
- package/dist/esm/components/link/link.js +48 -34
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/index.js +805 -803
- package/dist/esm/locale/en.json.js +1 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
- package/dist/types/components/base/values/constants.d.ts +1 -0
- package/dist/types/components/base/values/index.d.ts +1 -0
- package/dist/types/components/base/values/no-value.d.ts +25 -0
- package/dist/types/components/base/values/scalars.d.ts +7 -2
- package/dist/types/components/client-adapters/styled-button/styled-button.d.ts +10 -5
- package/dist/types/locale/en.json.d.ts +1 -0
- package/package.json +1 -1
|
@@ -16,8 +16,8 @@ export declare function formatBreakdownRate(value: Bps): string;
|
|
|
16
16
|
export interface ApyBreakdownBodyProps {
|
|
17
17
|
/** Heading to the left of the chip — "Net APY (7d)" and the like. */
|
|
18
18
|
readonly title: React.ReactNode;
|
|
19
|
-
/** The figure the chip prints. */
|
|
20
|
-
readonly chip:
|
|
19
|
+
/** The figure the chip prints, or {@link NoValue} when there is none. */
|
|
20
|
+
readonly chip: React.ReactNode;
|
|
21
21
|
/** Green chip when the net is positive; muted otherwise. */
|
|
22
22
|
readonly chipPositive?: boolean;
|
|
23
23
|
readonly chipTestId?: string;
|
|
@@ -31,7 +31,8 @@ export interface ApyBreakdownBodyProps {
|
|
|
31
31
|
export declare function ApyBreakdownBody({ title, chip, chipPositive, chipTestId, children, testId, }: ApyBreakdownBodyProps): React.ReactElement;
|
|
32
32
|
export interface ApyBreakdownRowProps {
|
|
33
33
|
readonly label: React.ReactNode;
|
|
34
|
-
|
|
34
|
+
/** The rate, or {@link NoValue} when the feed has none. */
|
|
35
|
+
readonly value: React.ReactNode;
|
|
35
36
|
readonly subtext?: React.ReactNode;
|
|
36
37
|
readonly muted?: boolean;
|
|
37
38
|
readonly testId?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ValueTest } from './constants';
|
|
2
|
+
export { NoValue, type NoValueProps } from './no-value';
|
|
2
3
|
export { PnlValue } from './pnl-value';
|
|
3
4
|
export { PointsValue, type PointsValueProps } from './points-value';
|
|
4
5
|
export { PositionShortLabel, PositionShortLabelTest, } from './position-short-label';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface NoValueProps {
|
|
3
|
+
/**
|
|
4
|
+
* Why the figure is absent, when the absence has an explanation worth
|
|
5
|
+
* giving. `"7d"` — the trailing seven-day average has not been computed yet
|
|
6
|
+
* — is the only one so far; anything else, including a spot figure that is
|
|
7
|
+
* simply not there, keeps the dash.
|
|
8
|
+
*/
|
|
9
|
+
readonly reason?: "7d";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Whatever stands where a figure would be.
|
|
13
|
+
*
|
|
14
|
+
* One component rather than a dash per call site, so no two surfaces can
|
|
15
|
+
* quietly disagree about what an absent value looks like — and so an absence
|
|
16
|
+
* that has an explanation carries it everywhere at once rather than wherever
|
|
17
|
+
* someone remembered to add it.
|
|
18
|
+
*
|
|
19
|
+
* The explained form is deliberately not a skeleton: a skeleton promises the
|
|
20
|
+
* value in a moment, and this one waits on days of history.
|
|
21
|
+
*
|
|
22
|
+
* The visually-hidden copy is load-bearing — `HelpTipIcon` is `aria-hidden`,
|
|
23
|
+
* so without it the cell would reach a screen reader as nothing at all.
|
|
24
|
+
*/
|
|
25
|
+
export declare function NoValue({ reason }: NoValueProps): React.ReactElement;
|
|
@@ -10,7 +10,7 @@ import { default as React } from 'react';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function bps(value: Bps): string;
|
|
12
12
|
export interface ApyValueProps {
|
|
13
|
-
/** A breakdown (tooltip-able) or a bare rate; `undefined` renders
|
|
13
|
+
/** A breakdown (tooltip-able) or a bare rate; `undefined` renders the empty state. */
|
|
14
14
|
readonly data: ApyBreakdown | Bps | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Whether a breakdown carries its yield tooltip on hover. Off where the
|
|
@@ -22,7 +22,12 @@ export interface ApyValueProps {
|
|
|
22
22
|
* @default true
|
|
23
23
|
*/
|
|
24
24
|
readonly tooltip?: boolean;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The averaging window this figure comes from. `"7d"` suffixes the breakdown
|
|
27
|
+
* tooltip labels — and, when the rate is missing, says the average is still
|
|
28
|
+
* accruing rather than printing a dash. A spot figure keeps the dash: history
|
|
29
|
+
* has nothing to do with why it is absent.
|
|
30
|
+
*/
|
|
26
31
|
readonly period?: "7d";
|
|
27
32
|
}
|
|
28
33
|
/**
|
|
@@ -3,11 +3,16 @@ import * as React from "react";
|
|
|
3
3
|
type ButtonWidth = "compact" | "wide";
|
|
4
4
|
type ButtonColors = "primary" | "outlined" | "neutral" | "white" | "success";
|
|
5
5
|
type ButtonSize = "sm" | "md" | "lg";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
/**
|
|
7
|
+
* `color` and `square` are named in this component's own vocabulary, so both
|
|
8
|
+
* are omitted from `ButtonProps` before being redeclared — `color` otherwise
|
|
9
|
+
* collides with the HTML attribute.
|
|
10
|
+
*/
|
|
11
|
+
export interface StyledButtonProps extends Omit<ButtonProps, "size" | "width" | "variant" | "color"> {
|
|
12
|
+
size?: ButtonSize;
|
|
13
|
+
width?: ButtonWidth;
|
|
14
|
+
color?: ButtonColors;
|
|
15
|
+
square?: boolean;
|
|
11
16
|
}
|
|
12
17
|
declare const StyledButton: React.ForwardRefExoticComponent<StyledButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
18
|
export { StyledButton };
|
|
@@ -60,6 +60,7 @@ declare const _default: {
|
|
|
60
60
|
"components.filterModal.reset": "Reset",
|
|
61
61
|
"components.filterModal.apply": "Apply",
|
|
62
62
|
|
|
63
|
+
"components.value.accruing": "Averaged data is still being computed and will be available shortly.",
|
|
63
64
|
"components.APY.tip": "These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.",
|
|
64
65
|
|
|
65
66
|
"components.creditSessionDetailedLiquidation.graph.noData": "No data",
|