@gearbox-protocol/ui-kit 4.0.0-next.4 → 4.0.0-next.6
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/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/badge/badge.cjs +1 -1
- package/dist/cjs/components/badge/chip.cjs +1 -0
- package/dist/cjs/components/badge/index.cjs +1 -1
- package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
- package/dist/cjs/components/base/chart-with-side-card/chart-with-side-card.cjs +1 -1
- package/dist/cjs/components/base/history-chart/history-chart.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/leverage-input/leverage-input.cjs +1 -1
- package/dist/cjs/components/base/leverage-preset-chips/constants.cjs +1 -0
- package/dist/cjs/components/base/leverage-preset-chips/index.cjs +1 -0
- package/dist/cjs/components/base/leverage-preset-chips/leverage-preset-chips.cjs +1 -0
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/constants.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/title-meta/constants.cjs +1 -1
- package/dist/cjs/components/base/title-meta/title-meta.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/position-status-badge.cjs +1 -0
- package/dist/cjs/components/base/values/position-type-badge.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -0
- package/dist/cjs/components/base-table/base-table.cjs +1 -0
- package/dist/cjs/components/base-table/constants.cjs +1 -0
- package/dist/cjs/components/base-table/index.cjs +1 -0
- package/dist/cjs/components/base-table/types.cjs +1 -0
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/collateral-allocation-tooltip/allocation-wheel.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/collateral-allocation-tooltip.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/constants.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/index.cjs +1 -0
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/constants.cjs +1 -0
- package/dist/cjs/components/composites/pool-assets-table/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/index.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/filter/filter-chip.cjs +1 -1
- package/dist/cjs/components/graph/default-config.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/hf-indicator/hf-indicator.cjs +1 -0
- package/dist/cjs/components/hf-indicator/index.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/infinite-scroll/index.cjs +1 -0
- package/dist/cjs/components/infinite-scroll/infinite-scroll-wrapper.cjs +1 -0
- package/dist/cjs/components/name-cell/index.cjs +1 -0
- package/dist/cjs/components/name-cell/name-cell.cjs +1 -0
- package/dist/cjs/components/network-icon/index.cjs +1 -1
- package/dist/cjs/components/network-icon/network-indicator.cjs +1 -0
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
- package/dist/cjs/configs/tailwind-preset.cjs +1 -1
- package/dist/cjs/hooks/index.cjs +1 -1
- package/dist/cjs/hooks/use-observed-width-key.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/utils/format-money.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/leverage-presets.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +161 -159
- package/dist/esm/components/badge/badge.js +14 -8
- package/dist/esm/components/badge/chip.js +47 -0
- package/dist/esm/components/badge/index.js +8 -3
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
- package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +6 -6
- package/dist/esm/components/base/history-chart/history-chart.js +86 -46
- package/dist/esm/components/base/index.js +144 -138
- package/dist/esm/components/base/info-list/info-list.js +7 -8
- package/dist/esm/components/base/leverage-input/leverage-input.js +1 -1
- package/dist/esm/components/base/leverage-preset-chips/constants.js +7 -0
- package/dist/esm/components/base/leverage-preset-chips/index.js +6 -0
- package/dist/esm/components/base/leverage-preset-chips/leverage-preset-chips.js +39 -0
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +23 -30
- package/dist/esm/components/base/strategy-apy-breakdown-card/constants.js +3 -2
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +194 -32
- package/dist/esm/components/base/title-meta/constants.js +1 -0
- package/dist/esm/components/base/title-meta/title-meta.js +53 -33
- package/dist/esm/components/base/values/index.js +16 -14
- package/dist/esm/components/base/values/position-status-badge.js +26 -0
- package/dist/esm/components/base/values/position-type-badge.js +7 -6
- package/dist/esm/components/base-table/base-table-line.js +117 -0
- package/dist/esm/components/base-table/base-table.js +110 -0
- package/dist/esm/components/base-table/constants.js +12 -0
- package/dist/esm/components/base-table/index.js +9 -0
- package/dist/esm/components/base-table/types.js +1 -0
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +9 -6
- package/dist/esm/components/checkbox/checkbox-labeled.js +7 -4
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +7 -4
- package/dist/esm/components/collateral-allocation-tooltip/allocation-wheel.js +71 -0
- package/dist/esm/components/collateral-allocation-tooltip/collateral-allocation-tooltip.js +102 -0
- package/dist/esm/components/collateral-allocation-tooltip/constants.js +12 -0
- package/dist/esm/components/collateral-allocation-tooltip/index.js +9 -0
- package/dist/esm/components/composites/index.js +31 -31
- package/dist/esm/components/composites/pool-assets-table/constants.js +9 -0
- package/dist/esm/components/composites/pool-assets-table/index.js +8 -6
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +52 -30
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +108 -76
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +44 -26
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +109 -52
- package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +8 -10
- package/dist/esm/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.js +1 -0
- package/dist/esm/components/composites/tx-preview/confirm/index.js +24 -26
- package/dist/esm/components/composites/tx-preview/index.js +24 -26
- package/dist/esm/components/compound-apy/compound-apy.js +85 -80
- package/dist/esm/components/filter/filter-chip.js +1 -0
- package/dist/esm/components/graph/default-config.js +20 -18
- package/dist/esm/components/graph/graph-view.js +32 -31
- package/dist/esm/components/graph/graph.js +459 -458
- package/dist/esm/components/hf-indicator/hf-indicator.js +33 -0
- package/dist/esm/components/hf-indicator/index.js +4 -0
- package/dist/esm/components/index.js +732 -701
- package/dist/esm/components/infinite-scroll/index.js +4 -0
- package/dist/esm/components/infinite-scroll/infinite-scroll-wrapper.js +30 -0
- package/dist/esm/components/name-cell/index.js +4 -0
- package/dist/esm/components/name-cell/name-cell.js +35 -0
- package/dist/esm/components/network-icon/index.js +4 -2
- package/dist/esm/components/network-icon/network-indicator.js +82 -0
- package/dist/esm/components/trading-view/trading-view.js +193 -155
- package/dist/esm/components/with-copy/with-copy.js +7 -4
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +112 -169
- package/dist/esm/configs/tailwind-preset.js +13 -1
- package/dist/esm/hooks/index.js +20 -18
- package/dist/esm/hooks/use-observed-width-key.js +24 -0
- package/dist/esm/index.js +881 -842
- package/dist/esm/locale/en.json.js +21 -18
- package/dist/esm/utils/format-money.js +59 -41
- package/dist/esm/utils/index.js +87 -83
- package/dist/esm/utils/leverage-presets.js +13 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +3 -0
- package/dist/types/components/badge/badge.d.ts +2 -1
- package/dist/types/components/badge/chip.d.ts +22 -0
- package/dist/types/components/badge/index.d.ts +1 -0
- package/dist/types/components/base/history-chart/history-chart.d.ts +13 -3
- package/dist/types/components/base/index.d.ts +1 -0
- package/dist/types/components/base/leverage-input/leverage-input.d.ts +1 -1
- package/dist/types/components/base/leverage-preset-chips/constants.d.ts +4 -0
- package/dist/types/components/base/leverage-preset-chips/index.d.ts +2 -0
- package/dist/types/components/base/leverage-preset-chips/leverage-preset-chips.d.ts +13 -0
- package/dist/types/components/base/liquidation-params-table/liquidation-params-table.d.ts +2 -2
- package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +4 -5
- package/dist/types/components/base/strategy-apy-breakdown-card/constants.d.ts +1 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -4
- package/dist/types/components/base/title-meta/constants.d.ts +1 -0
- package/dist/types/components/base/title-meta/title-meta.d.ts +9 -1
- package/dist/types/components/base/values/index.d.ts +1 -0
- package/dist/types/components/base/values/position-status-badge.d.ts +7 -0
- package/dist/types/components/base/values/position-type-badge.d.ts +1 -1
- package/dist/types/components/base-table/base-table-line.d.ts +21 -0
- package/dist/types/components/base-table/base-table.d.ts +19 -0
- package/dist/types/components/base-table/constants.d.ts +8 -0
- package/dist/types/components/base-table/index.d.ts +3 -0
- package/dist/types/components/base-table/types.d.ts +37 -0
- package/dist/types/components/collateral-allocation-tooltip/allocation-wheel.d.ts +10 -0
- package/dist/types/components/collateral-allocation-tooltip/collateral-allocation-tooltip.d.ts +23 -0
- package/dist/types/components/collateral-allocation-tooltip/constants.d.ts +8 -0
- package/dist/types/components/collateral-allocation-tooltip/index.d.ts +3 -0
- package/dist/types/components/composites/pool-assets-table/constants.d.ts +6 -0
- package/dist/types/components/composites/pool-assets-table/index.d.ts +1 -0
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-head.d.ts +1 -2
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +8 -8
- package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +7 -20
- package/dist/types/components/composites/pool-assets-table/types.d.ts +4 -12
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.d.ts +23 -19
- package/dist/types/components/composites/tx-preview/confirm/dialog/index.d.ts +2 -2
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.d.ts +0 -3
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.d.ts +97 -0
- package/dist/types/components/graph/graph-view.d.ts +1 -1
- package/dist/types/components/graph/graph.d.ts +4 -0
- package/dist/types/components/hf-indicator/hf-indicator.d.ts +8 -0
- package/dist/types/components/hf-indicator/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/components/infinite-scroll/index.d.ts +1 -0
- package/dist/types/components/infinite-scroll/infinite-scroll-wrapper.d.ts +11 -0
- package/dist/types/components/name-cell/index.d.ts +1 -0
- package/dist/types/components/name-cell/name-cell.d.ts +13 -0
- package/dist/types/components/network-icon/index.d.ts +1 -0
- package/dist/types/components/network-icon/network-indicator.d.ts +23 -0
- package/dist/types/components/trading-view/trading-view.d.ts +10 -3
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +6 -8
- package/dist/types/configs/tailwind-preset.d.ts +12 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-observed-width-key.d.ts +8 -0
- package/dist/types/index.d.ts +6 -1
- package/dist/types/locale/en.json.d.ts +23 -18
- package/dist/types/utils/format-money.d.ts +11 -5
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/leverage-presets.d.ts +7 -0
- package/package.json +1 -1
- package/src/styles/base.css +30 -0
- package/src/styles/theme.css +16 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +0 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.cjs +0 -1
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +0 -177
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.js +0 -54
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.d.ts +0 -17
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.d.ts +0 -16
|
@@ -1,210 +1,212 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { IconExternal as
|
|
3
|
-
import { useMemo as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { IconExternal as R } from "@gearbox-protocol/static";
|
|
3
|
+
import { useMemo as S } from "react";
|
|
4
4
|
import "../buttons/back-button/back-button.js";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as $ } from "../buttons/button/button.js";
|
|
6
6
|
import "../buttons/copy-button/copy-button.js";
|
|
7
7
|
import "../buttons/external-button/external-button.js";
|
|
8
8
|
import "../buttons/filter-button/filter-button.js";
|
|
9
9
|
import "../buttons/navigation-button/navigation-button.js";
|
|
10
10
|
import "@gearbox-protocol/sdk";
|
|
11
|
-
import { cn as
|
|
11
|
+
import { cn as T } from "../../utils/cn.js";
|
|
12
12
|
import "sonner";
|
|
13
13
|
import "@gearbox-protocol/sdk/common-utils";
|
|
14
14
|
import "luxon";
|
|
15
15
|
import "../../utils/z-index.js";
|
|
16
16
|
import "../buttons/tab-button/tab-button.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { CollateralAllocationTooltip as B } from "../collateral-allocation-tooltip/collateral-allocation-tooltip.js";
|
|
18
|
+
import { TokenIcon as j } from "../token-icon/token-icon.js";
|
|
19
|
+
import { SimpleTooltip as M } from "../tooltip/simple-tooltip.js";
|
|
19
20
|
import "../tooltip/tooltip.js";
|
|
20
|
-
function
|
|
21
|
+
function z(t, n) {
|
|
22
|
+
return t ? /* @__PURE__ */ e(B, { data: t, children: n }) : n;
|
|
23
|
+
}
|
|
24
|
+
function O({
|
|
25
|
+
count: t,
|
|
26
|
+
iconSize: n,
|
|
27
|
+
onOtherClick: o,
|
|
28
|
+
otherTooltip: i,
|
|
29
|
+
fallbackTooltip: m
|
|
30
|
+
}) {
|
|
31
|
+
const l = T(
|
|
32
|
+
"inline-flex items-center justify-center rounded-full shrink-0",
|
|
33
|
+
"bg-gray-50 text-foreground ml-1!",
|
|
34
|
+
o && "cursor-pointer hover:bg-gray-70 transition-colors"
|
|
35
|
+
), c = {
|
|
36
|
+
width: n,
|
|
37
|
+
height: n,
|
|
38
|
+
minWidth: n,
|
|
39
|
+
minHeight: n,
|
|
40
|
+
zIndex: 0
|
|
41
|
+
}, u = /* @__PURE__ */ p("span", { className: "text-[10px]! leading-[10px] font-medium", children: [
|
|
42
|
+
"+",
|
|
43
|
+
t
|
|
44
|
+
] });
|
|
45
|
+
return !o && !i ? /* @__PURE__ */ e("span", { className: l, style: c, children: u }) : /* @__PURE__ */ e(M, { title: o ? /* @__PURE__ */ e(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
type: "button",
|
|
49
|
+
onClick: o,
|
|
50
|
+
className: l,
|
|
51
|
+
style: c,
|
|
52
|
+
children: u
|
|
53
|
+
}
|
|
54
|
+
) : /* @__PURE__ */ e("span", { className: l, style: c, children: u }), placement: "top", children: i || m });
|
|
55
|
+
}
|
|
56
|
+
function E(t) {
|
|
21
57
|
return "balances" in t && t.balances !== void 0;
|
|
22
58
|
}
|
|
23
|
-
function
|
|
59
|
+
function H(t) {
|
|
24
60
|
return "tokens" in t && t.tokens !== void 0;
|
|
25
61
|
}
|
|
26
62
|
function W({
|
|
27
63
|
assetAddress: t,
|
|
28
|
-
symbol:
|
|
64
|
+
symbol: n,
|
|
29
65
|
iconSymbol: o,
|
|
30
|
-
comment:
|
|
31
|
-
explorerUrl:
|
|
32
|
-
iconSize:
|
|
33
|
-
className:
|
|
66
|
+
comment: i,
|
|
67
|
+
explorerUrl: m,
|
|
68
|
+
iconSize: l = 24,
|
|
69
|
+
className: c
|
|
34
70
|
}) {
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */ e("div", { className: "font-medium", children:
|
|
39
|
-
|
|
71
|
+
return /* @__PURE__ */ p("div", { className: T("flex items-center gap-3", c), children: [
|
|
72
|
+
/* @__PURE__ */ e(j, { token: o ?? n, size: l }),
|
|
73
|
+
/* @__PURE__ */ p("div", { className: "flex items-center gap-1", children: [
|
|
74
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: n }),
|
|
75
|
+
i && /* @__PURE__ */ p("div", { className: "text-md text-muted-foreground", children: [
|
|
40
76
|
"(",
|
|
41
|
-
|
|
77
|
+
i,
|
|
42
78
|
")"
|
|
43
79
|
] }),
|
|
44
|
-
|
|
45
|
-
|
|
80
|
+
m && /* @__PURE__ */ e(
|
|
81
|
+
$,
|
|
46
82
|
{
|
|
47
83
|
variant: "ghost",
|
|
48
84
|
size: "sm",
|
|
49
85
|
className: "text-muted-foreground hover:text-foreground p-0 h-auto",
|
|
50
|
-
onClick: () => window.open(`${
|
|
51
|
-
children: /* @__PURE__ */ e(
|
|
86
|
+
onClick: () => window.open(`${m}/address/${t}`, "_blank"),
|
|
87
|
+
children: /* @__PURE__ */ e(R, { size: 12, className: "size-3" })
|
|
52
88
|
}
|
|
53
89
|
)
|
|
54
90
|
] })
|
|
55
91
|
] });
|
|
56
92
|
}
|
|
57
|
-
function
|
|
93
|
+
function _({
|
|
58
94
|
balances: t,
|
|
59
|
-
tokensList:
|
|
95
|
+
tokensList: n,
|
|
60
96
|
maxAssets: o = 3,
|
|
61
|
-
iconSize:
|
|
62
|
-
options:
|
|
63
|
-
className:
|
|
97
|
+
iconSize: i = 24,
|
|
98
|
+
options: m,
|
|
99
|
+
className: l
|
|
64
100
|
}) {
|
|
65
101
|
const {
|
|
66
|
-
mode:
|
|
67
|
-
showIconTooltip:
|
|
68
|
-
otherTooltip:
|
|
69
|
-
onOtherClick:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
zIndex: v,
|
|
86
|
-
marginRight: p ? 0 : k ? -Math.round(r * 0.5) : 4
|
|
87
|
-
},
|
|
88
|
-
children: y ? /* @__PURE__ */ e(
|
|
89
|
-
w,
|
|
90
|
-
{
|
|
91
|
-
title: /* @__PURE__ */ e("span", { className: "inline-flex", children: j }),
|
|
92
|
-
placement: "top",
|
|
93
|
-
children: c?.title || c?.symbol || "unknown"
|
|
94
|
-
}
|
|
95
|
-
) : j
|
|
96
|
-
},
|
|
97
|
-
h ?? s
|
|
98
|
-
);
|
|
99
|
-
}),
|
|
100
|
-
d && /* @__PURE__ */ e(
|
|
101
|
-
w,
|
|
102
|
-
{
|
|
103
|
-
title: /* @__PURE__ */ e(
|
|
104
|
-
"button",
|
|
102
|
+
mode: c = "default",
|
|
103
|
+
showIconTooltip: u = !0,
|
|
104
|
+
otherTooltip: x,
|
|
105
|
+
onOtherClick: v,
|
|
106
|
+
allocation: g
|
|
107
|
+
} = m || {}, w = c === "cascade", k = u && !g, [y, C, I, h] = S(() => {
|
|
108
|
+
const s = t, r = s.slice(0, o), a = s.slice(o), f = a.map((b) => {
|
|
109
|
+
const N = typeof b == "string" ? b : b.token;
|
|
110
|
+
return n[N]?.title || n[N]?.symbol || "unknown";
|
|
111
|
+
}).join(", "), d = s.length > o;
|
|
112
|
+
return [r, a, f, d];
|
|
113
|
+
}, [t, o, n]);
|
|
114
|
+
return z(
|
|
115
|
+
g,
|
|
116
|
+
/* @__PURE__ */ p("div", { className: T("relative inline-flex items-center", l), children: [
|
|
117
|
+
y.map((s, r, a) => {
|
|
118
|
+
const f = typeof s == "string" ? s : s.token, d = n[f], b = r === a.length - 1, N = w ? a.length - r : void 0, A = /* @__PURE__ */ e(j, { token: d, size: i });
|
|
119
|
+
return /* @__PURE__ */ e(
|
|
120
|
+
"div",
|
|
105
121
|
{
|
|
106
|
-
|
|
107
|
-
onClick: x,
|
|
108
|
-
className: g(
|
|
109
|
-
"inline-flex items-center justify-center rounded-full shrink-0",
|
|
110
|
-
"cursor-pointer",
|
|
111
|
-
"bg-gray-50 hover:bg-gray-70 text-foreground transition-colors",
|
|
112
|
-
"ml-1!"
|
|
113
|
-
),
|
|
122
|
+
className: "flex-shrink-0 flex",
|
|
114
123
|
style: {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
minWidth: r,
|
|
118
|
-
minHeight: r,
|
|
119
|
-
zIndex: 0
|
|
124
|
+
zIndex: N,
|
|
125
|
+
marginRight: b ? 0 : w ? -Math.round(i * 0.5) : 4
|
|
120
126
|
},
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
children: k ? /* @__PURE__ */ e(
|
|
128
|
+
M,
|
|
129
|
+
{
|
|
130
|
+
title: /* @__PURE__ */ e("span", { className: "inline-flex", children: A }),
|
|
131
|
+
placement: "top",
|
|
132
|
+
children: d?.title || d?.symbol || "unknown"
|
|
133
|
+
}
|
|
134
|
+
) : A
|
|
135
|
+
},
|
|
136
|
+
f ?? r
|
|
137
|
+
);
|
|
138
|
+
}),
|
|
139
|
+
h && /* @__PURE__ */ e(
|
|
140
|
+
O,
|
|
141
|
+
{
|
|
142
|
+
count: C.length,
|
|
143
|
+
iconSize: i,
|
|
144
|
+
onOtherClick: v,
|
|
145
|
+
otherTooltip: x,
|
|
146
|
+
fallbackTooltip: I
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] })
|
|
150
|
+
);
|
|
132
151
|
}
|
|
133
|
-
function
|
|
152
|
+
function q({
|
|
134
153
|
tokens: t,
|
|
135
|
-
maxAssets:
|
|
154
|
+
maxAssets: n = 3,
|
|
136
155
|
iconSize: o = 24,
|
|
137
|
-
options:
|
|
138
|
-
className:
|
|
156
|
+
options: i,
|
|
157
|
+
className: m
|
|
139
158
|
}) {
|
|
140
159
|
const {
|
|
141
|
-
mode:
|
|
142
|
-
showIconTooltip:
|
|
143
|
-
otherTooltip:
|
|
144
|
-
onOtherClick:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
zIndex: h,
|
|
158
|
-
marginRight: l ? 0 : x ? -Math.round(o * 0.5) : 4
|
|
159
|
-
},
|
|
160
|
-
children: f ? /* @__PURE__ */ e(
|
|
161
|
-
w,
|
|
162
|
-
{
|
|
163
|
-
title: /* @__PURE__ */ e("span", { className: "inline-flex", children: c }),
|
|
164
|
-
placement: "top",
|
|
165
|
-
children: d.symbol || "unknown"
|
|
166
|
-
}
|
|
167
|
-
) : c
|
|
168
|
-
},
|
|
169
|
-
d.address ?? n
|
|
170
|
-
);
|
|
171
|
-
}),
|
|
172
|
-
C && /* @__PURE__ */ e(
|
|
173
|
-
w,
|
|
174
|
-
{
|
|
175
|
-
title: /* @__PURE__ */ e(
|
|
176
|
-
"button",
|
|
160
|
+
mode: l = "default",
|
|
161
|
+
showIconTooltip: c = !0,
|
|
162
|
+
otherTooltip: u,
|
|
163
|
+
onOtherClick: x,
|
|
164
|
+
allocation: v
|
|
165
|
+
} = i || {}, g = l === "cascade", w = c && !v, [k, y, C, I] = S(() => {
|
|
166
|
+
const h = t.slice(0, n), s = t.slice(n), r = s.map((a) => a.symbol || "unknown").join(", ");
|
|
167
|
+
return [h, s, r, t.length > n];
|
|
168
|
+
}, [t, n]);
|
|
169
|
+
return z(
|
|
170
|
+
v,
|
|
171
|
+
/* @__PURE__ */ p("div", { className: T("relative inline-flex items-center", m), children: [
|
|
172
|
+
k.map((h, s, r) => {
|
|
173
|
+
const a = s === r.length - 1, f = g ? r.length - s : void 0, d = /* @__PURE__ */ e(j, { token: h, size: o });
|
|
174
|
+
return /* @__PURE__ */ e(
|
|
175
|
+
"div",
|
|
177
176
|
{
|
|
178
|
-
|
|
179
|
-
onClick: N,
|
|
180
|
-
className: g(
|
|
181
|
-
"inline-flex items-center justify-center rounded-full shrink-0",
|
|
182
|
-
"cursor-pointer",
|
|
183
|
-
"bg-gray-50 hover:bg-gray-70 text-foreground transition-colors",
|
|
184
|
-
"ml-1!"
|
|
185
|
-
),
|
|
177
|
+
className: "flex-shrink-0 flex",
|
|
186
178
|
style: {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
minWidth: o,
|
|
190
|
-
minHeight: o,
|
|
191
|
-
zIndex: 0
|
|
179
|
+
zIndex: f,
|
|
180
|
+
marginRight: a ? 0 : g ? -Math.round(o * 0.5) : 4
|
|
192
181
|
},
|
|
193
|
-
children: /* @__PURE__ */
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
182
|
+
children: w ? /* @__PURE__ */ e(
|
|
183
|
+
M,
|
|
184
|
+
{
|
|
185
|
+
title: /* @__PURE__ */ e("span", { className: "inline-flex", children: d }),
|
|
186
|
+
placement: "top",
|
|
187
|
+
children: h.symbol || "unknown"
|
|
188
|
+
}
|
|
189
|
+
) : d
|
|
190
|
+
},
|
|
191
|
+
h.address ?? s
|
|
192
|
+
);
|
|
193
|
+
}),
|
|
194
|
+
I && /* @__PURE__ */ e(
|
|
195
|
+
O,
|
|
196
|
+
{
|
|
197
|
+
count: y.length,
|
|
198
|
+
iconSize: o,
|
|
199
|
+
onOtherClick: x,
|
|
200
|
+
otherTooltip: u,
|
|
201
|
+
fallbackTooltip: C
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
] })
|
|
205
|
+
);
|
|
204
206
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
207
|
+
function lt(t) {
|
|
208
|
+
return H(t) ? /* @__PURE__ */ e(q, { ...t }) : E(t) ? /* @__PURE__ */ e(_, { ...t }) : /* @__PURE__ */ e(W, { ...t });
|
|
207
209
|
}
|
|
208
210
|
export {
|
|
209
|
-
|
|
211
|
+
lt as AssetsListCell
|
|
210
212
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { cva as n } from "class-variance-authority";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@gearbox-protocol/sdk";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as a } from "../../utils/cn.js";
|
|
6
6
|
import "sonner";
|
|
7
7
|
import "@gearbox-protocol/sdk/common-utils";
|
|
8
8
|
import "luxon";
|
|
9
9
|
import "../../utils/z-index.js";
|
|
10
|
-
const
|
|
10
|
+
const d = n(
|
|
11
11
|
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-auto",
|
|
12
12
|
{
|
|
13
13
|
variants: {
|
|
@@ -15,7 +15,13 @@ const a = n(
|
|
|
15
15
|
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
16
16
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
17
17
|
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
18
|
-
outline: "border-input text-foreground"
|
|
18
|
+
outline: "border-input text-foreground",
|
|
19
|
+
success: "border-transparent bg-emerald-500/15 font-medium text-emerald-400 hover:bg-emerald-500/15",
|
|
20
|
+
info: "border-transparent bg-blue-500/15 font-medium text-blue-400 hover:bg-blue-500/15",
|
|
21
|
+
warning: "border-transparent bg-amber-500/15 font-medium text-amber-400 hover:bg-amber-500/15",
|
|
22
|
+
danger: "border-transparent bg-red-500/15 font-medium text-red-400 hover:bg-red-500/15",
|
|
23
|
+
accent: "border-transparent bg-purple-500/15 font-medium text-purple-400 hover:bg-purple-500/15",
|
|
24
|
+
neutral: "border-transparent font-medium"
|
|
19
25
|
}
|
|
20
26
|
},
|
|
21
27
|
defaultVariants: {
|
|
@@ -23,10 +29,10 @@ const a = n(
|
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
);
|
|
26
|
-
function
|
|
27
|
-
return /* @__PURE__ */
|
|
32
|
+
function l({ className: r, variant: e, ...t }) {
|
|
33
|
+
return /* @__PURE__ */ o("div", { className: a(d({ variant: e }), r), ...t });
|
|
28
34
|
}
|
|
29
35
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
l as Badge,
|
|
37
|
+
d as badgeVariants
|
|
32
38
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "@gearbox-protocol/sdk";
|
|
4
|
+
import { cn as i } from "../../utils/cn.js";
|
|
5
|
+
import "sonner";
|
|
6
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
7
|
+
import "luxon";
|
|
8
|
+
import "../../utils/z-index.js";
|
|
9
|
+
import { Badge as p } from "./badge.js";
|
|
10
|
+
class s {
|
|
11
|
+
static root = "chip-root";
|
|
12
|
+
}
|
|
13
|
+
class e {
|
|
14
|
+
static root = "chips-root";
|
|
15
|
+
static chip = s.root;
|
|
16
|
+
}
|
|
17
|
+
function C({
|
|
18
|
+
children: t,
|
|
19
|
+
tone: o = "neutral",
|
|
20
|
+
className: a
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ r(
|
|
23
|
+
p,
|
|
24
|
+
{
|
|
25
|
+
variant: o,
|
|
26
|
+
className: i("shrink-0", a),
|
|
27
|
+
"data-testid": s.root,
|
|
28
|
+
children: t
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function g({ children: t, className: o }) {
|
|
33
|
+
return /* @__PURE__ */ r(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: i("flex shrink-0 items-center gap-x-2", o),
|
|
37
|
+
"data-testid": e.root,
|
|
38
|
+
children: t
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
C as Chip,
|
|
44
|
+
s as ChipTest,
|
|
45
|
+
g as Chips,
|
|
46
|
+
e as ChipsTest
|
|
47
|
+
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { Badge as
|
|
1
|
+
import { Badge as i, badgeVariants as r } from "./badge.js";
|
|
2
|
+
import { Chip as t, ChipTest as a, Chips as h, ChipsTest as o } from "./chip.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
i as Badge,
|
|
5
|
+
t as Chip,
|
|
6
|
+
a as ChipTest,
|
|
7
|
+
h as Chips,
|
|
8
|
+
o as ChipsTest,
|
|
9
|
+
r as badgeVariants
|
|
5
10
|
};
|
|
@@ -16,6 +16,7 @@ import "../../../utils/z-index.js";
|
|
|
16
16
|
import "../../points-icon/points-icon.js";
|
|
17
17
|
import { ApyValue as a } from "../values/scalars.js";
|
|
18
18
|
import "../../badge/badge.js";
|
|
19
|
+
import "../../badge/chip.js";
|
|
19
20
|
import { BorrowRateBlockTest as n } from "./constants.js";
|
|
20
21
|
function p(t) {
|
|
21
22
|
return typeof t == "number" ? t : t?.total;
|
|
@@ -23,7 +24,7 @@ function p(t) {
|
|
|
23
24
|
function u(t) {
|
|
24
25
|
return typeof t == "number" ? t : t?.base;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function q({
|
|
27
28
|
data: t,
|
|
28
29
|
dataTo: r
|
|
29
30
|
}) {
|
|
@@ -84,6 +85,6 @@ function _({
|
|
|
84
85
|
) }) });
|
|
85
86
|
}
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
+
q as BorrowRateBlock,
|
|
88
89
|
n as BorrowRateBlockTest
|
|
89
90
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { ChartWithSideCardTest as i } from "./constants.js";
|
|
3
3
|
function m({
|
|
4
|
-
chart:
|
|
4
|
+
chart: a,
|
|
5
5
|
side: t
|
|
6
6
|
}) {
|
|
7
7
|
return /* @__PURE__ */ e(
|
|
@@ -10,18 +10,18 @@ function m({
|
|
|
10
10
|
className: "flex w-full flex-wrap gap-4",
|
|
11
11
|
"data-testid": i.root,
|
|
12
12
|
children: [
|
|
13
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
className: "min-w-[min(100%,40rem)] grow-[999] basis-0",
|
|
17
17
|
"data-testid": i.chart,
|
|
18
|
-
children:
|
|
18
|
+
children: a
|
|
19
19
|
}
|
|
20
20
|
),
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
24
|
-
className: "min-w-
|
|
24
|
+
className: "min-w-[min(100%,300px)] grow-0 shrink-0 basis-[22.5rem]",
|
|
25
25
|
"data-testid": i.side,
|
|
26
26
|
children: t
|
|
27
27
|
}
|