@deframe-sdk/components 0.1.37 → 0.1.38
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/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +50 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -35
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +6 -12
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10669,21 +10669,33 @@ var EarnNoBalanceNotificationView = ({
|
|
|
10669
10669
|
prompt,
|
|
10670
10670
|
actionLabel,
|
|
10671
10671
|
onAction
|
|
10672
|
-
}) => /* @__PURE__ */ jsx("div", { className: "
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10672
|
+
}) => /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-md)]", children: /* @__PURE__ */ jsxs(
|
|
10673
|
+
"div",
|
|
10674
|
+
{
|
|
10675
|
+
"data-test-id": "earn-no-balance-notification",
|
|
10676
|
+
className: [
|
|
10677
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-state-warning)_16%,transparent)]",
|
|
10678
|
+
"border border-[var(--deframe-widget-color-state-warning)]",
|
|
10679
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
10680
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
10681
|
+
"flex flex-col gap-[var(--deframe-widget-size-gap-md)]"
|
|
10682
|
+
].join(" "),
|
|
10683
|
+
children: [
|
|
10684
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
10685
|
+
/* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-[color:var(--deframe-widget-color-state-warning)] flex-shrink-0 mt-0.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
10686
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(TextBody, { variant: "text-small", children: prompt }) })
|
|
10687
|
+
] }),
|
|
10688
|
+
/* @__PURE__ */ jsx(
|
|
10689
|
+
PrimaryButton,
|
|
10690
|
+
{
|
|
10691
|
+
type: "button",
|
|
10692
|
+
onClick: onAction,
|
|
10693
|
+
children: actionLabel
|
|
10694
|
+
}
|
|
10695
|
+
)
|
|
10696
|
+
]
|
|
10697
|
+
}
|
|
10698
|
+
) });
|
|
10687
10699
|
var EarnTxStatusCardView = ({
|
|
10688
10700
|
statusLabel,
|
|
10689
10701
|
isProcessing,
|
|
@@ -11290,6 +11302,8 @@ var EarnDepositFormViewSimple = ({
|
|
|
11290
11302
|
isTxError,
|
|
11291
11303
|
txSuccessMessage,
|
|
11292
11304
|
txErrorMessage,
|
|
11305
|
+
// Insufficient balance
|
|
11306
|
+
insufficientBalanceMessage,
|
|
11293
11307
|
// Bytecode error
|
|
11294
11308
|
bytecodeErrorMessage,
|
|
11295
11309
|
// Submit button
|
|
@@ -11297,7 +11311,7 @@ var EarnDepositFormViewSimple = ({
|
|
|
11297
11311
|
submitButtonText
|
|
11298
11312
|
}) => {
|
|
11299
11313
|
const hasToken = selectedToken != null;
|
|
11300
|
-
const hasError = !!bytecodeErrorMessage;
|
|
11314
|
+
const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
|
|
11301
11315
|
const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
|
|
11302
11316
|
const [cardHovered, setCardHovered] = React6__default.useState(false);
|
|
11303
11317
|
const hideTimerRef = React6__default.useRef(void 0);
|
|
@@ -11458,7 +11472,21 @@ var EarnDepositFormViewSimple = ({
|
|
|
11458
11472
|
children: selectTokenLabel
|
|
11459
11473
|
}
|
|
11460
11474
|
),
|
|
11461
|
-
/* @__PURE__ */ jsx(
|
|
11475
|
+
hasError && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
|
|
11476
|
+
EarnInlineNotificationSimpleView,
|
|
11477
|
+
{
|
|
11478
|
+
variant: "error",
|
|
11479
|
+
message: insufficientBalanceMessage || bytecodeErrorMessage
|
|
11480
|
+
}
|
|
11481
|
+
) }),
|
|
11482
|
+
showNoBalanceNotification ? /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
|
|
11483
|
+
EarnNoBalanceNotificationView,
|
|
11484
|
+
{
|
|
11485
|
+
prompt: noBalancePrompt,
|
|
11486
|
+
actionLabel: goToSwapLabel,
|
|
11487
|
+
onAction: onGoToSwap
|
|
11488
|
+
}
|
|
11489
|
+
) }) : /* @__PURE__ */ jsx(AnimatePresence, { children: hasToken && cardHovered && /* @__PURE__ */ jsx(
|
|
11462
11490
|
motion.div,
|
|
11463
11491
|
{
|
|
11464
11492
|
"data-slot": "deposit-simple-chips-row",
|
|
@@ -11478,21 +11506,6 @@ var EarnDepositFormViewSimple = ({
|
|
|
11478
11506
|
}
|
|
11479
11507
|
)
|
|
11480
11508
|
}
|
|
11481
|
-
) }),
|
|
11482
|
-
showNoBalanceNotification && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
|
|
11483
|
-
EarnNoBalanceNotificationView,
|
|
11484
|
-
{
|
|
11485
|
-
prompt: noBalancePrompt,
|
|
11486
|
-
actionLabel: goToSwapLabel,
|
|
11487
|
-
onAction: onGoToSwap
|
|
11488
|
-
}
|
|
11489
|
-
) }),
|
|
11490
|
-
bytecodeErrorMessage && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
|
|
11491
|
-
EarnInlineNotificationSimpleView,
|
|
11492
|
-
{
|
|
11493
|
-
variant: "error",
|
|
11494
|
-
message: bytecodeErrorMessage
|
|
11495
|
-
}
|
|
11496
11509
|
) })
|
|
11497
11510
|
]
|
|
11498
11511
|
}
|
|
@@ -11748,6 +11761,8 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11748
11761
|
isTxError,
|
|
11749
11762
|
txSuccessMessage,
|
|
11750
11763
|
txErrorMessage,
|
|
11764
|
+
// Insufficient balance
|
|
11765
|
+
insufficientBalanceMessage,
|
|
11751
11766
|
// Bytecode error
|
|
11752
11767
|
bytecodeErrorMessage,
|
|
11753
11768
|
// Submit button
|
|
@@ -11755,7 +11770,7 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11755
11770
|
submitButtonText
|
|
11756
11771
|
}) => {
|
|
11757
11772
|
const hasToken = selectedToken != null;
|
|
11758
|
-
const hasError = !!bytecodeErrorMessage;
|
|
11773
|
+
const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
|
|
11759
11774
|
const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
|
|
11760
11775
|
const [cardHovered, setCardHovered] = React6__default.useState(false);
|
|
11761
11776
|
const hideTimerRef = React6__default.useRef(void 0);
|
|
@@ -11934,11 +11949,11 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11934
11949
|
)
|
|
11935
11950
|
}
|
|
11936
11951
|
) }),
|
|
11937
|
-
|
|
11952
|
+
hasError && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
|
|
11938
11953
|
EarnInlineNotificationSimpleView,
|
|
11939
11954
|
{
|
|
11940
11955
|
variant: "error",
|
|
11941
|
-
message: bytecodeErrorMessage
|
|
11956
|
+
message: insufficientBalanceMessage || bytecodeErrorMessage
|
|
11942
11957
|
}
|
|
11943
11958
|
) })
|
|
11944
11959
|
]
|