@gearbox-protocol/ui-kit 4.0.0-next.42 → 4.0.0-next.44

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 (59) hide show
  1. package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
  2. package/dist/cjs/components/base/index.cjs +1 -1
  3. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  4. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  5. package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
  6. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  7. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  8. package/dist/cjs/components/base/values/constants.cjs +1 -1
  9. package/dist/cjs/components/base/values/index.cjs +1 -1
  10. package/dist/cjs/components/base/values/no-value.cjs +1 -0
  11. package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
  12. package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
  13. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  14. package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
  15. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  16. package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
  17. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  18. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  19. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  20. package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
  21. package/dist/cjs/components/index.cjs +1 -1
  22. package/dist/cjs/components/link/link.cjs +1 -1
  23. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  24. package/dist/cjs/index.cjs +1 -1
  25. package/dist/cjs/locale/en.json.cjs +1 -1
  26. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
  27. package/dist/esm/components/base/index.js +63 -61
  28. package/dist/esm/components/base/info-list/info-list.js +8 -7
  29. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
  30. package/dist/esm/components/base/position-assets/position-assets.js +4 -3
  31. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
  32. package/dist/esm/components/base/token-amount/token-amount.js +32 -16
  33. package/dist/esm/components/base/values/constants.js +1 -0
  34. package/dist/esm/components/base/values/index.js +21 -19
  35. package/dist/esm/components/base/values/no-value.js +34 -0
  36. package/dist/esm/components/base/values/pnl-value.js +10 -9
  37. package/dist/esm/components/base/values/price-impact-value.js +6 -5
  38. package/dist/esm/components/base/values/scalars.js +23 -26
  39. package/dist/esm/components/base-table/base-table-line.js +44 -36
  40. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
  41. package/dist/esm/components/client-adapters/styled-button/styled-button.js +5 -11
  42. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
  43. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
  44. package/dist/esm/components/compound-apy/compound-apy.js +48 -40
  45. package/dist/esm/components/help-tip/help-tip.js +64 -59
  46. package/dist/esm/components/index.js +624 -622
  47. package/dist/esm/components/link/link.js +48 -34
  48. package/dist/esm/components/with-copy/with-copy.js +1 -1
  49. package/dist/esm/index.js +805 -803
  50. package/dist/esm/locale/en.json.js +1 -0
  51. package/dist/globals.css +1 -1
  52. package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
  53. package/dist/types/components/base/values/constants.d.ts +1 -0
  54. package/dist/types/components/base/values/index.d.ts +1 -0
  55. package/dist/types/components/base/values/no-value.d.ts +25 -0
  56. package/dist/types/components/base/values/scalars.d.ts +7 -2
  57. package/dist/types/components/client-adapters/styled-button/styled-button.d.ts +10 -5
  58. package/dist/types/locale/en.json.d.ts +1 -0
  59. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { jsxs as o, jsx as r, Fragment as g } from "react/jsx-runtime";
2
- import { IconExternal as x } from "@gearbox-protocol/static";
3
- import { cva as b } from "class-variance-authority";
1
+ import { jsxs as s, Fragment as b, jsx as n } from "react/jsx-runtime";
2
+ import { IconExternal as g } from "@gearbox-protocol/static";
3
+ import { cva as x } from "class-variance-authority";
4
4
  import { BaseLink as N } from "../base-link/base-link.js";
5
5
  import "react";
6
6
  import "@gearbox-protocol/sdk/onchain";
@@ -8,13 +8,17 @@ import { cn as h } from "../../utils/cn.js";
8
8
  import "sonner";
9
9
  import "luxon";
10
10
  import "../../utils/z-index.js";
11
- const v = b(
11
+ const v = x(
12
12
  "[&_.icon-wrap]:-mt-px [&_.icon-wrap]:pl-1.5 [&_.icon-wrap]:leading-none [&_.icon-wrap]:text-secondary-foreground hover:[&_.icon-wrap]:text-foreground",
13
13
  {
14
14
  variants: {
15
15
  variant: {
16
16
  default: "[&_.content-wrap]:border-b [&_.content-wrap]:border-transparent hover:[&_.content-wrap]:border-foreground",
17
- underlined: "[&_.content-wrap]:border-0",
17
+ // Underlined in rest as well as on hover — but drawn the same way, on
18
+ // `.content-wrap`, so the rule stops at the words. The real
19
+ // `text-decoration` this used to lean on paints under the external
20
+ // icon too, and no markup can scope it away.
21
+ underlined: "[&_.content-wrap]:border-b [&_.content-wrap]:border-gray-110 hover:[&_.content-wrap]:border-foreground",
18
22
  unset: "[&_.content-wrap]:border-0"
19
23
  }
20
24
  },
@@ -22,42 +26,52 @@ const v = b(
22
26
  }
23
27
  );
24
28
  function k({
25
- className: i,
26
- children: n,
27
- href: c,
28
- target: l,
29
- variant: e = "default",
30
- size: m = "default",
31
- color: d = "main",
29
+ className: c,
30
+ children: r,
31
+ href: l,
32
+ target: m,
33
+ variant: a = "default",
34
+ size: d = "default",
35
+ color: f = "main",
32
36
  external: t = !1,
33
- asChild: f = !1,
34
- ...w
37
+ asChild: w = !1,
38
+ ...u
35
39
  }) {
36
- const s = t ? /* @__PURE__ */ r("span", { className: "icon-wrap -mt-px pl-1.5 leading-none", children: /* @__PURE__ */ r(x, { size: 14 }) }) : null, p = t && typeof n == "string" ? (() => {
37
- const a = n.trimEnd().lastIndexOf(" "), u = a === -1 ? "" : n.slice(0, a + 1), _ = a === -1 ? n : n.slice(a + 1);
38
- return /* @__PURE__ */ o("span", { className: "content-wrap", children: [
39
- u,
40
- /* @__PURE__ */ o("span", { className: "whitespace-nowrap", children: [
41
- _,
42
- s
40
+ const o = t ? /* @__PURE__ */ n("span", { className: "icon-wrap -mt-px pl-1.5 leading-none", children: /* @__PURE__ */ n(g, { size: 14 }) }) : null, i = t && typeof r == "string" ? (() => {
41
+ const e = r.trimEnd().lastIndexOf(" "), p = e === -1 ? "" : r.slice(0, e + 1), _ = e === -1 ? r : r.slice(e + 1);
42
+ return /* @__PURE__ */ s(b, { children: [
43
+ p ? /* @__PURE__ */ n("span", { className: "content-wrap", children: p }) : null,
44
+ /* @__PURE__ */ s("span", { className: "inline-flex items-center whitespace-nowrap", children: [
45
+ /* @__PURE__ */ n("span", { className: "content-wrap", children: _ }),
46
+ o
43
47
  ] })
44
48
  ] });
45
- })() : /* @__PURE__ */ o(g, { children: [
46
- /* @__PURE__ */ r("span", { className: "content-wrap", children: n }),
47
- s
48
- ] });
49
- return /* @__PURE__ */ r(
49
+ })() : o ? (
50
+ // Wrapped so the icon is not a direct child of the anchor: a caller that
51
+ // lays its anchor out as a flex row — `TitleMeta` does — would add its
52
+ // `gap` on top of the icon's own padding.
53
+ //
54
+ // No `whitespace-nowrap` here: a node child is often prose and must stay
55
+ // free to wrap. And only when there is an icon — this arm also catches
56
+ // non-external links, where wrapping would blockify `.content-wrap` and
57
+ // move an `underlined` border, to align nothing.
58
+ /* @__PURE__ */ s("span", { className: "inline-flex items-center", children: [
59
+ /* @__PURE__ */ n("span", { className: "content-wrap", children: r }),
60
+ o
61
+ ] })
62
+ ) : /* @__PURE__ */ n("span", { className: "content-wrap", children: r });
63
+ return /* @__PURE__ */ n(
50
64
  N,
51
65
  {
52
- href: c,
53
- target: l,
66
+ href: l,
67
+ target: m,
54
68
  external: t,
55
- variant: e,
56
- size: m,
57
- color: d,
58
- className: h(v({ variant: e }), i),
59
- ...w,
60
- children: f ? /* @__PURE__ */ r("span", { children: p }) : p
69
+ variant: a === "underlined" ? "default" : a,
70
+ size: d,
71
+ color: f,
72
+ className: h(v({ variant: a }), c),
73
+ ...u,
74
+ children: w ? /* @__PURE__ */ n("span", { children: i }) : i
61
75
  }
62
76
  );
63
77
  }
@@ -34,6 +34,7 @@ import "../token-symbol/token-symbol.js";
34
34
  import "../simple-accordion/simple-accordion.js";
35
35
  import "../tip-card/tip-card.js";
36
36
  import "../typography/typography.js";
37
+ import "../help-tip/help-tip.js";
37
38
  import "../points-icon/points-icon.js";
38
39
  import "viem";
39
40
  import "../vertical-indicator/vertical-indicator.js";
@@ -81,7 +82,6 @@ import "../link/link.js";
81
82
  import "../rounded-image/rounded-image.js";
82
83
  import "../network-icon/network-indicator.js";
83
84
  import "../base-link/base-link.js";
84
- import "../help-tip/help-tip.js";
85
85
  import "../base-table/base-table-line.js";
86
86
  import "../navigation-context/navigation-context.js";
87
87
  import "../cards/card/card.js";