@gearbox-protocol/permissionless-ui 1.17.2 → 1.17.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.
@@ -1,10 +1,10 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import { cva as n } from "class-variance-authority";
2
+ import { cva as f } from "class-variance-authority";
3
3
  import * as s from "react";
4
- import { Col as m } from "../layout/col/col.js";
4
+ import { Col as c } from "../layout/col/col.js";
5
5
  import { Grid as b } from "../layout/grid/grid.js";
6
- import { cn as o } from "../../utils/cn.js";
7
- const G = n("w-full", {
6
+ import { cn as i } from "../../utils/cn.js";
7
+ const h = f("w-full", {
8
8
  variants: {
9
9
  size: {
10
10
  sm: "text-xs",
@@ -15,91 +15,102 @@ const G = n("w-full", {
15
15
  defaultVariants: {
16
16
  size: "default"
17
17
  }
18
- }), N = s.forwardRef(
19
- ({ className: e, size: t, cols: a = 12, gap: i = 0, ...r }, l) => /* @__PURE__ */ d("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ d(
18
+ }), G = s.forwardRef(
19
+ ({ className: e, size: t, cols: a = 12, gap: l = 0, ...r }, o) => /* @__PURE__ */ d("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ d(
20
20
  b,
21
21
  {
22
- ref: l,
22
+ ref: o,
23
23
  cols: a,
24
- gap: i,
25
- className: o(G({ size: t, className: e })),
24
+ gap: l,
25
+ className: i(h({ size: t, className: e })),
26
26
  ...r
27
27
  }
28
28
  ) })
29
29
  );
30
- N.displayName = "GridTable";
31
- const v = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
30
+ G.displayName = "GridTable";
31
+ const N = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
32
32
  "div",
33
33
  {
34
34
  ref: a,
35
- className: o("contents [&>*]:border-b [&>*]:border-border", e),
35
+ className: i(
36
+ "contents",
37
+ // Full-width border for header (no insets)
38
+ "[&>*>*]:after:absolute [&>*>*]:after:bottom-0 [&>*>*]:after:inset-x-0 [&>*>*]:after:h-px [&>*>*]:after:bg-border",
39
+ e
40
+ ),
36
41
  ...t
37
42
  }
38
43
  ));
39
- v.displayName = "GridTableHeader";
40
- const w = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
44
+ N.displayName = "GridTableHeader";
45
+ const v = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
41
46
  "div",
42
47
  {
43
48
  ref: a,
44
- className: o("contents [&>*:last-child>*]:border-0", e),
49
+ className: i("contents [&>*:last-child>*]:after:hidden", e),
45
50
  ...t
46
51
  }
47
52
  ));
48
- w.displayName = "GridTableBody";
49
- const h = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
53
+ v.displayName = "GridTableBody";
54
+ const w = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
50
55
  "div",
51
56
  {
52
57
  ref: a,
53
- className: o(
58
+ className: i(
54
59
  "contents [&>*]:border-t [&>*]:bg-muted/50 [&>*]:font-medium",
55
60
  e
56
61
  ),
57
62
  ...t
58
63
  }
59
64
  ));
60
- h.displayName = "GridTableFooter";
65
+ w.displayName = "GridTableFooter";
61
66
  const R = s.forwardRef(
62
67
  ({
63
68
  className: e,
64
69
  cols: t,
65
70
  gap: a = 0,
66
- last: i,
71
+ last: l,
67
72
  height: r,
68
- hideValue: l,
69
- noHover: u,
70
- noRound: y,
73
+ hideValue: o,
74
+ noHover: y,
75
+ noRound: n,
71
76
  style: x,
72
- ...T
73
- }, g) => {
74
- const f = typeof r == "number" ? `${r}px` : r;
77
+ ...g
78
+ }, T) => {
79
+ const m = typeof r == "number" ? `${r}px` : r;
75
80
  return /* @__PURE__ */ d(
76
81
  b,
77
82
  {
78
- ref: g,
83
+ ref: T,
79
84
  cols: t,
80
85
  gap: a,
81
- className: o(
82
- "contents md:[&>*]:border-b [&>*]:border-border [&>*]:transition-colors data-[state=selected]:[&>*]:bg-muted",
86
+ className: i(
87
+ "contents [&>*]:relative [&>*]:transition-colors data-[state=selected]:[&>*]:bg-muted",
88
+ // Bottom border via ::after with insets on first/last cells to avoid rounded corners
89
+ "md:[&>*]:after:absolute md:[&>*]:after:bottom-0 md:[&>*]:after:inset-x-0 md:[&>*]:after:h-px md:[&>*]:after:bg-border",
90
+ !n && [
91
+ "md:[&>*:first-child]:after:left-3",
92
+ "md:[&>*:last-child]:after:right-3"
93
+ ],
83
94
  // Hover background with optional rounded corners on first and last cells (unless noHover)
84
- !u && [
85
- "[&>*]:relative [&>*]:z-0",
95
+ !y && [
96
+ "[&>*]:z-0",
86
97
  "[&>*]:before:absolute [&>*]:before:inset-0 [&>*]:before:-z-10 [&>*]:before:bg-muted/50 [&>*]:before:opacity-0 [&>*]:before:transition-opacity",
87
98
  "hover:[&>*]:before:opacity-100",
88
99
  // Only add rounded corners if noRound is not set
89
- !y && "[&>*:first-child]:before:rounded-l-lg [&>*:last-child]:before:rounded-r-lg"
100
+ !n && "[&>*:first-child]:before:rounded-l-lg [&>*:last-child]:before:rounded-r-lg"
90
101
  ],
91
- i && "[&>*]:border-b-0",
92
- l && "[&>*]:opacity-0",
102
+ l && "md:[&>*]:after:hidden",
103
+ o && "[&>*]:opacity-0",
93
104
  e
94
105
  ),
95
- style: { ...x, ...f ? { height: f } : {} },
96
- ...T
106
+ style: { ...x, ...m ? { height: m } : {} },
107
+ ...g
97
108
  }
98
109
  );
99
110
  }
100
111
  );
101
112
  R.displayName = "GridTableRow";
102
- const z = n(
113
+ const z = f(
103
114
  "flex items-center justify-startborder-b text-left align-middle font-medium text-muted-foreground !bg-transparent",
104
115
  {
105
116
  variants: {
@@ -119,19 +130,19 @@ const z = n(
119
130
  justify: "start"
120
131
  }
121
132
  }
122
- ), c = s.forwardRef(
123
- ({ className: e, size: t, span: a = 1, justify: i = "start", ...r }, l) => /* @__PURE__ */ d(
124
- m,
133
+ ), p = s.forwardRef(
134
+ ({ className: e, size: t, span: a = 1, justify: l = "start", ...r }, o) => /* @__PURE__ */ d(
135
+ c,
125
136
  {
126
- ref: l,
137
+ ref: o,
127
138
  span: a,
128
- className: o(z({ size: t, justify: i, className: e })),
139
+ className: i(z({ size: t, justify: l, className: e })),
129
140
  ...r
130
141
  }
131
142
  )
132
143
  );
133
- c.displayName = "GridTableHead";
134
- const j = n("align-middle", {
144
+ p.displayName = "GridTableHead";
145
+ const j = f("align-middle", {
135
146
  variants: {
136
147
  size: {
137
148
  sm: "p-2",
@@ -147,23 +158,23 @@ const j = n("align-middle", {
147
158
  defaultVariants: {
148
159
  size: "default"
149
160
  }
150
- }), p = s.forwardRef(
151
- ({ className: e, size: t, span: a = 1, textAlign: i, ...r }, l) => /* @__PURE__ */ d(
152
- m,
161
+ }), u = s.forwardRef(
162
+ ({ className: e, size: t, span: a = 1, textAlign: l, ...r }, o) => /* @__PURE__ */ d(
163
+ c,
153
164
  {
154
- ref: l,
165
+ ref: o,
155
166
  span: a,
156
- className: o(j({ size: t, textAlign: i, className: e })),
167
+ className: i(j({ size: t, textAlign: l, className: e })),
157
168
  ...r
158
169
  }
159
170
  )
160
171
  );
161
- p.displayName = "GridTableCell";
172
+ u.displayName = "GridTableCell";
162
173
  const C = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
163
174
  "div",
164
175
  {
165
176
  ref: a,
166
- className: o(
177
+ className: i(
167
178
  "col-span-full mt-4 text-sm text-muted-foreground",
168
179
  e
169
180
  ),
@@ -171,19 +182,19 @@ const C = s.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ d(
171
182
  }
172
183
  ));
173
184
  C.displayName = "GridTableCaption";
174
- const S = p, $ = c;
185
+ const S = u, $ = p;
175
186
  export {
176
- N as GridTable,
177
- w as GridTableBody,
187
+ G as GridTable,
188
+ v as GridTableBody,
178
189
  C as GridTableCaption,
179
- p as GridTableCell,
180
- h as GridTableFooter,
181
- c as GridTableHead,
182
- v as GridTableHeader,
190
+ u as GridTableCell,
191
+ w as GridTableFooter,
192
+ p as GridTableHead,
193
+ N as GridTableHeader,
183
194
  R as GridTableRow,
184
195
  S as Td,
185
196
  $ as Th,
186
197
  j as gridTableCellVariants,
187
198
  z as gridTableHeadVariants,
188
- G as gridTableVariants
199
+ h as gridTableVariants
189
200
  };
@@ -1,13 +1,13 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { cva as i } from "class-variance-authority";
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { cva as d } from "class-variance-authority";
3
3
  import { ArrowDown as u } from "lucide-react";
4
4
  import * as l from "react";
5
5
  import { Button as g } from "../buttons/button/button.js";
6
- import { TooltipProvider as T, Tooltip as h, TooltipTrigger as x, TooltipContent as N } from "../tooltip/tooltip.js";
6
+ import { TooltipProvider as h, Tooltip as x, TooltipTrigger as T, TooltipContent as N } from "../tooltip/tooltip.js";
7
7
  import { cn as o } from "../../utils/cn.js";
8
8
  import "sonner";
9
9
  import "@gearbox-protocol/sdk";
10
- const w = i("w-full caption-bottom", {
10
+ const w = d("w-full caption-bottom", {
11
11
  variants: {
12
12
  size: {
13
13
  sm: "text-xs",
@@ -19,64 +19,67 @@ const w = i("w-full caption-bottom", {
19
19
  size: "default"
20
20
  }
21
21
  }), y = l.forwardRef(
22
- ({ className: a, size: t, ...e }, s) => /* @__PURE__ */ r("div", { className: "relative w-full overflow-auto rounded-lg border border-input bg-card", children: /* @__PURE__ */ r(
22
+ ({ className: t, size: a, ...e }, s) => /* @__PURE__ */ r("div", { className: "relative w-full overflow-auto rounded-lg border border-input bg-card", children: /* @__PURE__ */ r(
23
23
  "table",
24
24
  {
25
25
  ref: s,
26
- className: o(w({ size: t, className: a })),
26
+ className: o(w({ size: a, className: t })),
27
27
  ...e
28
28
  }
29
29
  ) })
30
30
  );
31
31
  y.displayName = "Table";
32
- const v = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
32
+ const v = l.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r(
33
33
  "thead",
34
34
  {
35
35
  ref: e,
36
36
  className: o(
37
- "[&_tr]:border-b border-input [&_tr]:hover:bg-transparent",
38
- a
37
+ "[&_tr]:after:inset-x-0 [&_tr]:after:bg-input [&_tr]:hover:bg-transparent [&_tr]:hover:before:opacity-0",
38
+ t
39
39
  ),
40
- ...t
40
+ ...a
41
41
  }
42
42
  ));
43
43
  v.displayName = "TableHeader";
44
- const R = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
44
+ const R = l.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r(
45
45
  "tbody",
46
46
  {
47
47
  ref: e,
48
- className: o("[&_tr:last-child]:border-0", a),
49
- ...t
48
+ className: o("[&_tr:last-child]:after:hidden", t),
49
+ ...a
50
50
  }
51
51
  ));
52
52
  R.displayName = "TableBody";
53
- const z = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
53
+ const z = l.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r(
54
54
  "tfoot",
55
55
  {
56
56
  ref: e,
57
57
  className: o(
58
58
  "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
59
- a
59
+ t
60
60
  ),
61
- ...t
61
+ ...a
62
62
  }
63
63
  ));
64
64
  z.displayName = "TableFooter";
65
- const C = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
65
+ const C = l.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r(
66
66
  "tr",
67
67
  {
68
68
  ref: e,
69
69
  className: o(
70
- "relative border-b transition-colors data-[state=selected]:bg-muted border-border",
70
+ "relative transition-colors data-[state=selected]:bg-muted",
71
+ // Hover background with rounded corners
71
72
  "before:absolute before:inset-0 before:-z-10 before:rounded-lg before:bg-muted/50 before:opacity-0 before:transition-opacity",
72
73
  "hover:before:opacity-100",
73
- a
74
+ // Border line that doesn't extend to rounded corners
75
+ "after:absolute after:bottom-0 after:inset-x-3 after:h-px after:bg-border",
76
+ t
74
77
  ),
75
- ...t
78
+ ...a
76
79
  }
77
80
  ));
78
81
  C.displayName = "TableRow";
79
- const H = i(
82
+ const H = d(
80
83
  "border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",
81
84
  {
82
85
  variants: {
@@ -91,17 +94,17 @@ const H = i(
91
94
  }
92
95
  }
93
96
  ), n = l.forwardRef(
94
- ({ className: a, size: t, ...e }, s) => /* @__PURE__ */ r(
97
+ ({ className: t, size: a, ...e }, s) => /* @__PURE__ */ r(
95
98
  "th",
96
99
  {
97
100
  ref: s,
98
- className: o(H({ size: t, className: a })),
101
+ className: o(H({ size: a, className: t })),
99
102
  ...e
100
103
  }
101
104
  )
102
105
  );
103
106
  n.displayName = "TableHead";
104
- const V = i("align-middle", {
107
+ const V = d("align-middle", {
105
108
  variants: {
106
109
  size: {
107
110
  sm: "p-1",
@@ -112,38 +115,38 @@ const V = i("align-middle", {
112
115
  defaultVariants: {
113
116
  size: "default"
114
117
  }
115
- }), B = l.forwardRef(
116
- ({ className: a, size: t, ...e }, s) => /* @__PURE__ */ r(
118
+ }), _ = l.forwardRef(
119
+ ({ className: t, size: a, ...e }, s) => /* @__PURE__ */ r(
117
120
  "td",
118
121
  {
119
122
  ref: s,
120
- className: o(V({ size: t, className: a })),
123
+ className: o(V({ size: a, className: t })),
121
124
  ...e
122
125
  }
123
126
  )
124
127
  );
125
- B.displayName = "TableCell";
126
- const S = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
128
+ _.displayName = "TableCell";
129
+ const B = l.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r(
127
130
  "caption",
128
131
  {
129
132
  ref: e,
130
- className: o("mt-4 text-sm text-muted-foreground", a),
131
- ...t
133
+ className: o("mt-4 text-sm text-muted-foreground", t),
134
+ ...a
132
135
  }
133
136
  ));
134
- S.displayName = "TableCaption";
135
- const _ = l.forwardRef(
137
+ B.displayName = "TableCaption";
138
+ const S = l.forwardRef(
136
139
  ({
137
- title: a,
138
- isSorted: t,
140
+ title: t,
141
+ isSorted: a,
139
142
  direction: e,
140
143
  setSort: s,
141
144
  placement: f = "right",
142
145
  children: m,
143
146
  className: b,
144
147
  ...c
145
- }, p) => /* @__PURE__ */ r(n, { ref: p, className: b, ...c, children: /* @__PURE__ */ r(T, { children: /* @__PURE__ */ d(h, { delayDuration: 200, children: [
146
- /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ d(
148
+ }, p) => /* @__PURE__ */ r(n, { ref: p, className: b, ...c, children: /* @__PURE__ */ r(h, { children: /* @__PURE__ */ i(x, { delayDuration: 200, children: [
149
+ /* @__PURE__ */ r(T, { asChild: !0, children: /* @__PURE__ */ i(
147
150
  "div",
148
151
  {
149
152
  className: o(
@@ -158,7 +161,7 @@ const _ = l.forwardRef(
158
161
  {
159
162
  variant: "text",
160
163
  size: "auto",
161
- className: t ? void 0 : "opacity-0 group-hover:opacity-100",
164
+ className: a ? void 0 : "opacity-0 group-hover:opacity-100",
162
165
  children: /* @__PURE__ */ r(
163
166
  u,
164
167
  {
@@ -174,19 +177,19 @@ const _ = l.forwardRef(
174
177
  ]
175
178
  }
176
179
  ) }),
177
- /* @__PURE__ */ d(N, { side: "top", children: [
180
+ /* @__PURE__ */ i(N, { side: "top", children: [
178
181
  "Sort by ",
179
- a
182
+ t
180
183
  ] })
181
184
  ] }) }) })
182
185
  );
183
- _.displayName = "SortingTableHead";
186
+ S.displayName = "SortingTableHead";
184
187
  export {
185
- _ as SortingTableHead,
188
+ S as SortingTableHead,
186
189
  y as Table,
187
190
  R as TableBody,
188
- S as TableCaption,
189
- B as TableCell,
191
+ B as TableCaption,
192
+ _ as TableCell,
190
193
  z as TableFooter,
191
194
  n as TableHead,
192
195
  v as TableHeader,
@@ -24,8 +24,8 @@ function I({ symbol: t, size: e = 48, className: r }) {
24
24
  width: e,
25
25
  height: e,
26
26
  className: m(
27
- "object-contain rounded-full",
28
- !f && "bg-gray-200 dark:bg-gray-700",
27
+ "object-contain",
28
+ !f && "bg-gray-200 dark:bg-gray-700 rounded-full",
29
29
  r
30
30
  ),
31
31
  style: { width: e, height: e },
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
- import { TokenIcon as f } from "../token-icon/token-icon.js";
2
+ import { TokenIcon as d } from "../token-icon/token-icon.js";
3
3
  import "react";
4
4
  import { cn as u } from "../../utils/cn.js";
5
5
  import "sonner";
@@ -14,25 +14,25 @@ function g(e) {
14
14
  }
15
15
  function I({
16
16
  token: e,
17
- title: o,
18
- className: m,
17
+ title: m,
18
+ className: o,
19
19
  comment: r,
20
20
  showIcon: l = !0,
21
21
  showSymbol: c = !1,
22
22
  size: a = 24,
23
23
  chainId: x,
24
24
  network: h,
25
- maxLength: b,
26
- ...d
25
+ maxLength: v,
26
+ ...f
27
27
  }) {
28
- const i = p(e), n = o || g(e);
29
- return /* @__PURE__ */ t("div", { className: u("flex items-center gap-3", m), ...d, children: [
28
+ const i = p(e), n = m || g(e);
29
+ return /* @__PURE__ */ t("div", { className: u("flex items-center gap-3", o), ...f, children: [
30
30
  l && i && /* @__PURE__ */ s(
31
- f,
31
+ d,
32
32
  {
33
33
  symbol: i,
34
34
  size: a,
35
- className: "rounded-full border-0 shrink-0 self-center"
35
+ className: "shrink-0 self-center"
36
36
  }
37
37
  ),
38
38
  c && n && /* @__PURE__ */ t("div", { className: "flex items-center gap-1 self-center", children: [