@gearbox-protocol/ui-kit 4.0.0-next.2 → 4.0.0-next.4

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.
Files changed (82) hide show
  1. package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
  2. package/dist/cjs/components/base/detailed-page-title/detailed-page-title.cjs +1 -1
  3. package/dist/cjs/components/base/health-factor-block/health-factor-block.cjs +1 -1
  4. package/dist/cjs/components/base/index.cjs +1 -1
  5. package/dist/cjs/components/base/info-list/index.cjs +1 -1
  6. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  7. package/dist/cjs/components/base/leverage-input/leverage-input.cjs +1 -1
  8. package/dist/cjs/components/base/liquidation-price-block/liquidation-price-block.cjs +1 -1
  9. package/dist/cjs/components/base/manage-pane/constants.cjs +1 -1
  10. package/dist/cjs/components/base/manage-pane/manage-pane.cjs +1 -1
  11. package/dist/cjs/components/base/page-title/index.cjs +1 -1
  12. package/dist/cjs/components/base/page-title/page-title.cjs +1 -1
  13. package/dist/cjs/components/base/stat-badge/stat-badge.cjs +1 -1
  14. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  15. package/dist/cjs/components/base/time-to-liquidation-block/time-to-liquidation-block.cjs +1 -1
  16. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  17. package/dist/cjs/components/base/values/constants.cjs +1 -1
  18. package/dist/cjs/components/base/values/index.cjs +1 -1
  19. package/dist/cjs/components/base/values/points-value.cjs +1 -0
  20. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  21. package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
  22. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  23. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  24. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  25. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
  26. package/dist/cjs/components/graph/graph-view.cjs +1 -1
  27. package/dist/cjs/components/index.cjs +1 -1
  28. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  29. package/dist/cjs/index.cjs +1 -1
  30. package/dist/cjs/utils/format-leverage.cjs +1 -0
  31. package/dist/cjs/utils/index.cjs +1 -1
  32. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +31 -25
  33. package/dist/esm/components/base/detailed-page-title/detailed-page-title.js +26 -27
  34. package/dist/esm/components/base/health-factor-block/health-factor-block.js +25 -25
  35. package/dist/esm/components/base/index.js +141 -136
  36. package/dist/esm/components/base/info-list/index.js +5 -4
  37. package/dist/esm/components/base/info-list/info-list.js +52 -27
  38. package/dist/esm/components/base/leverage-input/leverage-input.js +17 -19
  39. package/dist/esm/components/base/liquidation-price-block/liquidation-price-block.js +33 -28
  40. package/dist/esm/components/base/manage-pane/constants.js +3 -2
  41. package/dist/esm/components/base/manage-pane/manage-pane.js +154 -113
  42. package/dist/esm/components/base/page-title/index.js +5 -4
  43. package/dist/esm/components/base/page-title/page-title.js +31 -23
  44. package/dist/esm/components/base/stat-badge/stat-badge.js +18 -9
  45. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +3 -2
  46. package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +31 -31
  47. package/dist/esm/components/base/token-amount/token-amount.js +17 -16
  48. package/dist/esm/components/base/values/constants.js +1 -0
  49. package/dist/esm/components/base/values/index.js +16 -13
  50. package/dist/esm/components/base/values/points-value.js +30 -0
  51. package/dist/esm/components/base/values/scalars.js +29 -27
  52. package/dist/esm/components/block-sync-pill/block-sync-pill.js +17 -16
  53. package/dist/esm/components/checkbox/checkbox-labeled.js +15 -14
  54. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +15 -14
  55. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +17 -15
  56. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +24 -23
  57. package/dist/esm/components/graph/graph-view.js +78 -95
  58. package/dist/esm/components/index.js +665 -660
  59. package/dist/esm/components/with-copy/with-copy.js +17 -16
  60. package/dist/esm/index.js +843 -836
  61. package/dist/esm/utils/format-leverage.js +6 -0
  62. package/dist/esm/utils/index.js +80 -78
  63. package/dist/globals.css +1 -1
  64. package/dist/types/components/base/borrow-rate-block/borrow-rate-block.d.ts +10 -5
  65. package/dist/types/components/base/detailed-page-title/detailed-page-title.d.ts +1 -3
  66. package/dist/types/components/base/health-factor-block/health-factor-block.d.ts +6 -6
  67. package/dist/types/components/base/info-list/info-list.d.ts +7 -0
  68. package/dist/types/components/base/liquidation-price-block/liquidation-price-block.d.ts +6 -4
  69. package/dist/types/components/base/manage-pane/constants.d.ts +1 -0
  70. package/dist/types/components/base/manage-pane/manage-pane.d.ts +3 -1
  71. package/dist/types/components/base/page-title/page-title.d.ts +12 -6
  72. package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +5 -6
  73. package/dist/types/components/base/token-amount/token-amount.d.ts +8 -2
  74. package/dist/types/components/base/values/constants.d.ts +1 -0
  75. package/dist/types/components/base/values/index.d.ts +2 -1
  76. package/dist/types/components/base/values/points-value.d.ts +11 -0
  77. package/dist/types/components/base/values/position-short-label.d.ts +1 -1
  78. package/dist/types/components/base/values/scalars.d.ts +9 -0
  79. package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +1 -1
  80. package/dist/types/utils/format-leverage.d.ts +5 -0
  81. package/dist/types/utils/index.d.ts +1 -0
  82. package/package.json +2 -2
@@ -0,0 +1,6 @@
1
+ function r(e) {
2
+ return (Math.round(e * 100) / 100).toFixed(2);
3
+ }
4
+ export {
5
+ r as formatLeverage
6
+ };
@@ -1,107 +1,109 @@
1
1
  import { generateId as r, useFormFieldIds as t } from "./a11y.js";
2
2
  import { pointProgramsOf as m, positiveTokenRewardsOf as n, tokenRewardsOf as i, totalApyOf as p } from "./apy-breakdown.js";
3
3
  import { bnToInputView as l } from "./bn-to-input-view.js";
4
- import { bnToPrettyView as T } from "./bn-to-pretty-view.js";
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
7
  import { generateColorsFromBase as h, getCSSVariable as b, hexToRgba as A, hslToHex as I, resolveCSSColor as N } from "./colors.js";
8
- import { copyToClipboard as P } from "./copy.js";
9
- import { convertPercent as y, formatBytecodeSize as w, formatBytecodeVersion as L, formatTimestamp as C, shortenHash as F, significantTrunc as D } from "./format.js";
8
+ import { copyToClipboard as v } from "./copy.js";
9
+ import { convertPercent as y, formatBytecodeSize as L, formatBytecodeVersion as w, formatTimestamp as C, shortenHash as F, significantTrunc as D } from "./format.js";
10
10
  import { formatAssetAmount as V } from "./format-asset-amount.js";
11
- import { formatMoney as M, formatMoneyAmount as R, formatPercentAmount as _, percentTemplate as E, percentageTemplate as H } from "./format-money.js";
12
- import { FORMAT_CONSTANTS as Z, formatNumberWithSuffix as z, formatPrice as U, getAdaptiveDecimals as X, isBelowDisplayThreshold as q, isEffectivelyZero as j, toSignificantDigits as G } from "./format-number.js";
13
- import { slippageTemplate as K } from "./format-slippage.js";
14
- import { allLoaded as Y, loadingProgress as $, round5 as ee } from "./loading.js";
15
- import { decimalsToStep as re, findClosestPoint as te, formatWithDecimals as ae, formatWithoutDecimals as me, splitInterval as ne, validateMinMax as ie } from "./math.js";
16
- import { getNetworkIcon as fe } from "./network-icons.js";
17
- import { bnToLiquidationPriceView as se, isPositiveFloat as Te, parseInputToBN as xe, parseSmallNumber as ce } from "./parse-input-to-bn.js";
18
- import { pluralize as Se, selectPluralString as de } from "./plural.js";
19
- import { getAvailableRanges as he } from "./ranges.js";
20
- import { extractTextFromLabel as Ae, serializeValue as Ie } from "./react.js";
21
- import { searchInString as ke } from "./search.js";
22
- import { createTokenSearchFilter as ve, searchInToken as ye } from "./search-in-token.js";
23
- import { shortSHA as Le } from "./short-sha.js";
24
- import { isLongString as Fe, shortenString as De } from "./shorten-string.js";
25
- import { negativeTokenTemplate as Ve, tokenTemplate as Be, tokenTemplateNumber as Me, tokenTemplateString as Re } from "./templates.js";
26
- import { getTokenIcon as Ee, parseShareTokenUnderlying as He } from "./token-icon-source.js";
27
- import { TTL_CONSTANTS as Ze, getTTLZones as ze, ttlFromTimestamp as Ue, ttlLeft as Xe, ttlLeftHuman as qe } from "./ttl.js";
28
- import { openInNewWindow as Ge } from "./window.js";
29
- import { Z_INDEX as Ke, Z_INDEX_VALUES as Qe } from "./z-index.js";
11
+ import { formatLeverage as M } from "./format-leverage.js";
12
+ import { formatMoney as _, formatMoneyAmount as E, formatPercentAmount as H, percentTemplate as W, percentageTemplate as Z } from "./format-money.js";
13
+ import { FORMAT_CONSTANTS as U, formatNumberWithSuffix as X, formatPrice as q, getAdaptiveDecimals as j, isBelowDisplayThreshold as G, isEffectivelyZero as J, toSignificantDigits as K } from "./format-number.js";
14
+ import { slippageTemplate as Y } from "./format-slippage.js";
15
+ import { allLoaded as ee, loadingProgress as oe, round5 as re } from "./loading.js";
16
+ import { decimalsToStep as ae, findClosestPoint as me, formatWithDecimals as ne, formatWithoutDecimals as ie, splitInterval as pe, validateMinMax as fe } from "./math.js";
17
+ import { getNetworkIcon as se } from "./network-icons.js";
18
+ import { bnToLiquidationPriceView as Te, isPositiveFloat as ce, parseInputToBN as ge, parseSmallNumber as Se } from "./parse-input-to-bn.js";
19
+ import { pluralize as ue, selectPluralString as he } from "./plural.js";
20
+ import { getAvailableRanges as Ae } from "./ranges.js";
21
+ import { extractTextFromLabel as Ne, serializeValue as ke } from "./react.js";
22
+ import { searchInString as Pe } from "./search.js";
23
+ import { createTokenSearchFilter as Le, searchInToken as we } from "./search-in-token.js";
24
+ import { shortSHA as Fe } from "./short-sha.js";
25
+ import { isLongString as Oe, shortenString as Ve } from "./shorten-string.js";
26
+ import { negativeTokenTemplate as Me, tokenTemplate as Re, tokenTemplateNumber as _e, tokenTemplateString as Ee } from "./templates.js";
27
+ import { getTokenIcon as We, parseShareTokenUnderlying as Ze } from "./token-icon-source.js";
28
+ import { TTL_CONSTANTS as Ue, getTTLZones as Xe, ttlFromTimestamp as qe, ttlLeft as je, ttlLeftHuman as Ge } from "./ttl.js";
29
+ import { openInNewWindow as Ke } from "./window.js";
30
+ import { Z_INDEX as Ye, Z_INDEX_VALUES as $e } from "./z-index.js";
30
31
  export {
31
- Z as FORMAT_CONSTANTS,
32
- Ze as TTL_CONSTANTS,
33
- Ke as Z_INDEX,
34
- Qe as Z_INDEX_VALUES,
35
- Y as allLoaded,
32
+ U as FORMAT_CONSTANTS,
33
+ Ue as TTL_CONSTANTS,
34
+ Ye as Z_INDEX,
35
+ $e as Z_INDEX_VALUES,
36
+ ee as allLoaded,
36
37
  l as bnToInputView,
37
- se as bnToLiquidationPriceView,
38
- T as bnToPrettyView,
38
+ Te as bnToLiquidationPriceView,
39
+ x as bnToPrettyView,
39
40
  c as bpsToPercent,
40
41
  S as cn,
41
42
  y as convertPercent,
42
- P as copyToClipboard,
43
- ve as createTokenSearchFilter,
44
- re as decimalsToStep,
43
+ v as copyToClipboard,
44
+ Le as createTokenSearchFilter,
45
+ ae as decimalsToStep,
45
46
  d as default,
46
- Ae as extractTextFromLabel,
47
- te as findClosestPoint,
47
+ Ne as extractTextFromLabel,
48
+ me as findClosestPoint,
48
49
  V as formatAssetAmount,
49
- w as formatBytecodeSize,
50
- L as formatBytecodeVersion,
51
- M as formatMoney,
52
- R as formatMoneyAmount,
53
- z as formatNumberWithSuffix,
54
- _ as formatPercentAmount,
55
- U as formatPrice,
50
+ L as formatBytecodeSize,
51
+ w as formatBytecodeVersion,
52
+ M as formatLeverage,
53
+ _ as formatMoney,
54
+ E as formatMoneyAmount,
55
+ X as formatNumberWithSuffix,
56
+ H as formatPercentAmount,
57
+ q as formatPrice,
56
58
  C as formatTimestamp,
57
- ae as formatWithDecimals,
58
- me as formatWithoutDecimals,
59
+ ne as formatWithDecimals,
60
+ ie as formatWithoutDecimals,
59
61
  h as generateColorsFromBase,
60
62
  r as generateId,
61
- X as getAdaptiveDecimals,
62
- he as getAvailableRanges,
63
+ j as getAdaptiveDecimals,
64
+ Ae as getAvailableRanges,
63
65
  b as getCSSVariable,
64
- fe as getNetworkIcon,
65
- ze as getTTLZones,
66
- Ee as getTokenIcon,
66
+ se as getNetworkIcon,
67
+ Xe as getTTLZones,
68
+ We as getTokenIcon,
67
69
  A as hexToRgba,
68
70
  I as hslToHex,
69
- q as isBelowDisplayThreshold,
70
- j as isEffectivelyZero,
71
- Fe as isLongString,
72
- Te as isPositiveFloat,
73
- $ as loadingProgress,
74
- Ve as negativeTokenTemplate,
75
- Ge as openInNewWindow,
76
- xe as parseInputToBN,
77
- He as parseShareTokenUnderlying,
78
- ce as parseSmallNumber,
79
- E as percentTemplate,
80
- H as percentageTemplate,
81
- Se as pluralize,
71
+ G as isBelowDisplayThreshold,
72
+ J as isEffectivelyZero,
73
+ Oe as isLongString,
74
+ ce as isPositiveFloat,
75
+ oe as loadingProgress,
76
+ Me as negativeTokenTemplate,
77
+ Ke as openInNewWindow,
78
+ ge as parseInputToBN,
79
+ Ze as parseShareTokenUnderlying,
80
+ Se as parseSmallNumber,
81
+ W as percentTemplate,
82
+ Z as percentageTemplate,
83
+ ue as pluralize,
82
84
  m as pointProgramsOf,
83
85
  n as positiveTokenRewardsOf,
84
86
  N as resolveCSSColor,
85
- ee as round5,
86
- ke as searchInString,
87
- ye as searchInToken,
88
- de as selectPluralString,
89
- Ie as serializeValue,
90
- Le as shortSHA,
87
+ re as round5,
88
+ Pe as searchInString,
89
+ we as searchInToken,
90
+ he as selectPluralString,
91
+ ke as serializeValue,
92
+ Fe as shortSHA,
91
93
  F as shortenHash,
92
- De as shortenString,
94
+ Ve as shortenString,
93
95
  D as significantTrunc,
94
- K as slippageTemplate,
95
- ne as splitInterval,
96
- G as toSignificantDigits,
96
+ Y as slippageTemplate,
97
+ pe as splitInterval,
98
+ K as toSignificantDigits,
97
99
  i as tokenRewardsOf,
98
- Be as tokenTemplate,
99
- Me as tokenTemplateNumber,
100
- Re as tokenTemplateString,
100
+ Re as tokenTemplate,
101
+ _e as tokenTemplateNumber,
102
+ Ee as tokenTemplateString,
101
103
  p as totalApyOf,
102
- Ue as ttlFromTimestamp,
103
- Xe as ttlLeft,
104
- qe as ttlLeftHuman,
104
+ qe as ttlFromTimestamp,
105
+ je as ttlLeft,
106
+ Ge as ttlLeftHuman,
105
107
  t as useFormFieldIds,
106
- ie as validateMinMax
108
+ fe as validateMinMax
107
109
  };