@gearbox-protocol/permissionless-ui 1.22.0-next.2 → 1.22.0-next.21
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/buttons/button/button.cjs +1 -1
- package/dist/cjs/components/buttons/navigation-button/navigation-button.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/index.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-dialog-container/index.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-dialog-container/styled-dialog-container.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-rounded-image/index.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -0
- package/dist/cjs/components/description/description.cjs +1 -1
- package/dist/cjs/components/dialog/dialog-container.cjs +1 -1
- package/dist/cjs/components/dialog/dialog-modal-container.cjs +1 -1
- package/dist/cjs/components/dialog/index.cjs +1 -1
- package/dist/cjs/components/filter/filter-modal.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/app-logo/app-logo.cjs +1 -1
- package/dist/cjs/components/layout/col/col.cjs +1 -1
- package/dist/cjs/components/layout/container/container.cjs +1 -1
- package/dist/cjs/components/layout/footer/footer.cjs +1 -1
- package/dist/cjs/components/layout/grid/grid.cjs +1 -1
- package/dist/cjs/components/layout/header/header.cjs +1 -1
- package/dist/cjs/components/layout/layout/layout.cjs +2 -2
- package/dist/cjs/components/modal/index.cjs +1 -0
- package/dist/cjs/components/modal/modal.cjs +1 -0
- package/dist/cjs/components/network-icon/network-icon.cjs +1 -1
- package/dist/cjs/components/points-icon/points-icon.cjs +1 -1
- package/dist/cjs/components/rounded-image/rounded-image.cjs +1 -1
- package/dist/cjs/components/short-string/short-string.cjs +1 -1
- package/dist/cjs/components/table/grid-table.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/components/typography/typography.cjs +1 -1
- package/dist/cjs/components/vertical-list/vertical-list.cjs +1 -1
- package/dist/cjs/configs/tailwind-preset.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/format-money.cjs +1 -1
- package/dist/cjs/utils/format-slippage.cjs +1 -0
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/network-icons.cjs +1 -1
- package/dist/cjs/utils/search-in-token.cjs +1 -1
- package/dist/cjs/utils/shorten-string.cjs +1 -1
- package/dist/cjs/utils/static.cjs +1 -0
- package/dist/cjs/utils/templates.cjs +1 -1
- package/dist/cjs/utils/window.cjs +1 -1
- package/dist/cjs/utils/z-index.cjs +1 -0
- package/dist/esm/components/buttons/button/button.js +22 -15
- package/dist/esm/components/buttons/navigation-button/navigation-button.js +6 -6
- package/dist/esm/components/checkbox/checkbox-labeled.js +7 -1
- package/dist/esm/components/client-adapters/index.js +6 -2
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +24 -13
- package/dist/esm/components/client-adapters/styled-dialog-container/index.js +4 -0
- package/dist/esm/components/client-adapters/styled-dialog-container/styled-dialog-container.js +39 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/index.js +4 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +136 -0
- package/dist/esm/components/description/description.js +16 -10
- package/dist/esm/components/dialog/dialog-container.js +55 -21
- package/dist/esm/components/dialog/dialog-modal-container.js +38 -17
- package/dist/esm/components/dialog/index.js +18 -18
- package/dist/esm/components/filter/filter-modal.js +1 -1
- package/dist/esm/components/index.js +470 -466
- package/dist/esm/components/layout/app-logo/app-logo.js +8 -7
- package/dist/esm/components/layout/col/col.js +4 -4
- package/dist/esm/components/layout/container/container.js +5 -5
- package/dist/esm/components/layout/footer/footer.js +3 -3
- package/dist/esm/components/layout/grid/grid.js +9 -9
- package/dist/esm/components/layout/header/header.js +12 -12
- package/dist/esm/components/layout/layout/layout.js +4 -4
- package/dist/esm/components/modal/index.js +4 -0
- package/dist/esm/components/modal/modal.js +108 -0
- package/dist/esm/components/network-icon/network-icon.js +22 -21
- package/dist/esm/components/points-icon/points-icon.js +34 -37
- package/dist/esm/components/rounded-image/rounded-image.js +59 -27
- package/dist/esm/components/short-string/short-string.js +19 -23
- package/dist/esm/components/table/grid-table.js +2 -0
- package/dist/esm/components/token-icon/token-icon.js +45 -39
- package/dist/esm/components/token-symbol/token-symbol.js +98 -40
- package/dist/esm/components/typography/typography.js +15 -12
- package/dist/esm/components/vertical-list/vertical-list.js +39 -33
- package/dist/esm/configs/tailwind-preset.js +5 -3
- package/dist/esm/index.js +606 -601
- package/dist/esm/utils/format-money.js +13 -17
- package/dist/esm/utils/format-slippage.js +7 -0
- package/dist/esm/utils/index.js +66 -65
- package/dist/esm/utils/network-icons.js +4 -53
- package/dist/esm/utils/search-in-token.js +8 -8
- package/dist/esm/utils/shorten-string.js +7 -3
- package/dist/esm/utils/static.js +6 -0
- package/dist/esm/utils/templates.js +8 -9
- package/dist/esm/utils/window.js +4 -3
- package/dist/esm/utils/z-index.js +7 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/auth/connect-required.d.ts +2 -2
- package/dist/types/components/auth/signin-required.d.ts +2 -2
- package/dist/types/components/buttons/button/button.d.ts +1 -1
- package/dist/types/components/buttons/navigation-button/navigation-button.d.ts +1 -1
- package/dist/types/components/client-adapters/index.d.ts +2 -0
- package/dist/types/components/client-adapters/styled-button/styled-button.d.ts +2 -2
- package/dist/types/components/client-adapters/styled-dialog-container/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-dialog-container/styled-dialog-container.d.ts +13 -0
- package/dist/types/components/client-adapters/styled-rounded-image/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-rounded-image/styled-rounded-image.d.ts +9 -0
- package/dist/types/components/description/description.d.ts +5 -3
- package/dist/types/components/dialog/dialog-container.d.ts +8 -3
- package/dist/types/components/dialog/dialog-modal-container.d.ts +9 -3
- package/dist/types/components/dialog/dialog.d.ts +3 -3
- package/dist/types/components/dialog/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/layout/col/col.d.ts +1 -1
- package/dist/types/components/layout/container/container.d.ts +1 -1
- package/dist/types/components/layout/footer/footer.d.ts +1 -1
- package/dist/types/components/layout/grid/grid.d.ts +1 -1
- package/dist/types/components/layout/header/header.d.ts +1 -1
- package/dist/types/components/layout/layout/layout.d.ts +1 -1
- package/dist/types/components/modal/index.d.ts +1 -0
- package/dist/types/components/modal/modal.d.ts +33 -0
- package/dist/types/components/navbar/navbar-indicator-context.d.ts +1 -1
- package/dist/types/components/points-icon/points-icon.d.ts +2 -5
- package/dist/types/components/pool-points-indicator/pool-points-indicator.d.ts +1 -1
- package/dist/types/components/rounded-image/rounded-image.d.ts +19 -4
- package/dist/types/components/short-string/short-string.d.ts +4 -4
- package/dist/types/components/skeleton/skeleton.d.ts +1 -1
- package/dist/types/components/theme-provider.d.ts +1 -1
- package/dist/types/components/tip-card/tip-card.d.ts +1 -1
- package/dist/types/components/token-icon/token-icon.d.ts +10 -4
- package/dist/types/components/token-symbol/token-symbol.d.ts +9 -4
- package/dist/types/components/typography/typography.d.ts +2 -2
- package/dist/types/components/vertical-list/vertical-list.d.ts +2 -5
- package/dist/types/components/with-copy/with-copy.d.ts +1 -1
- package/dist/types/configs/tailwind-preset.d.ts +2 -0
- package/dist/types/hooks/use-filter.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/component-props.d.ts +1 -1
- package/dist/types/utils/format-money.d.ts +0 -15
- package/dist/types/utils/format-slippage.d.ts +15 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/utils/network-icons.d.ts +3 -32
- package/dist/types/utils/shorten-string.d.ts +2 -1
- package/dist/types/utils/static.d.ts +3 -0
- package/dist/types/utils/templates.d.ts +1 -1
- package/dist/types/utils/window.d.ts +3 -1
- package/dist/types/utils/z-index.d.ts +8 -0
- package/package.json +4 -1
- package/src/styles/base.css +17 -6
- package/src/styles/theme.css +26 -0
- package/dist/cjs/components/dialog/dialog-modal.cjs +0 -1
- package/dist/esm/components/dialog/dialog-modal.js +0 -70
- package/dist/types/components/dialog/dialog-modal.d.ts +0 -30
|
@@ -3,9 +3,9 @@ const N = 10000000000000000n;
|
|
|
3
3
|
function b(t) {
|
|
4
4
|
return BigInt(t.toFixed(18).replace(".", ""));
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
const r = typeof t == "number" && t < 0 || typeof t == "bigint" && t < 0n ? "-" : "", o = typeof t == "number" ? b(Math.abs(t)) : f.abs(t), u = o < N && o > 0n,
|
|
8
|
-
return u ? `< ${
|
|
6
|
+
function p(t, e) {
|
|
7
|
+
const r = typeof t == "number" && t < 0 || typeof t == "bigint" && t < 0n ? "-" : "", o = typeof t == "number" ? b(Math.abs(t)) : f.abs(t), u = o < N && o > 0n, i = u ? "0.01" : a(o, s, e), c = `${r}$${i}`;
|
|
8
|
+
return u ? `< ${c}` : c;
|
|
9
9
|
}
|
|
10
10
|
const y = 1e4;
|
|
11
11
|
function m(t, e, n = !0) {
|
|
@@ -15,13 +15,13 @@ function m(t, e, n = !0) {
|
|
|
15
15
|
function g(t, e = 2) {
|
|
16
16
|
return `${m(t, e)}%`;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
const n = Number(t) / Number(
|
|
18
|
+
const E = 1e4;
|
|
19
|
+
function T(t, e = 2) {
|
|
20
|
+
const n = Number(t) / Number(E);
|
|
21
21
|
return `${m(n, e)}%`;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const A = 1000n;
|
|
24
|
+
function S(t, e) {
|
|
25
25
|
let n;
|
|
26
26
|
return typeof t == "string" ? n = Number.parseFloat(t) || 0 : typeof t == "bigint" ? n = Number(t) : n = t, typeof e == "number" ? new Intl.NumberFormat("en-US", {
|
|
27
27
|
style: "currency",
|
|
@@ -37,16 +37,12 @@ function F(t, e) {
|
|
|
37
37
|
currency: "USD"
|
|
38
38
|
}).format(n);
|
|
39
39
|
}
|
|
40
|
-
function S(t, e = 1) {
|
|
41
|
-
return t === void 0 ? "-" : `${(t / Number(p)).toFixed(e)}%`;
|
|
42
|
-
}
|
|
43
40
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
E as PERCENTAGE_FACTOR,
|
|
42
|
+
A as SLIPPAGE_DECIMALS,
|
|
43
|
+
p as formatMoney,
|
|
44
|
+
S as formatMoneyAmount,
|
|
48
45
|
m as formatPercentAmount,
|
|
49
46
|
g as percentTemplate,
|
|
50
|
-
|
|
51
|
-
S as slippageTemplate
|
|
47
|
+
T as percentageTemplate
|
|
52
48
|
};
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1,82 +1,83 @@
|
|
|
1
|
-
import { generateId as
|
|
2
|
-
import { bnToInputView as
|
|
1
|
+
import { generateId as r, useFormFieldIds as t } from "./a11y.js";
|
|
2
|
+
import { bnToInputView as a } from "./bn-to-input-view.js";
|
|
3
3
|
import { bnToPrettyView as p } from "./bn-to-pretty-view.js";
|
|
4
4
|
import { cn as i, cn as l } from "./cn.js";
|
|
5
5
|
import { generateColorsFromBase as T, getCSSVariable as x, hexToRgba as c, resolveCSSColor as g } from "./colors.js";
|
|
6
|
-
import { copyToClipboard as
|
|
7
|
-
import { convertPercent as
|
|
8
|
-
import { formatAssetAmount as
|
|
9
|
-
import { PERCENTAGE_FACTOR as
|
|
10
|
-
import { FORMAT_CONSTANTS as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
6
|
+
import { copyToClipboard as u } from "./copy.js";
|
|
7
|
+
import { convertPercent as d, formatBytecodeSize as h, formatBytecodeVersion as I, formatTimestamp as N, shortenHash as C, significantTrunc as b } from "./format.js";
|
|
8
|
+
import { formatAssetAmount as P } from "./format-asset-amount.js";
|
|
9
|
+
import { PERCENTAGE_FACTOR as L, SLIPPAGE_DECIMALS as k, formatMoney as E, formatMoney as v, formatPercentAmount as w, percentTemplate as B, percentageTemplate as D } from "./format-money.js";
|
|
10
|
+
import { FORMAT_CONSTANTS as R, formatNumberWithSuffix as V, formatPrice as _, getAdaptiveDecimals as O, isBelowDisplayThreshold as z, isEffectivelyZero as Z, toSignificantDigits as G } from "./format-number.js";
|
|
11
|
+
import { slippageTemplate as W } from "./format-slippage.js";
|
|
12
|
+
import { getNetworkIcon as j } from "./network-icons.js";
|
|
13
|
+
import { parseInputToBN as J } from "./parse-input-to-bn.js";
|
|
14
|
+
import { pluralize as Q, selectPluralString as U } from "./plural.js";
|
|
15
|
+
import { getAvailableRanges as $ } from "./ranges.js";
|
|
16
|
+
import { extractTextFromLabel as oe, serializeValue as re } from "./react.js";
|
|
17
|
+
import { searchInString as me } from "./search.js";
|
|
18
|
+
import { createTokenSearchFilter as ne, searchInToken as pe } from "./search-in-token.js";
|
|
19
|
+
import { shortSHA as ie } from "./short-sha.js";
|
|
20
|
+
import { isLongString as se, shortenString as Te } from "./shorten-string.js";
|
|
21
|
+
import { negativeTokenTemplate as ce, tokenTemplate as ge, tokenTemplateNumber as Se, tokenTemplateString as ue } from "./templates.js";
|
|
22
|
+
import { TTL_CONSTANTS as de, getTTLZone as he, ttlFromTimestamp as Ie, ttlLeft as Ne, ttlLeftParsed as Ce } from "./ttl.js";
|
|
23
|
+
import { openInNewWindow as ye } from "./window.js";
|
|
24
|
+
import { Z_INDEX as Fe } from "./z-index.js";
|
|
23
25
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
R as FORMAT_CONSTANTS,
|
|
27
|
+
L as PERCENTAGE_FACTOR,
|
|
28
|
+
k as SLIPPAGE_DECIMALS,
|
|
27
29
|
de as TTL_CONSTANTS,
|
|
28
|
-
|
|
30
|
+
Fe as Z_INDEX,
|
|
31
|
+
a as bnToInputView,
|
|
29
32
|
p as bnToPrettyView,
|
|
30
33
|
i as cn,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
d as convertPercent,
|
|
35
|
+
u as copyToClipboard,
|
|
36
|
+
ne as createTokenSearchFilter,
|
|
34
37
|
l as default,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
oe as extractTextFromLabel,
|
|
39
|
+
P as formatAssetAmount,
|
|
40
|
+
h as formatBytecodeSize,
|
|
41
|
+
I as formatBytecodeVersion,
|
|
42
|
+
E as formatMoney,
|
|
40
43
|
v as formatMoneyAmount,
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
V as formatNumberWithSuffix,
|
|
45
|
+
w as formatPercentAmount,
|
|
43
46
|
_ as formatPrice,
|
|
44
|
-
|
|
47
|
+
N as formatTimestamp,
|
|
45
48
|
T as generateColorsFromBase,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
te as getAvailableRanges,
|
|
49
|
+
r as generateId,
|
|
50
|
+
O as getAdaptiveDecimals,
|
|
51
|
+
$ as getAvailableRanges,
|
|
50
52
|
x as getCSSVariable,
|
|
51
|
-
|
|
52
|
-
J as getNetworkConfig,
|
|
53
|
-
K as getNetworkIcon,
|
|
53
|
+
j as getNetworkIcon,
|
|
54
54
|
he as getTTLZone,
|
|
55
55
|
c as hexToRgba,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
z as isBelowDisplayThreshold,
|
|
57
|
+
Z as isEffectivelyZero,
|
|
58
|
+
se as isLongString,
|
|
59
|
+
ce as negativeTokenTemplate,
|
|
60
|
+
ye as openInNewWindow,
|
|
61
|
+
J as parseInputToBN,
|
|
62
|
+
B as percentTemplate,
|
|
63
|
+
D as percentageTemplate,
|
|
64
|
+
Q as pluralize,
|
|
64
65
|
g as resolveCSSColor,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
me as searchInString,
|
|
67
|
+
pe as searchInToken,
|
|
68
|
+
U as selectPluralString,
|
|
69
|
+
re as serializeValue,
|
|
70
|
+
ie as shortSHA,
|
|
71
|
+
C as shortenHash,
|
|
72
|
+
Te as shortenString,
|
|
73
|
+
b as significantTrunc,
|
|
74
|
+
W as slippageTemplate,
|
|
75
|
+
G as toSignificantDigits,
|
|
76
|
+
ge as tokenTemplate,
|
|
77
|
+
Se as tokenTemplateNumber,
|
|
77
78
|
ue as tokenTemplateString,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
Ie as ttlFromTimestamp,
|
|
80
|
+
Ne as ttlLeft,
|
|
81
|
+
Ce as ttlLeftParsed,
|
|
82
|
+
t as useFormFieldIds
|
|
82
83
|
};
|
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
icon: "/icons/networks/ethereum.svg",
|
|
5
|
-
chainId: 1
|
|
6
|
-
},
|
|
7
|
-
Arbitrum: {
|
|
8
|
-
name: "Arbitrum",
|
|
9
|
-
icon: "/icons/networks/arbitrum.svg",
|
|
10
|
-
chainId: 42161
|
|
11
|
-
},
|
|
12
|
-
Optimism: {
|
|
13
|
-
name: "Optimism",
|
|
14
|
-
icon: "/icons/networks/optimism.svg",
|
|
15
|
-
chainId: 10
|
|
16
|
-
},
|
|
17
|
-
Sonic: {
|
|
18
|
-
name: "Sonic",
|
|
19
|
-
icon: "/icons/networks/sonic.svg",
|
|
20
|
-
chainId: 146
|
|
21
|
-
},
|
|
22
|
-
Monad: {
|
|
23
|
-
name: "Monad",
|
|
24
|
-
icon: "/icons/networks/monad.svg",
|
|
25
|
-
chainId: 0
|
|
26
|
-
// TBD
|
|
27
|
-
},
|
|
28
|
-
AllNetworks: {
|
|
29
|
-
name: "All Networks",
|
|
30
|
-
icon: "/icons/networks/all.svg",
|
|
31
|
-
chainId: 0
|
|
32
|
-
}
|
|
33
|
-
}, o = {
|
|
34
|
-
1: "Mainnet",
|
|
35
|
-
42161: "Arbitrum",
|
|
36
|
-
10: "Optimism",
|
|
37
|
-
146: "Sonic"
|
|
38
|
-
};
|
|
39
|
-
function t(n) {
|
|
40
|
-
return i[n]?.icon || "";
|
|
41
|
-
}
|
|
42
|
-
function e(n) {
|
|
43
|
-
return o[n];
|
|
44
|
-
}
|
|
45
|
-
function c(n) {
|
|
46
|
-
return i[n];
|
|
47
|
-
}
|
|
48
|
-
function r() {
|
|
49
|
-
return Object.values(i);
|
|
1
|
+
import { getStatic as o } from "./static.js";
|
|
2
|
+
function r(t) {
|
|
3
|
+
return o(`/chains/${t.toLowerCase()}.svg`);
|
|
50
4
|
}
|
|
51
5
|
export {
|
|
52
|
-
r as
|
|
53
|
-
e as getNetworkByChainId,
|
|
54
|
-
c as getNetworkConfig,
|
|
55
|
-
t as getNetworkIcon
|
|
6
|
+
r as getNetworkIcon
|
|
56
7
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (!e || !t) return !
|
|
3
|
-
const
|
|
4
|
-
if (!
|
|
5
|
-
const
|
|
6
|
-
return
|
|
1
|
+
function c(e, t) {
|
|
2
|
+
if (!e || !t) return !1;
|
|
3
|
+
const s = t.toLowerCase().trim();
|
|
4
|
+
if (!s) return !1;
|
|
5
|
+
const r = e.title?.toLowerCase() || "", o = e.symbol?.toLowerCase() || "", n = e.name?.toLowerCase() || "", a = e.address?.toLowerCase() || "";
|
|
6
|
+
return r.includes(s) || o.includes(s) || n.includes(s) || s.length > 2 && a.toLowerCase().startsWith(s);
|
|
7
7
|
}
|
|
8
8
|
function i(e) {
|
|
9
|
-
return (t) =>
|
|
9
|
+
return (t) => c(t, e);
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
12
|
i as createTokenSearchFilter,
|
|
13
|
-
|
|
13
|
+
c as searchInToken
|
|
14
14
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
function
|
|
2
|
-
return n
|
|
1
|
+
function t(n, r) {
|
|
2
|
+
return i(n, r) ? `${n.slice(0, r - 3)}...` : n;
|
|
3
|
+
}
|
|
4
|
+
function i(n, r) {
|
|
5
|
+
return n.length > r;
|
|
3
6
|
}
|
|
4
7
|
export {
|
|
5
|
-
|
|
8
|
+
i as isLongString,
|
|
9
|
+
t as shortenString
|
|
6
10
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { jsx as u, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { formatBN as
|
|
2
|
+
import { formatBN as l, toBigInt as g, BigIntMath as $ } from "@gearbox-protocol/sdk";
|
|
3
3
|
import { percentTemplate as p } from "./format-money.js";
|
|
4
4
|
function T(o, t = 2) {
|
|
5
5
|
return /* @__PURE__ */ u(d, { children: p(o, t) });
|
|
6
6
|
}
|
|
7
7
|
function B(o, t, s, e = " ", i) {
|
|
8
8
|
const { decimals: r = 18 } = t || {};
|
|
9
|
-
let n =
|
|
9
|
+
let n = l(o, r, s);
|
|
10
10
|
const c = t?.title || t?.symbol || "undefined";
|
|
11
11
|
if (i !== void 0 && n !== "-") {
|
|
12
|
-
const f = e.length + c.length,
|
|
13
|
-
|
|
12
|
+
const f = e.length + c.length, m = i - f;
|
|
13
|
+
m > 0 && n.length > m && (n = n.slice(0, m));
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
return /* @__PURE__ */ u(d, { children: m });
|
|
15
|
+
return n === "-" ? n : `${n}${e}${c}`;
|
|
17
16
|
}
|
|
18
17
|
function x(o, t, s = 2) {
|
|
19
18
|
if (o === void 0) return "-";
|
|
@@ -21,11 +20,11 @@ function x(o, t, s = 2) {
|
|
|
21
20
|
return `${i}${r} ${t?.title}`;
|
|
22
21
|
}
|
|
23
22
|
function v(o, t, s, e = " ") {
|
|
24
|
-
const i = g(o || 0), r = i < 0n, { decimals: n = 18 } = t || {}, c =
|
|
25
|
-
return c === "-" ? c : `${r ? "-" : ""}${c}${e}${
|
|
23
|
+
const i = g(o || 0), r = i < 0n, { decimals: n = 18 } = t || {}, c = l($.abs(i), n, s), a = t?.title || t?.symbol || "undefined";
|
|
24
|
+
return c === "-" ? c : `${r ? "-" : ""}${c}${e}${a}`;
|
|
26
25
|
}
|
|
27
26
|
function P(o, t, s, e = " ") {
|
|
28
|
-
const { decimals: i = 18 } = t || {}, r =
|
|
27
|
+
const { decimals: i = 18 } = t || {}, r = l(o, i, s), n = t?.title || t?.symbol || "undefined";
|
|
29
28
|
return r === "-" ? r : `${r}${e}${n}`;
|
|
30
29
|
}
|
|
31
30
|
export {
|
package/dist/esm/utils/window.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
function
|
|
2
|
-
window.open(n, "
|
|
1
|
+
function i(o, n = "_blank", w) {
|
|
2
|
+
const e = n === "_blank" ? window.open(o, n, "noreferrer,noopener") : window.open(o, n, w);
|
|
3
|
+
e && e.focus();
|
|
3
4
|
}
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
i as openInNewWindow
|
|
6
7
|
};
|