@gearbox-protocol/ui-kit 4.0.0-next.44 → 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.
@@ -1,36 +1,38 @@
1
- function o(t) {
1
+ const o = "≈";
2
+ function c(t) {
2
3
  return `${(t / 1024).toFixed(2)} KB`;
3
4
  }
4
- function c(t) {
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 i(t) {
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 u(t, e = 4) {
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 f(t) {
21
+ function a(t) {
21
22
  return Math.floor(t * 100);
22
23
  }
23
- function a(t) {
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
- f as convertPercent,
31
- o as formatBytecodeSize,
32
- c as formatBytecodeVersion,
33
- i as formatTimestamp,
34
- u as shortenHash,
35
- a as significantTrunc
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
  };
@@ -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 v, hexToRgba as P, hslToHex as b, resolveCSSColor as A } from "./colors.js";
8
- import { copyToClipboard as N } from "./copy.js";
9
- import { convertPercent as L, formatBytecodeSize as y, formatBytecodeVersion as C, formatTimestamp as w, shortenHash as F, significantTrunc as D } from "./format.js";
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 M } from "./format-leverage.js";
12
- import { formatCompactPercent as _, formatMoney as E, formatMoneyAmount as H, formatPercentAmount as W, percentTemplate as Z, percentageTemplate as z } from "./format-money.js";
13
- import { FORMAT_CONSTANTS as X, formatNumberWithSuffix as q, formatPrice as j, getAdaptiveDecimals as G, isBelowDisplayThreshold as J, isEffectivelyZero as K, toSignificantDigits as Q } from "./format-number.js";
14
- import { slippageTemplate as $ } from "./format-slippage.js";
15
- import { formatChipLeverage as oe, leveragePresets as re } from "./leverage-presets.js";
16
- import { allLoaded as ae, loadingProgress as me, round5 as ne } from "./loading.js";
17
- import { decimalsToStep as pe, findClosestPoint as fe, formatWithDecimals as le, formatWithoutDecimals as se, splitInterval as xe, validateMinMax as Te } from "./math.js";
18
- import { getNetworkIcon as ge } from "./network-icons.js";
19
- import { bnToLiquidationPriceView as de, isPositiveFloat as ue, parseInputToBN as he, parseSmallNumber as ve } from "./parse-input-to-bn.js";
20
- import { pluralize as be, selectPluralString as Ae } from "./plural.js";
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 Le, serializeValue as ye } from "./react.js";
23
- import { searchInString as we } from "./search.js";
24
- import { createTokenSearchFilter as De, searchInToken as Oe } from "./search-in-token.js";
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 Re, shortenString as _e } from "./shorten-string.js";
27
- import { negativeTokenTemplate as He, tokenTemplate as We, tokenTemplateNumber as Ze, tokenTemplateString as ze } from "./templates.js";
28
- import { getTokenIcon as Xe, parseShareTokenUnderlying as qe } from "./token-icon-source.js";
29
- import { TTL_CONSTANTS as Ge, getTTLZones as Je, ttlFromTimestamp as Ke, ttlLeft as Qe, ttlLeftHuman as Ye } from "./ttl.js";
30
- import { openInNewWindow as eo } from "./window.js";
31
- import { Z_INDEX as ro, Z_INDEX_VALUES as to } from "./z-index.js";
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
- X as FORMAT_CONSTANTS,
33
+ k as APPROXIMATE_SYMBOL,
34
+ q as FORMAT_CONSTANTS,
34
35
  Ge as TTL_CONSTANTS,
35
- ro as Z_INDEX,
36
- to as Z_INDEX_VALUES,
37
- ae as allLoaded,
36
+ to as Z_INDEX,
37
+ ao as Z_INDEX_VALUES,
38
+ me as allLoaded,
38
39
  l as bnToInputView,
39
- de as bnToLiquidationPriceView,
40
+ ue as bnToLiquidationPriceView,
40
41
  x as bnToPrettyView,
41
42
  c as bpsToPercent,
42
43
  S as cn,
43
- L as convertPercent,
44
- N as copyToClipboard,
44
+ y as convertPercent,
45
+ L as copyToClipboard,
45
46
  De as createTokenSearchFilter,
46
- pe as decimalsToStep,
47
+ fe as decimalsToStep,
47
48
  d as default,
48
- Le as extractTextFromLabel,
49
- fe as findClosestPoint,
49
+ ye as extractTextFromLabel,
50
+ le as findClosestPoint,
50
51
  V as formatAssetAmount,
51
- y as formatBytecodeSize,
52
- C as formatBytecodeVersion,
53
- oe as formatChipLeverage,
54
- _ as formatCompactPercent,
55
- M as formatLeverage,
56
- E as formatMoney,
57
- H as formatMoneyAmount,
58
- q as formatNumberWithSuffix,
59
- W as formatPercentAmount,
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
- w as formatTimestamp,
62
- le as formatWithDecimals,
63
- se as formatWithoutDecimals,
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
- v as getCSSVariable,
69
- ge as getNetworkIcon,
69
+ P as getCSSVariable,
70
+ Se as getNetworkIcon,
70
71
  Je as getTTLZones,
71
- Xe as getTokenIcon,
72
- P as hexToRgba,
73
- b as hslToHex,
72
+ qe as getTokenIcon,
73
+ A as hexToRgba,
74
+ v as hslToHex,
74
75
  J as isBelowDisplayThreshold,
75
76
  K as isEffectivelyZero,
76
- Re as isLongString,
77
- ue as isPositiveFloat,
78
- re as leveragePresets,
79
- me as loadingProgress,
80
- He as negativeTokenTemplate,
81
- eo as openInNewWindow,
82
- he as parseInputToBN,
83
- qe as parseShareTokenUnderlying,
84
- ve as parseSmallNumber,
85
- Z as percentTemplate,
86
- z as percentageTemplate,
87
- be as pluralize,
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
- A as resolveCSSColor,
91
- ne as round5,
92
- we as searchInString,
93
- Oe as searchInToken,
94
- Ae as selectPluralString,
95
- ye as serializeValue,
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
- _e as shortenString,
99
+ Ee as shortenString,
99
100
  D as significantTrunc,
100
- $ as slippageTemplate,
101
- xe as splitInterval,
101
+ ee as slippageTemplate,
102
+ Te as splitInterval,
102
103
  Q as toSignificantDigits,
103
104
  i as tokenRewardsOf,
104
- We as tokenTemplate,
105
- Ze as tokenTemplateNumber,
106
- ze as tokenTemplateString,
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
- Ye as ttlLeftHuman,
111
+ $e as ttlLeftHuman,
111
112
  t as useFormFieldIds,
112
- Te as validateMinMax
113
+ ce as validateMinMax
113
114
  };