@gearbox-protocol/permissionless-ui 1.23.0 → 1.24.0

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,48 +1,48 @@
1
- function a(t, r = "#000000") {
1
+ function g(t, r = "#000000") {
2
2
  if (!t.includes("var("))
3
3
  return t;
4
4
  try {
5
- const e = document.createElement("div");
6
- e.style.color = t, e.style.display = "none", document.body.appendChild(e);
7
- const n = window.getComputedStyle(e).color;
8
- if (document.body.removeChild(e), n && n !== "rgba(0, 0, 0, 0)")
9
- return n;
10
- } catch (e) {
11
- console.warn(`Failed to resolve CSS color: ${t}`, e);
5
+ const n = document.createElement("div");
6
+ n.style.color = t, n.style.display = "none", document.body.appendChild(n);
7
+ const e = window.getComputedStyle(n).color;
8
+ if (document.body.removeChild(n), e && e !== "rgba(0, 0, 0, 0)")
9
+ return e;
10
+ } catch (n) {
11
+ console.warn(`Failed to resolve CSS color: ${t}`, n);
12
12
  }
13
13
  return r;
14
14
  }
15
- function i(t, r = "#000000") {
16
- const e = t.startsWith("--") ? t : `--${t}`;
15
+ function m(t, r = "#000000") {
16
+ const n = t.startsWith("--") ? t : `--${t}`;
17
17
  try {
18
- const n = getComputedStyle(document.documentElement).getPropertyValue(e).trim();
19
- if (n)
20
- return /^[\d\s.%]+$/.test(n) ? `hsl(${n})` : n;
21
- } catch (n) {
22
- console.warn(`Failed to get CSS variable: ${e}`, n);
18
+ const e = getComputedStyle(document.documentElement).getPropertyValue(n).trim();
19
+ if (e)
20
+ return /^[\d\s.%]+$/.test(e) ? `hsl(${e})` : e;
21
+ } catch (e) {
22
+ console.warn(`Failed to get CSS variable: ${n}`, e);
23
23
  }
24
24
  return r;
25
25
  }
26
- function s(t, r) {
27
- const e = parseInt(t.slice(1, 3), 16), n = parseInt(t.slice(3, 5), 16), o = parseInt(t.slice(5, 7), 16);
28
- return `rgba(${e}, ${n}, ${o}, ${r})`;
26
+ function l(t, r) {
27
+ const n = parseInt(t.slice(1, 3), 16), e = parseInt(t.slice(3, 5), 16), o = parseInt(t.slice(5, 7), 16);
28
+ return `rgba(${n}, ${e}, ${o}, ${r})`;
29
29
  }
30
- function u(t) {
30
+ function b(t) {
31
31
  if (t.startsWith("rgba")) {
32
32
  const r = t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
33
33
  if (r) {
34
- const [, e, n, o] = r;
34
+ const [, n, e, o] = r;
35
35
  return {
36
- topColor: `rgba(${e}, ${n}, ${o}, 0.56)`,
37
- bottomColor: `rgba(${e}, ${n}, ${o}, 0.04)`
36
+ topColor: `rgba(${n}, ${e}, ${o}, 0.56)`,
37
+ bottomColor: `rgba(${n}, ${e}, ${o}, 0.04)`
38
38
  };
39
39
  }
40
40
  }
41
41
  if (t.startsWith("#") && (t.length === 7 || t.length === 4)) {
42
42
  const r = t.length === 4 ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}` : t;
43
43
  return {
44
- topColor: s(r, 0.56),
45
- bottomColor: s(r, 0.04)
44
+ topColor: l(r, 0.56),
45
+ bottomColor: l(r, 0.04)
46
46
  };
47
47
  }
48
48
  return {
@@ -50,9 +50,21 @@ function u(t) {
50
50
  bottomColor: t
51
51
  };
52
52
  }
53
+ function f(t, r, n) {
54
+ r /= 100, n /= 100;
55
+ const e = (1 - Math.abs(2 * n - 1)) * r, o = e * (1 - Math.abs(t / 60 % 2 - 1)), c = n - e / 2;
56
+ let s = 0, a = 0, i = 0;
57
+ t < 60 ? (s = e, a = o) : t < 120 ? (s = o, a = e) : t < 180 ? (a = e, i = o) : t < 240 ? (a = o, i = e) : t < 300 ? (s = o, i = e) : (s = e, i = o);
58
+ const u = (d) => {
59
+ const $ = Math.round((d + c) * 255);
60
+ return Math.min(255, Math.max(0, $)).toString(16).padStart(2, "0");
61
+ };
62
+ return `#${u(s)}${u(a)}${u(i)}`;
63
+ }
53
64
  export {
54
- u as generateColorsFromBase,
55
- i as getCSSVariable,
56
- s as hexToRgba,
57
- a as resolveCSSColor
65
+ b as generateColorsFromBase,
66
+ m as getCSSVariable,
67
+ l as hexToRgba,
68
+ f as hslToHex,
69
+ g as resolveCSSColor
58
70
  };
@@ -1,96 +1,97 @@
1
1
  import { generateId as t, useFormFieldIds as r } from "./a11y.js";
2
2
  import { bnToInputView as m } from "./bn-to-input-view.js";
3
3
  import { bnToPrettyView as n } from "./bn-to-pretty-view.js";
4
- import { cn as f, cn as l } from "./cn.js";
5
- import { generateColorsFromBase as x, getCSSVariable as T, hexToRgba as c, resolveCSSColor as g } from "./colors.js";
6
- import { copyToClipboard as u } from "./copy.js";
7
- import { convertPercent as h, formatBytecodeSize as N, formatBytecodeVersion as b, formatTimestamp as A, shortenHash as I, significantTrunc as v } from "./format.js";
8
- import { formatAssetAmount as P } from "./format-asset-amount.js";
9
- import { formatMoney as C, formatMoneyAmount as F, formatPercentAmount as k, percentTemplate as w, percentageTemplate as D } from "./format-money.js";
10
- import { FORMAT_CONSTANTS as B, formatNumberWithSuffix as M, formatPrice as _, getAdaptiveDecimals as E, isBelowDisplayThreshold as W, isEffectivelyZero as Z, toSignificantDigits as z } from "./format-number.js";
11
- import { slippageTemplate as O } from "./format-slippage.js";
12
- import { allLoaded as X, loadingProgress as q, round5 as U } from "./loading.js";
13
- import { decimalsToStep as G, findClosestPoint as J, formatWithDecimals as K, formatWithoutDecimals as Q, splitInterval as Y, validateMinMax as $ } from "./math.js";
14
- import { getNetworkIcon as oe } from "./network-icons.js";
15
- import { bnToLiquidationPriceView as re, isPositiveFloat as ae, parseInputToBN as me, parseSmallNumber as ie } from "./parse-input-to-bn.js";
16
- import { pluralize as pe, selectPluralString as fe } from "./plural.js";
17
- import { getAvailableRanges as se } from "./ranges.js";
18
- import { extractTextFromLabel as Te, serializeValue as ce } from "./react.js";
19
- import { searchInString as Se } from "./search.js";
20
- import { createTokenSearchFilter as de, searchInToken as he } from "./search-in-token.js";
21
- import { shortSHA as be } from "./short-sha.js";
22
- import { isLongString as Ie, shortenString as ve } from "./shorten-string.js";
23
- import { negativeTokenTemplate as Pe, tokenTemplate as ye, tokenTemplateNumber as Ce, tokenTemplateString as Fe } from "./templates.js";
24
- import { TTL_CONSTANTS as we, getTTLZones as De, ttlFromTimestamp as Ve, ttlLeft as Be, ttlLeftHuman as Me } from "./ttl.js";
25
- import { openInNewWindow as Ee } from "./window.js";
4
+ import { cn as l, cn as f } from "./cn.js";
5
+ import { generateColorsFromBase as x, getCSSVariable as T, hexToRgba as c, hslToHex as g, resolveCSSColor as S } from "./colors.js";
6
+ import { copyToClipboard as d } from "./copy.js";
7
+ import { convertPercent as N, formatBytecodeSize as b, formatBytecodeVersion as A, formatTimestamp as I, shortenHash as v, significantTrunc as L } from "./format.js";
8
+ import { formatAssetAmount as y } from "./format-asset-amount.js";
9
+ import { formatMoney as F, formatMoneyAmount as k, formatPercentAmount as w, percentTemplate as D, percentageTemplate as V } from "./format-money.js";
10
+ import { FORMAT_CONSTANTS as M, formatNumberWithSuffix as _, formatPrice as E, getAdaptiveDecimals as H, isBelowDisplayThreshold as W, isEffectivelyZero as Z, toSignificantDigits as z } from "./format-number.js";
11
+ import { slippageTemplate as R } from "./format-slippage.js";
12
+ import { allLoaded as q, loadingProgress as U, round5 as j } from "./loading.js";
13
+ import { decimalsToStep as J, findClosestPoint as K, formatWithDecimals as Q, formatWithoutDecimals as Y, splitInterval as $, validateMinMax as ee } from "./math.js";
14
+ import { getNetworkIcon as te } from "./network-icons.js";
15
+ import { bnToLiquidationPriceView as ae, isPositiveFloat as me, parseInputToBN as ie, parseSmallNumber as ne } from "./parse-input-to-bn.js";
16
+ import { pluralize as le, selectPluralString as fe } from "./plural.js";
17
+ import { getAvailableRanges as xe } from "./ranges.js";
18
+ import { extractTextFromLabel as ce, serializeValue as ge } from "./react.js";
19
+ import { searchInString as ue } from "./search.js";
20
+ import { createTokenSearchFilter as he, searchInToken as Ne } from "./search-in-token.js";
21
+ import { shortSHA as Ae } from "./short-sha.js";
22
+ import { isLongString as ve, shortenString as Le } from "./shorten-string.js";
23
+ import { negativeTokenTemplate as ye, tokenTemplate as Ce, tokenTemplateNumber as Fe, tokenTemplateString as ke } from "./templates.js";
24
+ import { TTL_CONSTANTS as De, getTTLZones as Ve, ttlFromTimestamp as Be, ttlLeft as Me, ttlLeftHuman as _e } from "./ttl.js";
25
+ import { openInNewWindow as He } from "./window.js";
26
26
  import { Z_INDEX as Ze, Z_INDEX_VALUES as ze } from "./z-index.js";
27
27
  export {
28
- B as FORMAT_CONSTANTS,
29
- we as TTL_CONSTANTS,
28
+ M as FORMAT_CONSTANTS,
29
+ De as TTL_CONSTANTS,
30
30
  Ze as Z_INDEX,
31
31
  ze as Z_INDEX_VALUES,
32
- X as allLoaded,
32
+ q as allLoaded,
33
33
  m as bnToInputView,
34
- re as bnToLiquidationPriceView,
34
+ ae as bnToLiquidationPriceView,
35
35
  n as bnToPrettyView,
36
- f as cn,
37
- h as convertPercent,
38
- u as copyToClipboard,
39
- de as createTokenSearchFilter,
40
- G as decimalsToStep,
41
- l as default,
42
- Te as extractTextFromLabel,
43
- J as findClosestPoint,
44
- P as formatAssetAmount,
45
- N as formatBytecodeSize,
46
- b as formatBytecodeVersion,
47
- C as formatMoney,
48
- F as formatMoneyAmount,
49
- M as formatNumberWithSuffix,
50
- k as formatPercentAmount,
51
- _ as formatPrice,
52
- A as formatTimestamp,
53
- K as formatWithDecimals,
54
- Q as formatWithoutDecimals,
36
+ l as cn,
37
+ N as convertPercent,
38
+ d as copyToClipboard,
39
+ he as createTokenSearchFilter,
40
+ J as decimalsToStep,
41
+ f as default,
42
+ ce as extractTextFromLabel,
43
+ K as findClosestPoint,
44
+ y as formatAssetAmount,
45
+ b as formatBytecodeSize,
46
+ A as formatBytecodeVersion,
47
+ F as formatMoney,
48
+ k as formatMoneyAmount,
49
+ _ as formatNumberWithSuffix,
50
+ w as formatPercentAmount,
51
+ E as formatPrice,
52
+ I as formatTimestamp,
53
+ Q as formatWithDecimals,
54
+ Y as formatWithoutDecimals,
55
55
  x as generateColorsFromBase,
56
56
  t as generateId,
57
- E as getAdaptiveDecimals,
58
- se as getAvailableRanges,
57
+ H as getAdaptiveDecimals,
58
+ xe as getAvailableRanges,
59
59
  T as getCSSVariable,
60
- oe as getNetworkIcon,
61
- De as getTTLZones,
60
+ te as getNetworkIcon,
61
+ Ve as getTTLZones,
62
62
  c as hexToRgba,
63
+ g as hslToHex,
63
64
  W as isBelowDisplayThreshold,
64
65
  Z as isEffectivelyZero,
65
- Ie as isLongString,
66
- ae as isPositiveFloat,
67
- q as loadingProgress,
68
- Pe as negativeTokenTemplate,
69
- Ee as openInNewWindow,
70
- me as parseInputToBN,
71
- ie as parseSmallNumber,
72
- w as percentTemplate,
73
- D as percentageTemplate,
74
- pe as pluralize,
75
- g as resolveCSSColor,
76
- U as round5,
77
- Se as searchInString,
78
- he as searchInToken,
66
+ ve as isLongString,
67
+ me as isPositiveFloat,
68
+ U as loadingProgress,
69
+ ye as negativeTokenTemplate,
70
+ He as openInNewWindow,
71
+ ie as parseInputToBN,
72
+ ne as parseSmallNumber,
73
+ D as percentTemplate,
74
+ V as percentageTemplate,
75
+ le as pluralize,
76
+ S as resolveCSSColor,
77
+ j as round5,
78
+ ue as searchInString,
79
+ Ne as searchInToken,
79
80
  fe as selectPluralString,
80
- ce as serializeValue,
81
- be as shortSHA,
82
- I as shortenHash,
83
- ve as shortenString,
84
- v as significantTrunc,
85
- O as slippageTemplate,
86
- Y as splitInterval,
81
+ ge as serializeValue,
82
+ Ae as shortSHA,
83
+ v as shortenHash,
84
+ Le as shortenString,
85
+ L as significantTrunc,
86
+ R as slippageTemplate,
87
+ $ as splitInterval,
87
88
  z as toSignificantDigits,
88
- ye as tokenTemplate,
89
- Ce as tokenTemplateNumber,
90
- Fe as tokenTemplateString,
91
- Ve as ttlFromTimestamp,
92
- Be as ttlLeft,
93
- Me as ttlLeftHuman,
89
+ Ce as tokenTemplate,
90
+ Fe as tokenTemplateNumber,
91
+ ke as tokenTemplateString,
92
+ Be as ttlFromTimestamp,
93
+ Me as ttlLeft,
94
+ _e as ttlLeftHuman,
94
95
  r as useFormFieldIds,
95
- $ as validateMinMax
96
+ ee as validateMinMax
96
97
  };