@deframe-sdk/components 0.1.19 → 0.1.21
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 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -58
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1250,6 +1250,8 @@ interface SwapFromCardViewProps {
|
|
|
1250
1250
|
maxFractionDigits?: number;
|
|
1251
1251
|
amountUsdFormatted: string;
|
|
1252
1252
|
isAmountUsdLoading: boolean;
|
|
1253
|
+
/** Optional inline error message consumed by simple variants. */
|
|
1254
|
+
errorMessage?: string;
|
|
1253
1255
|
/** react-hook-form field registration (name, onBlur, ref) */
|
|
1254
1256
|
field?: InputFieldRegistration;
|
|
1255
1257
|
}
|
|
@@ -1377,8 +1379,6 @@ interface SwapFromCardViewSimpleProps extends SwapFromCardViewProps {
|
|
|
1377
1379
|
selectedPercentage?: number | null;
|
|
1378
1380
|
/** Label for the last (100 %) chip. Default: 'Max.' */
|
|
1379
1381
|
maxLabel?: string;
|
|
1380
|
-
/** Custom error message shown in the inline notification */
|
|
1381
|
-
errorMessage?: string;
|
|
1382
1382
|
/** Custom label for the error action button */
|
|
1383
1383
|
errorActionLabel?: string;
|
|
1384
1384
|
/** Called when the error action button is clicked */
|
package/dist/index.d.ts
CHANGED
|
@@ -1250,6 +1250,8 @@ interface SwapFromCardViewProps {
|
|
|
1250
1250
|
maxFractionDigits?: number;
|
|
1251
1251
|
amountUsdFormatted: string;
|
|
1252
1252
|
isAmountUsdLoading: boolean;
|
|
1253
|
+
/** Optional inline error message consumed by simple variants. */
|
|
1254
|
+
errorMessage?: string;
|
|
1253
1255
|
/** react-hook-form field registration (name, onBlur, ref) */
|
|
1254
1256
|
field?: InputFieldRegistration;
|
|
1255
1257
|
}
|
|
@@ -1377,8 +1379,6 @@ interface SwapFromCardViewSimpleProps extends SwapFromCardViewProps {
|
|
|
1377
1379
|
selectedPercentage?: number | null;
|
|
1378
1380
|
/** Label for the last (100 %) chip. Default: 'Max.' */
|
|
1379
1381
|
maxLabel?: string;
|
|
1380
|
-
/** Custom error message shown in the inline notification */
|
|
1381
|
-
errorMessage?: string;
|
|
1382
1382
|
/** Custom label for the error action button */
|
|
1383
1383
|
errorActionLabel?: string;
|
|
1384
1384
|
/** Called when the error action button is clicked */
|
package/dist/index.js
CHANGED
|
@@ -3830,11 +3830,14 @@ function WarningIcon() {
|
|
|
3830
3830
|
var SwapSignatureWarningViewSimple = ({
|
|
3831
3831
|
errorTitle,
|
|
3832
3832
|
errorDescription,
|
|
3833
|
-
onCancel
|
|
3834
|
-
onTryAgain,
|
|
3835
|
-
cancelButtonText,
|
|
3836
|
-
retryButtonText
|
|
3833
|
+
onCancel
|
|
3837
3834
|
}) => {
|
|
3835
|
+
React6.useEffect(() => {
|
|
3836
|
+
const timer = setTimeout(() => {
|
|
3837
|
+
onCancel == null ? void 0 : onCancel();
|
|
3838
|
+
}, 3e3);
|
|
3839
|
+
return () => clearTimeout(timer);
|
|
3840
|
+
}, [onCancel]);
|
|
3838
3841
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3839
3842
|
"div",
|
|
3840
3843
|
{
|
|
@@ -3900,35 +3903,6 @@ var SwapSignatureWarningViewSimple = ({
|
|
|
3900
3903
|
)
|
|
3901
3904
|
]
|
|
3902
3905
|
}
|
|
3903
|
-
),
|
|
3904
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3905
|
-
"div",
|
|
3906
|
-
{
|
|
3907
|
-
"data-test-id": "swap-signature-warning-simple-actions",
|
|
3908
|
-
className: "flex gap-[var(--deframe-widget-size-gap-sm)] w-full max-w-[320px]",
|
|
3909
|
-
children: [
|
|
3910
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3911
|
-
SecondaryButton,
|
|
3912
|
-
{
|
|
3913
|
-
"data-test-id": "swap-signature-warning-simple-cancel",
|
|
3914
|
-
"aria-label": cancelButtonText != null ? cancelButtonText : "Cancel",
|
|
3915
|
-
className: "flex-1",
|
|
3916
|
-
onClick: onCancel,
|
|
3917
|
-
children: cancelButtonText
|
|
3918
|
-
}
|
|
3919
|
-
),
|
|
3920
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3921
|
-
PrimaryButton,
|
|
3922
|
-
{
|
|
3923
|
-
"data-test-id": "swap-signature-warning-simple-retry",
|
|
3924
|
-
"aria-label": retryButtonText != null ? retryButtonText : "Retry",
|
|
3925
|
-
className: "flex-1",
|
|
3926
|
-
onClick: onTryAgain,
|
|
3927
|
-
children: retryButtonText
|
|
3928
|
-
}
|
|
3929
|
-
)
|
|
3930
|
-
]
|
|
3931
|
-
}
|
|
3932
3906
|
)
|
|
3933
3907
|
]
|
|
3934
3908
|
}
|
|
@@ -5216,7 +5190,7 @@ function TokenSelectorArea({
|
|
|
5216
5190
|
"aria-label": selectedToken ? `Select token \u2014 currently ${selectedToken.symbol} on ${chainLabel}` : selectTokenLabel,
|
|
5217
5191
|
className: tailwindMerge.twMerge(
|
|
5218
5192
|
"inline-flex items-center gap-[10px]",
|
|
5219
|
-
"
|
|
5193
|
+
"h-[54px] px-[10px]",
|
|
5220
5194
|
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5221
5195
|
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5222
5196
|
"border-none outline-none",
|
|
@@ -5264,22 +5238,15 @@ function TokenSelectorArea({
|
|
|
5264
5238
|
),
|
|
5265
5239
|
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
5266
5240
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5267
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5268
|
-
"div",
|
|
5269
|
-
{
|
|
5270
|
-
"data-test-id": "swap-from-card-simple-token-placeholder-icon",
|
|
5271
|
-
className: "w-[38px] h-[38px] rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex-shrink-0"
|
|
5272
|
-
}
|
|
5273
|
-
),
|
|
5274
5241
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5275
5242
|
"span",
|
|
5276
5243
|
{
|
|
5277
5244
|
"data-test-id": "swap-from-card-simple-token-placeholder-label",
|
|
5278
5245
|
className: tailwindMerge.twMerge(
|
|
5279
|
-
"text-[
|
|
5246
|
+
"text-[11px] [font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
5280
5247
|
"font-[var(--deframe-widget-font-family)]",
|
|
5281
5248
|
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5282
|
-
"whitespace-nowrap"
|
|
5249
|
+
"whitespace-nowrap uppercase"
|
|
5283
5250
|
),
|
|
5284
5251
|
children: selectTokenLabel
|
|
5285
5252
|
}
|
|
@@ -5576,7 +5543,7 @@ var SwapToCardViewSimple = ({
|
|
|
5576
5543
|
);
|
|
5577
5544
|
const selectorBaseClasses = tailwindMerge.twMerge(
|
|
5578
5545
|
"inline-flex items-center gap-[10px]",
|
|
5579
|
-
"
|
|
5546
|
+
"h-[54px] px-[10px]",
|
|
5580
5547
|
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5581
5548
|
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5582
5549
|
"border-none",
|
|
@@ -5671,19 +5638,11 @@ var SwapToCardViewSimple = ({
|
|
|
5671
5638
|
"aria-label": labels.selectTokenLabel,
|
|
5672
5639
|
className: selectorBaseClasses,
|
|
5673
5640
|
children: [
|
|
5674
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5675
|
-
"div",
|
|
5676
|
-
{
|
|
5677
|
-
"data-test-id": "swap-to-simple-placeholder-circle",
|
|
5678
|
-
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5679
|
-
style: { width: 38, height: 38 }
|
|
5680
|
-
}
|
|
5681
|
-
),
|
|
5682
5641
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5683
5642
|
"span",
|
|
5684
5643
|
{
|
|
5685
5644
|
"data-test-id": "swap-to-simple-placeholder-label",
|
|
5686
|
-
className: "text-[
|
|
5645
|
+
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-regular)] leading-[1.2] font-[var(--deframe-widget-font-family)] text-[color:var(--deframe-widget-color-text-secondary)] whitespace-nowrap uppercase",
|
|
5687
5646
|
children: labels.selectTokenLabel
|
|
5688
5647
|
}
|
|
5689
5648
|
),
|
|
@@ -5720,7 +5679,7 @@ var SwapToCardViewSimple = ({
|
|
|
5720
5679
|
"data-test-id": "swap-to-simple-output-wrapper",
|
|
5721
5680
|
className: "flex flex-col items-end flex-1 min-w-0",
|
|
5722
5681
|
children: [
|
|
5723
|
-
isOutputLoading ? /* @__PURE__ */ jsxRuntime.
|
|
5682
|
+
isOutputLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5724
5683
|
"span",
|
|
5725
5684
|
{
|
|
5726
5685
|
"data-test-id": "swap-to-simple-output-loading",
|
|
@@ -5731,10 +5690,7 @@ var SwapToCardViewSimple = ({
|
|
|
5731
5690
|
"text-right",
|
|
5732
5691
|
"flex items-center"
|
|
5733
5692
|
),
|
|
5734
|
-
children:
|
|
5735
|
-
labels.searchingQuoteLabel,
|
|
5736
|
-
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
5737
|
-
]
|
|
5693
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
5738
5694
|
}
|
|
5739
5695
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5740
5696
|
"span",
|