@gearbox-protocol/permissionless-ui 1.22.0-next.34 → 1.22.0-next.36

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 (57) 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/complex-input/index.cjs +1 -1
  6. package/dist/cjs/components/formatted-number/formatted-number.cjs +1 -1
  7. package/dist/cjs/components/index.cjs +1 -1
  8. package/dist/cjs/components/input/input.cjs +1 -1
  9. package/dist/cjs/components/input/use-icon-slot-widths.cjs +1 -0
  10. package/dist/cjs/components/short-string/short-string.cjs +1 -1
  11. package/dist/cjs/components/status-elements/index.cjs +1 -0
  12. package/dist/cjs/components/status-elements/status-elements.cjs +1 -0
  13. package/dist/cjs/components/tip-card/tip-card.cjs +1 -1
  14. package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
  15. package/dist/cjs/components/token-template/token-template.cjs +1 -1
  16. package/dist/cjs/components/tooltip/simple-tooltip.cjs +1 -1
  17. package/dist/cjs/components/with-title/with-title.cjs +1 -1
  18. package/dist/cjs/index.cjs +1 -1
  19. package/dist/cjs/locale/en.json.cjs +1 -0
  20. package/dist/cjs/locale/index.cjs +1 -0
  21. package/dist/esm/components/block-sync/block-sync.js +34 -36
  22. package/dist/esm/components/checkbox/checkbox-labeled.js +2 -1
  23. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -1
  24. package/dist/esm/components/complex-input/complex-input.js +211 -55
  25. package/dist/esm/components/complex-input/index.js +3 -2
  26. package/dist/esm/components/formatted-number/formatted-number.js +41 -8
  27. package/dist/esm/components/index.js +456 -452
  28. package/dist/esm/components/input/input.js +28 -22
  29. package/dist/esm/components/input/use-icon-slot-widths.js +41 -0
  30. package/dist/esm/components/short-string/short-string.js +10 -14
  31. package/dist/esm/components/status-elements/index.js +5 -0
  32. package/dist/esm/components/status-elements/status-elements.js +48 -0
  33. package/dist/esm/components/tip-card/tip-card.js +5 -5
  34. package/dist/esm/components/token-symbol/token-symbol.js +34 -38
  35. package/dist/esm/components/token-template/token-template.js +24 -16
  36. package/dist/esm/components/tooltip/simple-tooltip.js +12 -11
  37. package/dist/esm/components/with-title/with-title.js +27 -14
  38. package/dist/esm/index.js +594 -588
  39. package/dist/esm/locale/en.json.js +54 -0
  40. package/dist/esm/locale/index.js +4 -0
  41. package/dist/globals.css +1 -1
  42. package/dist/types/components/complex-input/complex-input.d.ts +10 -14
  43. package/dist/types/components/compound-apy/compound-apy.d.ts +1 -1
  44. package/dist/types/components/formatted-number/formatted-number.d.ts +14 -4
  45. package/dist/types/components/index.d.ts +1 -0
  46. package/dist/types/components/input/use-icon-slot-widths.d.ts +12 -0
  47. package/dist/types/components/status-elements/index.d.ts +1 -0
  48. package/dist/types/components/status-elements/status-elements.d.ts +16 -0
  49. package/dist/types/components/text-button/text-button.d.ts +1 -1
  50. package/dist/types/components/token-template/token-template.d.ts +7 -28
  51. package/dist/types/components/typed-intl/index.d.ts +1 -1
  52. package/dist/types/components/with-title/with-title.d.ts +6 -6
  53. package/dist/types/index.d.ts +5 -0
  54. package/dist/types/locale/en.json.d.ts +68 -0
  55. package/dist/types/locale/index.d.ts +10 -0
  56. package/package.json +3 -3
  57. package/src/styles/base.css +1 -1
@@ -1,10 +1,11 @@
1
1
  import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
- import { cva as y } from "class-variance-authority";
3
- import * as v from "react";
2
+ import { cva as D } from "class-variance-authority";
3
+ import * as T from "react";
4
4
  import "@gearbox-protocol/sdk";
5
5
  import { cn as e } from "../../utils/cn.js";
6
6
  import "sonner";
7
- const _ = y(
7
+ import { useIconSlotWidths as j } from "./use-icon-slot-widths.js";
8
+ const R = D(
8
9
  e(
9
10
  // Layout + typography (matches styled-components: 14/17)
10
11
  "flex w-full border shadow-sm transition-colors",
@@ -67,35 +68,40 @@ const _ = y(
67
68
  variant: "default"
68
69
  }
69
70
  }
70
- ), K = v.forwardRef(
71
+ ), P = T.forwardRef(
71
72
  ({
72
73
  hasError: t,
73
- errorMessage: s,
74
+ errorMessage: a,
74
75
  value: h,
75
76
  size: b,
76
77
  colorTheme: p,
77
78
  variant: g,
78
79
  className: x,
80
+ style: m,
79
81
  startingIcon: o,
80
82
  onStartingIconClick: i,
81
83
  endingIcon: l,
82
84
  onEndingIconClick: n,
83
85
  ...d
84
- }, m) => {
85
- const u = p ?? "filledDark", c = u === "filledLight" ? "text-gray-50" : "text-gray-110";
86
+ }, y) => {
87
+ const u = p ?? "filledDark", c = u === "filledLight" ? "text-gray-50" : "text-gray-110", { setStartRef: w, setEndRef: v, inputPaddingStyle: _ } = j(), k = (s) => (C) => {
88
+ C.key === "Enter" && s?.();
89
+ }, N = {
90
+ ...m,
91
+ ..._(!!o, !!l)
92
+ };
86
93
  return /* @__PURE__ */ f("div", { className: "flex flex-col space-y-2", children: [
87
94
  /* @__PURE__ */ f("div", { className: "relative", children: [
88
95
  o && /* @__PURE__ */ r(
89
96
  "button",
90
97
  {
98
+ ref: w,
91
99
  type: "button",
92
100
  onClick: i,
93
- onKeyDown: ((a) => (w) => {
94
- w.key === "Enter" && a?.();
95
- })(i),
101
+ onKeyDown: k(i),
96
102
  className: e(
97
- "absolute left-0 top-1/2 transform -translate-y-1/2",
98
- "w-9 h-9 flex items-center justify-center",
103
+ "absolute left-0 top-1/2 -translate-y-1/2",
104
+ "flex h-9 min-w-9 px-3 items-center justify-center",
99
105
  c,
100
106
  i ? "cursor-pointer" : "cursor-default"
101
107
  ),
@@ -105,31 +111,31 @@ const _ = y(
105
111
  /* @__PURE__ */ r(
106
112
  "input",
107
113
  {
108
- ref: m,
114
+ ref: y,
109
115
  ...d,
110
116
  value: h,
111
117
  "data-error": t ? "true" : "false",
118
+ style: N,
112
119
  className: e(
113
- _({
120
+ R({
114
121
  size: b,
115
122
  colorTheme: u,
116
123
  variant: t ? "error" : g
117
124
  }),
118
- o && "pl-9",
119
- l && "pr-9",
120
125
  x
121
126
  ),
122
- onWheel: d.type === "number" ? (a) => a.currentTarget.blur() : void 0
127
+ onWheel: d.type === "number" ? (s) => s.currentTarget.blur() : void 0
123
128
  }
124
129
  ),
125
130
  l && /* @__PURE__ */ r(
126
131
  "button",
127
132
  {
133
+ ref: v,
128
134
  type: "button",
129
135
  onClick: n,
130
136
  className: e(
131
- "absolute right-0 top-1/2 transform -translate-y-1/2 w-9 h-9",
132
- "flex items-center justify-center",
137
+ "absolute right-0 top-1/2 -translate-y-1/2",
138
+ "flex h-9 min-w-9 px-3 items-center justify-center",
133
139
  c,
134
140
  n ? "cursor-pointer" : "cursor-default"
135
141
  ),
@@ -137,11 +143,11 @@ const _ = y(
137
143
  }
138
144
  )
139
145
  ] }),
140
- t && s && /* @__PURE__ */ r("p", { className: "text-destructive text-sm", children: s })
146
+ t && a && /* @__PURE__ */ r("p", { className: "text-destructive text-sm", children: a })
141
147
  ] });
142
148
  }
143
149
  );
144
150
  export {
145
- K as Input,
146
- _ as inputVariants
151
+ P as Input,
152
+ R as inputVariants
147
153
  };
@@ -0,0 +1,41 @@
1
+ import * as e from "react";
2
+ const c = 36;
3
+ function i(n, s) {
4
+ const u = () => s(n.getBoundingClientRect().width);
5
+ u();
6
+ const r = new ResizeObserver(u);
7
+ return r.observe(n), () => r.disconnect();
8
+ }
9
+ function S() {
10
+ const [n, s] = e.useState(
11
+ null
12
+ ), [u, r] = e.useState(null), l = e.useRef(null), o = e.useRef(null), d = e.useCallback((t) => {
13
+ if (l.current?.(), l.current = null, !t) {
14
+ s(null);
15
+ return;
16
+ }
17
+ l.current = i(t, s);
18
+ }, []), a = e.useCallback((t) => {
19
+ if (o.current?.(), o.current = null, !t) {
20
+ r(null);
21
+ return;
22
+ }
23
+ o.current = i(t, r);
24
+ }, []), f = e.useCallback(
25
+ (t, R) => ({
26
+ paddingLeft: t ? n ?? c : void 0,
27
+ paddingRight: R ? u ?? c : void 0
28
+ }),
29
+ [n, u]
30
+ );
31
+ return {
32
+ startSlotWidth: n,
33
+ endSlotWidth: u,
34
+ setStartRef: d,
35
+ setEndRef: a,
36
+ inputPaddingStyle: f
37
+ };
38
+ }
39
+ export {
40
+ S as useIconSlotWidths
41
+ };
@@ -1,24 +1,20 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import "../tooltip/simple-tooltip.js";
3
- import { TooltipProvider as m, Tooltip as c, TooltipTrigger as f, TooltipContent as d } from "../tooltip/tooltip.js";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { SimpleTooltip as m } from "../tooltip/simple-tooltip.js";
3
+ import "../tooltip/tooltip.js";
4
4
  import "react";
5
5
  import "@gearbox-protocol/sdk";
6
- import { cn as u } from "../../utils/cn.js";
6
+ import { cn as s } from "../../utils/cn.js";
7
7
  import "sonner";
8
- import { isLongString as T, shortenString as a } from "../../utils/shorten-string.js";
9
- import { Z_INDEX as S } from "../../utils/z-index.js";
10
- function O({
8
+ import { isLongString as u, shortenString as S } from "../../utils/shorten-string.js";
9
+ function g({
11
10
  children: o,
12
11
  maxLength: t,
13
- showTooltip: l = !0,
12
+ showTooltip: f = !0,
14
13
  className: i
15
14
  }) {
16
- const e = (n, p) => p === "text-overflow" ? /* @__PURE__ */ r("span", { className: u("inline-block max-w-full truncate", i), children: n }) : /* @__PURE__ */ r("span", { className: i, children: a(n, p) });
17
- return typeof o == "string" && t !== void 0 ? l && (t === "text-overflow" || T(o, t)) ? /* @__PURE__ */ r(m, { delayDuration: 200, children: /* @__PURE__ */ s(c, { children: [
18
- /* @__PURE__ */ r(f, { asChild: !0, children: e(o, t) }),
19
- /* @__PURE__ */ r(d, { className: S.TOOLTIP, children: /* @__PURE__ */ r("p", { children: o }) })
20
- ] }) }) : e(o, t) : o;
15
+ const n = (e, p) => p === "text-overflow" ? /* @__PURE__ */ r("span", { className: s("inline-block max-w-full truncate", i), children: e }) : /* @__PURE__ */ r("span", { className: i, children: S(e, p) });
16
+ return typeof o == "string" && t !== void 0 ? f && (t === "text-overflow" || u(o, t)) ? /* @__PURE__ */ r(m, { title: n(o, t), children: o }) : n(o, t) : o;
21
17
  }
22
18
  export {
23
- O as ShortString
19
+ g as ShortString
24
20
  };
@@ -0,0 +1,5 @@
1
+ import { HealthDot as o, StatusBars as r } from "./status-elements.js";
2
+ export {
3
+ o as HealthDot,
4
+ r as StatusBars
5
+ };
@@ -0,0 +1,48 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import "@gearbox-protocol/sdk";
4
+ import { cn as o } from "../../utils/cn.js";
5
+ import "sonner";
6
+ const s = {
7
+ good: "bg-success",
8
+ medium: "bg-warning",
9
+ bad: "bg-destructive",
10
+ critical: "bg-destructive",
11
+ liquidation: "bg-liquidation"
12
+ }, l = {
13
+ good: 3,
14
+ medium: 2,
15
+ bad: 1,
16
+ critical: 1,
17
+ liquidation: 1
18
+ }, u = 3;
19
+ function b({ zone: t, size: i = 8 }) {
20
+ return /* @__PURE__ */ a(
21
+ "div",
22
+ {
23
+ className: o("rounded-full shrink-0", s[t]),
24
+ style: { width: i, height: i },
25
+ "aria-hidden": !0
26
+ }
27
+ );
28
+ }
29
+ function v({ zone: t }) {
30
+ const i = l[t], n = s[t], c = ["first", "second", "third"], d = Array.from({ length: u }, (e, r) => ({
31
+ key: c[r],
32
+ isActive: r < i
33
+ })).reverse();
34
+ return /* @__PURE__ */ a("div", { className: "flex w-2 flex-wrap gap-0.5", "aria-hidden": !0, children: d.map(({ key: e, isActive: r }) => /* @__PURE__ */ a(
35
+ "div",
36
+ {
37
+ className: o(
38
+ "h-[3px] w-full min-w-[3px] flex-1 rounded-[1.5px]",
39
+ r ? n : "bg-gray-50"
40
+ )
41
+ },
42
+ e
43
+ )) });
44
+ }
45
+ export {
46
+ b as HealthDot,
47
+ v as StatusBars
48
+ };
@@ -4,7 +4,7 @@ import * as f from "react";
4
4
  import "@gearbox-protocol/sdk";
5
5
  import { cn as e } from "../../utils/cn.js";
6
6
  import "sonner";
7
- const y = t("rounded-lg p-5", {
7
+ const p = t("rounded-lg p-5 text-[14px]", {
8
8
  variants: {
9
9
  backgroundColor: {
10
10
  transparent: "bg-transparent",
@@ -48,7 +48,7 @@ const y = t("rounded-lg p-5", {
48
48
  backgroundColor: "transparent",
49
49
  borderColor: "dark"
50
50
  }
51
- }), p = t(
51
+ }), y = t(
52
52
  // Translated from styled-components:
53
53
  // - absolute, top/left 0, w/h 100%, overflow hidden, pointer-events none
54
54
  // - border-radius: theme borderRadius.sm
@@ -80,7 +80,7 @@ const y = t("rounded-lg p-5", {
80
80
  ref: d,
81
81
  className: e(
82
82
  r ? "relative" : "",
83
- y({
83
+ p({
84
84
  textColor: g,
85
85
  backgroundColor: a,
86
86
  borderColor: n
@@ -95,7 +95,7 @@ const y = t("rounded-lg p-5", {
95
95
  className: e(
96
96
  "absolute inset-0 h-full w-full overflow-hidden pointer-events-none rounded-lg z-0",
97
97
  "after:absolute after:top-0 after:left-0 after:block after:w-1 after:h-full after:content-['']",
98
- p({ attributeColor: r })
98
+ y({ attributeColor: r })
99
99
  )
100
100
  }
101
101
  ),
@@ -107,5 +107,5 @@ const y = t("rounded-lg p-5", {
107
107
  c.displayName = "TipCard";
108
108
  export {
109
109
  c as TipCard,
110
- y as tipCardVariants
110
+ p as tipCardVariants
111
111
  };
@@ -1,17 +1,16 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { cva as T } from "class-variance-authority";
3
- import N from "react";
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { cva as N } from "class-variance-authority";
3
+ import x from "react";
4
4
  import { RoundedImage as y } from "../rounded-image/rounded-image.js";
5
- import { ShortString as x } from "../short-string/short-string.js";
6
- import { TokenIcon as s } from "../token-icon/token-icon.js";
7
- import "../tooltip/simple-tooltip.js";
8
- import { TooltipProvider as I, Tooltip as S, TooltipTrigger as b, TooltipContent as _ } from "../tooltip/tooltip.js";
5
+ import { ShortString as S } from "../short-string/short-string.js";
6
+ import { TokenIcon as c } from "../token-icon/token-icon.js";
7
+ import { SimpleTooltip as b } from "../tooltip/simple-tooltip.js";
8
+ import "../tooltip/tooltip.js";
9
9
  import "@gearbox-protocol/sdk";
10
- import { cn as O } from "../../utils/cn.js";
10
+ import { cn as I } from "../../utils/cn.js";
11
11
  import "sonner";
12
- import { getNetworkIcon as R } from "../../utils/network-icons.js";
13
- import { Z_INDEX as j } from "../../utils/z-index.js";
14
- const z = T("", {
12
+ import { getNetworkIcon as T } from "../../utils/network-icons.js";
13
+ const R = N("", {
15
14
  variants: {
16
15
  marginSize: {
17
16
  sm: "gap-1",
@@ -23,32 +22,32 @@ const z = T("", {
23
22
  marginSize: "md"
24
23
  }
25
24
  });
26
- function C(r) {
25
+ function _(r) {
27
26
  if (r)
28
27
  return typeof r == "string" ? r : r.icon ? { icon: r.icon } : r.symbol;
29
28
  }
30
- function D(r) {
29
+ function j(r) {
31
30
  if (r)
32
31
  return typeof r == "string" ? r : r.title;
33
32
  }
34
- const P = N.forwardRef(
33
+ const z = x.forwardRef(
35
34
  ({
36
35
  className: r,
37
36
  marginSize: d = "lg",
38
37
  token: n,
39
- title: l,
38
+ title: m,
40
39
  size: a = 24,
41
40
  showSymbol: f = !1,
42
41
  showIcon: p = !0,
43
42
  maxLength: g,
44
43
  chainId: V,
45
- comment: m,
46
- network: t,
44
+ comment: l,
45
+ network: i,
47
46
  ...u
48
47
  }, h) => {
49
- const o = C(n), v = l || D(n), c = () => t ? /* @__PURE__ */ i("div", { className: "relative", children: [
48
+ const o = _(n), v = m || j(n), s = () => i ? /* @__PURE__ */ t("div", { className: "relative", children: [
50
49
  /* @__PURE__ */ e(
51
- s,
50
+ c,
52
51
  {
53
52
  symbol: o,
54
53
  size: a,
@@ -58,43 +57,40 @@ const P = N.forwardRef(
58
57
  /* @__PURE__ */ e("div", { className: "absolute -top-[10px] -right-[7px]", children: /* @__PURE__ */ e(
59
58
  y,
60
59
  {
61
- src: R(t),
62
- alt: t,
60
+ src: T(i),
61
+ alt: i,
63
62
  size: 14,
64
63
  rounded: !0
65
64
  }
66
65
  ) })
67
66
  ] }) : /* @__PURE__ */ e(
68
- s,
67
+ c,
69
68
  {
70
69
  symbol: o,
71
70
  size: a,
72
71
  className: "shrink-0 self-center"
73
72
  }
74
73
  );
75
- return /* @__PURE__ */ i(
74
+ return /* @__PURE__ */ t(
76
75
  "div",
77
76
  {
78
77
  ref: h,
79
- className: O(
78
+ className: I(
80
79
  "flex items-center",
81
- z({ marginSize: d }),
80
+ R({ marginSize: d }),
82
81
  r
83
82
  ),
84
83
  ...u,
85
84
  children: [
86
- p && o && (t !== void 0 ? /* @__PURE__ */ e(I, { delayDuration: 200, children: /* @__PURE__ */ i(S, { children: [
87
- /* @__PURE__ */ e(b, { asChild: !0, children: c() }),
88
- /* @__PURE__ */ e(_, { className: j.TOOLTIP, children: /* @__PURE__ */ i("p", { children: [
89
- "Network: ",
90
- t
91
- ] }) })
92
- ] }) }) : c()),
93
- (l || f) && /* @__PURE__ */ i("div", { className: "flex items-center gap-1 self-center", children: [
94
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(x, { maxLength: g, children: v }) }),
95
- m && /* @__PURE__ */ i("div", { className: "text-md text-muted-foreground leading-tight", children: [
85
+ p && o && (i !== void 0 ? /* @__PURE__ */ t(b, { title: s(), children: [
86
+ "Network: ",
87
+ i
88
+ ] }) : s()),
89
+ (m || f) && /* @__PURE__ */ t("div", { className: "flex items-center gap-1 self-center", children: [
90
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(S, { maxLength: g, children: v }) }),
91
+ l && /* @__PURE__ */ t("div", { className: "text-md text-muted-foreground leading-tight", children: [
96
92
  "(",
97
- m,
93
+ l,
98
94
  ")"
99
95
  ] })
100
96
  ] })
@@ -103,7 +99,7 @@ const P = N.forwardRef(
103
99
  );
104
100
  }
105
101
  );
106
- P.displayName = "TokenSymbol";
102
+ z.displayName = "TokenSymbol";
107
103
  export {
108
- P as TokenSymbol
104
+ z as TokenSymbol
109
105
  };
@@ -1,24 +1,32 @@
1
- import { jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
2
  import "react";
3
- import "@gearbox-protocol/sdk";
4
- import { cn as f } from "../../utils/cn.js";
3
+ import { bnToPrettyView as T } from "../../utils/bn-to-pretty-view.js";
4
+ import "clsx";
5
+ import "tailwind-merge";
5
6
  import "sonner";
6
- import { negativeTokenTemplate as T, tokenTemplate as l } from "../../utils/templates.js";
7
- import { tokenTemplateString as N } from "../../utils/templates.js";
8
- function h({
9
- value: t,
7
+ import "@gearbox-protocol/sdk";
8
+ import { negativeTokenTemplate as I, tokenTemplateString as N } from "../../utils/templates.js";
9
+ import { FormattedNumberString as d } from "../formatted-number/formatted-number.js";
10
+ import { ShortString as g } from "../short-string/short-string.js";
11
+ function A({
12
+ value: r,
10
13
  token: e,
11
- precision: o,
12
- spaceSymbol: r = " ",
13
- maxLength: m,
14
- allowNegative: n = !1,
15
- className: p
14
+ precision: m,
15
+ formatter: n = T,
16
+ noFormattedAmountValue: i = "-",
17
+ showSymbol: p = !0,
18
+ maxLength: a = 1 / 0,
19
+ ...f
16
20
  }) {
17
- const i = n ? T(t, e, o, r) : l(t, e, o, r, m);
18
- return /* @__PURE__ */ a("span", { className: f(p), children: i });
21
+ const { decimals: l = 18, title: s } = e || {}, t = n(r, l, m), c = t === i;
22
+ return /* @__PURE__ */ u("span", { children: [
23
+ /* @__PURE__ */ o(d, { value: t, ...f }),
24
+ " ",
25
+ !c && p && /* @__PURE__ */ o(g, { maxLength: a, children: s })
26
+ ] });
19
27
  }
20
28
  export {
21
- h as TokenTemplate,
22
- T as negativeTokenTemplate,
29
+ A as TokenTemplate,
30
+ I as negativeTokenTemplate,
23
31
  N as tokenTemplateString
24
32
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as x } from "react/jsx-runtime";
2
- import * as s from "@radix-ui/react-tooltip";
2
+ import * as r from "@radix-ui/react-tooltip";
3
3
  import * as o from "react";
4
4
  import "@gearbox-protocol/sdk";
5
5
  import { cn as p } from "../../utils/cn.js";
@@ -20,7 +20,7 @@ function S({
20
20
  className: A,
21
21
  triggerClassName: h
22
22
  }) {
23
- const [L, N] = o.useState(!1), c = o.useRef(null), r = o.useRef(null), l = m !== void 0, a = l ? m : L, t = o.useCallback(
23
+ const [L, N] = o.useState(!1), c = o.useRef(null), s = o.useRef(null), l = m !== void 0, a = l ? m : L, t = o.useCallback(
24
24
  (e) => {
25
25
  l ? k?.(e) : N(e);
26
26
  },
@@ -45,7 +45,7 @@ function S({
45
45
  if (n !== "click" || !a) return;
46
46
  const e = (d) => {
47
47
  const v = d.target;
48
- c.current && !c.current.contains(v) && r.current && !r.current.contains(v) && t(!1);
48
+ c.current && !c.current.contains(v) && s.current && !s.current.contains(v) && t(!1);
49
49
  }, w = (d) => {
50
50
  d.key === "Escape" && t(!1);
51
51
  };
@@ -55,6 +55,7 @@ function S({
55
55
  }, [n, a, t]);
56
56
  const y = P === "modal-tooltip", b = T && !y, W = p(
57
57
  // Base
58
+ "break-all",
58
59
  "z-50 pointer-events-auto",
59
60
  "animate-in fade-in-0 duration-100",
60
61
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-75",
@@ -63,21 +64,21 @@ function S({
63
64
  A
64
65
  );
65
66
  return /* @__PURE__ */ i(
66
- s.Provider,
67
+ r.Provider,
67
68
  {
68
69
  delayDuration: n === "click" ? 0 : f,
69
70
  skipDelayDuration: 0,
70
71
  children: /* @__PURE__ */ x(
71
- s.Root,
72
+ r.Root,
72
73
  {
73
74
  open: a,
74
75
  onOpenChange: H,
75
76
  delayDuration: n === "click" ? 0 : f,
76
77
  children: [
77
- /* @__PURE__ */ i(s.Trigger, { asChild: !0, children: n === "click" ? /* @__PURE__ */ i(
78
+ /* @__PURE__ */ i(r.Trigger, { asChild: !0, children: n === "click" ? /* @__PURE__ */ i(
78
79
  "button",
79
80
  {
80
- ref: r,
81
+ ref: s,
81
82
  type: "button",
82
83
  onClick: I,
83
84
  onKeyDown: K,
@@ -90,13 +91,13 @@ function S({
90
91
  ) : /* @__PURE__ */ i(
91
92
  "span",
92
93
  {
93
- ref: r,
94
+ ref: s,
94
95
  className: p("inline-flex", h),
95
96
  children: u
96
97
  }
97
98
  ) }),
98
- /* @__PURE__ */ i(s.Portal, { children: /* @__PURE__ */ x(
99
- s.Content,
99
+ /* @__PURE__ */ i(r.Portal, { children: /* @__PURE__ */ x(
100
+ r.Content,
100
101
  {
101
102
  ref: c,
102
103
  side: R,
@@ -106,7 +107,7 @@ function S({
106
107
  children: [
107
108
  D,
108
109
  b && /* @__PURE__ */ i(
109
- s.Arrow,
110
+ r.Arrow,
110
111
  {
111
112
  width: j,
112
113
  height: C,
@@ -1,30 +1,43 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
+ import { cva as a } from "class-variance-authority";
2
3
  import "react";
3
4
  import "@gearbox-protocol/sdk";
4
- import { cn as s } from "../../utils/cn.js";
5
+ import { cn as i } from "../../utils/cn.js";
5
6
  import "sonner";
6
- const l = {
7
- default: "text-sm",
8
- sm: "text-xs",
9
- lg: "text-base"
10
- };
11
- function c({
12
- title: i,
7
+ const l = a("", {
8
+ variants: {
9
+ size: {
10
+ sm: "text-[14px] mb-[14px]",
11
+ default: "text-body mb-[18px]",
12
+ md: "text-lg mb-[22px]",
13
+ lg: "text-[21px] mb-[22px]"
14
+ }
15
+ },
16
+ defaultVariants: {
17
+ size: "default"
18
+ }
19
+ });
20
+ function u({
21
+ title: m,
13
22
  children: t,
14
23
  size: o = "default",
15
- className: m
24
+ className: r
16
25
  }) {
17
- return /* @__PURE__ */ r("div", { className: s("flex flex-col gap-2", m), children: [
26
+ return /* @__PURE__ */ x("div", { className: i("flex flex-col"), children: [
18
27
  /* @__PURE__ */ e(
19
28
  "div",
20
29
  {
21
- className: s("text-muted-foreground font-medium", l[o]),
22
- children: i
30
+ className: i(
31
+ "text-foreground font-medium",
32
+ l({ size: o }),
33
+ r
34
+ ),
35
+ children: m
23
36
  }
24
37
  ),
25
38
  t !== void 0 && /* @__PURE__ */ e("div", { children: t })
26
39
  ] });
27
40
  }
28
41
  export {
29
- c as WithTitle
42
+ u as WithTitle
30
43
  };