@gearbox-protocol/permissionless-ui 1.22.0-next.40 → 1.22.0-next.41

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 (37) hide show
  1. package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
  2. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  3. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  4. package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
  5. package/dist/cjs/components/fadeout-loading/fadeout-loading.cjs +1 -1
  6. package/dist/cjs/components/health-factor/health-factor.cjs +1 -1
  7. package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
  8. package/dist/cjs/components/index.cjs +1 -1
  9. package/dist/cjs/components/liquidation-price/index.cjs +1 -0
  10. package/dist/cjs/components/liquidation-price/liquidation-price.cjs +1 -0
  11. package/dist/cjs/components/status-elements/status-elements.cjs +1 -1
  12. package/dist/cjs/components/vertical-indicator/vertical-indicator.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/esm/components/block-sync/block-sync.js +4 -2
  15. package/dist/esm/components/checkbox/checkbox-labeled.js +2 -0
  16. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -0
  17. package/dist/esm/components/complex-input/complex-input.js +4 -2
  18. package/dist/esm/components/fadeout-loading/fadeout-loading.js +12 -12
  19. package/dist/esm/components/health-factor/health-factor.js +53 -42
  20. package/dist/esm/components/help-tip/help-tip.js +113 -64
  21. package/dist/esm/components/index.js +241 -239
  22. package/dist/esm/components/liquidation-price/index.js +4 -0
  23. package/dist/esm/components/liquidation-price/liquidation-price.js +43 -0
  24. package/dist/esm/components/status-elements/status-elements.js +46 -28
  25. package/dist/esm/components/vertical-indicator/vertical-indicator.js +90 -90
  26. package/dist/esm/index.js +398 -396
  27. package/dist/globals.css +1 -1
  28. package/dist/types/components/fadeout-loading/fadeout-loading.d.ts +5 -13
  29. package/dist/types/components/health-factor/health-factor.d.ts +16 -35
  30. package/dist/types/components/help-tip/help-tip.d.ts +33 -44
  31. package/dist/types/components/index.d.ts +1 -0
  32. package/dist/types/components/liquidation-price/index.d.ts +1 -0
  33. package/dist/types/components/liquidation-price/liquidation-price.d.ts +41 -0
  34. package/dist/types/components/status-elements/status-elements.d.ts +11 -1
  35. package/dist/types/components/vertical-indicator/vertical-indicator.d.ts +24 -51
  36. package/dist/types/index.d.ts +1 -0
  37. package/package.json +1 -1
@@ -87,6 +87,7 @@ import "../graph/formatters.js";
87
87
  import "lightweight-charts";
88
88
  import "../graph/graph-view.js";
89
89
  import "../help-tip/help-tip.js";
90
+ import "../health-factor/health-factor.js";
90
91
  import "../horizontal-indicator/horizontal-indicator.js";
91
92
  import "../layout/col/col.js";
92
93
  import "../layout/container/container.js";
@@ -95,6 +96,7 @@ import "../layout/grid/grid.js";
95
96
  import "../layout/header/header.js";
96
97
  import "../layout/layout/layout.js";
97
98
  import "../../utils/reactochart-compat.js";
99
+ import "../status-elements/status-elements.js";
98
100
  import "react-markdown";
99
101
  import "remark-gfm";
100
102
  import "../navbar/navbar.js";
@@ -126,7 +128,7 @@ import "../vertical-indicator/vertical-indicator.js";
126
128
  import "../vertical-list/vertical-list.js";
127
129
  import "../with-filter-button/with-filter-button.js";
128
130
  const D = 1e3 * 60 * 10;
129
- function Wr({
131
+ function Yr({
130
132
  blockByChain: i,
131
133
  explorerAddresses: S,
132
134
  networkById: v
@@ -190,5 +192,5 @@ function Wr({
190
192
  return i ? /* @__PURE__ */ o(j, { title: d(), children: N() }) : /* @__PURE__ */ o("div", { className: "select-none", children: d() });
191
193
  }
192
194
  export {
193
- Wr as BlockSync
195
+ Yr as BlockSync
194
196
  };
@@ -87,6 +87,7 @@ import "../graph/formatters.js";
87
87
  import "lightweight-charts";
88
88
  import "../graph/graph-view.js";
89
89
  import "../help-tip/help-tip.js";
90
+ import "../health-factor/health-factor.js";
90
91
  import "../horizontal-indicator/horizontal-indicator.js";
91
92
  import "../layout/col/col.js";
92
93
  import "../layout/container/container.js";
@@ -95,6 +96,7 @@ import "../layout/grid/grid.js";
95
96
  import "../layout/header/header.js";
96
97
  import "../layout/layout/layout.js";
97
98
  import "../../utils/reactochart-compat.js";
99
+ import "../status-elements/status-elements.js";
98
100
  import "react-markdown";
99
101
  import "remark-gfm";
100
102
  import "../navbar/navbar.js";
@@ -87,6 +87,7 @@ import "../../graph/formatters.js";
87
87
  import "lightweight-charts";
88
88
  import "../../graph/graph-view.js";
89
89
  import "../../help-tip/help-tip.js";
90
+ import "../../health-factor/health-factor.js";
90
91
  import "../../horizontal-indicator/horizontal-indicator.js";
91
92
  import "../../layout/col/col.js";
92
93
  import "../../layout/container/container.js";
@@ -95,6 +96,7 @@ import "../../layout/grid/grid.js";
95
96
  import "../../layout/header/header.js";
96
97
  import "../../layout/layout/layout.js";
97
98
  import "../../../utils/reactochart-compat.js";
99
+ import "../../status-elements/status-elements.js";
98
100
  import "react-markdown";
99
101
  import "remark-gfm";
100
102
  import "../../navbar/navbar.js";
@@ -89,6 +89,7 @@ import "../graph/formatters.js";
89
89
  import "lightweight-charts";
90
90
  import "../graph/graph-view.js";
91
91
  import "../help-tip/help-tip.js";
92
+ import "../health-factor/health-factor.js";
92
93
  import "../horizontal-indicator/horizontal-indicator.js";
93
94
  import "../layout/col/col.js";
94
95
  import "../layout/container/container.js";
@@ -98,6 +99,7 @@ import "../layout/header/header.js";
98
99
  import "../layout/layout/layout.js";
99
100
  import "../../utils/reactochart-compat.js";
100
101
  import { ShortString as j } from "../short-string/short-string.js";
102
+ import "../status-elements/status-elements.js";
101
103
  import "react-markdown";
102
104
  import "remark-gfm";
103
105
  import "../navbar/navbar.js";
@@ -174,7 +176,7 @@ function A({
174
176
  ) })
175
177
  ] });
176
178
  }
177
- function pr({
179
+ function nr({
178
180
  titleProps: e,
179
181
  inputProps: n,
180
182
  balanceIndicatorProps: s
@@ -237,5 +239,5 @@ function pr({
237
239
  }
238
240
  export {
239
241
  A as BalanceIndicator,
240
- pr as ComplexInput
242
+ nr as ComplexInput
241
243
  };
@@ -1,22 +1,22 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import * as n from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import * as p from "react";
3
3
  import "@gearbox-protocol/sdk";
4
- import { cn as p } from "../../utils/cn.js";
4
+ import { cn as n } from "../../utils/cn.js";
5
5
  import "sonner";
6
- const d = n.forwardRef(
7
- ({ className: o, loading: a = !1, duration: t = 150, children: i, style: e, ...r }, s) => /* @__PURE__ */ m(
6
+ const d = p.forwardRef(
7
+ ({ className: a, loading: o, duration: t = 100, children: r, style: i, ...e }, m) => /* @__PURE__ */ s(
8
8
  "span",
9
9
  {
10
- ref: s,
11
- className: p("inline-flex", o),
10
+ ref: m,
11
+ className: n(a),
12
12
  style: {
13
- opacity: a ? 0.5 : 1,
13
+ opacity: o ? 0.5 : 1,
14
14
  transition: `opacity ${t}ms ease-in-out`,
15
- ...e
15
+ ...i
16
16
  },
17
- "data-loading": a,
18
- ...r,
19
- children: i
17
+ "data-loading": o,
18
+ ...e,
19
+ children: r
20
20
  }
21
21
  )
22
22
  );
@@ -1,51 +1,62 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { PERCENTAGE_FACTOR as i } from "@gearbox-protocol/sdk";
1
+ import { jsxs as f, jsx as c } from "react/jsx-runtime";
2
+ import { PERCENTAGE_FACTOR as v, formatPercentage as x } from "@gearbox-protocol/sdk";
3
+ import { cva as p } from "class-variance-authority";
3
4
  import "react";
4
- import { cn as p } from "../../utils/cn.js";
5
+ import { cn as C } from "../../utils/cn.js";
5
6
  import "sonner";
6
- import { formatPercentAmount as v } from "../../utils/format-money.js";
7
- const x = 15e3, A = 11e3, C = 10500, F = (r) => {
8
- if (!r) return;
9
- const t = Number(r);
10
- return t >= x ? "good" : t > A ? "medium" : t > C ? "bad" : t > i ? "critical" : "liquidation";
11
- };
12
- function I({
13
- value: r,
14
- debt: t,
15
- decimals: u = 3,
16
- zone: e,
17
- showColor: c = !0,
18
- className: s,
7
+ import { StatusBars as F } from "../status-elements/status-elements.js";
8
+ const g = 15e3, A = 11e3, H = 10500, N = (t) => {
9
+ if (t)
10
+ return t >= g ? "good" : t > A ? "medium" : t > H ? "bad" : t > v ? "critical" : "liquidation";
11
+ }, b = p(
12
+ "inline-flex items-center font-medium [text-decoration:inherit]",
13
+ {
14
+ variants: {
15
+ zone: {
16
+ good: "text-success",
17
+ medium: "text-warning",
18
+ bad: "text-destructive",
19
+ critical: "text-destructive",
20
+ liquidation: "text-liquidation",
21
+ unset: "[color:unset]"
22
+ }
23
+ }
24
+ }
25
+ );
26
+ function R({
27
+ value: t,
28
+ debt: e,
29
+ decimals: a = 3,
30
+ zone: o,
31
+ zoneType: n = "color",
32
+ className: u,
19
33
  ...m
20
34
  }) {
21
- const n = t !== void 0 && t === 0n, o = (() => {
22
- if (!n)
23
- return e ?? F(r);
24
- })(), a = () => {
25
- if (!c || o === void 0) return "";
26
- switch (o) {
27
- case "good":
28
- return "text-green-600";
29
- case "medium":
30
- return "text-yellow-600";
31
- case "bad":
32
- return "text-orange-500";
33
- case "critical":
34
- case "liquidation":
35
- return "text-destructive";
36
- default:
37
- return "";
38
- }
39
- }, d = () => {
40
- if (n) return "N/A";
41
- const f = Number(r) / Number(i), l = v(f, u, !1);
42
- return String(l);
35
+ const i = e !== void 0 && e === 0n, r = !i && n === "color" ? o === void 0 ? N(t) : o : void 0, s = r === void 0 ? void 0 : r === null ? "unset" : r, d = () => {
36
+ if (i) return "N/A";
37
+ const l = Number(t);
38
+ return x(l, a);
43
39
  };
44
- return /* @__PURE__ */ g("div", { className: p("font-medium", a(), s), ...m, children: d() });
40
+ return /* @__PURE__ */ f(
41
+ "span",
42
+ {
43
+ className: C(
44
+ b(
45
+ s !== void 0 ? { zone: s } : {}
46
+ ),
47
+ u
48
+ ),
49
+ ...m,
50
+ children: [
51
+ o && n === "bars" && /* @__PURE__ */ c("span", { className: "mr-6 shrink-0", children: /* @__PURE__ */ c(F, { zone: o }) }),
52
+ d()
53
+ ]
54
+ }
55
+ );
45
56
  }
46
57
  export {
47
58
  A as BAD_HF,
48
- x as GOOD_HF,
49
- I as HealthFactor,
50
- F as getHFZones
59
+ g as GOOD_HF,
60
+ R as HealthFactor,
61
+ N as getHFZones
51
62
  };
@@ -1,80 +1,129 @@
1
- import { jsx as e, jsxs as x } from "react/jsx-runtime";
2
- import { IconQuestionCircle as s } from "@gearbox-protocol/static";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { IconQuestionCircle as u, IconInfo as v } from "@gearbox-protocol/static";
3
+ import { cva as T } from "class-variance-authority";
3
4
  import * as l from "react";
4
5
  import "@gearbox-protocol/sdk";
5
- import { cn as t } from "../../utils/cn.js";
6
+ import { cn as p } from "../../utils/cn.js";
6
7
  import "sonner";
7
- import "../tooltip/simple-tooltip.js";
8
- import { TooltipProvider as T, Tooltip as h, TooltipTrigger as y, TooltipContent as g } from "../tooltip/tooltip.js";
9
- const N = l.forwardRef(
8
+ import { SimpleTooltip as C } from "../tooltip/simple-tooltip.js";
9
+ const H = T("transition-colors", {
10
+ variants: {
11
+ iconColor: {
12
+ "gray-10": "text-gray-10",
13
+ "gray-20": "text-gray-20",
14
+ "gray-30": "text-gray-30",
15
+ "gray-40": "text-gray-40",
16
+ "gray-50": "text-gray-50",
17
+ "gray-60": "text-gray-60",
18
+ "gray-70": "text-gray-70",
19
+ "gray-80": "text-gray-80",
20
+ "gray-90": "text-gray-90",
21
+ "gray-100": "text-gray-100",
22
+ "gray-110": "text-gray-110",
23
+ muted: "text-secondary-foreground",
24
+ foreground: "text-foreground"
25
+ },
26
+ iconHoverColor: {
27
+ "gray-10": "hover:text-gray-10",
28
+ "gray-20": "hover:text-gray-20",
29
+ "gray-30": "hover:text-gray-30",
30
+ "gray-40": "hover:text-gray-40",
31
+ "gray-50": "hover:text-gray-50",
32
+ "gray-60": "hover:text-gray-60",
33
+ "gray-70": "hover:text-gray-70",
34
+ "gray-80": "hover:text-gray-80",
35
+ "gray-90": "hover:text-gray-90",
36
+ "gray-100": "hover:text-gray-100",
37
+ "gray-110": "hover:text-gray-110",
38
+ muted: "hover:text-secondary-foreground",
39
+ foreground: "hover:text-foreground"
40
+ }
41
+ },
42
+ defaultVariants: { iconColor: "gray-90", iconHoverColor: "gray-110" }
43
+ }), I = l.forwardRef(
10
44
  ({
11
- className: r,
12
- children: o,
13
- maxWidth: i,
14
- minWidth: n,
15
- delayShow: p = 200,
16
- delayHide: w = 150,
17
- side: a = "bottom",
18
- iconSize: c = 14,
19
- sideOffset: m = 4,
20
- onPointerEnter: d,
21
- ...f
22
- }, u) => /* @__PURE__ */ e(T, { delayDuration: p, children: /* @__PURE__ */ x(h, { children: [
23
- /* @__PURE__ */ e(y, { asChild: !0, children: /* @__PURE__ */ e(
24
- "span",
45
+ className: t,
46
+ children: r,
47
+ maxWidth: o,
48
+ minWidth: a,
49
+ delayShow: g = 200,
50
+ placement: y = "bottom",
51
+ iconSize: n = 14,
52
+ iconColor: i = "gray-90",
53
+ iconHoverColor: s = "gray-110",
54
+ iconVariant: x = "question",
55
+ onPointerEnter: m,
56
+ ...d
57
+ }, f) => {
58
+ const h = /* @__PURE__ */ e(
59
+ c,
25
60
  {
26
- ref: u,
27
- className: t(
28
- "inline-flex items-center justify-center cursor-help text-muted-foreground hover:text-foreground transition-colors",
29
- r
30
- ),
31
- onPointerEnter: d,
32
- ...f,
33
- children: /* @__PURE__ */ e(s, { size: c })
61
+ ref: f,
62
+ iconSize: n,
63
+ iconColor: i,
64
+ iconHoverColor: s,
65
+ iconVariant: x,
66
+ onPointerEnter: m,
67
+ className: t,
68
+ ...d
34
69
  }
35
- ) }),
36
- /* @__PURE__ */ e(
37
- g,
70
+ );
71
+ return /* @__PURE__ */ e(
72
+ C,
38
73
  {
39
- side: a,
40
- sideOffset: m,
41
- className: t("max-w-xs"),
42
- style: {
43
- maxWidth: i,
44
- minWidth: n
45
- },
46
- children: o
74
+ title: h,
75
+ placement: y,
76
+ delayShow: g,
77
+ maxWidth: o,
78
+ minWidth: a,
79
+ children: r
47
80
  }
48
- )
49
- ] }) })
81
+ );
82
+ }
50
83
  );
51
- N.displayName = "HelpTip";
52
- const H = l.forwardRef(
53
- ({ className: r, iconSize: o = 14, ...i }, n) => /* @__PURE__ */ e(
54
- "span",
55
- {
56
- ref: n,
57
- className: t(
58
- "inline-flex items-center justify-center cursor-help text-muted-foreground hover:text-foreground transition-colors",
59
- r
60
- ),
61
- ...i,
62
- children: /* @__PURE__ */ e(s, { size: o })
63
- }
64
- )
84
+ I.displayName = "HelpTip";
85
+ const c = l.forwardRef(
86
+ ({
87
+ className: t,
88
+ iconSize: r = 14,
89
+ iconColor: o = "gray-90",
90
+ iconHoverColor: a = "gray-110",
91
+ iconVariant: g = "question",
92
+ onPointerEnter: y,
93
+ ...n
94
+ }, i) => {
95
+ const s = g === "question" ? u : v;
96
+ return /* @__PURE__ */ e(
97
+ "span",
98
+ {
99
+ ref: i,
100
+ role: "img",
101
+ "aria-hidden": !0,
102
+ className: p(
103
+ "inline-block cursor-help",
104
+ H({ iconColor: o, iconHoverColor: a }),
105
+ t
106
+ ),
107
+ style: { width: r, height: r },
108
+ onPointerEnter: y,
109
+ ...n,
110
+ children: /* @__PURE__ */ e(s, { size: r })
111
+ }
112
+ );
113
+ }
65
114
  );
66
- H.displayName = "HelpTipIcon";
67
- const j = l.forwardRef(({ className: r, ...o }, i) => /* @__PURE__ */ e(
115
+ c.displayName = "HelpTipIcon";
116
+ const N = l.forwardRef(({ className: t, ...r }, o) => /* @__PURE__ */ e(
68
117
  "span",
69
118
  {
70
- ref: i,
71
- className: t("ml-1.5 inline-block leading-none", r),
72
- ...o
119
+ ref: o,
120
+ className: p("ml-1.5 inline-block leading-none", t),
121
+ ...r
73
122
  }
74
123
  ));
75
- j.displayName = "TipWrap";
124
+ N.displayName = "TipWrap";
76
125
  export {
77
- N as HelpTip,
78
- H as HelpTipIcon,
79
- j as TipWrap
126
+ I as HelpTip,
127
+ c as HelpTipIcon,
128
+ N as TipWrap
80
129
  };