@gearbox-protocol/ui-kit 3.1.0 → 3.2.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.
Files changed (67) hide show
  1. package/README.md +86 -6
  2. package/dist/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
  3. package/dist/cjs/components/auth/connect-required.cjs +1 -1
  4. package/dist/cjs/components/auth/index.cjs +1 -1
  5. package/dist/cjs/components/auth/signin-required.cjs +1 -1
  6. package/dist/cjs/components/auth/wallet-ui-context.cjs +1 -0
  7. package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
  8. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  9. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  10. package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
  11. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  12. package/dist/cjs/components/connectkit/connect-kit-wallet-adapter.cjs +1 -0
  13. package/dist/cjs/components/connectkit/index.cjs +1 -0
  14. package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
  15. package/dist/cjs/components/graph/graph.cjs +1 -1
  16. package/dist/cjs/components/index.cjs +1 -1
  17. package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
  18. package/dist/cjs/components/next/connectkit/index.cjs +1 -0
  19. package/dist/cjs/components/next/connectkit/siwe-provider.cjs +1 -0
  20. package/dist/cjs/components/next/index.cjs +1 -1
  21. package/dist/cjs/components/table/editable-grid-table.cjs +1 -1
  22. package/dist/cjs/components/table/editable-table.cjs +1 -1
  23. package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
  24. package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
  25. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  26. package/dist/cjs/index.cjs +1 -1
  27. package/dist/esm/components/assets-list-cell/assets-list-cell.js +3 -4
  28. package/dist/esm/components/auth/connect-required.js +18 -11
  29. package/dist/esm/components/auth/index.js +5 -4
  30. package/dist/esm/components/auth/signin-required.js +30 -23
  31. package/dist/esm/components/auth/wallet-ui-context.js +13 -0
  32. package/dist/esm/components/block-sync/block-sync.js +3 -4
  33. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -2
  34. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -2
  35. package/dist/esm/components/complex-input/complex-input.js +3 -4
  36. package/dist/esm/components/compound-apy/compound-apy.js +3 -4
  37. package/dist/esm/components/connectkit/connect-kit-wallet-adapter.js +32 -0
  38. package/dist/esm/components/connectkit/index.js +6 -0
  39. package/dist/esm/components/detailed-page-title/detailed-page-title.js +1 -2
  40. package/dist/esm/components/graph/graph.js +162 -159
  41. package/dist/esm/components/index.js +608 -607
  42. package/dist/esm/components/markdown-viewer/markdown-viewer.js +3 -4
  43. package/dist/esm/components/next/connectkit/index.js +4 -0
  44. package/dist/esm/components/next/{siwe-provider.js → connectkit/siwe-provider.js} +1 -1
  45. package/dist/esm/components/next/index.js +6 -8
  46. package/dist/esm/components/table/editable-grid-table.js +36 -37
  47. package/dist/esm/components/table/editable-table.js +17 -18
  48. package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +1 -2
  49. package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +3 -4
  50. package/dist/esm/components/with-copy/with-copy.js +3 -4
  51. package/dist/esm/index.js +768 -767
  52. package/dist/types/components/auth/connect-required.d.ts +10 -11
  53. package/dist/types/components/auth/index.d.ts +1 -1
  54. package/dist/types/components/auth/signin-required.d.ts +7 -5
  55. package/dist/types/components/auth/wallet-ui-context.d.ts +36 -0
  56. package/dist/types/components/connectkit/connect-kit-wallet-adapter.d.ts +12 -0
  57. package/dist/types/components/connectkit/index.d.ts +2 -0
  58. package/dist/types/components/connectkit/siwe-provider.d.ts +30 -0
  59. package/dist/types/components/next/connectkit/index.d.ts +1 -0
  60. package/dist/types/components/next/connectkit/siwe-provider.d.ts +8 -0
  61. package/dist/types/components/next/index.d.ts +0 -1
  62. package/package.json +21 -4
  63. package/dist/cjs/components/next/siwe-provider.cjs +0 -1
  64. package/dist/types/components/auth/siwe-provider.d.ts +0 -31
  65. package/dist/types/components/next/siwe-provider.d.ts +0 -7
  66. /package/dist/cjs/components/{auth → connectkit}/siwe-provider.cjs +0 -0
  67. /package/dist/esm/components/{auth → connectkit}/siwe-provider.js +0 -0
@@ -37,9 +37,8 @@ import "../buttons/filter-button/filter-button.js";
37
37
  import "../buttons/navigation-button/navigation-button.js";
38
38
  import "../buttons/tab-button/tab-button.js";
39
39
  import "../token-icon/token-icon.js";
40
- import "connectkit";
41
40
  import "wagmi";
42
- import "viem/siwe";
41
+ import "../auth/wallet-ui-context.js";
43
42
  import "../avatar/avatar.js";
44
43
  import "../badge/badge.js";
45
44
  import "../navigation-context/navigation-context.js";
@@ -179,7 +178,7 @@ function a(o) {
179
178
  }
180
179
  return { id: T(l), displayText: o };
181
180
  }
182
- function vr({
181
+ function Tr({
183
182
  content: o,
184
183
  title: l,
185
184
  backButton: s,
@@ -391,5 +390,5 @@ function vr({
391
390
  return c ? d : /* @__PURE__ */ r(w, { title: l || "", backButton: s, children: d });
392
391
  }
393
392
  export {
394
- vr as MarkdownViewer
393
+ Tr as MarkdownViewer
395
394
  };
@@ -0,0 +1,4 @@
1
+ import { SIWEClientProvider as o } from "./siwe-provider.js";
2
+ export {
3
+ o as SIWEClientProvider
4
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useRouter as t } from "next/navigation";
3
- import { SIWEClientProvider as i } from "../auth/siwe-provider.js";
3
+ import { SIWEClientProvider as i } from "../../connectkit/siwe-provider.js";
4
4
  function s(r) {
5
5
  const e = t();
6
6
  return /* @__PURE__ */ o(i, { ...r, onRefresh: () => e.refresh() });
@@ -1,16 +1,14 @@
1
1
  import { SignInRequired as e } from "../auth/signin-required.js";
2
2
  import { preloadTokenIcons as n } from "../token-icon/token-icon.js";
3
- import { BackButton as i } from "./back-button.js";
4
- import { NextMarkdownViewer as f } from "./next-markdown-viewer.js";
3
+ import { BackButton as p } from "./back-button.js";
4
+ import { NextMarkdownViewer as i } from "./next-markdown-viewer.js";
5
5
  import { NextNavigationProvider as a } from "./next-navigation-provider.js";
6
- import { SIWEClientProvider as k } from "./siwe-provider.js";
7
- import { TokenIcon as c } from "./token-icon.js";
6
+ import { TokenIcon as k } from "./token-icon.js";
8
7
  export {
9
- i as BackButton,
10
- f as NextMarkdownViewer,
8
+ p as BackButton,
9
+ i as NextMarkdownViewer,
11
10
  a as NextNavigationProvider,
12
- k as SIWEClientProvider,
13
11
  e as SignInRequired,
14
- c as TokenIcon,
12
+ k as TokenIcon,
15
13
  n as preloadTokenIcons
16
14
  };
@@ -1,7 +1,7 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
2
  import { IconExternal as x } from "@gearbox-protocol/static";
3
- import "connectkit";
4
3
  import "wagmi";
4
+ import "../auth/wallet-ui-context.js";
5
5
  import "../buttons/back-button/back-button.js";
6
6
  import { Button as g } from "../buttons/button/button.js";
7
7
  import "../buttons/copy-button/copy-button.js";
@@ -18,23 +18,22 @@ import "luxon";
18
18
  import "../../utils/z-index.js";
19
19
  import { TabButton as u } from "../buttons/tab-button/tab-button.js";
20
20
  import { SignInRequired as b } from "../auth/signin-required.js";
21
- import "viem/siwe";
22
21
  import { TokenIcon as v } from "../token-icon/token-icon.js";
23
22
  import { GridTableCell as h, GridTable as N } from "./grid-table.js";
24
23
  import { UpdatedValue as C } from "./updated-value.js";
25
- function M({
26
- assetAddress: n,
24
+ function K({
25
+ assetAddress: o,
27
26
  symbol: i,
28
- iconSymbol: m,
27
+ iconSymbol: s,
29
28
  comment: l,
30
29
  explorerUrl: r,
31
- span: o = 1
30
+ span: d = 1
32
31
  }) {
33
- return /* @__PURE__ */ e(h, { span: o, children: /* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
34
- /* @__PURE__ */ e(v, { symbol: m ?? i, size: 24 }),
35
- /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
32
+ return /* @__PURE__ */ e(h, { span: d, children: /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
33
+ /* @__PURE__ */ e(v, { symbol: s ?? i, size: 24 }),
34
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
36
35
  /* @__PURE__ */ e("div", { className: "font-medium", children: i }),
37
- l && /* @__PURE__ */ d("div", { className: "text-md text-muted-foreground", children: [
36
+ l && /* @__PURE__ */ n("div", { className: "text-md text-muted-foreground", children: [
38
37
  "(",
39
38
  l,
40
39
  ")"
@@ -45,22 +44,22 @@ function M({
45
44
  variant: "ghost",
46
45
  size: "sm",
47
46
  className: "text-muted-foreground hover:text-foreground p-0 h-auto",
48
- onClick: () => window.open(`${r}/address/${n}`, "_blank"),
47
+ onClick: () => window.open(`${r}/address/${o}`, "_blank"),
49
48
  children: /* @__PURE__ */ e(x, { size: 12, className: "size-3" })
50
49
  }
51
50
  )
52
51
  ] })
53
52
  ] }) });
54
53
  }
55
- function O({
56
- oldValue: n,
54
+ function M({
55
+ oldValue: o,
57
56
  newValue: i,
58
- onEdit: m,
57
+ onEdit: s,
59
58
  isEditable: l = !0,
60
59
  className: r,
61
- align: o = "right",
60
+ align: d = "right",
62
61
  customButton: a,
63
- postfix: s,
62
+ postfix: m,
64
63
  disabled: c,
65
64
  nowrap: p,
66
65
  span: t = 1
@@ -69,43 +68,43 @@ function O({
69
68
  left: "justify-start",
70
69
  right: "justify-end",
71
70
  center: "justify-center"
72
- }[o];
73
- return /* @__PURE__ */ e(h, { span: t, className: r, children: /* @__PURE__ */ e("div", { className: `flex ${f} w-full text-${o}`, children: /* @__PURE__ */ e(
71
+ }[d];
72
+ return /* @__PURE__ */ e(h, { span: t, className: r, children: /* @__PURE__ */ e("div", { className: `flex ${f} w-full text-${d}`, children: /* @__PURE__ */ e(
74
73
  C,
75
74
  {
76
- oldValue: n,
75
+ oldValue: o,
77
76
  newValue: i,
78
- onEdit: m,
77
+ onEdit: s,
79
78
  isEditable: l,
80
79
  customButton: a,
81
- postfix: s,
80
+ postfix: m,
82
81
  disabled: c,
83
82
  nowrap: p
84
83
  }
85
84
  ) }) });
86
85
  }
87
- function P({
88
- title: n,
86
+ function O({
87
+ title: o,
89
88
  onNew: i,
90
- newButtonText: m = "New",
89
+ newButtonText: s = "New",
91
90
  buttonLoadingText: l = "Adding...",
92
91
  isLoading: r,
93
- actions: o,
92
+ actions: d,
94
93
  children: a,
95
- disabled: s = !1,
94
+ disabled: m = !1,
96
95
  skipSignIn: c = !0,
97
96
  cols: p = 12
98
97
  }) {
99
- return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
100
- /* @__PURE__ */ d("div", { className: "flex justify-between items-center", children: [
101
- /* @__PURE__ */ e("h2", { className: "text-2xl font-bold", children: n }),
102
- /* @__PURE__ */ e(b, { skipSignIn: c, variant: "pink", size: "sm", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
103
- i && /* @__PURE__ */ e(u, { onClick: i, disabled: r || s, children: r ? l : m }),
104
- o?.map((t, f) => /* @__PURE__ */ e(
98
+ return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
99
+ /* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
100
+ /* @__PURE__ */ e("h2", { className: "text-2xl font-bold", children: o }),
101
+ /* @__PURE__ */ e(b, { skipSignIn: c, variant: "pink", size: "sm", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
102
+ i && /* @__PURE__ */ e(u, { onClick: i, disabled: r || m, children: r ? l : s }),
103
+ d?.map((t, f) => /* @__PURE__ */ e(
105
104
  u,
106
105
  {
107
106
  onClick: t.onClick,
108
- disabled: t.isLoading || s,
107
+ disabled: t.isLoading || m,
109
108
  children: t.isLoading ? t.loadingText || "Loading..." : t.text
110
109
  },
111
110
  f
@@ -116,7 +115,7 @@ function P({
116
115
  ] });
117
116
  }
118
117
  export {
119
- M as GridTableCellAsset,
120
- O as GridTableCellUpdatable,
121
- P as GridTableEditable
118
+ K as GridTableCellAsset,
119
+ M as GridTableCellUpdatable,
120
+ O as GridTableEditable
122
121
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
- import "connectkit";
3
2
  import "wagmi";
3
+ import "../auth/wallet-ui-context.js";
4
4
  import "../buttons/back-button/back-button.js";
5
5
  import "../buttons/button/button.js";
6
6
  import "../buttons/copy-button/copy-button.js";
@@ -17,11 +17,10 @@ import "luxon";
17
17
  import "../../utils/z-index.js";
18
18
  import { TabButton as f } from "../buttons/tab-button/tab-button.js";
19
19
  import { SignInRequired as x } from "../auth/signin-required.js";
20
- import "viem/siwe";
21
20
  import { TokenIcon as b } from "../token-icon/token-icon.js";
22
21
  import { TableCell as u, Table as g } from "./table.js";
23
22
  import { UpdatedValue as v } from "./updated-value.js";
24
- function J({
23
+ function H({
25
24
  assetAddress: n,
26
25
  symbol: t,
27
26
  iconSymbol: s,
@@ -41,15 +40,15 @@ function J({
41
40
  ] })
42
41
  ] }) });
43
42
  }
44
- function K({
43
+ function J({
45
44
  oldValue: n,
46
45
  newValue: t,
47
46
  onEdit: s,
48
47
  isEditable: l = !0,
49
48
  className: i,
50
- align: o = "right",
49
+ align: d = "right",
51
50
  customButton: a,
52
- postfix: d,
51
+ postfix: o,
53
52
  disabled: c,
54
53
  nowrap: r
55
54
  }) {
@@ -57,8 +56,8 @@ function K({
57
56
  left: "justify-start",
58
57
  right: "justify-end",
59
58
  center: "justify-center"
60
- }[o];
61
- return /* @__PURE__ */ e(u, { className: i, children: /* @__PURE__ */ e("div", { className: `flex ${p} w-full text-${o}`, children: /* @__PURE__ */ e(
59
+ }[d];
60
+ return /* @__PURE__ */ e(u, { className: i, children: /* @__PURE__ */ e("div", { className: `flex ${p} w-full text-${d}`, children: /* @__PURE__ */ e(
62
61
  v,
63
62
  {
64
63
  oldValue: n,
@@ -66,33 +65,33 @@ function K({
66
65
  onEdit: s,
67
66
  isEditable: l,
68
67
  customButton: a,
69
- postfix: d,
68
+ postfix: o,
70
69
  disabled: c,
71
70
  nowrap: r
72
71
  }
73
72
  ) }) });
74
73
  }
75
- function M({
74
+ function K({
76
75
  title: n,
77
76
  onNew: t,
78
77
  newButtonText: s = "New",
79
78
  buttonLoadingText: l = "Adding...",
80
79
  isLoading: i,
81
- actions: o,
80
+ actions: d,
82
81
  children: a,
83
- disabled: d = !1,
82
+ disabled: o = !1,
84
83
  skipSignIn: c = !0
85
84
  }) {
86
85
  return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
87
86
  /* @__PURE__ */ m("div", { className: "flex justify-between items-center", children: [
88
87
  /* @__PURE__ */ e("h2", { className: "text-2xl font-bold", children: n }),
89
88
  /* @__PURE__ */ e(x, { skipSignIn: c, variant: "pink", size: "sm", children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
90
- t && /* @__PURE__ */ e(f, { onClick: t, disabled: i || d, children: i ? l : s }),
91
- o?.map((r, p) => /* @__PURE__ */ e(
89
+ t && /* @__PURE__ */ e(f, { onClick: t, disabled: i || o, children: i ? l : s }),
90
+ d?.map((r, p) => /* @__PURE__ */ e(
92
91
  f,
93
92
  {
94
93
  onClick: r.onClick,
95
- disabled: r.isLoading || d,
94
+ disabled: r.isLoading || o,
96
95
  children: r.isLoading ? r.loadingText || "Loading..." : r.text
97
96
  },
98
97
  p
@@ -103,7 +102,7 @@ function M({
103
102
  ] });
104
103
  }
105
104
  export {
106
- J as TableCellAsset,
107
- K as TableCellUpdatable,
108
- M as TableEditable
105
+ H as TableCellAsset,
106
+ J as TableCellUpdatable,
107
+ K as TableEditable
109
108
  };
@@ -27,9 +27,8 @@ import "../buttons/filter-button/filter-button.js";
27
27
  import "../buttons/navigation-button/navigation-button.js";
28
28
  import "../buttons/tab-button/tab-button.js";
29
29
  import "../token-icon/token-icon.js";
30
- import "connectkit";
31
30
  import "wagmi";
32
- import "viem/siwe";
31
+ import "../auth/wallet-ui-context.js";
33
32
  import "../avatar/avatar.js";
34
33
  import "../badge/badge.js";
35
34
  import "../base-link/base-link.js";
@@ -26,9 +26,8 @@ import "../buttons/external-button/external-button.js";
26
26
  import "../buttons/filter-button/filter-button.js";
27
27
  import "../buttons/navigation-button/navigation-button.js";
28
28
  import "../buttons/tab-button/tab-button.js";
29
- import "connectkit";
30
29
  import "wagmi";
31
- import "viem/siwe";
30
+ import "../auth/wallet-ui-context.js";
32
31
  import "../avatar/avatar.js";
33
32
  import "../badge/badge.js";
34
33
  import "../base-link/base-link.js";
@@ -158,7 +157,7 @@ import "../tip-card/tip-card.js";
158
157
  import "../toggle/toggle.js";
159
158
  import "../typography/typography.js";
160
159
  import "../with-filter-button/with-filter-button.js";
161
- function zr({
160
+ function Mr({
162
161
  balances: a,
163
162
  tokensList: l,
164
163
  maxAssets: p = 3,
@@ -221,5 +220,5 @@ function zr({
221
220
  ] });
222
221
  }
223
222
  export {
224
- zr as TokensListCell
223
+ Mr as TokensListCell
225
224
  };
@@ -26,9 +26,8 @@ import "../buttons/filter-button/filter-button.js";
26
26
  import "../buttons/navigation-button/navigation-button.js";
27
27
  import "../buttons/tab-button/tab-button.js";
28
28
  import "../token-icon/token-icon.js";
29
- import "connectkit";
30
29
  import "wagmi";
31
- import "viem/siwe";
30
+ import "../auth/wallet-ui-context.js";
32
31
  import "../avatar/avatar.js";
33
32
  import "../badge/badge.js";
34
33
  import "../base-link/base-link.js";
@@ -158,7 +157,7 @@ import "../tip-card/tip-card.js";
158
157
  import "../toggle/toggle.js";
159
158
  import "../typography/typography.js";
160
159
  import "../with-filter-button/with-filter-button.js";
161
- function Tr({
160
+ function jr({
162
161
  toCopy: u,
163
162
  children: d,
164
163
  onCopySuccess: f,
@@ -240,5 +239,5 @@ function Tr({
240
239
  return a ? /* @__PURE__ */ t(T, { placement: "top", triangle: !0, title: c(), children: a }) : c();
241
240
  }
242
241
  export {
243
- Tr as WithCopy
242
+ jr as WithCopy
244
243
  };