@gearbox-protocol/permissionless-ui 1.16.0 → 1.17.1

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