@gearbox-protocol/ui-kit 3.14.0-next.13 → 3.14.0-next.14
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/block-sync/block-sync.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/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/constants.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/preview/OperationPreviewContent.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/summary/constants.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/summary/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/OperationsCard.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/PoolDepositView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/PoolWithdrawView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/prerequisites/PrerequisitesCard.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/state-change/BalanceChangeGroup.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/state-change/StateChangeCard.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/legal-agreement/index.cjs +1 -1
- package/dist/cjs/components/legal-agreement/legal-agreement-awaiting-panel.cjs +1 -0
- package/dist/cjs/components/legal-agreement/legal-agreement-dialog.cjs +1 -1
- package/dist/cjs/components/legal-agreement/legal-agreement-link.cjs +1 -0
- package/dist/cjs/components/legal-agreement/legal-agreement-panel.cjs +1 -0
- package/dist/cjs/components/legal-agreement/legal-agreement-theme.cjs +1 -0
- package/dist/cjs/components/legal-agreement/legal-agreement.stories-config.cjs +1 -0
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +3 -2
- package/dist/esm/components/block-sync/block-sync.js +3 -2
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -0
- package/dist/esm/components/complex-input/complex-input.js +3 -2
- package/dist/esm/components/composites/pool-table/columns.js +34 -33
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.js +24 -24
- package/dist/esm/components/composites/tx-preview/confirm/dialog/constants.js +7 -2
- package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +7 -6
- package/dist/esm/components/composites/tx-preview/confirm/index.js +20 -12
- package/dist/esm/components/composites/tx-preview/confirm/preview/OperationPreviewContent.js +3 -2
- package/dist/esm/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.js +77 -61
- package/dist/esm/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.js +41 -22
- package/dist/esm/components/composites/tx-preview/confirm/stepper/index.js +5 -2
- package/dist/esm/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.js +39 -0
- package/dist/esm/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.js +92 -0
- package/dist/esm/components/composites/tx-preview/confirm/summary/constants.js +6 -0
- package/dist/esm/components/composites/tx-preview/confirm/summary/index.js +6 -0
- package/dist/esm/components/composites/tx-preview/index.js +70 -62
- package/dist/esm/components/composites/tx-preview/operations/OperationsCard.js +3 -2
- package/dist/esm/components/composites/tx-preview/operations/PoolDepositView.js +3 -2
- package/dist/esm/components/composites/tx-preview/operations/PoolWithdrawView.js +3 -2
- package/dist/esm/components/composites/tx-preview/prerequisites/PrerequisitesCard.js +3 -2
- package/dist/esm/components/composites/tx-preview/state-change/BalanceChangeGroup.js +3 -2
- package/dist/esm/components/composites/tx-preview/state-change/StateChangeCard.js +3 -2
- package/dist/esm/components/compound-apy/compound-apy.js +3 -2
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +1 -0
- package/dist/esm/components/index.js +504 -488
- package/dist/esm/components/legal-agreement/index.js +23 -7
- package/dist/esm/components/legal-agreement/legal-agreement-awaiting-panel.js +29 -0
- package/dist/esm/components/legal-agreement/legal-agreement-dialog.js +72 -212
- package/dist/esm/components/legal-agreement/legal-agreement-link.js +22 -0
- package/dist/esm/components/legal-agreement/legal-agreement-panel.js +130 -0
- package/dist/esm/components/legal-agreement/legal-agreement-theme.js +137 -0
- package/dist/esm/components/legal-agreement/legal-agreement.stories-config.js +170 -0
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +3 -2
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +1 -0
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +3 -2
- package/dist/esm/components/with-copy/with-copy.js +3 -2
- package/dist/esm/index.js +836 -820
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.d.ts +2 -2
- package/dist/types/components/composites/tx-preview/confirm/dialog/constants.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/confirm/index.d.ts +1 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.d.ts +2 -2
- package/dist/types/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.d.ts +10 -3
- package/dist/types/components/composites/tx-preview/confirm/stepper/index.d.ts +1 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.d.ts +14 -0
- package/dist/types/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.d.ts +18 -0
- package/dist/types/components/composites/tx-preview/confirm/summary/constants.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/confirm/summary/index.d.ts +2 -0
- package/dist/types/components/legal-agreement/index.d.ts +5 -1
- package/dist/types/components/legal-agreement/legal-agreement-awaiting-panel.d.ts +10 -0
- package/dist/types/components/legal-agreement/legal-agreement-dialog.d.ts +19 -52
- package/dist/types/components/legal-agreement/legal-agreement-link.d.ts +11 -0
- package/dist/types/components/legal-agreement/legal-agreement-panel.d.ts +16 -0
- package/dist/types/components/legal-agreement/legal-agreement-theme.d.ts +36 -0
- package/dist/types/components/legal-agreement/legal-agreement.stories-config.d.ts +11 -0
- package/package.json +1 -1
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import { TransactionConfirmDialogTest as e } from "./dialog/constants.js";
|
|
1
|
+
import { TransactionConfirmDialogTest as e, transactionConfirmDialogShellVariants as t } from "./dialog/constants.js";
|
|
2
2
|
import { TransactionConfirmDialogView as a } from "./dialog/TransactionConfirmDialogView.js";
|
|
3
|
-
import { useTransactionConfirmDialog as
|
|
4
|
-
import { useCalldataOperationPreview as
|
|
5
|
-
import { OperationPreviewContent as
|
|
6
|
-
import { computeTransactionExecutionSteps as c } from "./stepper/computeTransactionExecutionSteps.js";
|
|
7
|
-
import { TransactionStepperTest as
|
|
8
|
-
import { HorizontalTransactionStepper as
|
|
3
|
+
import { useTransactionConfirmDialog as m } from "./dialog/useTransactionConfirmDialog.js";
|
|
4
|
+
import { useCalldataOperationPreview as s } from "./hooks/useCalldataOperationPreview.js";
|
|
5
|
+
import { OperationPreviewContent as x } from "./preview/OperationPreviewContent.js";
|
|
6
|
+
import { computeTransactionExecutionSteps as c, getTransactionExecutionStepRequirements as T } from "./stepper/computeTransactionExecutionSteps.js";
|
|
7
|
+
import { TransactionStepperTest as C } from "./stepper/constants.js";
|
|
8
|
+
import { HorizontalTransactionStepper as g } from "./stepper/HorizontalTransactionStepper.js";
|
|
9
|
+
import { useCompletedStepsInSession as O } from "./stepper/useCompletedStepsInSession.js";
|
|
10
|
+
import { PoolOperationConfirmSummaryTest as w } from "./summary/constants.js";
|
|
11
|
+
import { PoolOperationConfirmSummary as v } from "./summary/PoolOperationConfirmSummary.js";
|
|
9
12
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
g as HorizontalTransactionStepper,
|
|
14
|
+
x as OperationPreviewContent,
|
|
15
|
+
v as PoolOperationConfirmSummary,
|
|
16
|
+
w as PoolOperationConfirmSummaryTest,
|
|
12
17
|
e as TransactionConfirmDialogTest,
|
|
13
18
|
a as TransactionConfirmDialogView,
|
|
14
|
-
|
|
19
|
+
C as TransactionStepperTest,
|
|
15
20
|
c as computeTransactionExecutionSteps,
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
T as getTransactionExecutionStepRequirements,
|
|
22
|
+
t as transactionConfirmDialogShellVariants,
|
|
23
|
+
s as useCalldataOperationPreview,
|
|
24
|
+
O as useCompletedStepsInSession,
|
|
25
|
+
m as useTransactionConfirmDialog
|
|
18
26
|
};
|
package/dist/esm/components/composites/tx-preview/confirm/preview/OperationPreviewContent.js
CHANGED
|
@@ -125,6 +125,7 @@ import "../../../../layout/layout/layout.js";
|
|
|
125
125
|
import "../../../../layout/main-aside-layout/main-aside-layout.js";
|
|
126
126
|
import "../../../../page-title/page-title.js";
|
|
127
127
|
import "../../../../layout/social-icons/social-icons.js";
|
|
128
|
+
import "../../../../legal-agreement/legal-agreement-theme.js";
|
|
128
129
|
import "../../../../link/link.js";
|
|
129
130
|
import "../../../../../utils/reactochart-compat.js";
|
|
130
131
|
import "../../../../status-elements/status-elements.js";
|
|
@@ -167,7 +168,7 @@ import { OperationsCard as n } from "../../operations/OperationsCard.js";
|
|
|
167
168
|
import { PrerequisitesCard as s } from "../../prerequisites/PrerequisitesCard.js";
|
|
168
169
|
import "@tanstack/react-query";
|
|
169
170
|
import { StateChangeCard as f } from "../../state-change/StateChangeCard.js";
|
|
170
|
-
function
|
|
171
|
+
function vt({
|
|
171
172
|
sdk: r,
|
|
172
173
|
operation: i,
|
|
173
174
|
simulation: m,
|
|
@@ -199,5 +200,5 @@ function jt({
|
|
|
199
200
|
] });
|
|
200
201
|
}
|
|
201
202
|
export {
|
|
202
|
-
|
|
203
|
+
vt as OperationPreviewContent
|
|
203
204
|
};
|
package/dist/esm/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "@gearbox-protocol/sdk";
|
|
4
4
|
import { cn as o } from "../../../../../utils/cn.js";
|
|
@@ -6,64 +6,26 @@ import "sonner";
|
|
|
6
6
|
import "@gearbox-protocol/sdk/common-utils";
|
|
7
7
|
import "luxon";
|
|
8
8
|
import "../../../../../utils/z-index.js";
|
|
9
|
-
import { TransactionStepperTest as
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
label: r,
|
|
9
|
+
import { TransactionStepperTest as f } from "./constants.js";
|
|
10
|
+
const c = 12, u = 24, y = c + u;
|
|
11
|
+
function x({
|
|
13
12
|
status: t,
|
|
14
|
-
|
|
13
|
+
stepNumber: i
|
|
15
14
|
}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */ e(
|
|
19
|
-
"div",
|
|
20
|
-
{
|
|
21
|
-
className: o(
|
|
22
|
-
"h-0.5 flex-1",
|
|
23
|
-
t === "upcoming" ? "bg-gray-40" : "bg-success"
|
|
24
|
-
),
|
|
25
|
-
"aria-hidden": !0
|
|
26
|
-
}
|
|
27
|
-
),
|
|
28
|
-
/* @__PURE__ */ e(d, { status: t }),
|
|
29
|
-
/* @__PURE__ */ e(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
className: o(
|
|
33
|
-
"h-0.5 flex-1",
|
|
34
|
-
i || t === "upcoming" ? "bg-gray-40" : "bg-success"
|
|
35
|
-
),
|
|
36
|
-
"aria-hidden": !0
|
|
37
|
-
}
|
|
38
|
-
)
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
"span",
|
|
42
|
-
{
|
|
43
|
-
className: o(
|
|
44
|
-
"mt-2 truncate px-1 text-center text-xs",
|
|
45
|
-
t === "active" ? "font-bold text-foreground" : t === "completed" ? "text-foreground" : "text-secondary-foreground"
|
|
46
|
-
),
|
|
47
|
-
children: r
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
] });
|
|
51
|
-
}
|
|
52
|
-
function d({ status: r }) {
|
|
53
|
-
return r === "completed" ? /* @__PURE__ */ e(
|
|
15
|
+
const r = t === "active";
|
|
16
|
+
return t === "completed" ? /* @__PURE__ */ e(
|
|
54
17
|
"div",
|
|
55
18
|
{
|
|
56
|
-
className: "flex shrink-0 items-center justify-center rounded-full bg-
|
|
57
|
-
style: { width: n, height: n },
|
|
19
|
+
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-gray-40",
|
|
58
20
|
"aria-hidden": !0,
|
|
59
|
-
children: /* @__PURE__ */
|
|
21
|
+
children: /* @__PURE__ */ p(
|
|
60
22
|
"svg",
|
|
61
23
|
{
|
|
62
24
|
width: "12",
|
|
63
25
|
height: "10",
|
|
64
26
|
viewBox: "0 0 12 10",
|
|
65
27
|
fill: "none",
|
|
66
|
-
className: "text-
|
|
28
|
+
className: "text-gray-110",
|
|
67
29
|
role: "img",
|
|
68
30
|
"aria-hidden": !0,
|
|
69
31
|
children: [
|
|
@@ -86,35 +48,89 @@ function d({ status: r }) {
|
|
|
86
48
|
"div",
|
|
87
49
|
{
|
|
88
50
|
className: o(
|
|
89
|
-
"flex shrink-0 items-center justify-center rounded-full
|
|
90
|
-
r
|
|
51
|
+
"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",
|
|
52
|
+
r ? "bg-white text-gray-10" : "bg-gray-40 text-gray-110"
|
|
91
53
|
),
|
|
92
|
-
|
|
54
|
+
"aria-hidden": !0,
|
|
55
|
+
children: i
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function v({ active: t }) {
|
|
60
|
+
return /* @__PURE__ */ e(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
className: o(
|
|
64
|
+
"pointer-events-none absolute top-0 z-10 block h-full",
|
|
65
|
+
t ? "bg-gray-40" : "bg-gray-10"
|
|
66
|
+
),
|
|
67
|
+
style: {
|
|
68
|
+
right: -c,
|
|
69
|
+
width: c,
|
|
70
|
+
clipPath: "polygon(0 0, 100% 50%, 0 100%)"
|
|
71
|
+
},
|
|
93
72
|
"aria-hidden": !0
|
|
94
73
|
}
|
|
95
74
|
);
|
|
96
75
|
}
|
|
97
76
|
function N({
|
|
98
|
-
|
|
99
|
-
|
|
77
|
+
step: t,
|
|
78
|
+
stepNumber: i,
|
|
79
|
+
index: r,
|
|
80
|
+
total: n,
|
|
81
|
+
label: g
|
|
82
|
+
}) {
|
|
83
|
+
const { status: d } = t, s = r === 0, m = r === n - 1, a = n === 1, l = d === "active", h = s ? u : y;
|
|
84
|
+
return /* @__PURE__ */ e(
|
|
85
|
+
"li",
|
|
86
|
+
{
|
|
87
|
+
className: o("relative min-w-0 flex-1 list-none", !s && "-ml-3"),
|
|
88
|
+
style: { zIndex: n - r },
|
|
89
|
+
"aria-current": l ? "step" : void 0,
|
|
90
|
+
children: /* @__PURE__ */ p(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: o(
|
|
94
|
+
"relative flex min-h-12 w-full items-center gap-2 py-2.5 text-xs",
|
|
95
|
+
l ? "bg-gray-40 text-foreground" : "bg-gray-10 text-gray-110",
|
|
96
|
+
a && "rounded-lg pr-6",
|
|
97
|
+
!a && s && "rounded-l-lg pr-2",
|
|
98
|
+
!a && m && "rounded-r-lg pr-6"
|
|
99
|
+
),
|
|
100
|
+
style: { paddingLeft: h },
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ e(x, { status: d, stepNumber: i }),
|
|
103
|
+
/* @__PURE__ */ e("span", { className: o("min-w-0 truncate", l && "font-bold"), children: g }),
|
|
104
|
+
m ? null : /* @__PURE__ */ e(v, { active: l })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
function _({
|
|
112
|
+
steps: t,
|
|
113
|
+
renderLabel: i
|
|
100
114
|
}) {
|
|
101
115
|
return /* @__PURE__ */ e(
|
|
102
116
|
"ol",
|
|
103
117
|
{
|
|
104
118
|
className: "flex w-full list-none p-0 m-0",
|
|
105
|
-
"data-testid":
|
|
106
|
-
children:
|
|
107
|
-
|
|
119
|
+
"data-testid": f.root,
|
|
120
|
+
children: t.map((r, n) => /* @__PURE__ */ e(
|
|
121
|
+
N,
|
|
108
122
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
123
|
+
step: r,
|
|
124
|
+
stepNumber: n + 1,
|
|
125
|
+
index: n,
|
|
126
|
+
total: t.length,
|
|
127
|
+
label: i(r)
|
|
112
128
|
},
|
|
113
|
-
|
|
129
|
+
r.id
|
|
114
130
|
))
|
|
115
131
|
}
|
|
116
132
|
);
|
|
117
133
|
}
|
|
118
134
|
export {
|
|
119
|
-
|
|
135
|
+
_ as HorizontalTransactionStepper
|
|
120
136
|
};
|
|
@@ -1,28 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
connect: "connect",
|
|
8
|
-
network: "network",
|
|
9
|
-
approve: "approve",
|
|
10
|
-
execute: "execute"
|
|
11
|
-
};
|
|
1
|
+
function l(e) {
|
|
2
|
+
return {
|
|
3
|
+
approve: !e.allowWalletBatching && (e.needsApproval || e.isApprovalPending),
|
|
4
|
+
auth: !e.isAuthReady
|
|
5
|
+
};
|
|
6
|
+
}
|
|
12
7
|
function p(e) {
|
|
13
|
-
return
|
|
8
|
+
return !e.allowWalletBatching && (e.isApprovalPending || e.needsApproval);
|
|
9
|
+
}
|
|
10
|
+
function c(e, t) {
|
|
11
|
+
return l(t)[e];
|
|
12
|
+
}
|
|
13
|
+
function i(e, t) {
|
|
14
|
+
return t.completedStepsInSession?.includes(e) ?? !1;
|
|
15
|
+
}
|
|
16
|
+
function a(e, t) {
|
|
17
|
+
return c(e, t) || i(e, t);
|
|
18
|
+
}
|
|
19
|
+
function f(e) {
|
|
20
|
+
const t = [];
|
|
21
|
+
return a("approve", e) && t.push("approve"), a("auth", e) && t.push("auth"), t.push("execute"), t;
|
|
22
|
+
}
|
|
23
|
+
function v(e, t) {
|
|
24
|
+
return e.isCorrectChain ? p(e) ? "approve" : c("auth", e) ? "auth" : "execute" : t[0] ?? "execute";
|
|
25
|
+
}
|
|
26
|
+
function d(e, t, r, o) {
|
|
27
|
+
const n = o.indexOf(r);
|
|
28
|
+
return o.indexOf(e) < n ? !0 : e === "execute" ? !1 : !!(i(e, t) && !c(e, t));
|
|
14
29
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
return r.indexOf(e) < n || e === "approve" && t.allowWalletBatching || e === "approve" && !t.needsApproval ? !0 : (e === "execute" && t.isExecuting, !1);
|
|
30
|
+
function h(e, t) {
|
|
31
|
+
return e === "approve" && t.allowWalletBatching ? "approveBatch" : e === "auth" ? "auth" : e;
|
|
18
32
|
}
|
|
19
|
-
function
|
|
20
|
-
const t =
|
|
21
|
-
return { steps:
|
|
22
|
-
const
|
|
23
|
-
return {
|
|
24
|
-
|
|
33
|
+
function S(e) {
|
|
34
|
+
const t = f(e), r = v(e, t);
|
|
35
|
+
return { steps: t.map((n) => {
|
|
36
|
+
const s = d(n, e, r, t) ? "completed" : n === r ? "active" : "upcoming";
|
|
37
|
+
return {
|
|
38
|
+
id: n,
|
|
39
|
+
labelKey: h(n, e),
|
|
40
|
+
status: s
|
|
41
|
+
};
|
|
42
|
+
}), activeStepId: r };
|
|
25
43
|
}
|
|
26
44
|
export {
|
|
27
|
-
|
|
45
|
+
S as computeTransactionExecutionSteps,
|
|
46
|
+
l as getTransactionExecutionStepRequirements
|
|
28
47
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { computeTransactionExecutionSteps as r } from "./computeTransactionExecutionSteps.js";
|
|
1
|
+
import { computeTransactionExecutionSteps as o, getTransactionExecutionStepRequirements as r } from "./computeTransactionExecutionSteps.js";
|
|
2
2
|
import { TransactionStepperTest as p } from "./constants.js";
|
|
3
3
|
import { HorizontalTransactionStepper as a } from "./HorizontalTransactionStepper.js";
|
|
4
|
+
import { useCompletedStepsInSession as c } from "./useCompletedStepsInSession.js";
|
|
4
5
|
export {
|
|
5
6
|
a as HorizontalTransactionStepper,
|
|
6
7
|
p as TransactionStepperTest,
|
|
7
|
-
|
|
8
|
+
o as computeTransactionExecutionSteps,
|
|
9
|
+
r as getTransactionExecutionStepRequirements,
|
|
10
|
+
c as useCompletedStepsInSession
|
|
8
11
|
};
|
package/dist/esm/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useState as a, useEffect as u } from "react";
|
|
2
|
+
import { getTransactionExecutionStepRequirements as m } from "./computeTransactionExecutionSteps.js";
|
|
3
|
+
function I({
|
|
4
|
+
sessionActive: n,
|
|
5
|
+
needsApproval: S,
|
|
6
|
+
isApprovalPending: i = !1,
|
|
7
|
+
allowWalletBatching: d,
|
|
8
|
+
isAuthReady: f
|
|
9
|
+
}) {
|
|
10
|
+
const [p, o] = a([]), [c, s] = a([]), e = m({
|
|
11
|
+
needsApproval: S,
|
|
12
|
+
isApprovalPending: i,
|
|
13
|
+
allowWalletBatching: d,
|
|
14
|
+
isAuthReady: f
|
|
15
|
+
});
|
|
16
|
+
return u(() => {
|
|
17
|
+
if (!n) {
|
|
18
|
+
o([]), s([]);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
o((r) => {
|
|
22
|
+
const t = new Set(r);
|
|
23
|
+
return e.approve && t.add("approve"), e.auth && t.add("auth"), [...t];
|
|
24
|
+
});
|
|
25
|
+
}, [n, e.approve, e.auth]), u(() => {
|
|
26
|
+
n && s((r) => {
|
|
27
|
+
const t = new Set(r);
|
|
28
|
+
return p.includes("approve") && !e.approve && t.add("approve"), p.includes("auth") && !e.auth && t.add("auth"), [...t];
|
|
29
|
+
});
|
|
30
|
+
}, [
|
|
31
|
+
n,
|
|
32
|
+
p,
|
|
33
|
+
e.approve,
|
|
34
|
+
e.auth
|
|
35
|
+
]), c;
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
I as useCompletedStepsInSession
|
|
39
|
+
};
|
package/dist/esm/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { shortAddress as y } from "@gearbox-protocol/sdk";
|
|
3
|
+
import { FadeoutLoading as C } from "../../../../fadeout-loading/fadeout-loading.js";
|
|
4
|
+
import { TipCard as z } from "../../../../tip-card/tip-card.js";
|
|
5
|
+
import { VerticalIndicator as r } from "../../../../vertical-indicator/vertical-indicator.js";
|
|
6
|
+
import { VerticalList as x } from "../../../../vertical-list/vertical-list.js";
|
|
7
|
+
import { WithCopy as g } from "../../../../with-copy/with-copy.js";
|
|
8
|
+
import { PoolOperationConfirmSummaryTest as P } from "./constants.js";
|
|
9
|
+
function m({
|
|
10
|
+
amount: i,
|
|
11
|
+
symbol: t
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ a("span", { children: [
|
|
14
|
+
i,
|
|
15
|
+
" ",
|
|
16
|
+
t
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
function F({
|
|
20
|
+
primaryLabel: i,
|
|
21
|
+
primaryAmount: t,
|
|
22
|
+
primaryTokenSymbol: n,
|
|
23
|
+
receiveLabel: s,
|
|
24
|
+
receiveAmount: d,
|
|
25
|
+
receiveTokenSymbol: u,
|
|
26
|
+
apyLabel: p,
|
|
27
|
+
apy: e,
|
|
28
|
+
apyLoading: f = !1,
|
|
29
|
+
curatorLabel: c,
|
|
30
|
+
curatorName: h,
|
|
31
|
+
poolLabel: b,
|
|
32
|
+
poolAddress: l
|
|
33
|
+
}) {
|
|
34
|
+
const v = y(l);
|
|
35
|
+
return /* @__PURE__ */ o(
|
|
36
|
+
z,
|
|
37
|
+
{
|
|
38
|
+
textColor: "light",
|
|
39
|
+
"data-testid": P.root,
|
|
40
|
+
children: /* @__PURE__ */ a(x, { children: [
|
|
41
|
+
/* @__PURE__ */ o(
|
|
42
|
+
r,
|
|
43
|
+
{
|
|
44
|
+
size: "sm",
|
|
45
|
+
label: i,
|
|
46
|
+
value: /* @__PURE__ */ o(
|
|
47
|
+
m,
|
|
48
|
+
{
|
|
49
|
+
amount: t,
|
|
50
|
+
symbol: n
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ o(
|
|
56
|
+
r,
|
|
57
|
+
{
|
|
58
|
+
size: "sm",
|
|
59
|
+
label: s,
|
|
60
|
+
value: /* @__PURE__ */ o(
|
|
61
|
+
m,
|
|
62
|
+
{
|
|
63
|
+
amount: d,
|
|
64
|
+
symbol: u
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
e !== void 0 ? /* @__PURE__ */ o(
|
|
70
|
+
r,
|
|
71
|
+
{
|
|
72
|
+
size: "sm",
|
|
73
|
+
label: p,
|
|
74
|
+
value: /* @__PURE__ */ o(C, { loading: f, children: e })
|
|
75
|
+
}
|
|
76
|
+
) : null,
|
|
77
|
+
/* @__PURE__ */ o(r, { size: "sm", label: c, value: h }),
|
|
78
|
+
/* @__PURE__ */ o(
|
|
79
|
+
r,
|
|
80
|
+
{
|
|
81
|
+
size: "sm",
|
|
82
|
+
label: b,
|
|
83
|
+
value: /* @__PURE__ */ o(g, { toCopy: l, children: /* @__PURE__ */ o("span", { children: v }) })
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
F as PoolOperationConfirmSummary
|
|
92
|
+
};
|
|
@@ -1,70 +1,78 @@
|
|
|
1
1
|
import { AddressAvatar as e } from "./components/AddressAvatar.js";
|
|
2
2
|
import { AddressParty as a } from "./components/AddressParty.js";
|
|
3
|
-
import { AddressRow as
|
|
4
|
-
import { AmountRow as
|
|
5
|
-
import { getAddressLabel as
|
|
3
|
+
import { AddressRow as p } from "./components/AddressRow.js";
|
|
4
|
+
import { AmountRow as m } from "./components/AmountRow.js";
|
|
5
|
+
import { getAddressLabel as f } from "./components/addressLabel.js";
|
|
6
6
|
import { CollapsibleCard as l } from "./components/CollapsibleCard.js";
|
|
7
|
-
import { SectionDivider as
|
|
8
|
-
import { TransferList as
|
|
9
|
-
import { TransferRow as
|
|
10
|
-
import { TransactionConfirmDialogTest as g } from "./confirm/dialog/constants.js";
|
|
11
|
-
import { TransactionConfirmDialogView as
|
|
12
|
-
import { useTransactionConfirmDialog as
|
|
13
|
-
import { useCalldataOperationPreview as
|
|
14
|
-
import { OperationPreviewContent as
|
|
15
|
-
import { computeTransactionExecutionSteps as
|
|
16
|
-
import { TransactionStepperTest as
|
|
17
|
-
import { HorizontalTransactionStepper as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
7
|
+
import { SectionDivider as u } from "./components/SectionDivider.js";
|
|
8
|
+
import { TransferList as c } from "./components/TransferList.js";
|
|
9
|
+
import { TransferRow as T } from "./components/TransferRow.js";
|
|
10
|
+
import { TransactionConfirmDialogTest as S, transactionConfirmDialogShellVariants as g } from "./confirm/dialog/constants.js";
|
|
11
|
+
import { TransactionConfirmDialogView as O } from "./confirm/dialog/TransactionConfirmDialogView.js";
|
|
12
|
+
import { useTransactionConfirmDialog as h } from "./confirm/dialog/useTransactionConfirmDialog.js";
|
|
13
|
+
import { useCalldataOperationPreview as A } from "./confirm/hooks/useCalldataOperationPreview.js";
|
|
14
|
+
import { OperationPreviewContent as V } from "./confirm/preview/OperationPreviewContent.js";
|
|
15
|
+
import { computeTransactionExecutionSteps as y, getTransactionExecutionStepRequirements as B } from "./confirm/stepper/computeTransactionExecutionSteps.js";
|
|
16
|
+
import { TransactionStepperTest as E } from "./confirm/stepper/constants.js";
|
|
17
|
+
import { HorizontalTransactionStepper as z } from "./confirm/stepper/HorizontalTransactionStepper.js";
|
|
18
|
+
import { useCompletedStepsInSession as H } from "./confirm/stepper/useCompletedStepsInSession.js";
|
|
19
|
+
import { PoolOperationConfirmSummaryTest as W } from "./confirm/summary/constants.js";
|
|
20
|
+
import { PoolOperationConfirmSummary as F } from "./confirm/summary/PoolOperationConfirmSummary.js";
|
|
21
|
+
import { useParsedTransaction as K } from "./hooks/useParsedTransaction.js";
|
|
22
|
+
import { OperationBody as N } from "./operations/OperationBody.js";
|
|
23
|
+
import { OperationsCard as U, hasOperationView as X } from "./operations/OperationsCard.js";
|
|
24
|
+
import { PoolDepositView as Z } from "./operations/PoolDepositView.js";
|
|
25
|
+
import { PoolRow as $ } from "./operations/PoolRow.js";
|
|
26
|
+
import { PoolWithdrawView as or } from "./operations/PoolWithdrawView.js";
|
|
27
|
+
import { PrerequisiteRow as tr } from "./prerequisites/PrerequisiteRow.js";
|
|
28
|
+
import { PrerequisitesCard as ir } from "./prerequisites/PrerequisitesCard.js";
|
|
29
|
+
import { prerequisiteDetailRenderers as nr, renderPrerequisiteDetail as mr } from "./prerequisites/prerequisiteDetails.js";
|
|
30
|
+
import { usePrerequisites as fr } from "./prerequisites/usePrerequisites.js";
|
|
31
|
+
import { BalanceChangeGroup as lr } from "./state-change/BalanceChangeGroup.js";
|
|
32
|
+
import { BalanceChangeRow as ur } from "./state-change/BalanceChangeRow.js";
|
|
33
|
+
import { PoolStateChangeCard as cr } from "./state-change/PoolStateChangeCard.js";
|
|
34
|
+
import { StateChangeCard as Tr } from "./state-change/StateChangeCard.js";
|
|
35
|
+
import { buildPoolOperationLabels as Sr } from "./utils/addressLabels.js";
|
|
36
|
+
import { resolveToken as Dr } from "./utils/poolTokenInfo.js";
|
|
34
37
|
export {
|
|
35
38
|
e as AddressAvatar,
|
|
36
39
|
a as AddressParty,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
p as AddressRow,
|
|
41
|
+
m as AmountRow,
|
|
42
|
+
lr as BalanceChangeGroup,
|
|
43
|
+
ur as BalanceChangeRow,
|
|
41
44
|
l as CollapsibleCard,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
45
|
+
z as HorizontalTransactionStepper,
|
|
46
|
+
N as OperationBody,
|
|
47
|
+
V as OperationPreviewContent,
|
|
48
|
+
U as OperationsCard,
|
|
49
|
+
Z as PoolDepositView,
|
|
50
|
+
F as PoolOperationConfirmSummary,
|
|
51
|
+
W as PoolOperationConfirmSummaryTest,
|
|
52
|
+
$ as PoolRow,
|
|
53
|
+
cr as PoolStateChangeCard,
|
|
54
|
+
or as PoolWithdrawView,
|
|
55
|
+
tr as PrerequisiteRow,
|
|
56
|
+
ir as PrerequisitesCard,
|
|
57
|
+
u as SectionDivider,
|
|
58
|
+
Tr as StateChangeCard,
|
|
59
|
+
S as TransactionConfirmDialogTest,
|
|
60
|
+
O as TransactionConfirmDialogView,
|
|
61
|
+
E as TransactionStepperTest,
|
|
62
|
+
c as TransferList,
|
|
63
|
+
T as TransferRow,
|
|
64
|
+
Sr as buildPoolOperationLabels,
|
|
65
|
+
y as computeTransactionExecutionSteps,
|
|
66
|
+
f as getAddressLabel,
|
|
67
|
+
B as getTransactionExecutionStepRequirements,
|
|
68
|
+
X as hasOperationView,
|
|
69
|
+
nr as prerequisiteDetailRenderers,
|
|
70
|
+
mr as renderPrerequisiteDetail,
|
|
71
|
+
Dr as resolveToken,
|
|
72
|
+
g as transactionConfirmDialogShellVariants,
|
|
73
|
+
A as useCalldataOperationPreview,
|
|
74
|
+
H as useCompletedStepsInSession,
|
|
75
|
+
K as useParsedTransaction,
|
|
76
|
+
fr as usePrerequisites,
|
|
77
|
+
h as useTransactionConfirmDialog
|
|
70
78
|
};
|
|
@@ -125,6 +125,7 @@ import "../../../layout/layout/layout.js";
|
|
|
125
125
|
import "../../../layout/main-aside-layout/main-aside-layout.js";
|
|
126
126
|
import "../../../page-title/page-title.js";
|
|
127
127
|
import "../../../layout/social-icons/social-icons.js";
|
|
128
|
+
import "../../../legal-agreement/legal-agreement-theme.js";
|
|
128
129
|
import "../../../link/link.js";
|
|
129
130
|
import "../../../../utils/reactochart-compat.js";
|
|
130
131
|
import "../../../status-elements/status-elements.js";
|
|
@@ -178,7 +179,7 @@ function l(o) {
|
|
|
178
179
|
return o.operation;
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function Ot({
|
|
182
183
|
sdk: o,
|
|
183
184
|
transaction: r,
|
|
184
185
|
wallet: i
|
|
@@ -186,6 +187,6 @@ function ht({
|
|
|
186
187
|
return n(r) ? /* @__PURE__ */ t(m, { value: "operations", title: l(r), children: /* @__PURE__ */ t(e, { sdk: o, operation: r, wallet: i }) }) : null;
|
|
187
188
|
}
|
|
188
189
|
export {
|
|
189
|
-
|
|
190
|
+
Ot as OperationsCard,
|
|
190
191
|
n as hasOperationView
|
|
191
192
|
};
|