@gearbox-protocol/ui-kit 4.0.0-next.3 → 4.0.0-next.5
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/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/base/health-factor-block/health-factor-block.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/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/liquidation-price-block/liquidation-price-block.cjs +1 -1
- package/dist/cjs/components/base/manage-pane/constants.cjs +1 -1
- package/dist/cjs/components/base/manage-pane/manage-pane.cjs +1 -1
- package/dist/cjs/components/base/page-title/index.cjs +1 -1
- package/dist/cjs/components/base/page-title/page-title.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/stat-badge/stat-badge.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/time-to-liquidation-block/time-to-liquidation-block.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/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/points-value.cjs +1 -0
- 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/values/scalars.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/TransactionConfirmModalView.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-leverage.cjs +1 -0
- 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 +4 -2
- package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +6 -6
- package/dist/esm/components/base/detailed-page-title/detailed-page-title.js +26 -27
- package/dist/esm/components/base/health-factor-block/health-factor-block.js +25 -25
- package/dist/esm/components/base/history-chart/history-chart.js +86 -46
- package/dist/esm/components/base/index.js +148 -138
- package/dist/esm/components/base/info-list/index.js +5 -4
- package/dist/esm/components/base/info-list/info-list.js +51 -27
- package/dist/esm/components/base/leverage-input/leverage-input.js +18 -20
- 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/liquidation-price-block/liquidation-price-block.js +33 -28
- package/dist/esm/components/base/manage-pane/constants.js +3 -2
- package/dist/esm/components/base/manage-pane/manage-pane.js +154 -113
- package/dist/esm/components/base/page-title/index.js +5 -4
- package/dist/esm/components/base/page-title/page-title.js +31 -23
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +23 -30
- package/dist/esm/components/base/stat-badge/stat-badge.js +18 -9
- 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 -31
- package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +31 -31
- 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/token-amount/token-amount.js +17 -16
- package/dist/esm/components/base/values/constants.js +1 -0
- package/dist/esm/components/base/values/index.js +20 -16
- package/dist/esm/components/base/values/points-value.js +30 -0
- 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/values/scalars.js +18 -17
- 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 +24 -20
- package/dist/esm/components/checkbox/checkbox-labeled.js +22 -18
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +22 -18
- 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 +46 -44
- 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 +109 -76
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +44 -26
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +31 -27
- 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 +72 -88
- 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 +734 -697
- 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 +22 -18
- 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 +888 -841
- package/dist/esm/locale/en.json.js +21 -18
- package/dist/esm/utils/format-leverage.js +6 -0
- package/dist/esm/utils/format-money.js +59 -41
- package/dist/esm/utils/index.js +91 -85
- 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/detailed-page-title/detailed-page-title.d.ts +1 -3
- package/dist/types/components/base/health-factor-block/health-factor-block.d.ts +6 -6
- 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/info-list/info-list.d.ts +7 -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/liquidation-price-block/liquidation-price-block.d.ts +6 -4
- package/dist/types/components/base/manage-pane/constants.d.ts +1 -0
- package/dist/types/components/base/manage-pane/manage-pane.d.ts +3 -1
- package/dist/types/components/base/page-title/page-title.d.ts +12 -6
- 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/time-to-liquidation-block/time-to-liquidation-block.d.ts +5 -6
- 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/token-amount/token-amount.d.ts +8 -2
- package/dist/types/components/base/values/constants.d.ts +1 -0
- package/dist/types/components/base/values/index.d.ts +2 -0
- package/dist/types/components/base/values/points-value.d.ts +11 -0
- package/dist/types/components/base/values/position-short-label.d.ts +1 -1
- 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/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-leverage.d.ts +5 -0
- package/dist/types/utils/format-money.d.ts +11 -5
- package/dist/types/utils/index.d.ts +3 -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
|
@@ -1,43 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { useTitleText as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as c } from "../stack/stack.js";
|
|
3
|
+
import { useTitleText as n } from "../text/use-title-text.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { pointProgramsOf as f } from "../../../utils/apy-breakdown.js";
|
|
6
|
+
import "@gearbox-protocol/sdk";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "tailwind-merge";
|
|
9
|
+
import "sonner";
|
|
10
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
11
|
+
import "luxon";
|
|
12
|
+
import "../../../utils/z-index.js";
|
|
13
|
+
import { PointsValue as l } from "../values/points-value.js";
|
|
14
|
+
import "../../points-icon/points-icon.js";
|
|
15
|
+
import "../../token-icon/token-icon.js";
|
|
16
|
+
import "../../tooltip/simple-tooltip.js";
|
|
17
|
+
import "../../tooltip/tooltip.js";
|
|
18
|
+
import "react-intl";
|
|
19
|
+
import "../../badge/badge.js";
|
|
20
|
+
import "../../badge/chip.js";
|
|
21
|
+
import { Typography as u } from "../../typography/typography.js";
|
|
22
|
+
import { VerticalIndicator as d } from "../../vertical-indicator/vertical-indicator.js";
|
|
6
23
|
import { InfoListTest as i } from "./constants.js";
|
|
7
|
-
function
|
|
24
|
+
function F({
|
|
8
25
|
children: t
|
|
9
26
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ r(c, { gap: "sm", "data-testid": i.root, children: t });
|
|
11
28
|
}
|
|
12
|
-
function
|
|
29
|
+
function g({
|
|
13
30
|
title: t,
|
|
14
31
|
value: o,
|
|
15
|
-
tip:
|
|
16
|
-
valueDescription:
|
|
17
|
-
valueTo:
|
|
18
|
-
testId:
|
|
32
|
+
tip: e,
|
|
33
|
+
valueDescription: m,
|
|
34
|
+
valueTo: p,
|
|
35
|
+
testId: s
|
|
19
36
|
}) {
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
37
|
+
const a = n();
|
|
38
|
+
return /* @__PURE__ */ r(
|
|
39
|
+
d,
|
|
23
40
|
{
|
|
24
|
-
label:
|
|
25
|
-
tip:
|
|
41
|
+
label: a(t),
|
|
42
|
+
tip: e,
|
|
26
43
|
value: o,
|
|
27
|
-
valueTo:
|
|
28
|
-
valueDescription:
|
|
44
|
+
valueTo: p,
|
|
45
|
+
valueDescription: m,
|
|
29
46
|
size: "sm",
|
|
30
47
|
align: "center",
|
|
31
|
-
"data-testid":
|
|
48
|
+
"data-testid": s ?? i.line
|
|
32
49
|
}
|
|
33
50
|
);
|
|
34
51
|
}
|
|
35
|
-
function
|
|
52
|
+
function G({
|
|
36
53
|
title: t
|
|
37
54
|
}) {
|
|
38
|
-
const o =
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
55
|
+
const o = n();
|
|
56
|
+
return /* @__PURE__ */ r(
|
|
57
|
+
u,
|
|
41
58
|
{
|
|
42
59
|
as: "span",
|
|
43
60
|
color: "secondary",
|
|
@@ -49,9 +66,16 @@ function L({
|
|
|
49
66
|
}
|
|
50
67
|
);
|
|
51
68
|
}
|
|
69
|
+
function H({
|
|
70
|
+
data: t,
|
|
71
|
+
title: o = "components.yieldBreakdown.points"
|
|
72
|
+
}) {
|
|
73
|
+
return !t || f(t).length === 0 ? null : /* @__PURE__ */ r(g, { title: o, value: /* @__PURE__ */ r(l, { data: t }) });
|
|
74
|
+
}
|
|
52
75
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
g as InfoLine,
|
|
77
|
+
F as InfoList,
|
|
55
78
|
i as InfoListTest,
|
|
56
|
-
|
|
79
|
+
G as InfoSectionTitle,
|
|
80
|
+
H as PointsInfoLine
|
|
57
81
|
};
|
|
@@ -2,20 +2,21 @@ import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as I } from "react";
|
|
3
3
|
import { Stack as x } from "../stack/stack.js";
|
|
4
4
|
import { useTitleText as y } from "../text/use-title-text.js";
|
|
5
|
-
import { EditInput as
|
|
6
|
-
import { Slider as
|
|
5
|
+
import { EditInput as j } from "../../edit-input/edit-input.js";
|
|
6
|
+
import { Slider as F } from "../../slider/slider.js";
|
|
7
7
|
import "../../slider/slider-context.js";
|
|
8
8
|
import { TextButton as O } from "../../text-button/text-button.js";
|
|
9
9
|
import { SimpleTooltip as R } from "../../tooltip/simple-tooltip.js";
|
|
10
10
|
import "../../tooltip/tooltip.js";
|
|
11
11
|
import { useIntlTyped as B, FormattedMessageTyped as T } from "../../typed-intl/index.js";
|
|
12
12
|
import { WithTitle as D } from "../../with-title/with-title.js";
|
|
13
|
+
import { formatLeverage as b } from "../../../utils/format-leverage.js";
|
|
13
14
|
import { LeverageInputTest as i } from "./constants.js";
|
|
14
15
|
const o = 100, P = 10;
|
|
15
|
-
function
|
|
16
|
-
value:
|
|
16
|
+
function ee({
|
|
17
|
+
value: n,
|
|
17
18
|
onChange: s,
|
|
18
|
-
max:
|
|
19
|
+
max: r,
|
|
19
20
|
min: l = 1,
|
|
20
21
|
title: c,
|
|
21
22
|
hint: d,
|
|
@@ -25,11 +26,11 @@ function Z({
|
|
|
25
26
|
size: S = "sm"
|
|
26
27
|
}) {
|
|
27
28
|
const E = B(), C = y(), p = w ?? [
|
|
28
|
-
{ start: l, end:
|
|
29
|
+
{ start: l, end: r, color: "additionalSuccess" }
|
|
29
30
|
], L = N ?? (p.length > 0 ? E.formatMessage({
|
|
30
31
|
messageId: "components.leverageInput.available"
|
|
31
|
-
}) : void 0), [M, u] = I(void 0), [f, g] = I(""), h = M ??
|
|
32
|
-
s(_(e, l,
|
|
32
|
+
}) : void 0), [M, u] = I(void 0), [f, g] = I(""), h = M ?? n, v = (e) => {
|
|
33
|
+
s(_(e, l, r)), u(void 0);
|
|
33
34
|
}, k = () => {
|
|
34
35
|
const e = Number.parseFloat(f.replace(",", "."));
|
|
35
36
|
Number.isFinite(e) && v(e);
|
|
@@ -49,17 +50,17 @@ function Z({
|
|
|
49
50
|
] }),
|
|
50
51
|
/* @__PURE__ */ m(x, { direction: "row", align: "center", gap: "sm", children: [
|
|
51
52
|
/* @__PURE__ */ t("div", { className: "flex w-[90px] flex-row flex-nowrap items-center", children: /* @__PURE__ */ t(
|
|
52
|
-
|
|
53
|
+
j,
|
|
53
54
|
{
|
|
54
55
|
value: f,
|
|
55
56
|
placeholder: "0",
|
|
56
|
-
label:
|
|
57
|
+
label: `${b(h)}x`,
|
|
57
58
|
textButtonProps: {
|
|
58
59
|
className: "inline-flex items-center whitespace-nowrap"
|
|
59
60
|
},
|
|
60
61
|
"data-testid": i.value,
|
|
61
62
|
onEditModeChange: (e) => {
|
|
62
|
-
e && g(b(
|
|
63
|
+
e && g(b(n));
|
|
63
64
|
},
|
|
64
65
|
onChange: (e) => g(e.target.value),
|
|
65
66
|
onSubmit: k
|
|
@@ -88,15 +89,15 @@ function Z({
|
|
|
88
89
|
] })
|
|
89
90
|
] }),
|
|
90
91
|
children: /* @__PURE__ */ t(
|
|
91
|
-
|
|
92
|
+
F,
|
|
92
93
|
{
|
|
93
94
|
from: l * o,
|
|
94
|
-
to:
|
|
95
|
+
to: r * o,
|
|
95
96
|
precision: o,
|
|
96
97
|
value: h * o,
|
|
97
98
|
colorIntervals: V,
|
|
98
99
|
colorIntervalLabel: L,
|
|
99
|
-
markerStep:
|
|
100
|
+
markerStep: r > P ? 200 : 100,
|
|
100
101
|
"data-testid": i.slider,
|
|
101
102
|
onChangeValue: (e) => u(e / o),
|
|
102
103
|
onSubmitValue: (e) => v(e / o)
|
|
@@ -105,13 +106,10 @@ function Z({
|
|
|
105
106
|
}
|
|
106
107
|
) });
|
|
107
108
|
}
|
|
108
|
-
function _(
|
|
109
|
-
return Math.min(Math.max(
|
|
110
|
-
}
|
|
111
|
-
function b(r) {
|
|
112
|
-
return (Math.round(r * 100) / 100).toFixed(2);
|
|
109
|
+
function _(n, s, r) {
|
|
110
|
+
return Math.min(Math.max(n, s), r);
|
|
113
111
|
}
|
|
114
112
|
export {
|
|
115
|
-
|
|
113
|
+
ee as LeverageInput,
|
|
116
114
|
i as LeverageInputTest
|
|
117
115
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as n, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { SegmentedTabs as g } from "../segmented-tabs/segmented-tabs.js";
|
|
3
|
+
import { FormattedMessageTyped as d } from "../../typed-intl/index.js";
|
|
4
|
+
import { formatChipLeverage as l } from "../../../utils/leverage-presets.js";
|
|
5
|
+
import { LeveragePresetChipsTest as s } from "./constants.js";
|
|
6
|
+
function u({
|
|
7
|
+
options: e,
|
|
8
|
+
value: r,
|
|
9
|
+
onChange: a
|
|
10
|
+
}) {
|
|
11
|
+
if (e.length === 0) return null;
|
|
12
|
+
const i = r != null && e.includes(r) ? String(r) : String(e[e.length - 1]);
|
|
13
|
+
return /* @__PURE__ */ n(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: "flex items-center gap-2",
|
|
17
|
+
"data-testid": s.root,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ m("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ m(d, { messageId: "components.leveragePresetChips.label" }) }),
|
|
20
|
+
/* @__PURE__ */ m(
|
|
21
|
+
g,
|
|
22
|
+
{
|
|
23
|
+
items: e.map((t) => ({
|
|
24
|
+
id: String(t),
|
|
25
|
+
item: `${l(t)}×`,
|
|
26
|
+
testId: s.chip
|
|
27
|
+
})),
|
|
28
|
+
activeTab: i,
|
|
29
|
+
onTabChange: (t) => a(Number(t))
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
u as LeveragePresetChips,
|
|
38
|
+
s as LeveragePresetChipsTest
|
|
39
|
+
};
|
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTitleText as
|
|
3
|
-
import { FadeoutLoading as
|
|
4
|
-
import { FormattedNumberString as
|
|
5
|
-
import { HealthDot as
|
|
6
|
-
import { FormattedMessageTyped as
|
|
1
|
+
import { jsx as i, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { useTitleText as b } from "../text/use-title-text.js";
|
|
3
|
+
import { FadeoutLoading as s } from "../../fadeout-loading/fadeout-loading.js";
|
|
4
|
+
import { FormattedNumberString as T } from "../../formatted-number/formatted-number.js";
|
|
5
|
+
import { HealthDot as g } from "../../status-elements/status-elements.js";
|
|
6
|
+
import { FormattedMessageTyped as d } from "../../typed-intl/index.js";
|
|
7
7
|
import { VerticalIndicator as h } from "../../vertical-indicator/vertical-indicator.js";
|
|
8
8
|
import { bnToLiquidationPriceView as x } from "../../../utils/parse-input-to-bn.js";
|
|
9
9
|
import { LiquidationPriceBlockTest as r } from "./constants.js";
|
|
10
|
-
function
|
|
11
|
-
|
|
10
|
+
function q(e, o) {
|
|
11
|
+
if (!(!e || !o))
|
|
12
|
+
return `${e.symbol} / ${o.symbol}`;
|
|
13
|
+
}
|
|
14
|
+
function D({
|
|
15
|
+
price: e,
|
|
12
16
|
priceTo: o,
|
|
13
|
-
|
|
17
|
+
collateral: t,
|
|
18
|
+
underlying: u,
|
|
14
19
|
zone: l,
|
|
15
|
-
isLoading:
|
|
16
|
-
title:
|
|
17
|
-
tip:
|
|
18
|
-
testId:
|
|
20
|
+
isLoading: n,
|
|
21
|
+
title: a,
|
|
22
|
+
tip: p,
|
|
23
|
+
testId: f
|
|
19
24
|
}) {
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
25
|
+
const v = b(), m = o !== void 0;
|
|
26
|
+
return /* @__PURE__ */ i(
|
|
22
27
|
h,
|
|
23
28
|
{
|
|
24
29
|
align: "center",
|
|
25
30
|
dimPreviousValue: !1,
|
|
26
|
-
"data-testid":
|
|
27
|
-
label:
|
|
28
|
-
tip:
|
|
29
|
-
value: /* @__PURE__ */
|
|
31
|
+
"data-testid": f ?? r.root,
|
|
32
|
+
label: a !== void 0 ? v(a) : /* @__PURE__ */ i(d, { messageId: "components.liquidationPriceBlock.label" }),
|
|
33
|
+
tip: p ?? /* @__PURE__ */ i(d, { messageId: "components.liquidationPriceBlock.tip" }),
|
|
34
|
+
value: /* @__PURE__ */ i(s, { loading: n, children: /* @__PURE__ */ i(
|
|
30
35
|
c,
|
|
31
36
|
{
|
|
32
|
-
price:
|
|
33
|
-
zone:
|
|
37
|
+
price: e,
|
|
38
|
+
zone: m ? void 0 : l,
|
|
34
39
|
testId: r.value
|
|
35
40
|
}
|
|
36
41
|
) }),
|
|
37
|
-
valueTo:
|
|
42
|
+
valueTo: m ? /* @__PURE__ */ i(s, { loading: n, children: /* @__PURE__ */ i(
|
|
38
43
|
c,
|
|
39
44
|
{
|
|
40
45
|
price: o ?? null,
|
|
@@ -42,21 +47,21 @@ function j({
|
|
|
42
47
|
testId: r.valueTo
|
|
43
48
|
}
|
|
44
49
|
) }) : void 0,
|
|
45
|
-
valueDescription: t
|
|
50
|
+
valueDescription: q(t, u)
|
|
46
51
|
}
|
|
47
52
|
);
|
|
48
53
|
}
|
|
49
54
|
function c({
|
|
50
|
-
price:
|
|
55
|
+
price: e,
|
|
51
56
|
zone: o,
|
|
52
57
|
testId: t
|
|
53
58
|
}) {
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
o ? /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ P("span", { className: "inline-flex items-center", "data-testid": t, children: [
|
|
60
|
+
e === void 0 ? "—" : e === null || e === 0n ? "N/A" : /* @__PURE__ */ i(T, { value: x(e) }),
|
|
61
|
+
o ? /* @__PURE__ */ i("span", { className: "ml-1.5", children: /* @__PURE__ */ i(g, { zone: o }) }) : null
|
|
57
62
|
] });
|
|
58
63
|
}
|
|
59
64
|
export {
|
|
60
|
-
|
|
65
|
+
D as LiquidationPriceBlock,
|
|
61
66
|
r as LiquidationPriceBlockTest
|
|
62
67
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
class
|
|
1
|
+
class e {
|
|
2
2
|
static root = "manage-pane-root";
|
|
3
3
|
static tabs = "manage-pane-tabs";
|
|
4
4
|
static dropdown = "manage-pane-dropdown";
|
|
5
5
|
static body = "manage-pane-body";
|
|
6
6
|
static message = "manage-pane-message";
|
|
7
|
+
static actionDialog = "manage-pane-action-dialog";
|
|
7
8
|
static tab = (a) => `manage-pane-tab-${a}`;
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
e as ManagePaneTest
|
|
11
12
|
};
|