@gearbox-protocol/ui-kit 3.14.0-next.14 → 3.14.0-next.15
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/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/constants.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/formatUsdAmount.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.constants.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/computeTransactionConfirmDialogLayout.cjs +1 -0
- 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/dialog/transactionConfirmPhase.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/useTransactionConfirmFlow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/execution/TransactionConfirmExecuteButton.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/execution/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/result/constants.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/result/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/TransactionProgressStepper.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/constants.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 -1
- package/dist/cjs/components/composites/tx-preview/confirm/summary/PoolOperationConfirmDetails.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/summary/constants.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/summary/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/index.cjs +1 -1
- package/dist/cjs/components/confirm-menu/confirm-menu.cjs +1 -1
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +63 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.js +52 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/constants.js +10 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/formatUsdAmount.js +21 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/index.js +9 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.js +34 -51
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.js +70 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.constants.js +6 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +79 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/computeTransactionConfirmDialogLayout.js +35 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/constants.js +10 -5
- package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +18 -7
- package/dist/esm/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.js +1 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/useTransactionConfirmFlow.js +36 -0
- package/dist/esm/components/composites/tx-preview/confirm/execution/TransactionConfirmExecuteButton.js +30 -0
- package/dist/esm/components/composites/tx-preview/confirm/execution/index.js +4 -0
- package/dist/esm/components/composites/tx-preview/confirm/index.js +60 -24
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.js +55 -0
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.js +25 -0
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.js +60 -0
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.js +21 -0
- package/dist/esm/components/composites/tx-preview/confirm/result/constants.js +24 -0
- package/dist/esm/components/composites/tx-preview/confirm/result/index.js +15 -0
- package/dist/esm/components/composites/tx-preview/confirm/stepper/TransactionProgressStepper.js +67 -0
- package/dist/esm/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.js +26 -18
- package/dist/esm/components/composites/tx-preview/confirm/stepper/constants.js +3 -3
- package/dist/esm/components/composites/tx-preview/confirm/stepper/index.js +12 -9
- package/dist/esm/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.js +37 -31
- package/dist/esm/components/composites/tx-preview/confirm/summary/PoolOperationConfirmDetails.js +65 -0
- package/dist/esm/components/composites/tx-preview/confirm/summary/constants.js +3 -3
- package/dist/esm/components/composites/tx-preview/confirm/summary/index.js +4 -4
- package/dist/esm/components/composites/tx-preview/index.js +106 -70
- package/dist/esm/components/confirm-menu/confirm-menu.js +28 -25
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.d.ts +12 -0
- package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.d.ts +15 -0
- package/dist/types/components/composites/tx-preview/confirm/amounts/constants.d.ts +6 -0
- package/dist/types/components/composites/tx-preview/confirm/amounts/formatUsdAmount.d.ts +1 -0
- package/dist/types/components/composites/tx-preview/confirm/amounts/index.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.d.ts +9 -4
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.d.ts +23 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.constants.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.d.ts +19 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/computeTransactionConfirmDialogLayout.d.ts +8 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/constants.d.ts +5 -1
- package/dist/types/components/composites/tx-preview/confirm/dialog/index.d.ts +6 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.d.ts +4 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/useTransactionConfirmFlow.d.ts +14 -0
- package/dist/types/components/composites/tx-preview/confirm/execution/TransactionConfirmExecuteButton.d.ts +6 -0
- package/dist/types/components/composites/tx-preview/confirm/execution/index.d.ts +1 -0
- package/dist/types/components/composites/tx-preview/confirm/index.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.d.ts +8 -0
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.d.ts +2 -0
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.d.ts +8 -0
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.d.ts +6 -0
- package/dist/types/components/composites/tx-preview/confirm/result/constants.d.ts +18 -0
- package/dist/types/components/composites/tx-preview/confirm/result/index.d.ts +5 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/{HorizontalTransactionStepper.d.ts → TransactionProgressStepper.d.ts} +2 -2
- package/dist/types/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.d.ts +2 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/constants.d.ts +1 -1
- package/dist/types/components/composites/tx-preview/confirm/stepper/index.d.ts +1 -1
- package/dist/types/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.d.ts +3 -1
- package/dist/types/components/composites/tx-preview/confirm/summary/PoolOperationConfirmDetails.d.ts +15 -0
- package/dist/types/components/composites/tx-preview/confirm/summary/constants.d.ts +1 -1
- package/dist/types/components/composites/tx-preview/confirm/summary/index.d.ts +1 -1
- package/dist/types/components/confirm-menu/confirm-menu.d.ts +4 -2
- package/package.json +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.cjs +0 -1
- package/dist/cjs/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.cjs +0 -1
- package/dist/esm/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.js +0 -136
- package/dist/esm/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.js +0 -92
- package/dist/types/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.d.ts +0 -18
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorLineMessage as T } from "../../../../error-message/error-line-message.js";
|
|
3
|
+
import "react-intl";
|
|
4
|
+
import "../../../../buttons/button/button.js";
|
|
5
|
+
import "../../../../dialog/dialog-container.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "@gearbox-protocol/sdk";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "tailwind-merge";
|
|
10
|
+
import "sonner";
|
|
11
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
12
|
+
import "luxon";
|
|
13
|
+
import "../../../../../utils/z-index.js";
|
|
14
|
+
import { SkeletonStack as C } from "../../../../skeleton/skeleton-stack.js";
|
|
15
|
+
import { VSpace as l } from "../../../../vspace/vspace.js";
|
|
16
|
+
import { shouldShowTransactionProgressStepper as S } from "../stepper/computeTransactionExecutionSteps.js";
|
|
17
|
+
import { TransactionProgressStepper as P } from "../stepper/TransactionProgressStepper.js";
|
|
18
|
+
import { computeTransactionConfirmDialogLayout as y } from "./computeTransactionConfirmDialogLayout.js";
|
|
19
|
+
import { TransactionConfirmDialogTest as r, transactionConfirmShellContentVariants as N } from "./constants.js";
|
|
20
|
+
function K({
|
|
21
|
+
phase: h = "confirm",
|
|
22
|
+
header: a,
|
|
23
|
+
preview: p,
|
|
24
|
+
previewLoading: d = !1,
|
|
25
|
+
previewError: m,
|
|
26
|
+
previewErrorTitle: f = "Unable to preview transaction",
|
|
27
|
+
previewClassName: u = "flex max-h-[50vh] min-w-0 flex-col gap-4 overflow-x-hidden overflow-y-auto",
|
|
28
|
+
execution: w,
|
|
29
|
+
progressSteps: i,
|
|
30
|
+
renderProgressStepLabel: n,
|
|
31
|
+
result: s,
|
|
32
|
+
className: v,
|
|
33
|
+
"data-testid": x = r.root
|
|
34
|
+
}) {
|
|
35
|
+
const g = !!(i && n && S(i)), t = y(h, g);
|
|
36
|
+
return /* @__PURE__ */ e(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: N({ className: v }),
|
|
40
|
+
"data-testid": x,
|
|
41
|
+
children: [
|
|
42
|
+
a,
|
|
43
|
+
a ? /* @__PURE__ */ o(l, { height: 16 }) : null,
|
|
44
|
+
t.showResult && s ? /* @__PURE__ */ o("div", { "data-testid": r.result, children: s }) : null,
|
|
45
|
+
t.showResult ? null : /* @__PURE__ */ e(c, { children: [
|
|
46
|
+
t.showPreview ? /* @__PURE__ */ o("div", { className: u, children: d ? /* @__PURE__ */ o(C, { lines: 3 }) : m ? /* @__PURE__ */ o(
|
|
47
|
+
T,
|
|
48
|
+
{
|
|
49
|
+
err: m,
|
|
50
|
+
title: f
|
|
51
|
+
}
|
|
52
|
+
) : p }) : null,
|
|
53
|
+
t.showPreview && t.showExecution ? /* @__PURE__ */ o(l, { height: 24 }) : null,
|
|
54
|
+
t.showExecution ? /* @__PURE__ */ o(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: "min-w-0 w-full",
|
|
58
|
+
"data-testid": r.execution,
|
|
59
|
+
children: w
|
|
60
|
+
}
|
|
61
|
+
) : null
|
|
62
|
+
] }),
|
|
63
|
+
t.showProgressStepper && i && n ? /* @__PURE__ */ e(c, { children: [
|
|
64
|
+
/* @__PURE__ */ o(l, { height: 24 }),
|
|
65
|
+
/* @__PURE__ */ o("div", { "data-testid": r.progress, children: /* @__PURE__ */ o(
|
|
66
|
+
P,
|
|
67
|
+
{
|
|
68
|
+
steps: i,
|
|
69
|
+
renderLabel: n
|
|
70
|
+
}
|
|
71
|
+
) })
|
|
72
|
+
] }) : null
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
K as TransactionConfirmShell
|
|
79
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function r(s, e) {
|
|
2
|
+
switch (s) {
|
|
3
|
+
case "confirm":
|
|
4
|
+
return {
|
|
5
|
+
showPreview: !0,
|
|
6
|
+
showExecution: !0,
|
|
7
|
+
showProgressStepper: e,
|
|
8
|
+
showResult: !1
|
|
9
|
+
};
|
|
10
|
+
case "awaiting_receipt":
|
|
11
|
+
return {
|
|
12
|
+
showPreview: !0,
|
|
13
|
+
showExecution: !0,
|
|
14
|
+
showProgressStepper: e,
|
|
15
|
+
showResult: !1
|
|
16
|
+
};
|
|
17
|
+
case "success":
|
|
18
|
+
return {
|
|
19
|
+
showPreview: !1,
|
|
20
|
+
showExecution: !1,
|
|
21
|
+
showProgressStepper: e,
|
|
22
|
+
showResult: !0
|
|
23
|
+
};
|
|
24
|
+
case "failure":
|
|
25
|
+
return {
|
|
26
|
+
showPreview: !1,
|
|
27
|
+
showExecution: !1,
|
|
28
|
+
showProgressStepper: !1,
|
|
29
|
+
showResult: !0
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
r as computeTransactionConfirmDialogLayout
|
|
35
|
+
};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { cva as o } from "class-variance-authority";
|
|
2
|
-
class
|
|
2
|
+
class r {
|
|
3
3
|
static root = "transaction-confirm-dialog-root";
|
|
4
4
|
static execution = "transaction-confirm-dialog-execution";
|
|
5
|
+
static progress = "transaction-confirm-dialog-progress";
|
|
6
|
+
static result = "transaction-confirm-dialog-result";
|
|
5
7
|
}
|
|
6
|
-
const
|
|
7
|
-
"w-full max-w-full md:w-[560px] md:max-w-[560px]"
|
|
8
|
+
const i = o(
|
|
9
|
+
"box-border w-full max-w-full md:w-[560px] md:max-w-[560px]"
|
|
10
|
+
), n = o(
|
|
11
|
+
"box-border w-full min-w-0 max-w-full"
|
|
8
12
|
);
|
|
9
13
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
r as TransactionConfirmDialogTest,
|
|
15
|
+
i as transactionConfirmDialogShellVariants,
|
|
16
|
+
n as transactionConfirmShellContentVariants
|
|
12
17
|
};
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { computeTransactionConfirmDialogLayout as n } from "./computeTransactionConfirmDialogLayout.js";
|
|
2
|
+
import { TransactionConfirmDialogTest as i, transactionConfirmDialogShellVariants as t, transactionConfirmShellContentVariants as e } from "./constants.js";
|
|
3
|
+
import { TransactionConfirmDialogView as f } from "./TransactionConfirmDialogView.js";
|
|
4
|
+
import { TransactionConfirmPageView as l } from "./TransactionConfirmPageView.js";
|
|
5
|
+
import { TransactionConfirmShell as C } from "./TransactionConfirmShell.js";
|
|
6
|
+
import { TransactionConfirmShellTest as p } from "./TransactionConfirmShell.constants.js";
|
|
7
|
+
import { useTransactionConfirmDialog as g } from "./useTransactionConfirmDialog.js";
|
|
8
|
+
import { useTransactionConfirmFlow as h } from "./useTransactionConfirmFlow.js";
|
|
4
9
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
i as TransactionConfirmDialogTest,
|
|
11
|
+
f as TransactionConfirmDialogView,
|
|
12
|
+
l as TransactionConfirmPageView,
|
|
13
|
+
C as TransactionConfirmShell,
|
|
14
|
+
p as TransactionConfirmShellTest,
|
|
15
|
+
n as computeTransactionConfirmDialogLayout,
|
|
16
|
+
t as transactionConfirmDialogShellVariants,
|
|
17
|
+
e as transactionConfirmShellContentVariants,
|
|
18
|
+
g as useTransactionConfirmDialog,
|
|
19
|
+
h as useTransactionConfirmFlow
|
|
9
20
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useState as o, useCallback as e } from "react";
|
|
2
|
+
function k() {
|
|
3
|
+
const [a, c] = o(!1), [u, s] = o("confirm"), [f, i] = o(void 0), [l, r] = o(0), t = e(() => {
|
|
4
|
+
s("confirm"), i(void 0), r(0);
|
|
5
|
+
}, []), m = e(() => {
|
|
6
|
+
t(), c(!0);
|
|
7
|
+
}, [t]), p = e(() => {
|
|
8
|
+
c(!1), t();
|
|
9
|
+
}, [t]), b = e(() => {
|
|
10
|
+
r((n) => n + 1);
|
|
11
|
+
}, []), g = e(
|
|
12
|
+
(n) => {
|
|
13
|
+
i(n), s("awaiting_receipt");
|
|
14
|
+
},
|
|
15
|
+
[]
|
|
16
|
+
), h = e(() => {
|
|
17
|
+
s("success");
|
|
18
|
+
}, []), d = e(() => {
|
|
19
|
+
s("failure");
|
|
20
|
+
}, []);
|
|
21
|
+
return {
|
|
22
|
+
open: a,
|
|
23
|
+
phase: u,
|
|
24
|
+
submittedTx: f,
|
|
25
|
+
refreshNonce: l,
|
|
26
|
+
openDialog: m,
|
|
27
|
+
closeDialog: p,
|
|
28
|
+
bumpRefreshNonce: b,
|
|
29
|
+
beginAwaitingReceipt: g,
|
|
30
|
+
markSuccess: h,
|
|
31
|
+
markFailure: d
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
k as useTransactionConfirmFlow
|
|
36
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as o, jsxs as a, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { Button as f } from "../../../../buttons/button/button.js";
|
|
3
|
+
import { SpinnerLoader as d } from "../../../../spinner-loader/spinner-loader.js";
|
|
4
|
+
import { TransactionConfirmExecuteButtonTest as u } from "../result/constants.js";
|
|
5
|
+
function B({
|
|
6
|
+
isLoading: t = !1,
|
|
7
|
+
disabled: e,
|
|
8
|
+
children: r,
|
|
9
|
+
width: n = "wide",
|
|
10
|
+
size: i = "lg",
|
|
11
|
+
...m
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ o(
|
|
14
|
+
f,
|
|
15
|
+
{
|
|
16
|
+
"data-testid": u.root,
|
|
17
|
+
width: n,
|
|
18
|
+
size: i,
|
|
19
|
+
disabled: e || t,
|
|
20
|
+
...m,
|
|
21
|
+
children: t ? /* @__PURE__ */ a(s, { children: [
|
|
22
|
+
/* @__PURE__ */ o(d, { size: 18, width: 2 }),
|
|
23
|
+
r
|
|
24
|
+
] }) : r
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
B as TransactionConfirmExecuteButton
|
|
30
|
+
};
|
|
@@ -1,26 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { TransactionConfirmAmountFieldTest as t, TransactionConfirmAmountPairTest as e } from "./amounts/constants.js";
|
|
2
|
+
import { TransactionConfirmAmountField as a } from "./amounts/TransactionConfirmAmountField.js";
|
|
3
|
+
import { TransactionConfirmAmountPair as s } from "./amounts/TransactionConfirmAmountPair.js";
|
|
4
|
+
import { computeTransactionConfirmDialogLayout as f } from "./dialog/computeTransactionConfirmDialogLayout.js";
|
|
5
|
+
import { TransactionConfirmDialogTest as c, transactionConfirmDialogShellVariants as T, transactionConfirmShellContentVariants as l } from "./dialog/constants.js";
|
|
6
|
+
import { TransactionConfirmDialogView as C } from "./dialog/TransactionConfirmDialogView.js";
|
|
7
|
+
import { TransactionConfirmPageView as S } from "./dialog/TransactionConfirmPageView.js";
|
|
8
|
+
import { TransactionConfirmShell as P } from "./dialog/TransactionConfirmShell.js";
|
|
9
|
+
import { TransactionConfirmShellTest as w } from "./dialog/TransactionConfirmShell.constants.js";
|
|
10
|
+
import { useTransactionConfirmDialog as R } from "./dialog/useTransactionConfirmDialog.js";
|
|
11
|
+
import { useTransactionConfirmFlow as F } from "./dialog/useTransactionConfirmFlow.js";
|
|
12
|
+
import { TransactionConfirmExecuteButton as E } from "./execution/TransactionConfirmExecuteButton.js";
|
|
13
|
+
import { useCalldataOperationPreview as O } from "./hooks/useCalldataOperationPreview.js";
|
|
14
|
+
import { OperationPreviewContent as v } from "./preview/OperationPreviewContent.js";
|
|
15
|
+
import { TransactionConfirmExecuteButtonTest as H, TransactionConfirmFailureResultTest as q, TransactionConfirmSuccessResultTest as y, TransactionConfirmTxHashRowTest as L } from "./result/constants.js";
|
|
16
|
+
import { TransactionConfirmFailureResult as j } from "./result/TransactionConfirmFailureResult.js";
|
|
17
|
+
import { TransactionConfirmSuccessIcon as z } from "./result/TransactionConfirmSuccessIcon.js";
|
|
18
|
+
import { TransactionConfirmSuccessResult as J } from "./result/TransactionConfirmSuccessResult.js";
|
|
19
|
+
import { TransactionConfirmTxHashRow as M } from "./result/TransactionConfirmTxHashRow.js";
|
|
20
|
+
import { computeTransactionExecutionSteps as Q, getTransactionExecutionStepRequirements as U, shouldShowTransactionProgressStepper as W } from "./stepper/computeTransactionExecutionSteps.js";
|
|
21
|
+
import { TransactionProgressStepperTest as Y } from "./stepper/constants.js";
|
|
22
|
+
import { TransactionProgressStepper as _ } from "./stepper/TransactionProgressStepper.js";
|
|
23
|
+
import { mergeCompletedStepsInSession as oo, mergeStepsSeenInSession as ro, useCompletedStepsInSession as to } from "./stepper/useCompletedStepsInSession.js";
|
|
24
|
+
import { PoolOperationConfirmDetailsTest as no } from "./summary/constants.js";
|
|
25
|
+
import { PoolOperationConfirmDetails as io } from "./summary/PoolOperationConfirmDetails.js";
|
|
12
26
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
c as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
v as OperationPreviewContent,
|
|
28
|
+
io as PoolOperationConfirmDetails,
|
|
29
|
+
no as PoolOperationConfirmDetailsTest,
|
|
30
|
+
a as TransactionConfirmAmountField,
|
|
31
|
+
t as TransactionConfirmAmountFieldTest,
|
|
32
|
+
s as TransactionConfirmAmountPair,
|
|
33
|
+
e as TransactionConfirmAmountPairTest,
|
|
34
|
+
c as TransactionConfirmDialogTest,
|
|
35
|
+
C as TransactionConfirmDialogView,
|
|
36
|
+
E as TransactionConfirmExecuteButton,
|
|
37
|
+
H as TransactionConfirmExecuteButtonTest,
|
|
38
|
+
j as TransactionConfirmFailureResult,
|
|
39
|
+
q as TransactionConfirmFailureResultTest,
|
|
40
|
+
S as TransactionConfirmPageView,
|
|
41
|
+
P as TransactionConfirmShell,
|
|
42
|
+
w as TransactionConfirmShellTest,
|
|
43
|
+
z as TransactionConfirmSuccessIcon,
|
|
44
|
+
J as TransactionConfirmSuccessResult,
|
|
45
|
+
y as TransactionConfirmSuccessResultTest,
|
|
46
|
+
M as TransactionConfirmTxHashRow,
|
|
47
|
+
L as TransactionConfirmTxHashRowTest,
|
|
48
|
+
_ as TransactionProgressStepper,
|
|
49
|
+
Y as TransactionProgressStepperTest,
|
|
50
|
+
f as computeTransactionConfirmDialogLayout,
|
|
51
|
+
Q as computeTransactionExecutionSteps,
|
|
52
|
+
U as getTransactionExecutionStepRequirements,
|
|
53
|
+
oo as mergeCompletedStepsInSession,
|
|
54
|
+
ro as mergeStepsSeenInSession,
|
|
55
|
+
W as shouldShowTransactionProgressStepper,
|
|
56
|
+
T as transactionConfirmDialogShellVariants,
|
|
57
|
+
l as transactionConfirmShellContentVariants,
|
|
58
|
+
O as useCalldataOperationPreview,
|
|
59
|
+
to as useCompletedStepsInSession,
|
|
60
|
+
R as useTransactionConfirmDialog,
|
|
61
|
+
F as useTransactionConfirmFlow
|
|
26
62
|
};
|
package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as n } from "react/jsx-runtime";
|
|
2
|
+
import { faXmark as o } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { FaIcon as c } from "../../../../icons/fa-icon.js";
|
|
4
|
+
import { VSpace as r } from "../../../../vspace/vspace.js";
|
|
5
|
+
import { TransactionConfirmFailureResultTest as a } from "./constants.js";
|
|
6
|
+
function v({
|
|
7
|
+
title: d,
|
|
8
|
+
description: m,
|
|
9
|
+
footerAction: i,
|
|
10
|
+
iconSize: t = 48
|
|
11
|
+
}) {
|
|
12
|
+
const l = t + 32;
|
|
13
|
+
return /* @__PURE__ */ s(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: "flex w-full flex-col items-center text-center",
|
|
17
|
+
"data-testid": a.root,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ e(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: "flex items-center justify-center rounded-full border-2 border-destructive bg-destructive/10",
|
|
23
|
+
style: { width: l, height: l },
|
|
24
|
+
children: /* @__PURE__ */ e(
|
|
25
|
+
c,
|
|
26
|
+
{
|
|
27
|
+
icon: o,
|
|
28
|
+
className: "text-destructive",
|
|
29
|
+
style: { width: t, height: t }
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ e(r, { height: 24 }),
|
|
35
|
+
/* @__PURE__ */ e("div", { className: "text-xl font-medium leading-tight md:text-2xl", children: d }),
|
|
36
|
+
/* @__PURE__ */ e(r, { height: 12 }),
|
|
37
|
+
/* @__PURE__ */ e("div", { className: "text-sm text-secondary-foreground", children: m }),
|
|
38
|
+
i ? /* @__PURE__ */ s(n, { children: [
|
|
39
|
+
/* @__PURE__ */ e(r, { height: 24 }),
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: "w-full",
|
|
44
|
+
"data-testid": a.footer,
|
|
45
|
+
children: i
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] }) : null
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
v as TransactionConfirmFailureResult
|
|
55
|
+
};
|
package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { faCheck as t } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { FaIcon as c } from "../../../../icons/fa-icon.js";
|
|
4
|
+
import { useIsMobile as i } from "../../../../../hooks/use-media-query.js";
|
|
5
|
+
function a() {
|
|
6
|
+
const e = i(), o = e ? 80 : 120, s = e ? 36 : 42;
|
|
7
|
+
return /* @__PURE__ */ r(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
className: "flex items-center justify-center rounded-full border-2 border-success",
|
|
11
|
+
style: { width: o, height: o },
|
|
12
|
+
children: /* @__PURE__ */ r(
|
|
13
|
+
c,
|
|
14
|
+
{
|
|
15
|
+
icon: t,
|
|
16
|
+
className: "text-success",
|
|
17
|
+
style: { width: s, height: s }
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
a as TransactionConfirmSuccessIcon
|
|
25
|
+
};
|
package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as r } from "react/jsx-runtime";
|
|
2
|
+
import { VSpace as t } from "../../../../vspace/vspace.js";
|
|
3
|
+
import { useIsMobile as u } from "../../../../../hooks/use-media-query.js";
|
|
4
|
+
import { TransactionConfirmSuccessResultTest as i } from "./constants.js";
|
|
5
|
+
import { TransactionConfirmSuccessIcon as f } from "./TransactionConfirmSuccessIcon.js";
|
|
6
|
+
function v({
|
|
7
|
+
headline: o,
|
|
8
|
+
subtitle: d,
|
|
9
|
+
txHashRow: n,
|
|
10
|
+
footerAction: a
|
|
11
|
+
}) {
|
|
12
|
+
const s = u(), m = s ? 20 : 32, h = s ? 12 : 16, c = s ? 24 : 32;
|
|
13
|
+
return /* @__PURE__ */ l(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: "flex w-full flex-col items-center text-center",
|
|
17
|
+
"data-testid": i.root,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ e(t, { height: m }),
|
|
20
|
+
/* @__PURE__ */ e(f, {}),
|
|
21
|
+
/* @__PURE__ */ e(t, { height: 24 }),
|
|
22
|
+
/* @__PURE__ */ e(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: "text-xl font-medium leading-tight md:text-2xl",
|
|
26
|
+
"data-testid": i.headline,
|
|
27
|
+
children: o
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ e(t, { height: h }),
|
|
31
|
+
/* @__PURE__ */ e(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: "text-sm text-secondary-foreground",
|
|
35
|
+
"data-testid": i.subtitle,
|
|
36
|
+
children: d
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
n ? /* @__PURE__ */ l(r, { children: [
|
|
40
|
+
/* @__PURE__ */ e(t, { height: c }),
|
|
41
|
+
/* @__PURE__ */ e("div", { className: "w-full text-center", children: n })
|
|
42
|
+
] }) : null,
|
|
43
|
+
a ? /* @__PURE__ */ l(r, { children: [
|
|
44
|
+
/* @__PURE__ */ e(t, { height: c }),
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: "w-full",
|
|
49
|
+
"data-testid": i.footer,
|
|
50
|
+
children: a
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }) : null
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
v as TransactionConfirmSuccessResult
|
|
60
|
+
};
|
package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { TransactionConfirmTxHashRowTest as t } from "./constants.js";
|
|
3
|
+
function o({
|
|
4
|
+
txHashLink: r,
|
|
5
|
+
addToWalletLink: a
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ e(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
className: "flex w-full flex-wrap items-center justify-center gap-6 sm:gap-8",
|
|
11
|
+
"data-testid": t.root,
|
|
12
|
+
children: [
|
|
13
|
+
a ? /* @__PURE__ */ i("div", { "data-testid": t.addToWallet, children: a }) : null,
|
|
14
|
+
/* @__PURE__ */ i("div", { "data-testid": t.txHashLink, children: r })
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
o as TransactionConfirmTxHashRow
|
|
21
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
class s {
|
|
2
|
+
static root = "transaction-confirm-success-result-root";
|
|
3
|
+
static headline = "transaction-confirm-success-result-headline";
|
|
4
|
+
static subtitle = "transaction-confirm-success-result-subtitle";
|
|
5
|
+
static footer = "transaction-confirm-success-result-footer";
|
|
6
|
+
}
|
|
7
|
+
class o {
|
|
8
|
+
static root = "transaction-confirm-failure-result-root";
|
|
9
|
+
static footer = "transaction-confirm-failure-result-footer";
|
|
10
|
+
}
|
|
11
|
+
class a {
|
|
12
|
+
static root = "transaction-confirm-tx-hash-row-root";
|
|
13
|
+
static txHashLink = "transaction-confirm-tx-hash-row-tx-hash-link";
|
|
14
|
+
static addToWallet = "transaction-confirm-tx-hash-row-add-to-wallet";
|
|
15
|
+
}
|
|
16
|
+
class r {
|
|
17
|
+
static root = "transaction-confirm-execute-button-root";
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
r as TransactionConfirmExecuteButtonTest,
|
|
21
|
+
o as TransactionConfirmFailureResultTest,
|
|
22
|
+
s as TransactionConfirmSuccessResultTest,
|
|
23
|
+
a as TransactionConfirmTxHashRowTest
|
|
24
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TransactionConfirmExecuteButtonTest as n, TransactionConfirmFailureResultTest as s, TransactionConfirmSuccessResultTest as t, TransactionConfirmTxHashRowTest as a } from "./constants.js";
|
|
2
|
+
import { TransactionConfirmFailureResult as i } from "./TransactionConfirmFailureResult.js";
|
|
3
|
+
import { TransactionConfirmSuccessIcon as T } from "./TransactionConfirmSuccessIcon.js";
|
|
4
|
+
import { TransactionConfirmSuccessResult as m } from "./TransactionConfirmSuccessResult.js";
|
|
5
|
+
import { TransactionConfirmTxHashRow as x } from "./TransactionConfirmTxHashRow.js";
|
|
6
|
+
export {
|
|
7
|
+
n as TransactionConfirmExecuteButtonTest,
|
|
8
|
+
i as TransactionConfirmFailureResult,
|
|
9
|
+
s as TransactionConfirmFailureResultTest,
|
|
10
|
+
T as TransactionConfirmSuccessIcon,
|
|
11
|
+
m as TransactionConfirmSuccessResult,
|
|
12
|
+
t as TransactionConfirmSuccessResultTest,
|
|
13
|
+
x as TransactionConfirmTxHashRow,
|
|
14
|
+
a as TransactionConfirmTxHashRowTest
|
|
15
|
+
};
|
package/dist/esm/components/composites/tx-preview/confirm/stepper/TransactionProgressStepper.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "@gearbox-protocol/sdk";
|
|
4
|
+
import { cn as o } 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 { TransactionProgressStepperTest as m } from "./constants.js";
|
|
10
|
+
function c({ status: t }) {
|
|
11
|
+
const a = t === "active", r = t === "completed";
|
|
12
|
+
return /* @__PURE__ */ e(
|
|
13
|
+
"span",
|
|
14
|
+
{
|
|
15
|
+
className: o(
|
|
16
|
+
"relative z-10 block size-[9px] shrink-0 rounded-full",
|
|
17
|
+
a && "bg-foreground",
|
|
18
|
+
r && "bg-gray-50",
|
|
19
|
+
!a && !r && "border border-gray-50 bg-transparent"
|
|
20
|
+
),
|
|
21
|
+
"aria-hidden": !0
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function w({
|
|
26
|
+
steps: t,
|
|
27
|
+
renderLabel: a
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ e(
|
|
30
|
+
"ol",
|
|
31
|
+
{
|
|
32
|
+
className: "m-0 flex w-full list-none p-0",
|
|
33
|
+
"data-testid": m.root,
|
|
34
|
+
children: t.map((r, n) => {
|
|
35
|
+
const l = n === t.length - 1, s = r.status === "active";
|
|
36
|
+
return /* @__PURE__ */ i(
|
|
37
|
+
"li",
|
|
38
|
+
{
|
|
39
|
+
className: "flex min-w-0 flex-1 flex-col items-center",
|
|
40
|
+
"aria-current": s ? "step" : void 0,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ i("div", { className: "flex w-full items-center", children: [
|
|
43
|
+
n > 0 ? /* @__PURE__ */ e("span", { className: "h-px min-w-0 flex-1 bg-gray-50", "aria-hidden": !0 }) : /* @__PURE__ */ e("span", { className: "min-w-0 flex-1", "aria-hidden": !0 }),
|
|
44
|
+
/* @__PURE__ */ e(c, { status: r.status }),
|
|
45
|
+
l ? /* @__PURE__ */ e("span", { className: "min-w-0 flex-1", "aria-hidden": !0 }) : /* @__PURE__ */ e("span", { className: "h-px min-w-0 flex-1 bg-gray-50", "aria-hidden": !0 })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
className: o(
|
|
51
|
+
"mt-3 max-w-full truncate px-1 text-center text-xs leading-snug",
|
|
52
|
+
s ? "font-medium text-foreground" : "font-normal text-secondary-foreground"
|
|
53
|
+
),
|
|
54
|
+
children: a(r)
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
r.id
|
|
60
|
+
);
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
w as TransactionProgressStepper
|
|
67
|
+
};
|