@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
package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("class-variance-authority"),d=require("../../../../fadeout-loading/fadeout-loading.cjs"),x=require("../../../../token-icon/token-icon.cjs");require("react");require("@gearbox-protocol/sdk");const f=require("../../../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../../../utils/z-index.cjs");const p=require("./constants.cjs"),g=require("./formatUsdAmount.cjs"),_=u.cva("flex w-full items-center justify-between bg-gray-20 px-4 py-3",{variants:{position:{primary:"rounded-t-lg",receive:"rounded-b-lg"},size:{sm:"min-h-[52px]",md:"min-h-[56px]"}},defaultVariants:{position:"primary",size:"md"}});function q({label:r,amount:s,token:n,usdPrice:o,loading:a=!1,position:c,size:m="md"}){const i=o!==void 0?g.formatUsdAmount(s,o):null,t=n?.symbol??n?.title??"",l=s||"0";return e.jsxs("div",{className:f.cn(_({position:c,size:m})),"data-testid":p.TransactionConfirmAmountFieldTest.root,children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:r}),e.jsxs("div",{className:"flex flex-col items-end gap-0.5",children:[e.jsx(d.FadeoutLoading,{loading:a,children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm font-medium text-foreground",children:[n?e.jsx(x.TokenIcon,{symbol:t,size:16}):null,e.jsxs("span",{children:[l,t?` ${t}`:""]})]})}),i?e.jsx("span",{className:"text-xs leading-[130%] text-secondary-foreground",children:i}):null]})]})}exports.TransactionConfirmAmountField=q;
|
package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("./constants.cjs"),e=require("./TransactionConfirmAmountField.cjs");function d({primaryLabel:i,primaryAmount:r,primaryToken:s,primaryUsdPrice:a,receiveLabel:m,receiveAmount:c,receiveToken:u,receiveUsdPrice:l,loading:o=!1,size:t="md"}){return n.jsxs("div",{className:"mb-4 flex flex-col gap-px","data-testid":f.TransactionConfirmAmountPairTest.root,children:[n.jsx(e.TransactionConfirmAmountField,{label:i,amount:r,token:s,usdPrice:a,loading:o,position:"primary",size:t}),n.jsx(e.TransactionConfirmAmountField,{label:m,amount:c,token:u,usdPrice:l,loading:o,position:"receive",size:t})]})}exports.TransactionConfirmAmountPair=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{static root="transaction-confirm-amount-field-root"}class n{static root="transaction-confirm-amount-pair-root"}exports.TransactionConfirmAmountFieldTest=o;exports.TransactionConfirmAmountPairTest=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(o,r){if(!r)return null;const t=Number.parseFloat(o.replace(",",".")||"0");if(!Number.isFinite(t)||t===0)return null;const n=t*r,e=Math.abs(n)<100;try{return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:e?2:0,maximumFractionDigits:e?2:0}).format(n)}catch{return"$0"}}exports.formatUsdAmount=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./constants.cjs"),o=require("./TransactionConfirmAmountField.cjs"),t=require("./TransactionConfirmAmountPair.cjs");exports.TransactionConfirmAmountFieldTest=n.TransactionConfirmAmountFieldTest;exports.TransactionConfirmAmountPairTest=n.TransactionConfirmAmountPairTest;exports.TransactionConfirmAmountField=o.TransactionConfirmAmountField;exports.TransactionConfirmAmountPair=t.TransactionConfirmAmountPair;
|
package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("../../../../modal/modal.cjs"),_=require("./TransactionConfirmPageView.cjs");function x({open:e,onClose:i,phase:o="confirm",title:r,titleAddon:t,preview:a,previewLoading:s=!1,previewError:c,previewErrorTitle:l="Unable to preview transaction",execution:m,progressSteps:u,renderProgressStepLabel:f,result:d,hideTitleAddonOnResult:g=!0}){return e?n.jsx(w.Modal,{show:e,onClickOutside:i,zIndexLayer:"MODAL",children:n.jsx(_.TransactionConfirmPageView,{phase:o,onClose:i,title:r,titleAddon:t,preview:a,previewLoading:s,previewError:c,previewErrorTitle:l,execution:m,progressSteps:u,renderProgressStepLabel:f,result:d,hideTitleAddonOnResult:g})}):null}exports.TransactionConfirmDialogView=x;
|
package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),v=require("../../../../client-adapters/styled-dialog-container/styled-dialog-container.cjs"),w=require("../../../../confirm-menu/confirm-menu.cjs");require("react");require("@gearbox-protocol/sdk");const x=require("../../../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../../../utils/z-index.cjs");const i=require("./constants.cjs"),S=require("./TransactionConfirmShell.cjs");function j({onClose:r,phase:e="confirm",title:o,titleAddon:t,preview:a,previewLoading:s=!1,previewError:c,previewErrorTitle:l="Unable to preview transaction",previewClassName:u,execution:m,progressSteps:d,renderProgressStepLabel:_,result:f,hideTitleAddonOnResult:g=!0,containerClassName:q,containerTestId:C,shellTestId:p}){const T=e!=="confirm"&&e!=="awaiting_receipt"&&g?void 0:t;return n.jsx(v.StyledDialogContainer,{className:x.cn(i.transactionConfirmDialogShellVariants(),q),"data-testid":C,children:n.jsx(S.TransactionConfirmShell,{phase:e,header:n.jsx(w.ConfirmMenu,{title:o,titleAddon:T,onClose:r}),preview:a,previewLoading:s,previewError:c,previewErrorTitle:l,previewClassName:u,execution:m,progressSteps:d,renderProgressStepLabel:_,result:f,"data-testid":p??i.TransactionConfirmDialogTest.root})})}exports.TransactionConfirmPageView=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("../../../../error-message/error-line-message.cjs");require("react-intl");require("../../../../buttons/button/button.cjs");require("../../../../dialog/dialog-container.cjs");require("react");require("@gearbox-protocol/sdk");require("clsx");require("tailwind-merge");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../../../utils/z-index.cjs");const q=require("../../../../skeleton/skeleton-stack.cjs"),s=require("../../../../vspace/vspace.cjs"),w=require("../stepper/computeTransactionExecutionSteps.cjs"),v=require("../stepper/TransactionProgressStepper.cjs"),T=require("./computeTransactionConfirmDialogLayout.cjs"),n=require("./constants.cjs");function j({phase:l="confirm",header:i,preview:u,previewLoading:m=!1,previewError:a,previewErrorTitle:p="Unable to preview transaction",previewClassName:h="flex max-h-[50vh] min-w-0 flex-col gap-4 overflow-x-hidden overflow-y-auto",execution:d,progressSteps:t,renderProgressStepLabel:r,result:c,className:x,"data-testid":_=n.TransactionConfirmDialogTest.root}){const f=!!(t&&r&&w.shouldShowTransactionProgressStepper(t)),o=T.computeTransactionConfirmDialogLayout(l,f);return e.jsxs("div",{className:n.transactionConfirmShellContentVariants({className:x}),"data-testid":_,children:[i,i?e.jsx(s.VSpace,{height:16}):null,o.showResult&&c?e.jsx("div",{"data-testid":n.TransactionConfirmDialogTest.result,children:c}):null,o.showResult?null:e.jsxs(e.Fragment,{children:[o.showPreview?e.jsx("div",{className:h,children:m?e.jsx(q.SkeletonStack,{lines:3}):a?e.jsx(g.ErrorLineMessage,{err:a,title:p}):u}):null,o.showPreview&&o.showExecution?e.jsx(s.VSpace,{height:24}):null,o.showExecution?e.jsx("div",{className:"min-w-0 w-full","data-testid":n.TransactionConfirmDialogTest.execution,children:d}):null]}),o.showProgressStepper&&t&&r?e.jsxs(e.Fragment,{children:[e.jsx(s.VSpace,{height:24}),e.jsx("div",{"data-testid":n.TransactionConfirmDialogTest.progress,children:e.jsx(v.TransactionProgressStepper,{steps:t,renderLabel:r})})]}):null]})}exports.TransactionConfirmShell=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{static root="transaction-confirm-shell-root"}exports.TransactionConfirmShellTest=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(s,e){switch(s){case"confirm":return{showPreview:!0,showExecution:!0,showProgressStepper:e,showResult:!1};case"awaiting_receipt":return{showPreview:!0,showExecution:!0,showProgressStepper:e,showResult:!1};case"success":return{showPreview:!1,showExecution:!1,showProgressStepper:e,showResult:!0};case"failure":return{showPreview:!1,showExecution:!1,showProgressStepper:!1,showResult:!0}}}exports.computeTransactionConfirmDialogLayout=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("class-variance-authority");class a{static root="transaction-confirm-dialog-root";static execution="transaction-confirm-dialog-execution";static progress="transaction-confirm-dialog-progress";static result="transaction-confirm-dialog-result"}const o=t.cva("box-border w-full max-w-full md:w-[560px] md:max-w-[560px]"),n=t.cva("box-border w-full min-w-0 max-w-full");exports.TransactionConfirmDialogTest=a;exports.transactionConfirmDialogShellVariants=o;exports.transactionConfirmShellContentVariants=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./constants.cjs"),i=require("./TransactionConfirmDialogView.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./computeTransactionConfirmDialogLayout.cjs"),o=require("./constants.cjs"),i=require("./TransactionConfirmDialogView.cjs"),r=require("./TransactionConfirmPageView.cjs"),a=require("./TransactionConfirmShell.cjs"),t=require("./TransactionConfirmShell.constants.cjs"),e=require("./useTransactionConfirmDialog.cjs"),s=require("./useTransactionConfirmFlow.cjs");exports.computeTransactionConfirmDialogLayout=n.computeTransactionConfirmDialogLayout;exports.TransactionConfirmDialogTest=o.TransactionConfirmDialogTest;exports.transactionConfirmDialogShellVariants=o.transactionConfirmDialogShellVariants;exports.transactionConfirmShellContentVariants=o.transactionConfirmShellContentVariants;exports.TransactionConfirmDialogView=i.TransactionConfirmDialogView;exports.TransactionConfirmPageView=r.TransactionConfirmPageView;exports.TransactionConfirmShell=a.TransactionConfirmShell;exports.TransactionConfirmShellTest=t.TransactionConfirmShellTest;exports.useTransactionConfirmDialog=e.useTransactionConfirmDialog;exports.useTransactionConfirmFlow=s.useTransactionConfirmFlow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/cjs/components/composites/tx-preview/confirm/dialog/useTransactionConfirmFlow.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");function S(){const[l,c]=e.useState(!1),[u,s]=e.useState("confirm"),[i,o]=e.useState(void 0),[r,n]=e.useState(0),t=e.useCallback(()=>{s("confirm"),o(void 0),n(0)},[]),b=e.useCallback(()=>{t(),c(!0)},[t]),f=e.useCallback(()=>{c(!1),t()},[t]),m=e.useCallback(()=>{n(a=>a+1)},[]),k=e.useCallback(a=>{o(a),s("awaiting_receipt")},[]),C=e.useCallback(()=>{s("success")},[]),p=e.useCallback(()=>{s("failure")},[]);return{open:l,phase:u,submittedTx:i,refreshNonce:r,openDialog:b,closeDialog:f,bumpRefreshNonce:m,beginAwaitingReceipt:k,markSuccess:C,markFailure:p}}exports.useTransactionConfirmFlow=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("../../../../buttons/button/button.cjs"),c=require("../../../../spinner-loader/spinner-loader.cjs"),a=require("../result/constants.cjs");function d({isLoading:e=!1,disabled:o,children:n,width:r="wide",size:s="lg",...i}){return t.jsx(u.Button,{"data-testid":a.TransactionConfirmExecuteButtonTest.root,width:r,size:s,disabled:o||e,...i,children:e?t.jsxs(t.Fragment,{children:[t.jsx(c.SpinnerLoader,{size:18,width:2}),n]}):n})}exports.TransactionConfirmExecuteButton=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./TransactionConfirmExecuteButton.cjs");exports.TransactionConfirmExecuteButton=t.TransactionConfirmExecuteButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./amounts/constants.cjs"),s=require("./amounts/TransactionConfirmAmountField.cjs"),r=require("./amounts/TransactionConfirmAmountPair.cjs"),a=require("./dialog/computeTransactionConfirmDialogLayout.cjs"),n=require("./dialog/constants.cjs"),c=require("./dialog/TransactionConfirmDialogView.cjs"),m=require("./dialog/TransactionConfirmPageView.cjs"),_=require("./dialog/TransactionConfirmShell.cjs"),u=require("./dialog/TransactionConfirmShell.constants.cjs"),p=require("./dialog/useTransactionConfirmDialog.cjs"),l=require("./dialog/useTransactionConfirmFlow.cjs"),T=require("./execution/TransactionConfirmExecuteButton.cjs"),f=require("./hooks/useCalldataOperationPreview.cjs"),C=require("./preview/OperationPreviewContent.cjs"),o=require("./result/constants.cjs"),P=require("./result/TransactionConfirmFailureResult.cjs"),S=require("./result/TransactionConfirmSuccessIcon.cjs"),w=require("./result/TransactionConfirmSuccessResult.cjs"),x=require("./result/TransactionConfirmTxHashRow.cjs"),e=require("./stepper/computeTransactionExecutionSteps.cjs"),g=require("./stepper/constants.cjs"),v=require("./stepper/TransactionProgressStepper.cjs"),t=require("./stepper/useCompletedStepsInSession.cjs"),q=require("./summary/constants.cjs"),d=require("./summary/PoolOperationConfirmDetails.cjs");exports.TransactionConfirmAmountFieldTest=i.TransactionConfirmAmountFieldTest;exports.TransactionConfirmAmountPairTest=i.TransactionConfirmAmountPairTest;exports.TransactionConfirmAmountField=s.TransactionConfirmAmountField;exports.TransactionConfirmAmountPair=r.TransactionConfirmAmountPair;exports.computeTransactionConfirmDialogLayout=a.computeTransactionConfirmDialogLayout;exports.TransactionConfirmDialogTest=n.TransactionConfirmDialogTest;exports.transactionConfirmDialogShellVariants=n.transactionConfirmDialogShellVariants;exports.transactionConfirmShellContentVariants=n.transactionConfirmShellContentVariants;exports.TransactionConfirmDialogView=c.TransactionConfirmDialogView;exports.TransactionConfirmPageView=m.TransactionConfirmPageView;exports.TransactionConfirmShell=_.TransactionConfirmShell;exports.TransactionConfirmShellTest=u.TransactionConfirmShellTest;exports.useTransactionConfirmDialog=p.useTransactionConfirmDialog;exports.useTransactionConfirmFlow=l.useTransactionConfirmFlow;exports.TransactionConfirmExecuteButton=T.TransactionConfirmExecuteButton;exports.useCalldataOperationPreview=f.useCalldataOperationPreview;exports.OperationPreviewContent=C.OperationPreviewContent;exports.TransactionConfirmExecuteButtonTest=o.TransactionConfirmExecuteButtonTest;exports.TransactionConfirmFailureResultTest=o.TransactionConfirmFailureResultTest;exports.TransactionConfirmSuccessResultTest=o.TransactionConfirmSuccessResultTest;exports.TransactionConfirmTxHashRowTest=o.TransactionConfirmTxHashRowTest;exports.TransactionConfirmFailureResult=P.TransactionConfirmFailureResult;exports.TransactionConfirmSuccessIcon=S.TransactionConfirmSuccessIcon;exports.TransactionConfirmSuccessResult=w.TransactionConfirmSuccessResult;exports.TransactionConfirmTxHashRow=x.TransactionConfirmTxHashRow;exports.computeTransactionExecutionSteps=e.computeTransactionExecutionSteps;exports.getTransactionExecutionStepRequirements=e.getTransactionExecutionStepRequirements;exports.shouldShowTransactionProgressStepper=e.shouldShowTransactionProgressStepper;exports.TransactionProgressStepperTest=g.TransactionProgressStepperTest;exports.TransactionProgressStepper=v.TransactionProgressStepper;exports.mergeCompletedStepsInSession=t.mergeCompletedStepsInSession;exports.mergeStepsSeenInSession=t.mergeStepsSeenInSession;exports.useCompletedStepsInSession=t.useCompletedStepsInSession;exports.PoolOperationConfirmDetailsTest=q.PoolOperationConfirmDetailsTest;exports.PoolOperationConfirmDetails=d.PoolOperationConfirmDetails;
|
package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@fortawesome/free-solid-svg-icons"),o=require("../../../../icons/fa-icon.cjs"),s=require("../../../../vspace/vspace.cjs"),n=require("./constants.cjs");function d({title:c,description:a,footerAction:r,iconSize:t=48}){const i=t+32;return e.jsxs("div",{className:"flex w-full flex-col items-center text-center","data-testid":n.TransactionConfirmFailureResultTest.root,children:[e.jsx("div",{className:"flex items-center justify-center rounded-full border-2 border-destructive bg-destructive/10",style:{width:i,height:i},children:e.jsx(o.FaIcon,{icon:l.faXmark,className:"text-destructive",style:{width:t,height:t}})}),e.jsx(s.VSpace,{height:24}),e.jsx("div",{className:"text-xl font-medium leading-tight md:text-2xl",children:c}),e.jsx(s.VSpace,{height:12}),e.jsx("div",{className:"text-sm text-secondary-foreground",children:a}),r?e.jsxs(e.Fragment,{children:[e.jsx(s.VSpace,{height:24}),e.jsx("div",{className:"w-full","data-testid":n.TransactionConfirmFailureResultTest.footer,children:r})]}):null]})}exports.TransactionConfirmFailureResult=d;
|
package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("@fortawesome/free-solid-svg-icons"),i=require("../../../../icons/fa-icon.cjs"),t=require("../../../../../hooks/use-media-query.cjs");function r(){const e=t.useIsMobile(),s=e?80:120,c=e?36:42;return o.jsx("div",{className:"flex items-center justify-center rounded-full border-2 border-success",style:{width:s,height:s},children:o.jsx(i.FaIcon,{icon:n.faCheck,className:"text-success",style:{width:c,height:c}})})}exports.TransactionConfirmSuccessIcon=r;
|
package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("../../../../vspace/vspace.cjs"),d=require("../../../../../hooks/use-media-query.cjs"),t=require("./constants.cjs"),m=require("./TransactionConfirmSuccessIcon.cjs");function x({headline:a,subtitle:r,txHashRow:c,footerAction:i}){const n=d.useIsMobile(),l=n?20:32,u=n?12:16,o=n?24:32;return e.jsxs("div",{className:"flex w-full flex-col items-center text-center","data-testid":t.TransactionConfirmSuccessResultTest.root,children:[e.jsx(s.VSpace,{height:l}),e.jsx(m.TransactionConfirmSuccessIcon,{}),e.jsx(s.VSpace,{height:24}),e.jsx("div",{className:"text-xl font-medium leading-tight md:text-2xl","data-testid":t.TransactionConfirmSuccessResultTest.headline,children:a}),e.jsx(s.VSpace,{height:u}),e.jsx("div",{className:"text-sm text-secondary-foreground","data-testid":t.TransactionConfirmSuccessResultTest.subtitle,children:r}),c?e.jsxs(e.Fragment,{children:[e.jsx(s.VSpace,{height:o}),e.jsx("div",{className:"w-full text-center",children:c})]}):null,i?e.jsxs(e.Fragment,{children:[e.jsx(s.VSpace,{height:o}),e.jsx("div",{className:"w-full","data-testid":t.TransactionConfirmSuccessResultTest.footer,children:i})]}):null]})}exports.TransactionConfirmSuccessResult=x;
|
package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("./constants.cjs");function i({txHashLink:n,addToWalletLink:e}){return t.jsxs("div",{className:"flex w-full flex-wrap items-center justify-center gap-6 sm:gap-8","data-testid":s.TransactionConfirmTxHashRowTest.root,children:[e?t.jsx("div",{"data-testid":s.TransactionConfirmTxHashRowTest.addToWallet,children:e}):null,t.jsx("div",{"data-testid":s.TransactionConfirmTxHashRowTest.txHashLink,children:n})]})}exports.TransactionConfirmTxHashRow=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{static root="transaction-confirm-success-result-root";static headline="transaction-confirm-success-result-headline";static subtitle="transaction-confirm-success-result-subtitle";static footer="transaction-confirm-success-result-footer"}class o{static root="transaction-confirm-failure-result-root";static footer="transaction-confirm-failure-result-footer"}class a{static root="transaction-confirm-tx-hash-row-root";static txHashLink="transaction-confirm-tx-hash-row-tx-hash-link";static addToWallet="transaction-confirm-tx-hash-row-add-to-wallet"}class r{static root="transaction-confirm-execute-button-root"}exports.TransactionConfirmExecuteButtonTest=r;exports.TransactionConfirmFailureResultTest=o;exports.TransactionConfirmSuccessResultTest=s;exports.TransactionConfirmTxHashRowTest=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./constants.cjs"),s=require("./TransactionConfirmFailureResult.cjs"),o=require("./TransactionConfirmSuccessIcon.cjs"),e=require("./TransactionConfirmSuccessResult.cjs"),t=require("./TransactionConfirmTxHashRow.cjs");exports.TransactionConfirmExecuteButtonTest=n.TransactionConfirmExecuteButtonTest;exports.TransactionConfirmFailureResultTest=n.TransactionConfirmFailureResultTest;exports.TransactionConfirmSuccessResultTest=n.TransactionConfirmSuccessResultTest;exports.TransactionConfirmTxHashRowTest=n.TransactionConfirmTxHashRowTest;exports.TransactionConfirmFailureResult=s.TransactionConfirmFailureResult;exports.TransactionConfirmSuccessIcon=o.TransactionConfirmSuccessIcon;exports.TransactionConfirmSuccessResult=e.TransactionConfirmSuccessResult;exports.TransactionConfirmTxHashRow=t.TransactionConfirmTxHashRow;
|
package/dist/cjs/components/composites/tx-preview/confirm/stepper/TransactionProgressStepper.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk");const i=require("../../../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../../../utils/z-index.cjs");const c=require("./constants.cjs");function l({status:s}){const t=s==="active",r=s==="completed";return e.jsx("span",{className:i.cn("relative z-10 block size-[9px] shrink-0 rounded-full",t&&"bg-foreground",r&&"bg-gray-50",!t&&!r&&"border border-gray-50 bg-transparent"),"aria-hidden":!0})}function u({steps:s,renderLabel:t}){return e.jsx("ol",{className:"m-0 flex w-full list-none p-0","data-testid":c.TransactionProgressStepperTest.root,children:s.map((r,n)=>{const o=n===s.length-1,a=r.status==="active";return e.jsxs("li",{className:"flex min-w-0 flex-1 flex-col items-center","aria-current":a?"step":void 0,children:[e.jsxs("div",{className:"flex w-full items-center",children:[n>0?e.jsx("span",{className:"h-px min-w-0 flex-1 bg-gray-50","aria-hidden":!0}):e.jsx("span",{className:"min-w-0 flex-1","aria-hidden":!0}),e.jsx(l,{status:r.status}),o?e.jsx("span",{className:"min-w-0 flex-1","aria-hidden":!0}):e.jsx("span",{className:"h-px min-w-0 flex-1 bg-gray-50","aria-hidden":!0})]}),e.jsx("span",{className:i.cn("mt-3 max-w-full truncate px-1 text-center text-xs leading-snug",a?"font-medium text-foreground":"font-normal text-secondary-foreground"),children:t(r)})]},r.id)})})}exports.TransactionProgressStepper=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(e){return{approve:!e.allowWalletBatching&&(e.needsApproval||e.isApprovalPending),auth:!e.isAuthReady}}function f(e){return!e.allowWalletBatching&&(e.isApprovalPending||e.needsApproval)}function c(e,t){return u(t)[e]}function a(e,t){return t.completedStepsInSession?.includes(e)??!1}function i(e,t){return c(e,t)||a(e,t)}function S(e){const t=[];return i("approve",e)&&t.push("approve"),i("auth",e)&&t.push("auth"),t.push("execute"),t}function d(e,t){return e.isCorrectChain?f(e)?"approve":c("auth",e)?"auth":"execute":t[0]??"execute"}function h(e,t,r,o){const n=o.indexOf(r);return o.indexOf(e)<n?!0:e==="execute"?!1:!!(a(e,t)&&!c(e,t))}function v(e,t){return e==="approve"&&t.allowWalletBatching?"approveBatch":e==="auth"?"auth":e}function s(e){return e.some(t=>t.id!=="execute")}function m(e){const t=S(e),r=d(e,t),o=t.map(n=>{const l=h(n,e,r,t)?"completed":n===r?"active":"upcoming";return{id:n,labelKey:v(n,e),status:l}});return{steps:o,activeStepId:r,showProgressStepper:s(o)}}exports.computeTransactionExecutionSteps=m;exports.getTransactionExecutionStepRequirements=u;exports.shouldShowTransactionProgressStepper=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{static root="transaction-stepper-root"}exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{static root="transaction-progress-stepper-root"}exports.TransactionProgressStepperTest=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./computeTransactionExecutionSteps.cjs"),t=require("./constants.cjs"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./computeTransactionExecutionSteps.cjs"),t=require("./constants.cjs"),o=require("./TransactionProgressStepper.cjs"),s=require("./useCompletedStepsInSession.cjs");exports.computeTransactionExecutionSteps=e.computeTransactionExecutionSteps;exports.getTransactionExecutionStepRequirements=e.getTransactionExecutionStepRequirements;exports.shouldShowTransactionProgressStepper=e.shouldShowTransactionProgressStepper;exports.TransactionProgressStepperTest=t.TransactionProgressStepperTest;exports.TransactionProgressStepper=o.TransactionProgressStepper;exports.mergeCompletedStepsInSession=s.mergeCompletedStepsInSession;exports.mergeStepsSeenInSession=s.mergeStepsSeenInSession;exports.useCompletedStepsInSession=s.useCompletedStepsInSession;
|
package/dist/cjs/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),m=require("./computeTransactionExecutionSteps.cjs");function i(e,n){const t=new Set(e);return n.approve&&t.add("approve"),n.auth&&t.add("auth"),[...t]}function c(e,n,t){const o=new Set(e);return n.includes("approve")&&!t.approve&&o.add("approve"),n.includes("auth")&&!t.auth&&o.add("auth"),[...o]}function l({sessionActive:e,needsApproval:n,isApprovalPending:t=!1,allowWalletBatching:o,isAuthReady:d}){const[u,S]=p.useState([]),[f,a]=p.useState([]),s=m.getTransactionExecutionStepRequirements({needsApproval:n,isApprovalPending:t,allowWalletBatching:o,isAuthReady:d});return p.useEffect(()=>{if(!e){S([]),a([]);return}S(r=>i(r,s))},[e,s.approve,s.auth]),p.useEffect(()=>{e&&a(r=>c(r,u,s))},[e,u,s.approve,s.auth]),f}exports.mergeCompletedStepsInSession=c;exports.mergeStepsSeenInSession=i;exports.useCompletedStepsInSession=l;
|
package/dist/cjs/components/composites/tx-preview/confirm/summary/PoolOperationConfirmDetails.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),_=require("../../../../fadeout-loading/fadeout-loading.cjs"),p=require("../../../../tip-card/tip-card.cjs"),t=require("../../../../vertical-indicator/vertical-indicator.cjs"),v=require("../../../../vertical-list/vertical-list.cjs"),x=require("./constants.cjs");function j({apyLabel:o,apy:i,apyLoading:r=!1,poolTvlLabel:a,poolTvl:s,poolUtilizationLabel:n,poolUtilization:l,curatorLabel:c,curatorValue:d,poolLabel:u,poolContractValue:m}){return e.jsx(p.TipCard,{textColor:"light","data-testid":x.PoolOperationConfirmDetailsTest.root,children:e.jsxs(v.VerticalList,{children:[i!==void 0?e.jsx(t.VerticalIndicator,{size:"sm",label:o,value:e.jsx(_.FadeoutLoading,{loading:r,children:i})}):null,e.jsx(t.VerticalIndicator,{size:"sm",label:a,value:s}),e.jsx(t.VerticalIndicator,{size:"sm",label:n,value:l}),e.jsx(t.VerticalIndicator,{size:"sm",label:c,value:d}),e.jsx(t.VerticalIndicator,{size:"sm",label:u,value:m})]})})}exports.PoolOperationConfirmDetails=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{static root="pool-operation-confirm-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{static root="pool-operation-confirm-details-root"}exports.PoolOperationConfirmDetailsTest=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./constants.cjs"),e=require("./PoolOperationConfirmDetails.cjs");exports.PoolOperationConfirmDetailsTest=o.PoolOperationConfirmDetailsTest;exports.PoolOperationConfirmDetails=e.PoolOperationConfirmDetails;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./components/AddressAvatar.cjs"),c=require("./components/AddressParty.cjs"),m=require("./components/AddressRow.cjs"),_=require("./components/AmountRow.cjs"),p=require("./components/addressLabel.cjs"),u=require("./components/CollapsibleCard.cjs"),l=require("./components/SectionDivider.cjs"),C=require("./components/TransferList.cjs"),P=require("./components/TransferRow.cjs"),s=require("./confirm/amounts/constants.cjs"),T=require("./confirm/amounts/TransactionConfirmAmountField.cjs"),w=require("./confirm/amounts/TransactionConfirmAmountPair.cjs"),f=require("./confirm/dialog/computeTransactionConfirmDialogLayout.cjs"),o=require("./confirm/dialog/constants.cjs"),d=require("./confirm/dialog/TransactionConfirmDialogView.cjs"),q=require("./confirm/dialog/TransactionConfirmPageView.cjs"),v=require("./confirm/dialog/TransactionConfirmShell.cjs"),x=require("./confirm/dialog/TransactionConfirmShell.constants.cjs"),S=require("./confirm/dialog/useTransactionConfirmDialog.cjs"),g=require("./confirm/dialog/useTransactionConfirmFlow.cjs"),h=require("./confirm/execution/TransactionConfirmExecuteButton.cjs"),R=require("./confirm/hooks/useCalldataOperationPreview.cjs"),D=require("./confirm/preview/OperationPreviewContent.cjs"),e=require("./confirm/result/constants.cjs"),A=require("./confirm/result/TransactionConfirmFailureResult.cjs"),O=require("./confirm/result/TransactionConfirmSuccessIcon.cjs"),V=require("./confirm/result/TransactionConfirmSuccessResult.cjs"),B=require("./confirm/result/TransactionConfirmTxHashRow.cjs"),n=require("./confirm/stepper/computeTransactionExecutionSteps.cjs"),b=require("./confirm/stepper/constants.cjs"),y=require("./confirm/stepper/TransactionProgressStepper.cjs"),t=require("./confirm/stepper/useCompletedStepsInSession.cjs"),F=require("./confirm/summary/constants.cjs"),L=require("./confirm/summary/PoolOperationConfirmDetails.cjs"),I=require("./hooks/useParsedTransaction.cjs"),E=require("./operations/OperationBody.cjs"),r=require("./operations/OperationsCard.cjs"),k=require("./operations/PoolDepositView.cjs"),H=require("./operations/PoolRow.cjs"),G=require("./operations/PoolWithdrawView.cjs"),W=require("./prerequisites/PrerequisiteRow.cjs"),j=require("./prerequisites/PrerequisitesCard.cjs"),i=require("./prerequisites/prerequisiteDetails.cjs"),M=require("./prerequisites/usePrerequisites.cjs"),z=require("./state-change/BalanceChangeGroup.cjs"),J=require("./state-change/BalanceChangeRow.cjs"),K=require("./state-change/PoolStateChangeCard.cjs"),N=require("./state-change/StateChangeCard.cjs"),Q=require("./utils/addressLabels.cjs"),U=require("./utils/poolTokenInfo.cjs");exports.AddressAvatar=a.AddressAvatar;exports.AddressParty=c.AddressParty;exports.AddressRow=m.AddressRow;exports.AmountRow=_.AmountRow;exports.getAddressLabel=p.getAddressLabel;exports.CollapsibleCard=u.CollapsibleCard;exports.SectionDivider=l.SectionDivider;exports.TransferList=C.TransferList;exports.TransferRow=P.TransferRow;exports.TransactionConfirmAmountFieldTest=s.TransactionConfirmAmountFieldTest;exports.TransactionConfirmAmountPairTest=s.TransactionConfirmAmountPairTest;exports.TransactionConfirmAmountField=T.TransactionConfirmAmountField;exports.TransactionConfirmAmountPair=w.TransactionConfirmAmountPair;exports.computeTransactionConfirmDialogLayout=f.computeTransactionConfirmDialogLayout;exports.TransactionConfirmDialogTest=o.TransactionConfirmDialogTest;exports.transactionConfirmDialogShellVariants=o.transactionConfirmDialogShellVariants;exports.transactionConfirmShellContentVariants=o.transactionConfirmShellContentVariants;exports.TransactionConfirmDialogView=d.TransactionConfirmDialogView;exports.TransactionConfirmPageView=q.TransactionConfirmPageView;exports.TransactionConfirmShell=v.TransactionConfirmShell;exports.TransactionConfirmShellTest=x.TransactionConfirmShellTest;exports.useTransactionConfirmDialog=S.useTransactionConfirmDialog;exports.useTransactionConfirmFlow=g.useTransactionConfirmFlow;exports.TransactionConfirmExecuteButton=h.TransactionConfirmExecuteButton;exports.useCalldataOperationPreview=R.useCalldataOperationPreview;exports.OperationPreviewContent=D.OperationPreviewContent;exports.TransactionConfirmExecuteButtonTest=e.TransactionConfirmExecuteButtonTest;exports.TransactionConfirmFailureResultTest=e.TransactionConfirmFailureResultTest;exports.TransactionConfirmSuccessResultTest=e.TransactionConfirmSuccessResultTest;exports.TransactionConfirmTxHashRowTest=e.TransactionConfirmTxHashRowTest;exports.TransactionConfirmFailureResult=A.TransactionConfirmFailureResult;exports.TransactionConfirmSuccessIcon=O.TransactionConfirmSuccessIcon;exports.TransactionConfirmSuccessResult=V.TransactionConfirmSuccessResult;exports.TransactionConfirmTxHashRow=B.TransactionConfirmTxHashRow;exports.computeTransactionExecutionSteps=n.computeTransactionExecutionSteps;exports.getTransactionExecutionStepRequirements=n.getTransactionExecutionStepRequirements;exports.shouldShowTransactionProgressStepper=n.shouldShowTransactionProgressStepper;exports.TransactionProgressStepperTest=b.TransactionProgressStepperTest;exports.TransactionProgressStepper=y.TransactionProgressStepper;exports.mergeCompletedStepsInSession=t.mergeCompletedStepsInSession;exports.mergeStepsSeenInSession=t.mergeStepsSeenInSession;exports.useCompletedStepsInSession=t.useCompletedStepsInSession;exports.PoolOperationConfirmDetailsTest=F.PoolOperationConfirmDetailsTest;exports.PoolOperationConfirmDetails=L.PoolOperationConfirmDetails;exports.useParsedTransaction=I.useParsedTransaction;exports.OperationBody=E.OperationBody;exports.OperationsCard=r.OperationsCard;exports.hasOperationView=r.hasOperationView;exports.PoolDepositView=k.PoolDepositView;exports.PoolRow=H.PoolRow;exports.PoolWithdrawView=G.PoolWithdrawView;exports.PrerequisiteRow=W.PrerequisiteRow;exports.PrerequisitesCard=j.PrerequisitesCard;exports.prerequisiteDetailRenderers=i.prerequisiteDetailRenderers;exports.renderPrerequisiteDetail=i.renderPrerequisiteDetail;exports.usePrerequisites=M.usePrerequisites;exports.BalanceChangeGroup=z.BalanceChangeGroup;exports.BalanceChangeRow=J.BalanceChangeRow;exports.PoolStateChangeCard=K.PoolStateChangeCard;exports.StateChangeCard=N.StateChangeCard;exports.buildPoolOperationLabels=Q.buildPoolOperationLabels;exports.resolveToken=U.resolveToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),a=require("../icon-button/icon-button.cjs"),u=require("@fortawesome/free-solid-svg-icons"),f=require("../icons/fa-icon.cjs");require("@gearbox-protocol/sdk");const s=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");function m(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return i.default=e,Object.freeze(i)}const d=m(l),c=d.forwardRef(({title:e,titleAddon:i,onClose:n,className:t},o)=>r.jsxs("div",{ref:o,className:s.cn("flex flex-nowrap items-center w-full max-w-full shrink-0 basis-full",t),children:[r.jsxs("div",{className:"flex min-w-0 grow shrink-0 basis-[0%] flex-nowrap items-center gap-2",children:[r.jsx("div",{className:s.cn("font-normal min-h-[min-content]","text-[21px] leading-[25px]"),children:e}),i?r.jsx("div",{className:"shrink-0",children:i}):null]}),n?r.jsx("div",{className:"shrink-0 pl-2",children:r.jsx(a.IconButton,{buttonType:"hollow",size:30,onClick:n,"aria-label":"Close",children:r.jsx(f.FaIcon,{icon:u.faXmark,className:"size-5"})})}):null]}));c.displayName="ConfirmMenu";exports.ConfirmMenu=c;
|
package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cva as c } from "class-variance-authority";
|
|
3
|
+
import { FadeoutLoading as f } from "../../../../fadeout-loading/fadeout-loading.js";
|
|
4
|
+
import { TokenIcon as u } from "../../../../token-icon/token-icon.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "@gearbox-protocol/sdk";
|
|
7
|
+
import { cn as x } from "../../../../../utils/cn.js";
|
|
8
|
+
import "sonner";
|
|
9
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
10
|
+
import "luxon";
|
|
11
|
+
import "../../../../../utils/z-index.js";
|
|
12
|
+
import { TransactionConfirmAmountFieldTest as g } from "./constants.js";
|
|
13
|
+
import { formatUsdAmount as y } from "./formatUsdAmount.js";
|
|
14
|
+
const h = c(
|
|
15
|
+
"flex w-full items-center justify-between bg-gray-20 px-4 py-3",
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
position: {
|
|
19
|
+
primary: "rounded-t-lg",
|
|
20
|
+
receive: "rounded-b-lg"
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
sm: "min-h-[52px]",
|
|
24
|
+
md: "min-h-[56px]"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { position: "primary", size: "md" }
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
function S({
|
|
31
|
+
label: s,
|
|
32
|
+
amount: r,
|
|
33
|
+
token: e,
|
|
34
|
+
usdPrice: n,
|
|
35
|
+
loading: a = !1,
|
|
36
|
+
position: l,
|
|
37
|
+
size: d = "md"
|
|
38
|
+
}) {
|
|
39
|
+
const m = n !== void 0 ? y(r, n) : null, i = e?.symbol ?? e?.title ?? "", p = r || "0";
|
|
40
|
+
return /* @__PURE__ */ t(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: x(h({ position: l, size: d })),
|
|
44
|
+
"data-testid": g.root,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ o("span", { className: "text-sm font-medium text-foreground", children: s }),
|
|
47
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col items-end gap-0.5", children: [
|
|
48
|
+
/* @__PURE__ */ o(f, { loading: a, children: /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5 text-sm font-medium text-foreground", children: [
|
|
49
|
+
e ? /* @__PURE__ */ o(u, { symbol: i, size: 16 }) : null,
|
|
50
|
+
/* @__PURE__ */ t("span", { children: [
|
|
51
|
+
p,
|
|
52
|
+
i ? ` ${i}` : ""
|
|
53
|
+
] })
|
|
54
|
+
] }) }),
|
|
55
|
+
m ? /* @__PURE__ */ o("span", { className: "text-xs leading-[130%] text-secondary-foreground", children: m }) : null
|
|
56
|
+
] })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
S as TransactionConfirmAmountField
|
|
63
|
+
};
|
package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { TransactionConfirmAmountPairTest as u } from "./constants.js";
|
|
3
|
+
import { TransactionConfirmAmountField as i } from "./TransactionConfirmAmountField.js";
|
|
4
|
+
function T({
|
|
5
|
+
primaryLabel: n,
|
|
6
|
+
primaryAmount: a,
|
|
7
|
+
primaryToken: e,
|
|
8
|
+
primaryUsdPrice: m,
|
|
9
|
+
receiveLabel: s,
|
|
10
|
+
receiveAmount: c,
|
|
11
|
+
receiveToken: f,
|
|
12
|
+
receiveUsdPrice: l,
|
|
13
|
+
loading: o = !1,
|
|
14
|
+
size: r = "md"
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ p(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: "mb-4 flex flex-col gap-px",
|
|
20
|
+
"data-testid": u.root,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ t(
|
|
23
|
+
i,
|
|
24
|
+
{
|
|
25
|
+
label: n,
|
|
26
|
+
amount: a,
|
|
27
|
+
token: e,
|
|
28
|
+
usdPrice: m,
|
|
29
|
+
loading: o,
|
|
30
|
+
position: "primary",
|
|
31
|
+
size: r
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ t(
|
|
35
|
+
i,
|
|
36
|
+
{
|
|
37
|
+
label: s,
|
|
38
|
+
amount: c,
|
|
39
|
+
token: f,
|
|
40
|
+
usdPrice: l,
|
|
41
|
+
loading: o,
|
|
42
|
+
position: "receive",
|
|
43
|
+
size: r
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
T as TransactionConfirmAmountPair
|
|
52
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function u(s, r) {
|
|
2
|
+
if (!r)
|
|
3
|
+
return null;
|
|
4
|
+
const t = Number.parseFloat(s.replace(",", ".") || "0");
|
|
5
|
+
if (!Number.isFinite(t) || t === 0)
|
|
6
|
+
return null;
|
|
7
|
+
const n = t * r, e = Math.abs(n) < 100;
|
|
8
|
+
try {
|
|
9
|
+
return new Intl.NumberFormat("en-US", {
|
|
10
|
+
style: "currency",
|
|
11
|
+
currency: "USD",
|
|
12
|
+
minimumFractionDigits: e ? 2 : 0,
|
|
13
|
+
maximumFractionDigits: e ? 2 : 0
|
|
14
|
+
}).format(n);
|
|
15
|
+
} catch {
|
|
16
|
+
return "$0";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
u as formatUsdAmount
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TransactionConfirmAmountFieldTest as r, TransactionConfirmAmountPairTest as t } from "./constants.js";
|
|
2
|
+
import { TransactionConfirmAmountField as m } from "./TransactionConfirmAmountField.js";
|
|
3
|
+
import { TransactionConfirmAmountPair as e } from "./TransactionConfirmAmountPair.js";
|
|
4
|
+
export {
|
|
5
|
+
m as TransactionConfirmAmountField,
|
|
6
|
+
r as TransactionConfirmAmountFieldTest,
|
|
7
|
+
e as TransactionConfirmAmountPair,
|
|
8
|
+
t as TransactionConfirmAmountPairTest
|
|
9
|
+
};
|
package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.js
CHANGED
|
@@ -1,58 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import { HorizontalTransactionStepper as v } from "../stepper/HorizontalTransactionStepper.js";
|
|
20
|
-
import { TransactionConfirmDialogTest as a, transactionConfirmDialogShellVariants as w } from "./constants.js";
|
|
21
|
-
function F({
|
|
22
|
-
open: o,
|
|
23
|
-
onClose: t,
|
|
24
|
-
title: m,
|
|
25
|
-
preview: n,
|
|
26
|
-
previewLoading: l = !1,
|
|
27
|
-
previewError: e,
|
|
28
|
-
previewErrorTitle: p = "Unable to preview transaction",
|
|
29
|
-
execution: s,
|
|
30
|
-
steps: f,
|
|
31
|
-
renderStepLabel: c
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as w } from "../../../../modal/modal.js";
|
|
3
|
+
import { TransactionConfirmPageView as x } from "./TransactionConfirmPageView.js";
|
|
4
|
+
function D({
|
|
5
|
+
open: r,
|
|
6
|
+
onClose: i,
|
|
7
|
+
phase: o = "confirm",
|
|
8
|
+
title: t,
|
|
9
|
+
titleAddon: e,
|
|
10
|
+
preview: a,
|
|
11
|
+
previewLoading: f = !1,
|
|
12
|
+
previewError: m,
|
|
13
|
+
previewErrorTitle: c = "Unable to preview transaction",
|
|
14
|
+
execution: l,
|
|
15
|
+
progressSteps: s,
|
|
16
|
+
renderProgressStepLabel: u,
|
|
17
|
+
result: d,
|
|
18
|
+
hideTitleAddonOnResult: p = !0
|
|
32
19
|
}) {
|
|
33
|
-
return
|
|
34
|
-
|
|
20
|
+
return r ? /* @__PURE__ */ n(w, { show: r, onClickOutside: i, zIndexLayer: "MODAL", children: /* @__PURE__ */ n(
|
|
21
|
+
x,
|
|
35
22
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */ r("div", { className: "flex max-h-[50vh] min-w-0 flex-col gap-4 overflow-x-hidden overflow-y-auto", children: l ? /* @__PURE__ */ r(S, { lines: 3 }) : e ? /* @__PURE__ */ r(x, { err: e, title: p }) : n }),
|
|
50
|
-
/* @__PURE__ */ r(i, { height: 24 }),
|
|
51
|
-
/* @__PURE__ */ r("div", { "data-testid": a.execution, children: s })
|
|
52
|
-
]
|
|
23
|
+
phase: o,
|
|
24
|
+
onClose: i,
|
|
25
|
+
title: t,
|
|
26
|
+
titleAddon: e,
|
|
27
|
+
preview: a,
|
|
28
|
+
previewLoading: f,
|
|
29
|
+
previewError: m,
|
|
30
|
+
previewErrorTitle: c,
|
|
31
|
+
execution: l,
|
|
32
|
+
progressSteps: s,
|
|
33
|
+
renderProgressStepLabel: u,
|
|
34
|
+
result: d,
|
|
35
|
+
hideTitleAddonOnResult: p
|
|
53
36
|
}
|
|
54
37
|
) }) : null;
|
|
55
38
|
}
|
|
56
39
|
export {
|
|
57
|
-
|
|
40
|
+
D as TransactionConfirmDialogView
|
|
58
41
|
};
|
package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { StyledDialogContainer as w } from "../../../../client-adapters/styled-dialog-container/styled-dialog-container.js";
|
|
3
|
+
import { ConfirmMenu as D } from "../../../../confirm-menu/confirm-menu.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "@gearbox-protocol/sdk";
|
|
6
|
+
import { cn as S } from "../../../../../utils/cn.js";
|
|
7
|
+
import "sonner";
|
|
8
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
9
|
+
import "luxon";
|
|
10
|
+
import "../../../../../utils/z-index.js";
|
|
11
|
+
import { TransactionConfirmDialogTest as h, transactionConfirmDialogShellVariants as x } from "./constants.js";
|
|
12
|
+
import { TransactionConfirmShell as A } from "./TransactionConfirmShell.js";
|
|
13
|
+
function B({
|
|
14
|
+
onClose: i,
|
|
15
|
+
phase: o = "confirm",
|
|
16
|
+
title: t,
|
|
17
|
+
titleAddon: n,
|
|
18
|
+
preview: a,
|
|
19
|
+
previewLoading: m = !1,
|
|
20
|
+
previewError: e,
|
|
21
|
+
previewErrorTitle: f = "Unable to preview transaction",
|
|
22
|
+
previewClassName: l,
|
|
23
|
+
execution: c,
|
|
24
|
+
progressSteps: d,
|
|
25
|
+
renderProgressStepLabel: p,
|
|
26
|
+
result: s,
|
|
27
|
+
hideTitleAddonOnResult: C = !0,
|
|
28
|
+
containerClassName: g,
|
|
29
|
+
containerTestId: T,
|
|
30
|
+
shellTestId: u
|
|
31
|
+
}) {
|
|
32
|
+
const v = o !== "confirm" && o !== "awaiting_receipt" && C ? void 0 : n;
|
|
33
|
+
return /* @__PURE__ */ r(
|
|
34
|
+
w,
|
|
35
|
+
{
|
|
36
|
+
className: S(
|
|
37
|
+
x(),
|
|
38
|
+
g
|
|
39
|
+
),
|
|
40
|
+
"data-testid": T,
|
|
41
|
+
children: /* @__PURE__ */ r(
|
|
42
|
+
A,
|
|
43
|
+
{
|
|
44
|
+
phase: o,
|
|
45
|
+
header: /* @__PURE__ */ r(
|
|
46
|
+
D,
|
|
47
|
+
{
|
|
48
|
+
title: t,
|
|
49
|
+
titleAddon: v,
|
|
50
|
+
onClose: i
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
preview: a,
|
|
54
|
+
previewLoading: m,
|
|
55
|
+
previewError: e,
|
|
56
|
+
previewErrorTitle: f,
|
|
57
|
+
previewClassName: l,
|
|
58
|
+
execution: c,
|
|
59
|
+
progressSteps: d,
|
|
60
|
+
renderProgressStepLabel: p,
|
|
61
|
+
result: s,
|
|
62
|
+
"data-testid": u ?? h.root
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
B as TransactionConfirmPageView
|
|
70
|
+
};
|