@gearbox-protocol/ui-kit 4.0.0-next.15 → 4.0.0-next.17
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/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/position-assets/constants.cjs +1 -0
- package/dist/cjs/components/base/position-assets/index.cjs +1 -0
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -0
- package/dist/cjs/components/base/stat-badge/constants.cjs +1 -1
- package/dist/cjs/components/base/stat-badge/stat-badge.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/tabber/tabber.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.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/index.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/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/strategy-apy.cjs +1 -0
- package/dist/esm/components/base/index.js +112 -108
- package/dist/esm/components/base/info-list/info-list.js +7 -6
- package/dist/esm/components/base/position-assets/constants.js +8 -0
- package/dist/esm/components/base/position-assets/index.js +6 -0
- package/dist/esm/components/base/position-assets/position-assets.js +73 -0
- package/dist/esm/components/base/stat-badge/constants.js +1 -0
- package/dist/esm/components/base/stat-badge/stat-badge.js +87 -52
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +130 -110
- package/dist/esm/components/base/tabber/tabber.js +67 -64
- package/dist/esm/components/base/values/scalars.js +52 -33
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/index.js +662 -658
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +20 -19
- package/dist/esm/index.js +858 -850
- package/dist/esm/locale/en.json.js +2 -1
- package/dist/esm/utils/index.js +64 -60
- package/dist/esm/utils/strategy-apy.js +41 -0
- package/dist/types/components/base/index.d.ts +1 -0
- package/dist/types/components/base/position-assets/constants.d.ts +5 -0
- package/dist/types/components/base/position-assets/index.d.ts +2 -0
- package/dist/types/components/base/position-assets/position-assets.d.ts +49 -0
- package/dist/types/components/base/stat-badge/constants.d.ts +1 -0
- package/dist/types/components/base/stat-badge/stat-badge.d.ts +11 -1
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -0
- package/dist/types/components/base/tabber/tabber.d.ts +2 -2
- package/dist/types/components/base/values/scalars.d.ts +4 -0
- package/dist/types/locale/en.json.d.ts +2 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/strategy-apy.d.ts +37 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { TokenSelectPanel as a } from "./amount-input/token-select-panel.js";
|
|
|
3
3
|
import { BorrowRateBlock as p } from "./borrow-rate-block/borrow-rate-block.js";
|
|
4
4
|
import { BorrowRateBlockTest as f } from "./borrow-rate-block/constants.js";
|
|
5
5
|
import { ChartWithSideCard as x } from "./chart-with-side-card/chart-with-side-card.js";
|
|
6
|
-
import { ChartWithSideCardTest as
|
|
6
|
+
import { ChartWithSideCardTest as T } from "./chart-with-side-card/constants.js";
|
|
7
7
|
import { DetailedPageTitle as d } from "./detailed-page-title/detailed-page-title.js";
|
|
8
8
|
import { AsideAlignAnchor as S } from "./details-view/detail-aside/detail-aside-scope.js";
|
|
9
9
|
import { DetailAsideScreenLayout as g } from "./details-view/detail-aside/detail-aside-screen-layout.js";
|
|
@@ -25,87 +25,89 @@ import { MoreAccordionTest as ae } from "./more-accordion/constants.js";
|
|
|
25
25
|
import { MoreAccordion as pe } from "./more-accordion/more-accordion.js";
|
|
26
26
|
import { NestedInfoStackTest as fe } from "./nested-info-stack/constants.js";
|
|
27
27
|
import { NestedInfoStack as xe } from "./nested-info-stack/nested-info-stack.js";
|
|
28
|
-
import { PageHeadProvider as
|
|
28
|
+
import { PageHeadProvider as Te, PageTitle as le } from "./page-title/page-title.js";
|
|
29
29
|
import { PoolApyBreakdownCardTest as Pe } from "./pool-apy-breakdown-card/constants.js";
|
|
30
30
|
import { PoolApyBreakdownCard as ce } from "./pool-apy-breakdown-card/pool-apy-breakdown-card.js";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
31
|
+
import { PositionAssetsTest as ue } from "./position-assets/constants.js";
|
|
32
|
+
import { PositionAssets as Be } from "./position-assets/position-assets.js";
|
|
33
|
+
import { ReviewButton as be } from "./review-button/review-button.js";
|
|
34
|
+
import { SectionHeading as Ce } from "./section-heading/section-heading.js";
|
|
35
|
+
import { SEGMENTED_TABS_INACTIVE_BUTTON_CLASS as Ie, SegmentedTabs as he } from "./segmented-tabs/segmented-tabs.js";
|
|
36
|
+
import { SideCardTest as Me } from "./side-card/constants.js";
|
|
37
|
+
import { SideCard as De } from "./side-card/side-card.js";
|
|
38
|
+
import { SPACE_HEIGHT as ve, SPACE_PX as Ee } from "./spacing.js";
|
|
39
|
+
import { Stack as _e } from "./stack/stack.js";
|
|
40
|
+
import { StatBadge as Re, StatBadgeGrid as Fe } from "./stat-badge/stat-badge.js";
|
|
41
|
+
import { StickyBar as Ue } from "./sticky-bar/sticky-bar.js";
|
|
42
|
+
import { StrategyApyBreakdownCardTest as We } from "./strategy-apy-breakdown-card/constants.js";
|
|
43
|
+
import { StrategyApyBreakdownCard as Xe } from "./strategy-apy-breakdown-card/strategy-apy-breakdown-card.js";
|
|
44
|
+
import { Tabber as Je, TabberSection as Ke, isTabber as Qe } from "./tabber/tabber.js";
|
|
45
|
+
import { useDetailScrollSpy as Ze } from "./tabber/use-detail-scroll-spy.js";
|
|
46
|
+
import { useTitleText as eo } from "./text/use-title-text.js";
|
|
47
|
+
import { TimeToLiquidationBlockTest as ro } from "./time-to-liquidation-block/constants.js";
|
|
48
|
+
import { TimeToLiquidationBlock as ao } from "./time-to-liquidation-block/time-to-liquidation-block.js";
|
|
49
|
+
import { TitleMetaTest as po } from "./title-meta/constants.js";
|
|
50
|
+
import { TitleMeta as fo } from "./title-meta/title-meta.js";
|
|
51
|
+
import { TokenAmount as xo } from "./token-amount/token-amount.js";
|
|
52
|
+
import { TokenPairSymbolTest as To } from "./token-pair-symbol/constants.js";
|
|
53
|
+
import { TokenPairSymbol as Po } from "./token-pair-symbol/token-pair-symbol.js";
|
|
54
|
+
import { TokenPairTitleTest as co } from "./token-pair-title/constants.js";
|
|
55
|
+
import { TokenPairTitle as uo } from "./token-pair-title/token-pair-title.js";
|
|
56
|
+
import { PositionShortLabelTest as Bo, ValueTest as Ao } from "./values/constants.js";
|
|
57
|
+
import { PnlValue as Lo } from "./values/pnl-value.js";
|
|
58
|
+
import { PointsValue as yo } from "./values/points-value.js";
|
|
59
|
+
import { PositionShortLabel as ho } from "./values/position-short-label.js";
|
|
60
|
+
import { PositionStatusBadge as Mo } from "./values/position-status-badge.js";
|
|
61
|
+
import { PositionTypeBadge as Do } from "./values/position-type-badge.js";
|
|
62
|
+
import { ApyValue as vo, HealthFactorValue as Eo, LeverageValue as qo, TokenBigint as _o, UsdValue as No, UtilizationValue as Ro, bps as Fo } from "./values/scalars.js";
|
|
63
|
+
import { AmountInputTest as Uo } from "./amount-input/constants.js";
|
|
64
|
+
import { DetailedPageTitleTest as Wo } from "./detailed-page-title/constants.js";
|
|
65
|
+
import { DetailsViewTest as Xo } from "./details-view/constants.js";
|
|
66
|
+
import { HistoryChartTest as Jo } from "./history-chart/constants.js";
|
|
67
|
+
import { InfoListTest as Qo } from "./info-list/constants.js";
|
|
68
|
+
import { LeverageInputTest as Zo } from "./leverage-input/constants.js";
|
|
69
|
+
import { ManagePaneTest as er } from "./manage-pane/constants.js";
|
|
70
|
+
import { PageTitleTest as rr } from "./page-title/constants.js";
|
|
71
|
+
import { ReviewButtonTest as ar } from "./review-button/constants.js";
|
|
72
|
+
import { SectionHeadingTest as pr } from "./section-heading/constants.js";
|
|
73
|
+
import { SegmentedTabsTest as fr } from "./segmented-tabs/constants.js";
|
|
74
|
+
import { StackTest as xr } from "./stack/constants.js";
|
|
75
|
+
import { StatBadgeTest as Tr } from "./stat-badge/constants.js";
|
|
76
|
+
import { StickyBarTest as dr } from "./sticky-bar/constants.js";
|
|
77
|
+
import { TabberTest as Sr } from "./tabber/constants.js";
|
|
78
|
+
import { TokenAmountTest as gr } from "./token-amount/constants.js";
|
|
77
79
|
export {
|
|
78
80
|
r as AmountInput,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
Uo as AmountInputTest,
|
|
82
|
+
vo as ApyValue,
|
|
81
83
|
S as AsideAlignAnchor,
|
|
82
84
|
p as BorrowRateBlock,
|
|
83
85
|
f as BorrowRateBlockTest,
|
|
84
86
|
x as ChartWithSideCard,
|
|
85
|
-
|
|
87
|
+
T as ChartWithSideCardTest,
|
|
86
88
|
g as DetailAsideScreenLayout,
|
|
87
89
|
d as DetailedPageTitle,
|
|
88
|
-
|
|
90
|
+
Wo as DetailedPageTitleTest,
|
|
89
91
|
k as DetailsView,
|
|
90
92
|
B as DetailsViewLeftPane,
|
|
91
93
|
A as DetailsViewManagePane,
|
|
92
|
-
|
|
94
|
+
Xo as DetailsViewTest,
|
|
93
95
|
y as HealthFactorBlock,
|
|
94
96
|
L as HealthFactorBlockTest,
|
|
95
|
-
|
|
97
|
+
Eo as HealthFactorValue,
|
|
96
98
|
h as HistoryChart,
|
|
97
|
-
|
|
99
|
+
Jo as HistoryChartTest,
|
|
98
100
|
M as InfoLine,
|
|
99
101
|
V as InfoList,
|
|
100
|
-
|
|
102
|
+
Qo as InfoListTest,
|
|
101
103
|
E as InfoPortalOut,
|
|
102
104
|
q as InfoPortalProvider,
|
|
103
105
|
D as InfoSectionTitle,
|
|
104
106
|
N as LeverageInput,
|
|
105
|
-
|
|
107
|
+
Zo as LeverageInputTest,
|
|
106
108
|
U as LeveragePresetChips,
|
|
107
109
|
F as LeveragePresetChipsTest,
|
|
108
|
-
|
|
110
|
+
qo as LeverageValue,
|
|
109
111
|
X as LiquidationParamsTable,
|
|
110
112
|
W as LiquidationParamsTableTest,
|
|
111
113
|
Q as LiquidationPriceBlock,
|
|
@@ -115,63 +117,65 @@ export {
|
|
|
115
117
|
ee as ManagePaneMessage,
|
|
116
118
|
oe as ManagePaneTab,
|
|
117
119
|
re as ManagePaneTabDropdown,
|
|
118
|
-
|
|
120
|
+
er as ManagePaneTest,
|
|
119
121
|
pe as MoreAccordion,
|
|
120
122
|
ae as MoreAccordionTest,
|
|
121
123
|
xe as NestedInfoStack,
|
|
122
124
|
fe as NestedInfoStackTest,
|
|
123
|
-
|
|
125
|
+
Te as PageHeadProvider,
|
|
124
126
|
le as PageTitle,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
rr as PageTitleTest,
|
|
128
|
+
Lo as PnlValue,
|
|
127
129
|
H as PointsInfoLine,
|
|
128
|
-
|
|
130
|
+
yo as PointsValue,
|
|
129
131
|
ce as PoolApyBreakdownCard,
|
|
130
132
|
Pe as PoolApyBreakdownCardTest,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
be as
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
he as
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
Ue as
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
ao as
|
|
161
|
-
ro as
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
Po as
|
|
168
|
-
|
|
133
|
+
Be as PositionAssets,
|
|
134
|
+
ue as PositionAssetsTest,
|
|
135
|
+
ho as PositionShortLabel,
|
|
136
|
+
Bo as PositionShortLabelTest,
|
|
137
|
+
Mo as PositionStatusBadge,
|
|
138
|
+
Do as PositionTypeBadge,
|
|
139
|
+
be as ReviewButton,
|
|
140
|
+
ar as ReviewButtonTest,
|
|
141
|
+
Ie as SEGMENTED_TABS_INACTIVE_BUTTON_CLASS,
|
|
142
|
+
ve as SPACE_HEIGHT,
|
|
143
|
+
Ee as SPACE_PX,
|
|
144
|
+
Ce as SectionHeading,
|
|
145
|
+
pr as SectionHeadingTest,
|
|
146
|
+
he as SegmentedTabs,
|
|
147
|
+
fr as SegmentedTabsTest,
|
|
148
|
+
De as SideCard,
|
|
149
|
+
Me as SideCardTest,
|
|
150
|
+
_e as Stack,
|
|
151
|
+
xr as StackTest,
|
|
152
|
+
Re as StatBadge,
|
|
153
|
+
Fe as StatBadgeGrid,
|
|
154
|
+
Tr as StatBadgeTest,
|
|
155
|
+
Ue as StickyBar,
|
|
156
|
+
dr as StickyBarTest,
|
|
157
|
+
Xe as StrategyApyBreakdownCard,
|
|
158
|
+
We as StrategyApyBreakdownCardTest,
|
|
159
|
+
Je as Tabber,
|
|
160
|
+
Ke as TabberSection,
|
|
161
|
+
Sr as TabberTest,
|
|
162
|
+
ao as TimeToLiquidationBlock,
|
|
163
|
+
ro as TimeToLiquidationBlockTest,
|
|
164
|
+
fo as TitleMeta,
|
|
165
|
+
po as TitleMetaTest,
|
|
166
|
+
xo as TokenAmount,
|
|
167
|
+
gr as TokenAmountTest,
|
|
168
|
+
_o as TokenBigint,
|
|
169
|
+
Po as TokenPairSymbol,
|
|
170
|
+
To as TokenPairSymbolTest,
|
|
171
|
+
uo as TokenPairTitle,
|
|
172
|
+
co as TokenPairTitleTest,
|
|
169
173
|
a as TokenSelectPanel,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
No as UsdValue,
|
|
175
|
+
Ro as UtilizationValue,
|
|
176
|
+
Ao as ValueTest,
|
|
177
|
+
Fo as bps,
|
|
178
|
+
Qe as isTabber,
|
|
179
|
+
Ze as useDetailScrollSpy,
|
|
180
|
+
eo as useTitleText
|
|
177
181
|
};
|
|
@@ -11,6 +11,7 @@ import "@gearbox-protocol/sdk/common-utils";
|
|
|
11
11
|
import "luxon";
|
|
12
12
|
import "../../../utils/z-index.js";
|
|
13
13
|
import { PointsValue as l } from "../values/points-value.js";
|
|
14
|
+
import "viem";
|
|
14
15
|
import "../../points-icon/points-icon.js";
|
|
15
16
|
import "../../token-icon/token-icon.js";
|
|
16
17
|
import "../../tooltip/simple-tooltip.js";
|
|
@@ -21,7 +22,7 @@ import "../../badge/chip.js";
|
|
|
21
22
|
import { Typography as u } from "../../typography/typography.js";
|
|
22
23
|
import { VerticalIndicator as d } from "../../vertical-indicator/vertical-indicator.js";
|
|
23
24
|
import { InfoListTest as i } from "./constants.js";
|
|
24
|
-
function
|
|
25
|
+
function G({
|
|
25
26
|
children: t
|
|
26
27
|
}) {
|
|
27
28
|
return /* @__PURE__ */ r(c, { gap: "sm", "data-testid": i.root, children: t });
|
|
@@ -49,7 +50,7 @@ function g({
|
|
|
49
50
|
}
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
+
function H({
|
|
53
54
|
title: t
|
|
54
55
|
}) {
|
|
55
56
|
const o = n();
|
|
@@ -66,7 +67,7 @@ function G({
|
|
|
66
67
|
}
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function J({
|
|
70
71
|
data: t,
|
|
71
72
|
title: o = "components.yieldBreakdown.points"
|
|
72
73
|
}) {
|
|
@@ -74,8 +75,8 @@ function H({
|
|
|
74
75
|
}
|
|
75
76
|
export {
|
|
76
77
|
g as InfoLine,
|
|
77
|
-
|
|
78
|
+
G as InfoList,
|
|
78
79
|
i as InfoListTest,
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
H as InfoSectionTitle,
|
|
81
|
+
J as PointsInfoLine
|
|
81
82
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as d } from "../stack/stack.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "@gearbox-protocol/sdk";
|
|
5
|
+
import "clsx";
|
|
6
|
+
import "tailwind-merge";
|
|
7
|
+
import "sonner";
|
|
8
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
9
|
+
import "luxon";
|
|
10
|
+
import "../../../utils/z-index.js";
|
|
11
|
+
import "../../points-icon/points-icon.js";
|
|
12
|
+
import { TokenBigint as c } from "../values/scalars.js";
|
|
13
|
+
import "../../badge/badge.js";
|
|
14
|
+
import "../../badge/chip.js";
|
|
15
|
+
import "react-intl";
|
|
16
|
+
import { TokenSymbol as f } from "../../token-symbol/token-symbol.js";
|
|
17
|
+
import { Typography as u } from "../../typography/typography.js";
|
|
18
|
+
import { PositionAssetsTest as m } from "./constants.js";
|
|
19
|
+
const k = 1;
|
|
20
|
+
function _({
|
|
21
|
+
assets: r,
|
|
22
|
+
against: e,
|
|
23
|
+
empty: s,
|
|
24
|
+
testId: n
|
|
25
|
+
}) {
|
|
26
|
+
const t = h(r, e);
|
|
27
|
+
return /* @__PURE__ */ i(d, { gap: "sm", align: "end", "data-testid": n ?? m.root, children: t.length === 0 ? s !== void 0 && /* @__PURE__ */ i(
|
|
28
|
+
u,
|
|
29
|
+
{
|
|
30
|
+
variant: "caption",
|
|
31
|
+
color: "secondary",
|
|
32
|
+
as: "div",
|
|
33
|
+
"data-testid": m.empty,
|
|
34
|
+
children: s
|
|
35
|
+
}
|
|
36
|
+
) : t.map((o) => /* @__PURE__ */ p(
|
|
37
|
+
"span",
|
|
38
|
+
{
|
|
39
|
+
className: "flex items-center gap-2",
|
|
40
|
+
"data-testid": m.row,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ i(f, { size: 20, token: o.token }),
|
|
43
|
+
/* @__PURE__ */ i(c, { data: o.value, token: o.token })
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
o.token.address
|
|
47
|
+
)) });
|
|
48
|
+
}
|
|
49
|
+
function h(r, e) {
|
|
50
|
+
const s = /* @__PURE__ */ new Map(), n = (t, o) => {
|
|
51
|
+
const l = t.token.address.toLowerCase(), a = s.get(l);
|
|
52
|
+
s.set(l, {
|
|
53
|
+
token: a?.token ?? t.token,
|
|
54
|
+
// a token the other side alone holds is a zero here, not a gap
|
|
55
|
+
value: o ? t.value : a?.value ?? 0n,
|
|
56
|
+
worth: v(a?.worth, t.valueUsd)
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
for (const t of r ?? []) n(t, !0);
|
|
60
|
+
for (const t of e ?? []) n(t, !1);
|
|
61
|
+
return [...s.values()].filter((t) => t.worth === null || t.worth >= k).sort(
|
|
62
|
+
(t, o) => (o.worth ?? 0) - (t.worth ?? 0) || // a tie has to break the same way on both sides, or the rows drift
|
|
63
|
+
t.token.address.localeCompare(o.token.address)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function v(r, e) {
|
|
67
|
+
return r === void 0 ? e : r === null || e === null ? null : Math.max(r, e);
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
_ as PositionAssets,
|
|
71
|
+
m as PositionAssetsTest,
|
|
72
|
+
h as visibleAssets
|
|
73
|
+
};
|
|
@@ -1,124 +1,159 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { useTitleText as
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as p } from "../stack/stack.js";
|
|
3
|
+
import { useTitleText as x } from "../text/use-title-text.js";
|
|
4
|
+
import { faCaretDown as h, faCaretUp as S } from "@fortawesome/free-solid-svg-icons";
|
|
5
|
+
import { FaIcon as v } from "../../icons/fa-icon.js";
|
|
6
|
+
import { Skeleton as N } from "../../skeleton/skeleton.js";
|
|
5
7
|
import "react";
|
|
6
8
|
import "@gearbox-protocol/sdk";
|
|
7
|
-
import { cn as
|
|
9
|
+
import { cn as o } from "../../../utils/cn.js";
|
|
8
10
|
import "sonner";
|
|
9
11
|
import "@gearbox-protocol/sdk/common-utils";
|
|
10
12
|
import "luxon";
|
|
11
13
|
import "../../../utils/z-index.js";
|
|
14
|
+
import { SimpleTooltip as b } from "../../tooltip/simple-tooltip.js";
|
|
15
|
+
import "../../tooltip/tooltip.js";
|
|
12
16
|
import { StatBadgeTest as m } from "./constants.js";
|
|
13
|
-
const
|
|
17
|
+
const I = {
|
|
14
18
|
sm: "p-4",
|
|
15
19
|
md: "p-5",
|
|
16
20
|
default: "p-6"
|
|
17
|
-
},
|
|
21
|
+
}, T = {
|
|
18
22
|
sm: "mb-2.5",
|
|
19
23
|
md: "mb-2",
|
|
20
24
|
default: "mb-3"
|
|
21
|
-
},
|
|
25
|
+
}, d = {
|
|
22
26
|
sm: "text-xs leading-[0.8125rem]",
|
|
23
27
|
md: "text-xs leading-[0.9rem]",
|
|
24
28
|
default: "text-sm leading-[1.0625rem]"
|
|
25
|
-
},
|
|
29
|
+
}, _ = {
|
|
26
30
|
sm: "text-sm leading-[1.0625rem]",
|
|
27
31
|
md: "text-base leading-[1.25rem]",
|
|
28
32
|
default: "text-xl leading-[1.5625rem]"
|
|
29
33
|
};
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
isLoading: a = !1,
|
|
34
|
-
size: t = "default",
|
|
35
|
-
action: l,
|
|
36
|
-
className: o,
|
|
37
|
-
testId: n
|
|
34
|
+
function w({
|
|
35
|
+
delta: t,
|
|
36
|
+
size: i
|
|
38
37
|
}) {
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
const l = t.value > 0 ? "text-success" : t.value < 0 ? "text-destructive" : "text-muted-foreground", e = /* @__PURE__ */ a(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
className: o(
|
|
42
|
+
"inline-flex items-center gap-0.5 font-medium",
|
|
43
|
+
d[i],
|
|
44
|
+
l
|
|
45
|
+
),
|
|
46
|
+
"data-testid": m.delta,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
v,
|
|
50
|
+
{
|
|
51
|
+
icon: t.value < 0 ? h : S,
|
|
52
|
+
className: "size-3"
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
t.label
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
return t.tooltip == null ? e : /* @__PURE__ */ r(b, { title: e, triggerClassName: "shrink-0", children: t.tooltip });
|
|
60
|
+
}
|
|
61
|
+
function J({
|
|
62
|
+
title: t,
|
|
63
|
+
value: i,
|
|
64
|
+
isLoading: l = !1,
|
|
65
|
+
size: e = "default",
|
|
66
|
+
delta: s,
|
|
67
|
+
action: n,
|
|
68
|
+
className: c,
|
|
69
|
+
testId: u
|
|
70
|
+
}) {
|
|
71
|
+
const f = x(), g = s != null && !l;
|
|
72
|
+
return /* @__PURE__ */ a(
|
|
41
73
|
"div",
|
|
42
74
|
{
|
|
43
|
-
className:
|
|
75
|
+
className: o(
|
|
44
76
|
"h-full w-full rounded-lg border border-border bg-card",
|
|
45
|
-
|
|
46
|
-
|
|
77
|
+
I[e],
|
|
78
|
+
c
|
|
47
79
|
),
|
|
48
|
-
"data-testid":
|
|
80
|
+
"data-testid": u ?? m.root,
|
|
49
81
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ a(
|
|
51
83
|
"div",
|
|
52
84
|
{
|
|
53
|
-
className:
|
|
85
|
+
className: o(
|
|
54
86
|
"flex items-center justify-between gap-2",
|
|
55
|
-
|
|
87
|
+
T[e]
|
|
56
88
|
),
|
|
57
89
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ r(
|
|
59
91
|
"div",
|
|
60
92
|
{
|
|
61
|
-
className:
|
|
62
|
-
children:
|
|
93
|
+
className: o("font-medium text-muted-foreground", d[e]),
|
|
94
|
+
children: f(t)
|
|
63
95
|
}
|
|
64
96
|
),
|
|
65
|
-
|
|
97
|
+
g || n != null ? /* @__PURE__ */ a("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
98
|
+
s != null && !l ? /* @__PURE__ */ r(w, { delta: s, size: e }) : null,
|
|
99
|
+
n != null ? /* @__PURE__ */ r("div", { className: "shrink-0", "data-testid": m.action, children: n }) : null
|
|
100
|
+
] }) : null
|
|
66
101
|
]
|
|
67
102
|
}
|
|
68
103
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ r(
|
|
70
105
|
"div",
|
|
71
106
|
{
|
|
72
|
-
className:
|
|
107
|
+
className: o(
|
|
73
108
|
"text-left font-medium text-foreground",
|
|
74
|
-
|
|
109
|
+
_[e]
|
|
75
110
|
),
|
|
76
|
-
children: /* @__PURE__ */
|
|
111
|
+
children: /* @__PURE__ */ r(N, { width: 80, loading: l, children: /* @__PURE__ */ r(p, { gap: "xs", align: "start", className: "w-full items-start", children: i }) })
|
|
77
112
|
}
|
|
78
113
|
)
|
|
79
114
|
]
|
|
80
115
|
}
|
|
81
116
|
);
|
|
82
117
|
}
|
|
83
|
-
const
|
|
118
|
+
const E = {
|
|
84
119
|
1: "grid-cols-1",
|
|
85
120
|
2: "grid-cols-2",
|
|
86
121
|
3: "grid-cols-3",
|
|
87
122
|
4: "grid-cols-4"
|
|
88
|
-
},
|
|
123
|
+
}, G = {
|
|
89
124
|
1: "lg:grid-cols-1",
|
|
90
125
|
2: "lg:grid-cols-2",
|
|
91
126
|
3: "lg:grid-cols-3",
|
|
92
127
|
4: "lg:grid-cols-4"
|
|
93
|
-
},
|
|
128
|
+
}, D = {
|
|
94
129
|
sm: "gap-2",
|
|
95
130
|
default: "gap-4",
|
|
96
131
|
lg: "gap-6"
|
|
97
132
|
};
|
|
98
|
-
function
|
|
99
|
-
cols:
|
|
100
|
-
colsLg:
|
|
101
|
-
gap:
|
|
102
|
-
children:
|
|
103
|
-
className:
|
|
133
|
+
function K({
|
|
134
|
+
cols: t = 1,
|
|
135
|
+
colsLg: i,
|
|
136
|
+
gap: l = "default",
|
|
137
|
+
children: e,
|
|
138
|
+
className: s
|
|
104
139
|
}) {
|
|
105
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ r(
|
|
106
141
|
"div",
|
|
107
142
|
{
|
|
108
|
-
className:
|
|
143
|
+
className: o(
|
|
109
144
|
"grid w-full",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
145
|
+
E[t],
|
|
146
|
+
i ? G[i] : void 0,
|
|
147
|
+
D[l],
|
|
148
|
+
s
|
|
114
149
|
),
|
|
115
150
|
"data-testid": m.grid,
|
|
116
|
-
children:
|
|
151
|
+
children: e
|
|
117
152
|
}
|
|
118
153
|
);
|
|
119
154
|
}
|
|
120
155
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
156
|
+
J as StatBadge,
|
|
157
|
+
K as StatBadgeGrid,
|
|
123
158
|
m as StatBadgeTest
|
|
124
159
|
};
|