@gearbox-protocol/ui-kit 4.0.0-next.43 → 4.0.0-next.45
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/liquidation-price-block/liquidation-price-block.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/time-to-liquidation-block/time-to-liquidation-block.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-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/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.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/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/cjs/utils/format.cjs +1 -1
- package/dist/cjs/utils/index.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/liquidation-price-block/liquidation-price-block.js +46 -38
- 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 +45 -41
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
- package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +40 -32
- 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-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/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +26 -25
- 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/with-copy/with-copy.js +1 -1
- package/dist/esm/index.js +814 -811
- package/dist/esm/locale/en.json.js +1 -0
- package/dist/esm/utils/format.js +14 -12
- package/dist/esm/utils/index.js +76 -75
- 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/liquidation-price-block/liquidation-price-block.d.ts +8 -1
- package/dist/types/components/base/position-assets/position-assets.d.ts +7 -1
- package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +8 -1
- 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/locale/en.json.d.ts +1 -0
- package/dist/types/utils/format.d.ts +8 -0
- package/package.json +1 -1
|
@@ -46,6 +46,7 @@ const e = {
|
|
|
46
46
|
"components.filterModal.noOptionsMatchSearch": "No options match your search",
|
|
47
47
|
"components.filterModal.reset": "Reset",
|
|
48
48
|
"components.filterModal.apply": "Apply",
|
|
49
|
+
"components.value.accruing": "Averaged data is still being computed and will be available shortly.",
|
|
49
50
|
"components.APY.tip": "These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.",
|
|
50
51
|
"components.creditSessionDetailedLiquidation.graph.noData": "No data",
|
|
51
52
|
"components.creditSessionDetailedLiquidation.graph.legend.point": "Current Price",
|
package/dist/esm/utils/format.js
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
const o = "≈";
|
|
2
|
+
function c(t) {
|
|
2
3
|
return `${(t / 1024).toFixed(2)} KB`;
|
|
3
4
|
}
|
|
4
|
-
function
|
|
5
|
+
function i(t) {
|
|
5
6
|
if (t === 0) return "-";
|
|
6
7
|
const e = Math.floor(t / 100), n = Math.floor(t % 100 / 10), r = t % 10;
|
|
7
8
|
return `v${e}.${n}.${r}`;
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function u(t) {
|
|
10
11
|
return new Date(t * 1e3).toLocaleString("en-GB", {
|
|
11
12
|
dateStyle: "short",
|
|
12
13
|
timeStyle: "short"
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function f(t, e = 4) {
|
|
16
17
|
if (!t) return "";
|
|
17
18
|
const n = t.slice(0, e + 2), r = t.slice(-e);
|
|
18
19
|
return `${n}...${r}`;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function a(t) {
|
|
21
22
|
return Math.floor(t * 100);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function s(t) {
|
|
24
25
|
if (t === 0) return "0";
|
|
25
26
|
if (t >= 1) return t.toFixed(0);
|
|
26
27
|
const e = t.toPrecision(2);
|
|
27
28
|
return e.includes("e") ? Number(e).toFixed(20).replace(/\.?0+$/, "") : e.replace(/\.?0+$/, "");
|
|
28
29
|
}
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
c as
|
|
33
|
-
i as
|
|
34
|
-
u as
|
|
35
|
-
|
|
31
|
+
o as APPROXIMATE_SYMBOL,
|
|
32
|
+
a as convertPercent,
|
|
33
|
+
c as formatBytecodeSize,
|
|
34
|
+
i as formatBytecodeVersion,
|
|
35
|
+
u as formatTimestamp,
|
|
36
|
+
f as shortenHash,
|
|
37
|
+
s as significantTrunc
|
|
36
38
|
};
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -4,110 +4,111 @@ import { bnToInputView as l } from "./bn-to-input-view.js";
|
|
|
4
4
|
import { bnToPrettyView as x } from "./bn-to-pretty-view.js";
|
|
5
5
|
import { bpsToPercent as c } from "./bps.js";
|
|
6
6
|
import { cn as S, cn as d } from "./cn.js";
|
|
7
|
-
import { generateColorsFromBase as h, getCSSVariable as
|
|
8
|
-
import { copyToClipboard as
|
|
9
|
-
import { convertPercent as
|
|
7
|
+
import { generateColorsFromBase as h, getCSSVariable as P, hexToRgba as A, hslToHex as v, resolveCSSColor as I } from "./colors.js";
|
|
8
|
+
import { copyToClipboard as L } from "./copy.js";
|
|
9
|
+
import { APPROXIMATE_SYMBOL as k, convertPercent as y, formatBytecodeSize as C, formatBytecodeVersion as w, formatTimestamp as O, shortenHash as F, significantTrunc as D } from "./format.js";
|
|
10
10
|
import { formatAssetAmount as V } from "./format-asset-amount.js";
|
|
11
|
-
import { formatLeverage as
|
|
12
|
-
import { formatCompactPercent as
|
|
13
|
-
import { FORMAT_CONSTANTS as
|
|
14
|
-
import { slippageTemplate as
|
|
15
|
-
import { formatChipLeverage as
|
|
16
|
-
import { allLoaded as
|
|
17
|
-
import { decimalsToStep as
|
|
18
|
-
import { getNetworkIcon as
|
|
19
|
-
import { bnToLiquidationPriceView as
|
|
20
|
-
import { pluralize as
|
|
11
|
+
import { formatLeverage as R } from "./format-leverage.js";
|
|
12
|
+
import { formatCompactPercent as E, formatMoney as H, formatMoneyAmount as W, formatPercentAmount as Z, percentTemplate as z, percentageTemplate as X } from "./format-money.js";
|
|
13
|
+
import { FORMAT_CONSTANTS as q, formatNumberWithSuffix as Y, formatPrice as j, getAdaptiveDecimals as G, isBelowDisplayThreshold as J, isEffectivelyZero as K, toSignificantDigits as Q } from "./format-number.js";
|
|
14
|
+
import { slippageTemplate as ee } from "./format-slippage.js";
|
|
15
|
+
import { formatChipLeverage as re, leveragePresets as te } from "./leverage-presets.js";
|
|
16
|
+
import { allLoaded as me, loadingProgress as ne, round5 as ie } from "./loading.js";
|
|
17
|
+
import { decimalsToStep as fe, findClosestPoint as le, formatWithDecimals as se, formatWithoutDecimals as xe, splitInterval as Te, validateMinMax as ce } from "./math.js";
|
|
18
|
+
import { getNetworkIcon as Se } from "./network-icons.js";
|
|
19
|
+
import { bnToLiquidationPriceView as ue, isPositiveFloat as he, parseInputToBN as Pe, parseSmallNumber as Ae } from "./parse-input-to-bn.js";
|
|
20
|
+
import { pluralize as Ie, selectPluralString as be } from "./plural.js";
|
|
21
21
|
import { getAvailableRanges as Ne } from "./ranges.js";
|
|
22
|
-
import { extractTextFromLabel as
|
|
23
|
-
import { searchInString as
|
|
24
|
-
import { createTokenSearchFilter as De, searchInToken as
|
|
22
|
+
import { extractTextFromLabel as ye, serializeValue as Ce } from "./react.js";
|
|
23
|
+
import { searchInString as Oe } from "./search.js";
|
|
24
|
+
import { createTokenSearchFilter as De, searchInToken as Me } from "./search-in-token.js";
|
|
25
25
|
import { shortSHA as Be } from "./short-sha.js";
|
|
26
|
-
import { isLongString as
|
|
27
|
-
import { negativeTokenTemplate as
|
|
28
|
-
import { getTokenIcon as
|
|
29
|
-
import { TTL_CONSTANTS as Ge, getTTLZones as Je, ttlFromTimestamp as Ke, ttlLeft as Qe, ttlLeftHuman as
|
|
30
|
-
import { openInNewWindow as
|
|
31
|
-
import { Z_INDEX as
|
|
26
|
+
import { isLongString as _e, shortenString as Ee } from "./shorten-string.js";
|
|
27
|
+
import { negativeTokenTemplate as We, tokenTemplate as Ze, tokenTemplateNumber as ze, tokenTemplateString as Xe } from "./templates.js";
|
|
28
|
+
import { getTokenIcon as qe, parseShareTokenUnderlying as Ye } from "./token-icon-source.js";
|
|
29
|
+
import { TTL_CONSTANTS as Ge, getTTLZones as Je, ttlFromTimestamp as Ke, ttlLeft as Qe, ttlLeftHuman as $e } from "./ttl.js";
|
|
30
|
+
import { openInNewWindow as oo } from "./window.js";
|
|
31
|
+
import { Z_INDEX as to, Z_INDEX_VALUES as ao } from "./z-index.js";
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
k as APPROXIMATE_SYMBOL,
|
|
34
|
+
q as FORMAT_CONSTANTS,
|
|
34
35
|
Ge as TTL_CONSTANTS,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
to as Z_INDEX,
|
|
37
|
+
ao as Z_INDEX_VALUES,
|
|
38
|
+
me as allLoaded,
|
|
38
39
|
l as bnToInputView,
|
|
39
|
-
|
|
40
|
+
ue as bnToLiquidationPriceView,
|
|
40
41
|
x as bnToPrettyView,
|
|
41
42
|
c as bpsToPercent,
|
|
42
43
|
S as cn,
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
y as convertPercent,
|
|
45
|
+
L as copyToClipboard,
|
|
45
46
|
De as createTokenSearchFilter,
|
|
46
|
-
|
|
47
|
+
fe as decimalsToStep,
|
|
47
48
|
d as default,
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
ye as extractTextFromLabel,
|
|
50
|
+
le as findClosestPoint,
|
|
50
51
|
V as formatAssetAmount,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
C as formatBytecodeSize,
|
|
53
|
+
w as formatBytecodeVersion,
|
|
54
|
+
re as formatChipLeverage,
|
|
55
|
+
E as formatCompactPercent,
|
|
56
|
+
R as formatLeverage,
|
|
57
|
+
H as formatMoney,
|
|
58
|
+
W as formatMoneyAmount,
|
|
59
|
+
Y as formatNumberWithSuffix,
|
|
60
|
+
Z as formatPercentAmount,
|
|
60
61
|
j as formatPrice,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
O as formatTimestamp,
|
|
63
|
+
se as formatWithDecimals,
|
|
64
|
+
xe as formatWithoutDecimals,
|
|
64
65
|
h as generateColorsFromBase,
|
|
65
66
|
r as generateId,
|
|
66
67
|
G as getAdaptiveDecimals,
|
|
67
68
|
Ne as getAvailableRanges,
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
P as getCSSVariable,
|
|
70
|
+
Se as getNetworkIcon,
|
|
70
71
|
Je as getTTLZones,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
qe as getTokenIcon,
|
|
73
|
+
A as hexToRgba,
|
|
74
|
+
v as hslToHex,
|
|
74
75
|
J as isBelowDisplayThreshold,
|
|
75
76
|
K as isEffectivelyZero,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
_e as isLongString,
|
|
78
|
+
he as isPositiveFloat,
|
|
79
|
+
te as leveragePresets,
|
|
80
|
+
ne as loadingProgress,
|
|
81
|
+
We as negativeTokenTemplate,
|
|
82
|
+
oo as openInNewWindow,
|
|
83
|
+
Pe as parseInputToBN,
|
|
84
|
+
Ye as parseShareTokenUnderlying,
|
|
85
|
+
Ae as parseSmallNumber,
|
|
86
|
+
z as percentTemplate,
|
|
87
|
+
X as percentageTemplate,
|
|
88
|
+
Ie as pluralize,
|
|
88
89
|
m as pointProgramsOf,
|
|
89
90
|
n as positiveTokenRewardsOf,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
I as resolveCSSColor,
|
|
92
|
+
ie as round5,
|
|
93
|
+
Oe as searchInString,
|
|
94
|
+
Me as searchInToken,
|
|
95
|
+
be as selectPluralString,
|
|
96
|
+
Ce as serializeValue,
|
|
96
97
|
Be as shortSHA,
|
|
97
98
|
F as shortenHash,
|
|
98
|
-
|
|
99
|
+
Ee as shortenString,
|
|
99
100
|
D as significantTrunc,
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
ee as slippageTemplate,
|
|
102
|
+
Te as splitInterval,
|
|
102
103
|
Q as toSignificantDigits,
|
|
103
104
|
i as tokenRewardsOf,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
Ze as tokenTemplate,
|
|
106
|
+
ze as tokenTemplateNumber,
|
|
107
|
+
Xe as tokenTemplateString,
|
|
107
108
|
p as totalApyOf,
|
|
108
109
|
Ke as ttlFromTimestamp,
|
|
109
110
|
Qe as ttlLeft,
|
|
110
|
-
|
|
111
|
+
$e as ttlLeftHuman,
|
|
111
112
|
t as useFormFieldIds,
|
|
112
|
-
|
|
113
|
+
ce as validateMinMax
|
|
113
114
|
};
|