@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.d.mts
CHANGED
|
@@ -2416,6 +2416,7 @@ interface EarnDepositFormViewProps {
|
|
|
2416
2416
|
isTxError: boolean;
|
|
2417
2417
|
txSuccessMessage?: string;
|
|
2418
2418
|
txErrorMessage?: string;
|
|
2419
|
+
insufficientBalanceMessage?: string;
|
|
2419
2420
|
bytecodeErrorMessage?: string;
|
|
2420
2421
|
transactionErrorLabel: string;
|
|
2421
2422
|
isQuoteValid: boolean;
|
|
@@ -2471,6 +2472,7 @@ interface EarnWithdrawFormViewProps {
|
|
|
2471
2472
|
isTxError: boolean;
|
|
2472
2473
|
txSuccessMessage?: string;
|
|
2473
2474
|
txErrorMessage?: string;
|
|
2475
|
+
insufficientBalanceMessage?: string;
|
|
2474
2476
|
bytecodeErrorMessage?: string;
|
|
2475
2477
|
transactionErrorLabel: string;
|
|
2476
2478
|
isQuoteValid: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -2416,6 +2416,7 @@ interface EarnDepositFormViewProps {
|
|
|
2416
2416
|
isTxError: boolean;
|
|
2417
2417
|
txSuccessMessage?: string;
|
|
2418
2418
|
txErrorMessage?: string;
|
|
2419
|
+
insufficientBalanceMessage?: string;
|
|
2419
2420
|
bytecodeErrorMessage?: string;
|
|
2420
2421
|
transactionErrorLabel: string;
|
|
2421
2422
|
isQuoteValid: boolean;
|
|
@@ -2471,6 +2472,7 @@ interface EarnWithdrawFormViewProps {
|
|
|
2471
2472
|
isTxError: boolean;
|
|
2472
2473
|
txSuccessMessage?: string;
|
|
2473
2474
|
txErrorMessage?: string;
|
|
2475
|
+
insufficientBalanceMessage?: string;
|
|
2474
2476
|
bytecodeErrorMessage?: string;
|
|
2475
2477
|
transactionErrorLabel: string;
|
|
2476
2478
|
isQuoteValid: boolean;
|
package/dist/index.js
CHANGED
|
@@ -10693,21 +10693,33 @@ var EarnNoBalanceNotificationView = ({
|
|
|
10693
10693
|
prompt,
|
|
10694
10694
|
actionLabel,
|
|
10695
10695
|
onAction
|
|
10696
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10696
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-md)]", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10697
|
+
"div",
|
|
10698
|
+
{
|
|
10699
|
+
"data-test-id": "earn-no-balance-notification",
|
|
10700
|
+
className: [
|
|
10701
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-state-warning)_16%,transparent)]",
|
|
10702
|
+
"border border-[var(--deframe-widget-color-state-warning)]",
|
|
10703
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
10704
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
10705
|
+
"flex flex-col gap-[var(--deframe-widget-size-gap-md)]"
|
|
10706
|
+
].join(" "),
|
|
10707
|
+
children: [
|
|
10708
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
10709
|
+
/* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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" }) }),
|
|
10710
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: prompt }) })
|
|
10711
|
+
] }),
|
|
10712
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10713
|
+
PrimaryButton,
|
|
10714
|
+
{
|
|
10715
|
+
type: "button",
|
|
10716
|
+
onClick: onAction,
|
|
10717
|
+
children: actionLabel
|
|
10718
|
+
}
|
|
10719
|
+
)
|
|
10720
|
+
]
|
|
10721
|
+
}
|
|
10722
|
+
) });
|
|
10711
10723
|
var EarnTxStatusCardView = ({
|
|
10712
10724
|
statusLabel,
|
|
10713
10725
|
isProcessing,
|
|
@@ -11314,6 +11326,8 @@ var EarnDepositFormViewSimple = ({
|
|
|
11314
11326
|
isTxError,
|
|
11315
11327
|
txSuccessMessage,
|
|
11316
11328
|
txErrorMessage,
|
|
11329
|
+
// Insufficient balance
|
|
11330
|
+
insufficientBalanceMessage,
|
|
11317
11331
|
// Bytecode error
|
|
11318
11332
|
bytecodeErrorMessage,
|
|
11319
11333
|
// Submit button
|
|
@@ -11321,7 +11335,7 @@ var EarnDepositFormViewSimple = ({
|
|
|
11321
11335
|
submitButtonText
|
|
11322
11336
|
}) => {
|
|
11323
11337
|
const hasToken = selectedToken != null;
|
|
11324
|
-
const hasError = !!bytecodeErrorMessage;
|
|
11338
|
+
const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
|
|
11325
11339
|
const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
|
|
11326
11340
|
const [cardHovered, setCardHovered] = React6__namespace.default.useState(false);
|
|
11327
11341
|
const hideTimerRef = React6__namespace.default.useRef(void 0);
|
|
@@ -11482,7 +11496,21 @@ var EarnDepositFormViewSimple = ({
|
|
|
11482
11496
|
children: selectTokenLabel
|
|
11483
11497
|
}
|
|
11484
11498
|
),
|
|
11485
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11499
|
+
hasError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11500
|
+
EarnInlineNotificationSimpleView,
|
|
11501
|
+
{
|
|
11502
|
+
variant: "error",
|
|
11503
|
+
message: insufficientBalanceMessage || bytecodeErrorMessage
|
|
11504
|
+
}
|
|
11505
|
+
) }),
|
|
11506
|
+
showNoBalanceNotification ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11507
|
+
EarnNoBalanceNotificationView,
|
|
11508
|
+
{
|
|
11509
|
+
prompt: noBalancePrompt,
|
|
11510
|
+
actionLabel: goToSwapLabel,
|
|
11511
|
+
onAction: onGoToSwap
|
|
11512
|
+
}
|
|
11513
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: hasToken && cardHovered && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11486
11514
|
framerMotion.motion.div,
|
|
11487
11515
|
{
|
|
11488
11516
|
"data-slot": "deposit-simple-chips-row",
|
|
@@ -11502,21 +11530,6 @@ var EarnDepositFormViewSimple = ({
|
|
|
11502
11530
|
}
|
|
11503
11531
|
)
|
|
11504
11532
|
}
|
|
11505
|
-
) }),
|
|
11506
|
-
showNoBalanceNotification && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11507
|
-
EarnNoBalanceNotificationView,
|
|
11508
|
-
{
|
|
11509
|
-
prompt: noBalancePrompt,
|
|
11510
|
-
actionLabel: goToSwapLabel,
|
|
11511
|
-
onAction: onGoToSwap
|
|
11512
|
-
}
|
|
11513
|
-
) }),
|
|
11514
|
-
bytecodeErrorMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11515
|
-
EarnInlineNotificationSimpleView,
|
|
11516
|
-
{
|
|
11517
|
-
variant: "error",
|
|
11518
|
-
message: bytecodeErrorMessage
|
|
11519
|
-
}
|
|
11520
11533
|
) })
|
|
11521
11534
|
]
|
|
11522
11535
|
}
|
|
@@ -11772,6 +11785,8 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11772
11785
|
isTxError,
|
|
11773
11786
|
txSuccessMessage,
|
|
11774
11787
|
txErrorMessage,
|
|
11788
|
+
// Insufficient balance
|
|
11789
|
+
insufficientBalanceMessage,
|
|
11775
11790
|
// Bytecode error
|
|
11776
11791
|
bytecodeErrorMessage,
|
|
11777
11792
|
// Submit button
|
|
@@ -11779,7 +11794,7 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11779
11794
|
submitButtonText
|
|
11780
11795
|
}) => {
|
|
11781
11796
|
const hasToken = selectedToken != null;
|
|
11782
|
-
const hasError = !!bytecodeErrorMessage;
|
|
11797
|
+
const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
|
|
11783
11798
|
const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
|
|
11784
11799
|
const [cardHovered, setCardHovered] = React6__namespace.default.useState(false);
|
|
11785
11800
|
const hideTimerRef = React6__namespace.default.useRef(void 0);
|
|
@@ -11958,11 +11973,11 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11958
11973
|
)
|
|
11959
11974
|
}
|
|
11960
11975
|
) }),
|
|
11961
|
-
|
|
11976
|
+
hasError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11962
11977
|
EarnInlineNotificationSimpleView,
|
|
11963
11978
|
{
|
|
11964
11979
|
variant: "error",
|
|
11965
|
-
message: bytecodeErrorMessage
|
|
11980
|
+
message: insufficientBalanceMessage || bytecodeErrorMessage
|
|
11966
11981
|
}
|
|
11967
11982
|
) })
|
|
11968
11983
|
]
|