@gearbox-protocol/permissionless-ui 1.22.0-next.30 → 1.22.0-next.32

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,55 +1,107 @@
1
- import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import * as d from "react";
1
+ import { jsxs as v, Fragment as D, jsx as t } from "react/jsx-runtime";
2
+ import { cva as n } from "class-variance-authority";
3
+ import * as g from "react";
3
4
  import "@gearbox-protocol/sdk";
4
- import { cn as g } from "../../utils/cn.js";
5
+ import { cn as o } from "../../utils/cn.js";
5
6
  import "sonner";
6
- const v = {
7
- sm: "text-xs",
8
- md: "text-sm",
9
- lg: "text-base"
10
- }, m = {
11
- primary: "text-primary hover:text-primary/80",
12
- secondary: "text-secondary-foreground hover:text-secondary-foreground/80",
13
- muted: "text-muted-foreground hover:text-foreground",
14
- primaryDashed: "text-primary hover:text-primary/80 border-b border-dashed border-primary",
15
- secondaryDashed: "text-secondary-foreground hover:text-secondary-foreground/80 border-b border-dashed border-secondary-foreground",
16
- empty: "text-foreground hover:text-foreground/80"
17
- }, N = d.forwardRef(
7
+ const f = n("", {
8
+ variants: {
9
+ buttonColor: {
10
+ primaryDashed: "text-foreground",
11
+ secondaryDashed: "text-secondary-foreground group-hover:text-foreground",
12
+ empty: "text-foreground"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ buttonColor: "primaryDashed"
17
+ }
18
+ }), w = n("", {
19
+ variants: {
20
+ size: {
21
+ sm: "text-[13px] leading-[15px]",
22
+ default: "",
23
+ md: "",
24
+ lg: "text-base"
25
+ },
26
+ width: {
27
+ compact: "w-auto",
28
+ wide: "w-full"
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ size: "default",
33
+ width: "compact"
34
+ }
35
+ }), N = n("", {
36
+ variants: {
37
+ borderColor: {
38
+ primaryDashed: "border-b border-dashed border-secondary-foreground group-hover:border-foreground",
39
+ secondaryDashed: "border-b border-dashed border-secondary-foreground group-hover:border-foreground",
40
+ empty: ""
41
+ },
42
+ defaultVariants: {
43
+ primaryDashed: "primaryDashed"
44
+ }
45
+ }
46
+ }), V = g.forwardRef(
18
47
  ({
19
- children: o,
20
- $icon: i,
21
- icon: c,
22
- $size: l = "md",
23
- size: p,
24
- $color: x = "primary",
25
- color: u,
26
- as: t = "button",
27
- className: f,
28
- ...s
29
- }, n) => {
30
- const r = c || i, y = p || l, b = u || x, a = g(
31
- "inline-flex items-center gap-1 bg-transparent border-none cursor-pointer transition-colors",
32
- "hover:underline underline-offset-2",
33
- v[y],
34
- m[b] || m.primary,
35
- f
36
- );
37
- return t === "button" ? /* @__PURE__ */ h("button", { ref: n, className: a, ...s, children: [
38
- /* @__PURE__ */ e("span", { children: o }),
39
- r && /* @__PURE__ */ e("span", { className: "ml-1", children: r })
40
- ] }) : d.createElement(
41
- t,
48
+ children: y,
49
+ icon: s,
50
+ size: h = "default",
51
+ buttonColor: e = "primaryDashed",
52
+ width: x = "compact",
53
+ as: a = "button",
54
+ className: b,
55
+ disabled: r,
56
+ ...d
57
+ }, c) => {
58
+ const i = a === "a", l = o(
59
+ "group inline-block p-0 leading-[100%] font-normal bg-transparent border-none cursor-pointer transition-colors",
60
+ w({ size: h, width: x }),
61
+ !i && f({ buttonColor: e }),
62
+ r && "text-gray-110 cursor-default [&_svg]:text-gray-110",
63
+ b
64
+ ), p = i ? o(f({ buttonColor: e }), r && "text-gray-110") : null, u = /* @__PURE__ */ v(D, { children: [
65
+ /* @__PURE__ */ t(
66
+ "span",
67
+ {
68
+ className: o(
69
+ "inline-block",
70
+ N({ borderColor: e }),
71
+ r && e !== "empty" && "border-gray-110"
72
+ ),
73
+ children: y
74
+ }
75
+ ),
76
+ s && /* @__PURE__ */ t(
77
+ "span",
78
+ {
79
+ className: o(
80
+ "ml-1.5 [&_svg]:fill-current",
81
+ r ? "text-gray-110" : "text-gray-90 group-hover:text-foreground"
82
+ ),
83
+ children: s
84
+ }
85
+ )
86
+ ] }), m = p ? /* @__PURE__ */ t("span", { className: p, children: u }) : u;
87
+ return a === "button" ? /* @__PURE__ */ t(
88
+ "button",
42
89
  {
43
- ref: n,
44
- className: a,
45
- ...s
46
- },
47
- /* @__PURE__ */ e("span", { children: o }),
48
- r && /* @__PURE__ */ e("span", { className: "ml-1", children: r })
90
+ ref: c,
91
+ type: "button",
92
+ className: l,
93
+ disabled: r,
94
+ ...d,
95
+ children: m
96
+ }
97
+ ) : g.createElement(
98
+ a,
99
+ { ref: c, className: l, ...d },
100
+ m
49
101
  );
50
102
  }
51
103
  );
52
- N.displayName = "TextButton";
104
+ V.displayName = "TextButton";
53
105
  export {
54
- N as TextButton
106
+ V as TextButton
55
107
  };