@gearbox-protocol/permissionless-ui 1.22.0-next.13 → 1.22.0-next.15
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/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/short-string/short-string.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/index.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/network-icons.cjs +1 -1
- package/dist/cjs/utils/shorten-string.cjs +1 -1
- package/dist/cjs/utils/z-index.cjs +1 -0
- package/dist/esm/components/buttons/button/button.js +2 -0
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -0
- package/dist/esm/components/short-string/short-string.js +19 -23
- package/dist/esm/components/token-icon/token-icon.js +23 -22
- package/dist/esm/components/token-symbol/token-symbol.js +98 -40
- package/dist/esm/index.js +208 -208
- package/dist/esm/utils/index.js +68 -68
- package/dist/esm/utils/network-icons.js +4 -53
- package/dist/esm/utils/shorten-string.js +7 -3
- package/dist/esm/utils/z-index.js +7 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/short-string/short-string.d.ts +4 -4
- package/dist/types/components/token-icon/token-icon.d.ts +1 -1
- package/dist/types/components/token-symbol/token-symbol.d.ts +9 -4
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/network-icons.d.ts +3 -32
- package/dist/types/utils/shorten-string.d.ts +2 -1
- package/dist/types/utils/z-index.d.ts +8 -0
- package/package.json +1 -1
package/dist/esm/utils/index.js
CHANGED
|
@@ -1,83 +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 { slippageTemplate as
|
|
12
|
-
import {
|
|
13
|
-
import { parseInputToBN as
|
|
14
|
-
import { pluralize as
|
|
15
|
-
import { getAvailableRanges as
|
|
16
|
-
import { extractTextFromLabel as
|
|
17
|
-
import { searchInString as
|
|
18
|
-
import { createTokenSearchFilter as
|
|
19
|
-
import { shortSHA as
|
|
20
|
-
import { shortenString as
|
|
21
|
-
import { negativeTokenTemplate as
|
|
22
|
-
import { TTL_CONSTANTS as
|
|
23
|
-
import { openInNewWindow as
|
|
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";
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
R as FORMAT_CONSTANTS,
|
|
27
|
+
L as PERCENTAGE_FACTOR,
|
|
28
|
+
k as SLIPPAGE_DECIMALS,
|
|
29
|
+
de as TTL_CONSTANTS,
|
|
30
|
+
Fe as Z_INDEX,
|
|
31
|
+
a as bnToInputView,
|
|
30
32
|
p as bnToPrettyView,
|
|
31
33
|
i as cn,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
d as convertPercent,
|
|
35
|
+
u as copyToClipboard,
|
|
36
|
+
ne as createTokenSearchFilter,
|
|
35
37
|
l as default,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
oe as extractTextFromLabel,
|
|
39
|
+
P as formatAssetAmount,
|
|
40
|
+
h as formatBytecodeSize,
|
|
41
|
+
I as formatBytecodeVersion,
|
|
42
|
+
E as formatMoney,
|
|
41
43
|
v as formatMoneyAmount,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
V as formatNumberWithSuffix,
|
|
45
|
+
w as formatPercentAmount,
|
|
46
|
+
_ as formatPrice,
|
|
47
|
+
N as formatTimestamp,
|
|
46
48
|
T as generateColorsFromBase,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
te as getAvailableRanges,
|
|
49
|
+
r as generateId,
|
|
50
|
+
O as getAdaptiveDecimals,
|
|
51
|
+
$ as getAvailableRanges,
|
|
51
52
|
x as getCSSVariable,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Q as getNetworkIcon,
|
|
55
|
-
Ce as getTTLZone,
|
|
53
|
+
j as getNetworkIcon,
|
|
54
|
+
he as getTTLZone,
|
|
56
55
|
c as hexToRgba,
|
|
57
56
|
z as isBelowDisplayThreshold,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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,
|
|
65
65
|
g as resolveCSSColor,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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,
|
|
78
|
+
ue as tokenTemplateString,
|
|
79
79
|
Ie as ttlFromTimestamp,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
Ne as ttlLeft,
|
|
81
|
+
Ce as ttlLeftParsed,
|
|
82
|
+
t as useFormFieldIds
|
|
83
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,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
|
};
|