@0xsquid/ui 2.4.9 → 2.4.10-beta.1
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/index.js +89 -27
- package/dist/cjs/types/components/buttons/Button.d.ts +2 -1
- package/dist/cjs/types/components/icons/Arrow.d.ts +10 -2
- package/dist/cjs/types/components/layout/HashLink.d.ts +5 -2
- package/dist/cjs/types/components/layout/Join.d.ts +1 -1
- package/dist/cjs/types/components/layout/TxProgressViewHeader.d.ts +7 -0
- package/dist/cjs/types/components/layout/UnsupportedPairNotice.d.ts +7 -0
- package/dist/cjs/types/components/layout/index.d.ts +2 -1
- package/dist/cjs/types/components/lists/PropertyListItem.d.ts +3 -1
- package/dist/cjs/types/components/views/DepositAddressView.d.ts +29 -0
- package/dist/cjs/types/components/views/index.d.ts +1 -0
- package/dist/cjs/types/core/utils.d.ts +1 -1
- package/dist/cjs/types/hooks/useCountdown.d.ts +1 -0
- package/dist/cjs/types/stories/badges/Image.stories.d.ts +1 -0
- package/dist/cjs/types/stories/buttons/Button.stories.d.ts +2 -0
- package/dist/cjs/types/stories/layout/TxProgressViewHeader.stories.d.ts +7 -0
- package/dist/cjs/types/stories/layout/UnsupportedPairNotice.stories.d.ts +6 -0
- package/dist/cjs/types/stories/views/DepositAddressView.stories.d.ts +6 -0
- package/dist/esm/index.js +87 -27
- package/dist/esm/types/components/buttons/Button.d.ts +2 -1
- package/dist/esm/types/components/icons/Arrow.d.ts +10 -2
- package/dist/esm/types/components/layout/HashLink.d.ts +5 -2
- package/dist/esm/types/components/layout/Join.d.ts +1 -1
- package/dist/esm/types/components/layout/TxProgressViewHeader.d.ts +7 -0
- package/dist/esm/types/components/layout/UnsupportedPairNotice.d.ts +7 -0
- package/dist/esm/types/components/layout/index.d.ts +2 -1
- package/dist/esm/types/components/lists/PropertyListItem.d.ts +3 -1
- package/dist/esm/types/components/views/DepositAddressView.d.ts +29 -0
- package/dist/esm/types/components/views/index.d.ts +1 -0
- package/dist/esm/types/core/utils.d.ts +1 -1
- package/dist/esm/types/hooks/useCountdown.d.ts +1 -0
- package/dist/esm/types/stories/badges/Image.stories.d.ts +1 -0
- package/dist/esm/types/stories/buttons/Button.stories.d.ts +2 -0
- package/dist/esm/types/stories/layout/TxProgressViewHeader.stories.d.ts +7 -0
- package/dist/esm/types/stories/layout/UnsupportedPairNotice.stories.d.ts +6 -0
- package/dist/esm/types/stories/views/DepositAddressView.stories.d.ts +6 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +65 -16
- package/package.json +1 -1
- package/dist/cjs/types/components/layout/SwapProgressViewHeader.d.ts +0 -6
- package/dist/cjs/types/stories/layout/SwapProgressViewHeader.stories.d.ts +0 -6
- package/dist/esm/types/components/layout/SwapProgressViewHeader.d.ts +0 -6
- package/dist/esm/types/stories/layout/SwapProgressViewHeader.stories.d.ts +0 -6
package/dist/esm/index.js
CHANGED
|
@@ -2788,6 +2788,20 @@ const formatDuration = (elapsedTime) => {
|
|
|
2788
2788
|
// Show only minutes if total time is 1 minute or more
|
|
2789
2789
|
return `${minutes}m`;
|
|
2790
2790
|
};
|
|
2791
|
+
function formatCountdown(seconds) {
|
|
2792
|
+
const hours = Math.floor((seconds / 3600) % 24);
|
|
2793
|
+
const minutes = Math.floor((seconds / 60) % 60);
|
|
2794
|
+
const secs = seconds % 60;
|
|
2795
|
+
if (hours > 0) {
|
|
2796
|
+
return `${hours}h : ${String(minutes).padStart(2, "0")}m : ${String(secs).padStart(2, "0")}s`;
|
|
2797
|
+
}
|
|
2798
|
+
else if (minutes > 0) {
|
|
2799
|
+
return `${minutes}m : ${String(secs).padStart(2, "0")}s`;
|
|
2800
|
+
}
|
|
2801
|
+
else {
|
|
2802
|
+
return `${secs}s`;
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2791
2805
|
const formatTime = (timestampSeconds) => {
|
|
2792
2806
|
const date = new Date(timestampSeconds * 1000);
|
|
2793
2807
|
const hours = date.getHours();
|
|
@@ -2850,9 +2864,6 @@ const formatRelativeDate = (timestampSeconds) => {
|
|
|
2850
2864
|
});
|
|
2851
2865
|
return formattedDate;
|
|
2852
2866
|
};
|
|
2853
|
-
function truncateHash(hash) {
|
|
2854
|
-
return `${hash.slice(0, 8)}...${hash.slice(-6)}`;
|
|
2855
|
-
}
|
|
2856
2867
|
const calcLerp = (a, b, t) => `calc(${a} + (${b} - ${a}) * ${t})`;
|
|
2857
2868
|
/**
|
|
2858
2869
|
* Returns an array including the first `count` unique values of the array
|
|
@@ -3642,11 +3653,11 @@ function Approve() {
|
|
|
3642
3653
|
function ArrowRightIcon() {
|
|
3643
3654
|
return (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M14 6L20 12L14 18M19 12H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
3644
3655
|
}
|
|
3645
|
-
function ArrowRightDownIcon() {
|
|
3646
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width:
|
|
3656
|
+
function ArrowRightDownIcon({ size = "10", className, strokeWidth = "2", }) {
|
|
3657
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 10 10", className: className, children: jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: strokeWidth, d: "M9 3v6H3M1.167 1.167l7.166 7.166" }) }));
|
|
3647
3658
|
}
|
|
3648
|
-
function ArrowRightUpIcon() {
|
|
3649
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width:
|
|
3659
|
+
function ArrowRightUpIcon({ size = "10", className, strokeWidth = "2", }) {
|
|
3660
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 10 10", className: className, children: jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: strokeWidth, d: "M9 7V1m0 0H3m6 0L1.167 8.833" }) }));
|
|
3650
3661
|
}
|
|
3651
3662
|
function ChevronArrowIcon({ size = "16", className, }) {
|
|
3652
3663
|
return (jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
@@ -4307,12 +4318,14 @@ function UsdAmount({ usdAmount }) {
|
|
|
4307
4318
|
return (jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsx(CaptionText, { className: "tw-opacity-66", children: "$" }), jsx(CaptionText, { children: usdAmount.toString() })] }));
|
|
4308
4319
|
}
|
|
4309
4320
|
|
|
4310
|
-
function HashLink({ showTx = false, hash, showCopyButton = false, url, children, }) {
|
|
4311
|
-
return (jsxs("div", { className: "tw-flex tw-items-center", children: [showTx && jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children :
|
|
4321
|
+
function HashLink({ showTx = false, hash, showCopyButton = false, url, children, className, formattedHash, copyIconSize = "16", }) {
|
|
4322
|
+
return (jsxs("div", { className: cn("tw-flex tw-items-center", className), children: [showTx && jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children : formattedHash, url && (jsx("a", { href: url, target: "_blank", className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", rel: "noreferrer", children: jsx(SquareArrowTopRight2Icon, { strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-text-royal-500" }) })), showCopyButton && (jsx("span", { className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", children: jsx(Copy, { size: copyIconSize, strokeWidth: "2", className: "tw-cursor-pointer tw-text-royal-500", onClick: () => {
|
|
4323
|
+
navigator.clipboard.writeText(hash).catch(() => { });
|
|
4324
|
+
} }) }))] }));
|
|
4312
4325
|
}
|
|
4313
4326
|
|
|
4314
4327
|
function WalletLink({ imageURI, address }) {
|
|
4315
|
-
return (jsx(IconLabel, { src: imageURI, rounded: "full", children: jsx(HashLink, { hash: address, showCopyButton: true, children: jsx(BodyText, { size: "small", children:
|
|
4328
|
+
return (jsx(IconLabel, { src: imageURI, rounded: "full", children: jsx(HashLink, { hash: address, showCopyButton: true, children: jsx(BodyText, { size: "small", children: address }) }) }));
|
|
4316
4329
|
}
|
|
4317
4330
|
|
|
4318
4331
|
const extraPaddingMap = {
|
|
@@ -4380,9 +4393,9 @@ const buttonVariantClassMap = {
|
|
|
4380
4393
|
const buttonDisabledClass = "!tw-bg-grey-800 !tw-text-grey-600 tw-cursor-not-allowed";
|
|
4381
4394
|
const loadingClassname = "tw-invisible tw-opacity-0";
|
|
4382
4395
|
function Button$1(_a) {
|
|
4383
|
-
var { label, disabled = false, size, variant, icon, link, isLoading = false, chip, containerClassName, anchorRef, buttonRef } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "chip", "containerClassName", "anchorRef", "buttonRef"]);
|
|
4396
|
+
var { label, disabled = false, size, variant, icon, link, isLoading = false, showLoader = false, chip, containerClassName, anchorRef, buttonRef } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "showLoader", "chip", "containerClassName", "anchorRef", "buttonRef"]);
|
|
4384
4397
|
const chipElement = chip != null ? (jsx(Chip, Object.assign({}, chip, { className: cn("tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10", chip.className) }))) : null;
|
|
4385
|
-
const children = (jsxs(Fragment, { children: [!disabled && !isLoading && (jsx(ButtonHoverOverlay, { className: roundedClassMap[size][variant] })), jsx("div", { className: "tw-relative tw-z-[5] tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", children: label == null && icon == null ? (props.children) : size === "lg" ? (
|
|
4398
|
+
const children = (jsxs(Fragment, { children: [!disabled && !isLoading && (jsx(ButtonHoverOverlay, { className: roundedClassMap[size][variant] })), jsx("div", { className: "tw-relative tw-z-[5] tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", children: label == null && icon == null ? (props.children) : size === "lg" ? (jsxs("span", { className: "tw-flex tw-items-center tw-justify-center tw-gap-squid-xs tw-px-squid-m", children: [showLoader && jsx(Loader, {}), jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "medium", children: label })] })) : size === "md" ? (label != null && icon == null ? (
|
|
4386
4399
|
// label only
|
|
4387
4400
|
jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "small", children: label })) : label == null && icon != null ? (
|
|
4388
4401
|
// icon only
|
|
@@ -18868,7 +18881,7 @@ const borderTypeClassMap = {
|
|
|
18868
18881
|
};
|
|
18869
18882
|
function ModalContent(_a) {
|
|
18870
18883
|
var { children, addGap = false, paddingY = false, borderType = "border", className } = _a, props = __rest$1(_a, ["children", "addGap", "paddingY", "borderType", "className"]);
|
|
18871
|
-
return (jsx("div", Object.assign({}, props, { className: cn("tw-flex tw-h-full tw-max-h-[
|
|
18884
|
+
return (jsx("div", Object.assign({}, props, { className: cn("tw-flex tw-h-full tw-max-h-[415px] tw-w-full tw-flex-col tw-self-stretch tw-rounded-modal tw-bg-grey-800 tw-text-grey-300 mobile-xs-height:tw-max-h-[535px]", addGap && "tw-gap-squid-xxs tw-pt-squid-xxs", borderTypeClassMap[borderType], paddingY && "tw-py-squid-xxs", className), children: children })));
|
|
18872
18885
|
}
|
|
18873
18886
|
function ModalContentDivider() {
|
|
18874
18887
|
return (jsx("svg", { width: "100%", height: "11", viewBox: "0 0 400 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("rect", { x: "1", y: "5", width: "398", height: "1", fill: "currentColor" }) }));
|
|
@@ -18932,19 +18945,23 @@ function LogoContainer({ children }) {
|
|
|
18932
18945
|
}
|
|
18933
18946
|
|
|
18934
18947
|
function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp = false, chain, token, direction = "from", onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive = true, isLoading = false, inputModeButton, balanceButton, assetsButton, walletButton, showNumericInputDetails = true, }) {
|
|
18935
|
-
var _a, _b
|
|
18948
|
+
var _a, _b;
|
|
18936
18949
|
const isWalletButtonInteractive = !isLoading && !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick);
|
|
18937
18950
|
const WalletButtonTag = isWalletButtonInteractive ? "button" : "div";
|
|
18938
18951
|
const isFetching = isFetchingProp || isLoading;
|
|
18939
|
-
|
|
18952
|
+
const showWalletButtonLabel = !isLoading &&
|
|
18953
|
+
!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.disabled) &&
|
|
18954
|
+
!!token &&
|
|
18955
|
+
(!!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.address) || !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel));
|
|
18956
|
+
return (jsxs("section", { className: "tw-relative tw-flex tw-h-full tw-w-full tw-flex-col tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-pb-squid-m mobile-lg:tw-w-card-large", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-m tw-py-squid-xs tw-leading-5 tw-text-grey-300 mobile-lg:tw-px-squid-l", children: jsx(Tooltip, Object.assign({}, walletButton === null || walletButton === void 0 ? void 0 : walletButton.tooltip, { tooltipWidth: "max", childrenClassName: "tw-rounded-squid-s", containerClassName: "tw-rounded-squid-s", children: jsxs(WalletButtonTag, { onClick: isWalletButtonInteractive ? walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick : undefined, className: cn("-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs tw-text-grey-600", isWalletButtonInteractive && "hover:tw-bg-material-light-thin", isLoading && "tw-opacity-50"), children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === "from" ? "Pay" : "Receive" }), showWalletButtonLabel && (jsxs(Fragment, { children: [jsx(BodyText, { size: "small", children: ":" }), jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsx(BodyText, { size: "small", className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
18940
18957
|
? "tw-text-grey-300"
|
|
18941
18958
|
: "tw-text-royal-500", children: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
18942
18959
|
? walletButton === null || walletButton === void 0 ? void 0 : walletButton.address
|
|
18943
|
-
:
|
|
18960
|
+
: walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel }), jsx(ChevronArrowIcon, { className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
18944
18961
|
? "tw-text-grey-600"
|
|
18945
18962
|
: "tw-text-royal-500" })] })] }))] }) })) }), jsx("div", { className: "tw-px-squid-m mobile-lg:tw-px-squid-l", children: jsx(AssetsButton, Object.assign({}, assetsButton, { chain: chain, token: token, isLoading: isLoading })) }), isFetching && (jsx("div", { className: "tw-absolute tw-bottom-2 tw-left-squid-m tw-z-10 tw-overflow-hidden mobile-lg:tw-left-squid-l", children: jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsx(NumericInput, { inputMode: "decimal", pattern: "[0-9.,]*", token: {
|
|
18946
|
-
decimals: (
|
|
18947
|
-
symbol: (
|
|
18963
|
+
decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
|
|
18964
|
+
symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : "",
|
|
18948
18965
|
price: tokenPrice,
|
|
18949
18966
|
}, onAmountChange: (value) => {
|
|
18950
18967
|
onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value);
|
|
@@ -18954,10 +18971,6 @@ function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp
|
|
|
18954
18971
|
}, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails: showNumericInputDetails, direction: direction, forcedAmount: amount, inputModeButton: inputModeButton, balanceButton: balanceButton, isInteractive: isInputInteractive && !isLoading })] }));
|
|
18955
18972
|
}
|
|
18956
18973
|
|
|
18957
|
-
function SwapProgressViewHeader({ title, description, }) {
|
|
18958
|
-
return (jsxs("header", { className: "tw-flex tw-min-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsx(BodyText, { size: "large", className: "tw-min-h-squid-m !tw-leading-[25px] tw-text-grey-300", children: title }), jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
|
|
18959
|
-
}
|
|
18960
|
-
|
|
18961
18974
|
function AccountListItem({ isConnected, imageUrls = [], imageUrl, badgeUrl, actions, subtitle, title, }) {
|
|
18962
18975
|
const badge = {
|
|
18963
18976
|
src: isConnected ? badgeUrl : undefined,
|
|
@@ -19469,9 +19482,9 @@ function SmallBodyText(props) {
|
|
|
19469
19482
|
return jsx(BodyText, Object.assign({ size: "small" }, props));
|
|
19470
19483
|
}
|
|
19471
19484
|
function PropertyListItem(_a) {
|
|
19472
|
-
var { isLoading = false, label, detail, icon, className, variant = "small", showGradientBg = true, labelClassName, iconClassName, detailClassName } = _a, props = __rest$1(_a, ["isLoading", "label", "detail", "icon", "className", "variant", "showGradientBg", "labelClassName", "iconClassName", "detailClassName"]);
|
|
19485
|
+
var { isLoading = false, label, detail, icon, className, variant = "small", showGradientBg = true, labelClassName, iconClassName, detailClassName, tooltip } = _a, props = __rest$1(_a, ["isLoading", "label", "detail", "icon", "className", "variant", "showGradientBg", "labelClassName", "iconClassName", "detailClassName", "tooltip"]);
|
|
19473
19486
|
const Text = variant === "small" ? CaptionText : SmallBodyText;
|
|
19474
|
-
return (jsx("li", Object.assign({}, props, { className: cn("tw-flex tw-w-full tw-gap-squid-xs tw-rounded-squid-xs tw-text-grey-300", showGradientBg && "squid-property-row-bg", containerVariantClassNameMap[variant], className), children: jsxs("div", { className: cn("tw-flex tw-h-squid-l tw-w-full tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs", childrenVariantClassNameMap[variant]), children: [jsx("div", { className: cn("tw-w-6 tw-text-grey-500", iconClassName), children: icon }),
|
|
19487
|
+
return (jsx("li", Object.assign({}, props, { className: cn("tw-flex tw-w-full tw-gap-squid-xs tw-rounded-squid-xs tw-text-grey-300", showGradientBg && "squid-property-row-bg", containerVariantClassNameMap[variant], className), children: jsxs("div", { className: cn("tw-flex tw-h-squid-l tw-w-full tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs", childrenVariantClassNameMap[variant]), children: [jsx("div", { className: cn("tw-w-6 tw-text-grey-500", iconClassName), children: icon }), jsxs(Text, { className: cn("tw-flex tw-min-w-fit tw-flex-1 tw-gap-squid-xxs tw-text-grey-500", labelClassName), children: [jsx(TextSkeleton, { isLoading: isLoading, children: label }), !!tooltip && (jsx(Tooltip, Object.assign({}, tooltip, { children: jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-500" }) })))] }), jsx(Text, { truncate: variant === "small" || undefined, className: cn("tw-flex tw-text-grey-300", detailClassName), children: jsx(TextSkeleton, { isLoading: isLoading, children: detail }) })] }) })));
|
|
19475
19488
|
}
|
|
19476
19489
|
|
|
19477
19490
|
function RouteStep({ imageUrl, descriptionBlocks, subtitle, showStepSeparator = false, }) {
|
|
@@ -19809,7 +19822,7 @@ const TransactionItemHeader = ({ isLoading = false, variant, type, hash, status,
|
|
|
19809
19822
|
if (variant === "full") {
|
|
19810
19823
|
if (!type || !hash)
|
|
19811
19824
|
return null;
|
|
19812
|
-
return (jsxs(TransactionItemHeaderWrapper, { children: [jsx(TxTypeLabel, { type: type }), jsx("span", { className: "tw-text-grey-500", children:
|
|
19825
|
+
return (jsxs(TransactionItemHeaderWrapper, { children: [jsx(TxTypeLabel, { type: type }), jsx("span", { className: "tw-text-grey-500", children: hash })] }));
|
|
19813
19826
|
}
|
|
19814
19827
|
if (status && type) {
|
|
19815
19828
|
return (jsxs(TransactionItemHeaderWrapper, { children: [jsx(TransactionState, { status: status, variant: "small" }), jsx(TxTypeLabel, { type: type })] }));
|
|
@@ -25930,6 +25943,14 @@ function PopLayout(props) {
|
|
|
25930
25943
|
return jsx(motion.div, Object.assign({ ref: ref }, props));
|
|
25931
25944
|
}
|
|
25932
25945
|
|
|
25946
|
+
function TxProgressViewHeader({ title, description, isWarning = false, }) {
|
|
25947
|
+
return (jsxs("header", { className: "tw-flex tw-min-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsx(BodyText, { size: "large", className: "tw-min-h-squid-m !tw-leading-[25px] tw-text-grey-300", children: title }), jsx(CaptionText, { className: cn("tw-h-squid-l", isWarning ? "tw-text-status-partial" : "tw-text-grey-500"), children: description })] }));
|
|
25948
|
+
}
|
|
25949
|
+
|
|
25950
|
+
function UnsupportedPairNotice({ description, fromImageUrl, toImageUrl, }) {
|
|
25951
|
+
return (jsxs("article", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs", children: [jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs -tw-space-x-[18px] tw-p-squid-xs", children: [jsx(Image$1, { src: fromImageUrl, size: "large", rounded: "xs" }), jsx("span", { className: "tw-z-[1] tw-rounded-full tw-bg-grey-900", children: jsx(CircleXFilledIcon, {}) }), jsx(Image$1, { src: toImageUrl, size: "large", rounded: "xs" })] }), jsx(CaptionText, { className: "tw-max-w-[260px] tw-text-balance tw-text-center tw-text-grey-500", children: description })] }));
|
|
25952
|
+
}
|
|
25953
|
+
|
|
25933
25954
|
var lib = {};
|
|
25934
25955
|
|
|
25935
25956
|
var uaParser_min = {exports: {}};
|
|
@@ -27775,6 +27796,45 @@ const List = ({ children }) => {
|
|
|
27775
27796
|
return (jsx("ul", { className: "tw-flex tw-flex-col tw-gap-squid-xxs tw-pb-squid-xs", children: children }));
|
|
27776
27797
|
};
|
|
27777
27798
|
|
|
27799
|
+
function useCountdown(initialSeconds) {
|
|
27800
|
+
const [secondsLeft, setSecondsLeft] = useState(initialSeconds);
|
|
27801
|
+
useEffect(() => {
|
|
27802
|
+
if (secondsLeft <= 0)
|
|
27803
|
+
return;
|
|
27804
|
+
const timer = setInterval(() => {
|
|
27805
|
+
setSecondsLeft((prev) => Math.max(prev - 1, 0));
|
|
27806
|
+
}, 1000);
|
|
27807
|
+
return () => {
|
|
27808
|
+
clearInterval(timer);
|
|
27809
|
+
};
|
|
27810
|
+
}, [secondsLeft]);
|
|
27811
|
+
return formatCountdown(secondsLeft);
|
|
27812
|
+
}
|
|
27813
|
+
|
|
27814
|
+
function DepositAddressView({ isOpen = true, fromToken, toToken, handleClose, fromChain, toChain, fromAmount, toAmount, depositAddress, depositAddressFormatted, timeRemainingSeconds = 0, tooltips, description, title, }) {
|
|
27815
|
+
return (jsxs(Modal, { isOpen: isOpen, onBackdropClick: handleClose, children: [jsxs(ModalContent, { style: {
|
|
27816
|
+
[CSS_VARS.SCALE_AND_FADE_DOWN_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE}ms`,
|
|
27817
|
+
[CSS_VARS.SCALE_AND_FADE_UP_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE}ms`,
|
|
27818
|
+
}, borderType: "outline", children: [jsx("div", { className: "tw-relative tw-flex tw-h-[130px] tw-w-full tw-items-center tw-justify-center tw-rounded-tl-modal tw-rounded-tr-modal tw-bg-grey-900 tw-py-squid-s tw-text-material-light-thin mobile-xs-height:tw-h-[160px]", style: {
|
|
27819
|
+
// box shadow simulating bottom outline (we do not use css outline because cannot apply it to only one side)
|
|
27820
|
+
boxShadow: "0 1px 0 currentColor",
|
|
27821
|
+
}, children: jsx("div", { className: "tw-absolute tw-right-squid-xs tw-top-squid-xs", children: jsx(Button$1, { size: "md", variant: "secondary", label: "Copy" }) }) }), jsx("div", { className: "tw-relative tw-flex tw-h-squid-m tw-w-full tw-items-end tw-justify-between tw-self-stretch tw-px-squid-m", children: jsx(Image$1, { src: fromToken.logoUrl, rounded: "full", shadow: true, size: "xlarge" }) }), jsx(TxProgressViewHeader, { title: title, description: description, isWarning: true }), jsxs("ul", { className: "tw-flex tw-w-full tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xxs tw-rounded-squid-l tw-pb-squid-s mobile-xs-height:tw-max-h-[195px]", children: [jsx(PropertyListItem, { icon: jsx(WalletFilledIcon, { size: "24" }), label: "Deposit address", detail: jsx(HashLink, { className: "tw-text-royal-500", formattedHash: depositAddressFormatted, hash: depositAddress, showCopyButton: true, copyIconSize: "24" }), tooltip: (tooltips === null || tooltips === void 0 ? void 0 : tooltips.depositAddress)
|
|
27822
|
+
? {
|
|
27823
|
+
tooltipContent: tooltips.depositAddress,
|
|
27824
|
+
tooltipWidth: "max",
|
|
27825
|
+
}
|
|
27826
|
+
: undefined }), jsx(PropertyListItem, { iconClassName: "tw-flex tw-items-center tw-justify-center", icon: jsx(ArrowRightUpIcon, { size: "15", strokeWidth: "1.5" }), label: "Send exactly", detail: jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: jsx(CaptionText, { children: fromAmount }) }) }), jsx(PropertyListItem, { iconClassName: "tw-flex tw-items-center tw-justify-center", icon: jsx(ArrowRightDownIcon, { size: "15", strokeWidth: "1.5" }), label: "You receive", detail: jsx(IconLabel, { src: toToken.logoUrl, rounded: "full", children: jsxs(Fragment, { children: [jsx(CaptionText, { children: toAmount }), jsx(Loader, { size: "16" })] }) }) }), jsx(PropertyListItem, { icon: jsx(ChainLink, { size: "24", strokeWidth: "2" }), label: "Chain", detail: jsx(Transfer, { from: jsxs(Fragment, { children: [jsx(Image$1, { src: fromChain.logoUrl, rounded: "xxs", shadow: true, size: "medium" }), jsx(CaptionText, { children: fromChain.networkName })] }), to: jsxs(Fragment, { children: [jsx(Image$1, { src: toChain.logoUrl, rounded: "xxs", shadow: true, size: "medium" }), jsx(CaptionText, { children: toChain.networkName })] }) }) }), jsx(TimeRemaining, { timeRemainingSeconds: timeRemainingSeconds, tooltipContent: tooltips === null || tooltips === void 0 ? void 0 : tooltips.timeRemaining })] })] }), jsx(Button$1, { size: "lg", variant: "secondary", label: "Cancel", onClick: handleClose, className: "tw-min-h-button" })] }));
|
|
27827
|
+
}
|
|
27828
|
+
function TimeRemaining({ timeRemainingSeconds, tooltipContent, }) {
|
|
27829
|
+
const timeRemaining = useCountdown(timeRemainingSeconds);
|
|
27830
|
+
return (jsx(PropertyListItem, { icon: jsx(TimeFliesIcon, {}), label: "Time remaining", detail: timeRemaining, tooltip: tooltipContent
|
|
27831
|
+
? {
|
|
27832
|
+
tooltipWidth: "max",
|
|
27833
|
+
tooltipContent,
|
|
27834
|
+
}
|
|
27835
|
+
: undefined }));
|
|
27836
|
+
}
|
|
27837
|
+
|
|
27778
27838
|
function MainView({ isLoading = false }) {
|
|
27779
27839
|
return (jsxs(ProductCard, { children: [jsx(NavigationBar, { isLoading: isLoading, title: "Swap", actions: [
|
|
27780
27840
|
{
|
|
@@ -69347,7 +69407,7 @@ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, s
|
|
|
69347
69407
|
}, secondToken: {
|
|
69348
69408
|
bgColor: toToken.bgColor,
|
|
69349
69409
|
logoURI: toToken.logoUrl,
|
|
69350
|
-
} })) }), jsx(
|
|
69410
|
+
} })) }), jsx(TxProgressViewHeader, { title: headerTitle, description: headerDescription }), jsxs("ul", { className: "tw-flex tw-w-full tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xxs tw-rounded-squid-l tw-pb-squid-s tw-pt-squid-xs mobile-xs-height:tw-h-[195px] mobile-sm-height:tw-py-squid-s", children: [jsx(PropertyListItem, { icon: jsx(ArrowsSwapIcon, {}), label: "Swap", detail: jsx(Transfer, { from: jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: fromAmount }), to: jsx(IconLabel, { src: toToken.logoUrl, rounded: "full", children: toAmount }) }) }), jsx(PropertyListItem, { icon: jsx(ChainLink, { size: "24", strokeWidth: "2" }), label: "Chain", detail: jsx(Transfer, { from: jsxs(Fragment, { children: [jsx("img", { className: "tw-h-squid-m tw-w-squid-m tw-rounded-squid-xxs", src: fromChain.logoUrl }), jsx(CaptionText, { children: fromChain.networkName })] }), to: jsxs(Fragment, { children: [jsx("img", { className: "tw-h-squid-m tw-w-squid-m tw-rounded-squid-xxs", src: toChain.logoUrl }), jsx(CaptionText, { children: toChain.networkName })] }) }) }), jsx(PropertyListItem, { icon: jsx(WalletFilledIcon, { size: "24" }), label: "Wallet", detail: jsx(Transfer, { from: fromAddressFormatted, to: toAddressFormatted }) }), jsx(PropertyListItem, { icon: jsx(TimeFliesIcon, {}), label: "Time to complete", detail: swapState === SwapState.PROGRESS ? (jsx(Transfer, { from: timer, to: estimatedTimeToComplete })) : swapState === SwapState.COMPLETED ? (jsx(CaptionText, { children: timer })) : (jsx(CaptionText, { children: estimatedTimeToComplete })) })] })] }), jsx(TrackTransactionView, { ref: trackTransactionViewRef, onTxEnd: () => {
|
|
69351
69411
|
stopTimer();
|
|
69352
69412
|
}, onTxStart: () => {
|
|
69353
69413
|
startTimer();
|
|
@@ -69804,4 +69864,4 @@ function ThemeProvider(_a) {
|
|
|
69804
69864
|
return (jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-group tw-relative tw-flex tw-font-squid-main tw-h-d-screen mobile-lg:tw-h-auto", props.className), children: children })));
|
|
69805
69865
|
}
|
|
69806
69866
|
|
|
69807
|
-
export { ANIMATION_DURATIONS, AccountListItem, AccountsButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, Announcement, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, CelebrateIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CopyIcon, CopyOutlinedIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FavouriteFilterIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HighestPriceRangeIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageGroup, ImageIcon, ImageSparkle, ImageState, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NewsIcon, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PauseIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, PriceChange, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, QrCodeIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileFilledIcon, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, SquidVector, StakeAction, StarLinesIcon, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView,
|
|
69867
|
+
export { ANIMATION_DURATIONS, AccountListItem, AccountsButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, Announcement, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, CelebrateIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CopyIcon, CopyOutlinedIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DepositAddressView, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FavouriteFilterIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HighestPriceRangeIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageGroup, ImageIcon, ImageSparkle, ImageState, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NewsIcon, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PauseIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, PriceChange, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, QrCodeIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileFilledIcon, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, SquidVector, StakeAction, StarLinesIcon, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, Tab, Tabs, TagIcon, TagIconFilled, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenDetailsView, TokenGroup, TokenGroups, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, TxProgressViewHeader, UnsupportedPairNotice, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, adjustColorForContrast, baseTailwindConfig, blendColors, cn, darkTheme, getColorBrightness, getContrastColor, getHexColorFromOpacityPercentage, getWalletCardBackground, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseColor, parseSquidTheme, pxToRem, remToPx, rgbToHex, spacing$1 as spacing, statusTextClassMap, transactionErrorPauseAnimation, transactionFailureAnimation, transactionHalfSuccessAnimation, transactionPendingAnimation, transactionProcessingAnimation, transactionRejectedAnimation, transactionSuccessAnimation, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
|
|
@@ -9,10 +9,11 @@ interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
link?: string;
|
|
11
11
|
isLoading?: boolean;
|
|
12
|
+
showLoader?: boolean;
|
|
12
13
|
chip?: ChipProps;
|
|
13
14
|
containerClassName?: string;
|
|
14
15
|
buttonRef?: React.Ref<HTMLButtonElement>;
|
|
15
16
|
anchorRef?: React.Ref<HTMLAnchorElement>;
|
|
16
17
|
}
|
|
17
|
-
export declare function Button({ label, disabled, size, variant, icon, link, isLoading, chip, containerClassName, anchorRef, buttonRef, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function Button({ label, disabled, size, variant, icon, link, isLoading, showLoader, chip, containerClassName, anchorRef, buttonRef, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { type ComponentProps } from "react";
|
|
2
2
|
export declare function ArrowRightIcon(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare function ArrowRightDownIcon(
|
|
4
|
-
|
|
3
|
+
export declare function ArrowRightDownIcon({ size, className, strokeWidth, }: {
|
|
4
|
+
size?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
strokeWidth?: string;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function ArrowRightUpIcon({ size, className, strokeWidth, }: {
|
|
9
|
+
size?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
strokeWidth?: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
13
|
export declare function ChevronArrowIcon({ size, className, }: {
|
|
6
14
|
size?: string;
|
|
7
15
|
className?: string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
interface HashLinkProps {
|
|
3
3
|
showTx?: boolean;
|
|
4
4
|
hash: string;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
showCopyButton?: boolean;
|
|
7
7
|
url?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
formattedHash?: string;
|
|
10
|
+
copyIconSize?: string;
|
|
8
11
|
}
|
|
9
|
-
export declare function HashLink({ showTx, hash, showCopyButton, url, children, }: HashLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function HashLink({ showTx, hash, showCopyButton, url, children, className, formattedHash, copyIconSize, }: HashLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface TxProgressViewHeaderProps {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
isWarning?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function TxProgressViewHeader({ title, description, isWarning, }: TxProgressViewHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface UnsupportedPairNoticeProps {
|
|
2
|
+
description: string;
|
|
3
|
+
fromImageUrl: string;
|
|
4
|
+
toImageUrl: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function UnsupportedPairNotice({ description, fromImageUrl, toImageUrl, }: UnsupportedPairNoticeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -20,7 +20,6 @@ export * from "./PipeSeparator";
|
|
|
20
20
|
export * from "./ProductCard";
|
|
21
21
|
export * from "./ProfileHeaderBackground";
|
|
22
22
|
export * from "./SwapConfiguration";
|
|
23
|
-
export * from "./SwapProgressViewHeader";
|
|
24
23
|
export * from "./SwapStepsCollapsed";
|
|
25
24
|
export * from "./Toast";
|
|
26
25
|
export * from "./TokenDetailsView";
|
|
@@ -41,3 +40,5 @@ export * from "./TransactionProperties/SwapProperties";
|
|
|
41
40
|
export * from "./TransactionProperties/TransactionProperties";
|
|
42
41
|
export * from "./TransactionSearch";
|
|
43
42
|
export * from "./Transfer";
|
|
43
|
+
export * from "./TxProgressViewHeader";
|
|
44
|
+
export * from "./UnsupportedPairNotice";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps } from "react";
|
|
2
2
|
import { type PropertyListItemSize } from "../../types/components";
|
|
3
|
+
import { type TooltipProps } from "../controls";
|
|
3
4
|
export interface PropertyListItemProps extends ComponentProps<"li"> {
|
|
4
5
|
isLoading?: boolean;
|
|
5
6
|
label?: React.ReactNode;
|
|
@@ -10,5 +11,6 @@ export interface PropertyListItemProps extends ComponentProps<"li"> {
|
|
|
10
11
|
labelClassName?: string;
|
|
11
12
|
iconClassName?: string;
|
|
12
13
|
detailClassName?: string;
|
|
14
|
+
tooltip?: Omit<TooltipProps, "children">;
|
|
13
15
|
}
|
|
14
|
-
export declare function PropertyListItem({ isLoading, label, detail, icon, className, variant, showGradientBg, labelClassName, iconClassName, detailClassName, ...props }: PropertyListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function PropertyListItem({ isLoading, label, detail, icon, className, variant, showGradientBg, labelClassName, iconClassName, detailClassName, tooltip, ...props }: PropertyListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ChainData {
|
|
3
|
+
networkName: string;
|
|
4
|
+
logoUrl: string;
|
|
5
|
+
}
|
|
6
|
+
interface Token {
|
|
7
|
+
symbol: string;
|
|
8
|
+
logoUrl: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function DepositAddressView({ isOpen, fromToken, toToken, handleClose, fromChain, toChain, fromAmount, toAmount, depositAddress, depositAddressFormatted, timeRemainingSeconds, tooltips, description, title, }: {
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
fromToken: Token;
|
|
13
|
+
toToken: Token;
|
|
14
|
+
handleClose?: () => void;
|
|
15
|
+
fromChain: ChainData;
|
|
16
|
+
toChain: ChainData;
|
|
17
|
+
fromAmount: string;
|
|
18
|
+
toAmount: string;
|
|
19
|
+
depositAddress: string;
|
|
20
|
+
depositAddressFormatted: string;
|
|
21
|
+
timeRemainingSeconds?: number;
|
|
22
|
+
tooltips?: {
|
|
23
|
+
depositAddress?: React.ReactNode;
|
|
24
|
+
timeRemaining?: React.ReactNode;
|
|
25
|
+
};
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -16,13 +16,13 @@ interface DebouncedFunction<F extends AnyFunction> {
|
|
|
16
16
|
}
|
|
17
17
|
export declare function debounce<F extends AnyFunction>(func: F, delay: number): DebouncedFunction<F>;
|
|
18
18
|
export declare const formatDuration: (elapsedTime: number) => string;
|
|
19
|
+
export declare function formatCountdown(seconds: number): string;
|
|
19
20
|
export declare const formatTime: (timestampSeconds: number) => string;
|
|
20
21
|
export declare const formatRelativeTime: (timestampSeconds: number) => string;
|
|
21
22
|
export declare const formatRelativeDate: (timestampSeconds: number) => string;
|
|
22
23
|
export declare function capitalize(text: string): string;
|
|
23
24
|
type Falsy = false | null | undefined | 0 | "";
|
|
24
25
|
export declare function truthy<T>(value: T): value is Exclude<T, Falsy>;
|
|
25
|
-
export declare function truncateHash(hash: string): string;
|
|
26
26
|
export declare const styled: <Tag extends keyof JSX.IntrinsicElements>(tag: Tag, className: string) => import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<ComponentProps<Tag>> & import("react").RefAttributes<ElementType<Tag>>>;
|
|
27
27
|
export declare const mergeProps: <Tag extends keyof JSX.IntrinsicElements = any>(a: ComponentProps<Tag>, b: ComponentProps<Tag>) => ComponentProps<Tag>;
|
|
28
28
|
export declare const calcLerp: (a: string, b: string, t: string | number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCountdown(initialSeconds: number): string;
|
|
@@ -13,6 +13,7 @@ export declare const GradientBorder: Story;
|
|
|
13
13
|
export declare const InsetBorder: Story;
|
|
14
14
|
export declare const OutlineBorder: Story;
|
|
15
15
|
export declare const RoundedFull: Story;
|
|
16
|
+
export declare const Shadow: Story;
|
|
16
17
|
export declare const CustomContent: Story;
|
|
17
18
|
export declare const PlaceholderForMissingImage: Story;
|
|
18
19
|
export declare const PlaceholderForBrokenImage: Story;
|
|
@@ -23,6 +23,8 @@ export declare const LargeTertiary: Story;
|
|
|
23
23
|
export declare const LargeDisabled: Story;
|
|
24
24
|
export declare const LargeAndLink: Story;
|
|
25
25
|
export declare const LargeAndLinkDisabled: Story;
|
|
26
|
+
export declare const LargeWithLoader: Story;
|
|
27
|
+
export declare const LargeDisabledWithLoader: Story;
|
|
26
28
|
export declare const MediumWithIconLoading: Story;
|
|
27
29
|
export declare const MediumWithLabelLoading: Story;
|
|
28
30
|
export declare const MediumWithLongLabelLoading: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/react";
|
|
2
|
+
import { TxProgressViewHeader } from "../../components/layout/TxProgressViewHeader";
|
|
3
|
+
declare const meta: Meta<typeof TxProgressViewHeader>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Warning: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/react";
|
|
2
|
+
import { UnsupportedPairNotice } from "../../components/layout/UnsupportedPairNotice";
|
|
3
|
+
declare const meta: Meta<typeof UnsupportedPairNotice>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/react";
|
|
2
|
+
import { DepositAddressView } from "../../components/views/DepositAddressView";
|
|
3
|
+
declare const meta: Meta<typeof DepositAddressView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|