@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.
- package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
- package/dist/cjs/components/base/values/constants.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/no-value.cjs +1 -0
- package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
- package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/link/link.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
- package/dist/esm/components/base/index.js +63 -61
- package/dist/esm/components/base/info-list/info-list.js +8 -7
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
- package/dist/esm/components/base/position-assets/position-assets.js +4 -3
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
- package/dist/esm/components/base/token-amount/token-amount.js +32 -16
- package/dist/esm/components/base/values/constants.js +1 -0
- package/dist/esm/components/base/values/index.js +21 -19
- package/dist/esm/components/base/values/no-value.js +34 -0
- package/dist/esm/components/base/values/pnl-value.js +10 -9
- package/dist/esm/components/base/values/price-impact-value.js +6 -5
- package/dist/esm/components/base/values/scalars.js +23 -26
- package/dist/esm/components/base-table/base-table-line.js +44 -36
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +5 -11
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
- package/dist/esm/components/compound-apy/compound-apy.js +48 -40
- package/dist/esm/components/help-tip/help-tip.js +64 -59
- package/dist/esm/components/index.js +624 -622
- package/dist/esm/components/link/link.js +48 -34
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/index.js +805 -803
- package/dist/esm/locale/en.json.js +1 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
- package/dist/types/components/base/values/constants.d.ts +1 -0
- package/dist/types/components/base/values/index.d.ts +1 -0
- package/dist/types/components/base/values/no-value.d.ts +25 -0
- package/dist/types/components/base/values/scalars.d.ts +7 -2
- package/dist/types/components/client-adapters/styled-button/styled-button.d.ts +10 -5
- package/dist/types/locale/en.json.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { IconExternal as
|
|
3
|
-
import { cva as
|
|
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 =
|
|
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
|
-
|
|
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:
|
|
26
|
-
children:
|
|
27
|
-
href:
|
|
28
|
-
target:
|
|
29
|
-
variant:
|
|
30
|
-
size:
|
|
31
|
-
color:
|
|
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:
|
|
34
|
-
...
|
|
37
|
+
asChild: w = !1,
|
|
38
|
+
...u
|
|
35
39
|
}) {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
_,
|
|
42
|
-
|
|
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
|
-
})() :
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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:
|
|
53
|
-
target:
|
|
66
|
+
href: l,
|
|
67
|
+
target: m,
|
|
54
68
|
external: t,
|
|
55
|
-
variant:
|
|
56
|
-
size:
|
|
57
|
-
color:
|
|
58
|
-
className: h(v({ variant:
|
|
59
|
-
...
|
|
60
|
-
children:
|
|
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";
|