@0xsquid/ui 2.4.8 → 2.4.10-beta.0

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.
Files changed (39) hide show
  1. package/dist/cjs/index.js +92 -28
  2. package/dist/cjs/types/components/buttons/Button.d.ts +2 -1
  3. package/dist/cjs/types/components/icons/Arrow.d.ts +10 -2
  4. package/dist/cjs/types/components/layout/HashLink.d.ts +5 -2
  5. package/dist/cjs/types/components/layout/Join.d.ts +1 -1
  6. package/dist/cjs/types/components/layout/TxProgressViewHeader.d.ts +7 -0
  7. package/dist/cjs/types/components/layout/index.d.ts +1 -1
  8. package/dist/cjs/types/components/lists/PropertyListItem.d.ts +3 -1
  9. package/dist/cjs/types/components/views/DepositAddressView.d.ts +33 -0
  10. package/dist/cjs/types/components/views/index.d.ts +1 -0
  11. package/dist/cjs/types/core/utils.d.ts +1 -1
  12. package/dist/cjs/types/hooks/useCountdown.d.ts +1 -0
  13. package/dist/cjs/types/stories/badges/Image.stories.d.ts +1 -0
  14. package/dist/cjs/types/stories/buttons/Button.stories.d.ts +2 -0
  15. package/dist/cjs/types/stories/layout/TxProgressViewHeader.stories.d.ts +7 -0
  16. package/dist/cjs/types/stories/views/DepositAddressView.stories.d.ts +6 -0
  17. package/dist/esm/index.js +91 -28
  18. package/dist/esm/types/components/buttons/Button.d.ts +2 -1
  19. package/dist/esm/types/components/icons/Arrow.d.ts +10 -2
  20. package/dist/esm/types/components/layout/HashLink.d.ts +5 -2
  21. package/dist/esm/types/components/layout/Join.d.ts +1 -1
  22. package/dist/esm/types/components/layout/TxProgressViewHeader.d.ts +7 -0
  23. package/dist/esm/types/components/layout/index.d.ts +1 -1
  24. package/dist/esm/types/components/lists/PropertyListItem.d.ts +3 -1
  25. package/dist/esm/types/components/views/DepositAddressView.d.ts +33 -0
  26. package/dist/esm/types/components/views/index.d.ts +1 -0
  27. package/dist/esm/types/core/utils.d.ts +1 -1
  28. package/dist/esm/types/hooks/useCountdown.d.ts +1 -0
  29. package/dist/esm/types/stories/badges/Image.stories.d.ts +1 -0
  30. package/dist/esm/types/stories/buttons/Button.stories.d.ts +2 -0
  31. package/dist/esm/types/stories/layout/TxProgressViewHeader.stories.d.ts +7 -0
  32. package/dist/esm/types/stories/views/DepositAddressView.stories.d.ts +6 -0
  33. package/dist/index.css +1 -1
  34. package/dist/index.d.ts +58 -12
  35. package/package.json +1 -1
  36. package/dist/cjs/types/components/layout/SwapProgressViewHeader.d.ts +0 -6
  37. package/dist/cjs/types/stories/layout/SwapProgressViewHeader.stories.d.ts +0 -6
  38. package/dist/esm/types/components/layout/SwapProgressViewHeader.d.ts +0 -6
  39. package/dist/esm/types/stories/layout/SwapProgressViewHeader.stories.d.ts +0 -6
package/dist/cjs/index.js CHANGED
@@ -2808,6 +2808,20 @@ const formatDuration = (elapsedTime) => {
2808
2808
  // Show only minutes if total time is 1 minute or more
2809
2809
  return `${minutes}m`;
2810
2810
  };
2811
+ function formatCountdown(seconds) {
2812
+ const hours = Math.floor((seconds / 3600) % 24);
2813
+ const minutes = Math.floor((seconds / 60) % 60);
2814
+ const secs = seconds % 60;
2815
+ if (hours > 0) {
2816
+ return `${hours}h : ${String(minutes).padStart(2, "0")}m : ${String(secs).padStart(2, "0")}s`;
2817
+ }
2818
+ else if (minutes > 0) {
2819
+ return `${minutes}m : ${String(secs).padStart(2, "0")}s`;
2820
+ }
2821
+ else {
2822
+ return `${secs}s`;
2823
+ }
2824
+ }
2811
2825
  const formatTime = (timestampSeconds) => {
2812
2826
  const date = new Date(timestampSeconds * 1000);
2813
2827
  const hours = date.getHours();
@@ -2870,9 +2884,6 @@ const formatRelativeDate = (timestampSeconds) => {
2870
2884
  });
2871
2885
  return formattedDate;
2872
2886
  };
2873
- function truncateHash(hash) {
2874
- return `${hash.slice(0, 8)}...${hash.slice(-6)}`;
2875
- }
2876
2887
  const calcLerp = (a, b, t) => `calc(${a} + (${b} - ${a}) * ${t})`;
2877
2888
  /**
2878
2889
  * Returns an array including the first `count` unique values of the array
@@ -3662,11 +3673,11 @@ function Approve() {
3662
3673
  function ArrowRightIcon() {
3663
3674
  return (jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M14 6L20 12L14 18M19 12H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
3664
3675
  }
3665
- function ArrowRightDownIcon() {
3666
- return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", fill: "none", viewBox: "0 0 10 10", children: jsxRuntime.jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9 3v6H3M1.167 1.167l7.166 7.166" }) }));
3676
+ function ArrowRightDownIcon({ size = "10", className, strokeWidth = "2", }) {
3677
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 10 10", className: className, children: jsxRuntime.jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: strokeWidth, d: "M9 3v6H3M1.167 1.167l7.166 7.166" }) }));
3667
3678
  }
3668
- function ArrowRightUpIcon() {
3669
- return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", fill: "none", viewBox: "0 0 10 10", children: jsxRuntime.jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9 7V1m0 0H3m6 0L1.167 8.833" }) }));
3679
+ function ArrowRightUpIcon({ size = "10", className, strokeWidth = "2", }) {
3680
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 10 10", className: className, children: jsxRuntime.jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: strokeWidth, d: "M9 7V1m0 0H3m6 0L1.167 8.833" }) }));
3670
3681
  }
3671
3682
  function ChevronArrowIcon({ size = "16", className, }) {
3672
3683
  return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.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" }) }));
@@ -4327,12 +4338,14 @@ function UsdAmount({ usdAmount }) {
4327
4338
  return (jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "$" }), jsxRuntime.jsx(CaptionText, { children: usdAmount.toString() })] }));
4328
4339
  }
4329
4340
 
4330
- function HashLink({ showTx = false, hash, showCopyButton = false, url, children, }) {
4331
- return (jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [showTx && jsxRuntime.jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children : truncateHash(hash), url && (jsxRuntime.jsx("a", { href: url, target: "_blank", className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(SquareArrowTopRight2Icon, { strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-text-royal-500" }) })), showCopyButton && (jsxRuntime.jsx("span", { className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(Copy, { size: "16", strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-cursor-pointer tw-text-royal-500", onClick: () => navigator.clipboard.writeText(hash) }) }))] }));
4341
+ function HashLink({ showTx = false, hash, showCopyButton = false, url, children, className, formattedHash, copyIconSize = "16", }) {
4342
+ return (jsxRuntime.jsxs("div", { className: cn("tw-flex tw-items-center", className), children: [showTx && jsxRuntime.jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children : formattedHash, url && (jsxRuntime.jsx("a", { href: url, target: "_blank", className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", rel: "noreferrer", children: jsxRuntime.jsx(SquareArrowTopRight2Icon, { strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-text-royal-500" }) })), showCopyButton && (jsxRuntime.jsx("span", { className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(Copy, { size: copyIconSize, strokeWidth: "2", className: "tw-cursor-pointer tw-text-royal-500", onClick: () => {
4343
+ navigator.clipboard.writeText(hash).catch(() => { });
4344
+ } }) }))] }));
4332
4345
  }
4333
4346
 
4334
4347
  function WalletLink({ imageURI, address }) {
4335
- return (jsxRuntime.jsx(IconLabel, { src: imageURI, rounded: "full", children: jsxRuntime.jsx(HashLink, { hash: address, showCopyButton: true, children: jsxRuntime.jsx(BodyText, { size: "small", children: truncateHash(address) }) }) }));
4348
+ return (jsxRuntime.jsx(IconLabel, { src: imageURI, rounded: "full", children: jsxRuntime.jsx(HashLink, { hash: address, showCopyButton: true, children: jsxRuntime.jsx(BodyText, { size: "small", children: address }) }) }));
4336
4349
  }
4337
4350
 
4338
4351
  const extraPaddingMap = {
@@ -4400,9 +4413,9 @@ const buttonVariantClassMap = {
4400
4413
  const buttonDisabledClass = "!tw-bg-grey-800 !tw-text-grey-600 tw-cursor-not-allowed";
4401
4414
  const loadingClassname = "tw-invisible tw-opacity-0";
4402
4415
  function Button$1(_a) {
4403
- 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"]);
4416
+ 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"]);
4404
4417
  const chipElement = chip != null ? (jsxRuntime.jsx(Chip, Object.assign({}, chip, { className: cn("tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10", chip.className) }))) : null;
4405
- const children = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!disabled && !isLoading && (jsxRuntime.jsx(ButtonHoverOverlay, { className: roundedClassMap[size][variant] })), jsxRuntime.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" ? (jsxRuntime.jsx("span", { className: "tw-px-squid-m", children: jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "medium", children: label }) })) : size === "md" ? (label != null && icon == null ? (
4418
+ const children = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!disabled && !isLoading && (jsxRuntime.jsx(ButtonHoverOverlay, { className: roundedClassMap[size][variant] })), jsxRuntime.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" ? (jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-justify-center tw-gap-squid-xs tw-px-squid-m", children: [showLoader && jsxRuntime.jsx(Loader, {}), jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "medium", children: label })] })) : size === "md" ? (label != null && icon == null ? (
4406
4419
  // label only
4407
4420
  jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "small", children: label })) : label == null && icon != null ? (
4408
4421
  // icon only
@@ -18888,7 +18901,7 @@ const borderTypeClassMap = {
18888
18901
  };
18889
18902
  function ModalContent(_a) {
18890
18903
  var { children, addGap = false, paddingY = false, borderType = "border", className } = _a, props = __rest$1(_a, ["children", "addGap", "paddingY", "borderType", "className"]);
18891
- return (jsxRuntime.jsx("div", Object.assign({}, props, { className: cn("tw-flex tw-h-full tw-max-h-[445px] tw-w-full tw-flex-col tw-self-stretch tw-rounded-modal tw-bg-grey-800 tw-text-grey-300 mobile-sm-height:tw-max-h-[535px]", addGap && "tw-gap-squid-xxs tw-pt-squid-xxs", borderTypeClassMap[borderType], paddingY && "tw-py-squid-xxs", className), children: children })));
18904
+ return (jsxRuntime.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 })));
18892
18905
  }
18893
18906
  function ModalContentDivider() {
18894
18907
  return (jsxRuntime.jsx("svg", { width: "100%", height: "11", viewBox: "0 0 400 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("rect", { x: "1", y: "5", width: "398", height: "1", fill: "currentColor" }) }));
@@ -18952,19 +18965,23 @@ function LogoContainer({ children }) {
18952
18965
  }
18953
18966
 
18954
18967
  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, }) {
18955
- var _a, _b, _c;
18968
+ var _a, _b;
18956
18969
  const isWalletButtonInteractive = !isLoading && !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick);
18957
18970
  const WalletButtonTag = isWalletButtonInteractive ? "button" : "div";
18958
18971
  const isFetching = isFetchingProp || isLoading;
18959
- return (jsxRuntime.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: [jsxRuntime.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: jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === "from" ? "Pay" : "Receive" }), !isLoading && !(walletButton === null || walletButton === void 0 ? void 0 : walletButton.disabled) && !!token && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BodyText, { size: "small", children: ":" }), jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsxRuntime.jsx(BodyText, { size: "small", className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
18972
+ const showWalletButtonLabel = !isLoading &&
18973
+ !(walletButton === null || walletButton === void 0 ? void 0 : walletButton.disabled) &&
18974
+ !!token &&
18975
+ (!!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.address) || !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel));
18976
+ return (jsxRuntime.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: [jsxRuntime.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: jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === "from" ? "Pay" : "Receive" }), showWalletButtonLabel && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BodyText, { size: "small", children: ":" }), jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsxRuntime.jsx(BodyText, { size: "small", className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
18960
18977
  ? "tw-text-grey-300"
18961
18978
  : "tw-text-royal-500", children: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
18962
18979
  ? walletButton === null || walletButton === void 0 ? void 0 : walletButton.address
18963
- : (_a = walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel) !== null && _a !== void 0 ? _a : "Connect wallet" }), jsxRuntime.jsx(ChevronArrowIcon, { className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
18980
+ : walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel }), jsxRuntime.jsx(ChevronArrowIcon, { className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
18964
18981
  ? "tw-text-grey-600"
18965
18982
  : "tw-text-royal-500" })] })] }))] }) })) }), jsxRuntime.jsx("div", { className: "tw-px-squid-m mobile-lg:tw-px-squid-l", children: jsxRuntime.jsx(AssetsButton, Object.assign({}, assetsButton, { chain: chain, token: token, isLoading: isLoading })) }), isFetching && (jsxRuntime.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: jsxRuntime.jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsxRuntime.jsx(NumericInput, { inputMode: "decimal", pattern: "[0-9.,]*", token: {
18966
- decimals: (_b = token === null || token === void 0 ? void 0 : token.decimals) !== null && _b !== void 0 ? _b : 18,
18967
- symbol: (_c = token === null || token === void 0 ? void 0 : token.symbol) !== null && _c !== void 0 ? _c : "",
18983
+ decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
18984
+ symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : "",
18968
18985
  price: tokenPrice,
18969
18986
  }, onAmountChange: (value) => {
18970
18987
  onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value);
@@ -18974,8 +18991,8 @@ function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp
18974
18991
  }, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails: showNumericInputDetails, direction: direction, forcedAmount: amount, inputModeButton: inputModeButton, balanceButton: balanceButton, isInteractive: isInputInteractive && !isLoading })] }));
18975
18992
  }
18976
18993
 
18977
- function SwapProgressViewHeader({ title, description, }) {
18978
- return (jsxRuntime.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: [jsxRuntime.jsx(BodyText, { size: "large", className: "tw-min-h-squid-m !tw-leading-[25px] tw-text-grey-300", children: title }), jsxRuntime.jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
18994
+ function TxProgressViewHeader({ title, description, isWarning = false, }) {
18995
+ return (jsxRuntime.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: [jsxRuntime.jsx(BodyText, { size: "large", className: "tw-min-h-squid-m !tw-leading-[25px] tw-text-grey-300", children: title }), jsxRuntime.jsx(CaptionText, { className: cn("tw-h-squid-l", isWarning ? "tw-text-status-partial" : "tw-text-grey-500"), children: description })] }));
18979
18996
  }
18980
18997
 
18981
18998
  function AccountListItem({ isConnected, imageUrls = [], imageUrl, badgeUrl, actions, subtitle, title, }) {
@@ -19489,9 +19506,9 @@ function SmallBodyText(props) {
19489
19506
  return jsxRuntime.jsx(BodyText, Object.assign({ size: "small" }, props));
19490
19507
  }
19491
19508
  function PropertyListItem(_a) {
19492
- 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"]);
19509
+ 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"]);
19493
19510
  const Text = variant === "small" ? CaptionText : SmallBodyText;
19494
- return (jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsx("div", { className: cn("tw-w-6 tw-text-grey-500", iconClassName), children: icon }), jsxRuntime.jsx(Text, { className: cn("tw-min-w-fit tw-flex-1 tw-text-grey-500", labelClassName), children: jsxRuntime.jsx(TextSkeleton, { isLoading: isLoading, children: label }) }), jsxRuntime.jsx(Text, { truncate: variant === "small" || undefined, className: cn("tw-flex tw-text-grey-300", detailClassName), children: jsxRuntime.jsx(TextSkeleton, { isLoading: isLoading, children: detail }) })] }) })));
19511
+ return (jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsx("div", { className: cn("tw-w-6 tw-text-grey-500", iconClassName), children: icon }), jsxRuntime.jsxs(Text, { className: cn("tw-flex tw-min-w-fit tw-flex-1 tw-gap-squid-xxs tw-text-grey-500", labelClassName), children: [jsxRuntime.jsx(TextSkeleton, { isLoading: isLoading, children: label }), !!tooltip && (jsxRuntime.jsx(Tooltip, Object.assign({}, tooltip, { children: jsxRuntime.jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-500" }) })))] }), jsxRuntime.jsx(Text, { truncate: variant === "small" || undefined, className: cn("tw-flex tw-text-grey-300", detailClassName), children: jsxRuntime.jsx(TextSkeleton, { isLoading: isLoading, children: detail }) })] }) })));
19495
19512
  }
19496
19513
 
19497
19514
  function RouteStep({ imageUrl, descriptionBlocks, subtitle, showStepSeparator = false, }) {
@@ -19829,7 +19846,7 @@ const TransactionItemHeader = ({ isLoading = false, variant, type, hash, status,
19829
19846
  if (variant === "full") {
19830
19847
  if (!type || !hash)
19831
19848
  return null;
19832
- return (jsxRuntime.jsxs(TransactionItemHeaderWrapper, { children: [jsxRuntime.jsx(TxTypeLabel, { type: type }), jsxRuntime.jsx("span", { className: "tw-text-grey-500", children: truncateHash(hash) })] }));
19849
+ return (jsxRuntime.jsxs(TransactionItemHeaderWrapper, { children: [jsxRuntime.jsx(TxTypeLabel, { type: type }), jsxRuntime.jsx("span", { className: "tw-text-grey-500", children: hash })] }));
19833
19850
  }
19834
19851
  if (status && type) {
19835
19852
  return (jsxRuntime.jsxs(TransactionItemHeaderWrapper, { children: [jsxRuntime.jsx(TransactionState, { status: status, variant: "small" }), jsxRuntime.jsx(TxTypeLabel, { type: type })] }));
@@ -27376,8 +27393,15 @@ function NumericInput(_a) {
27376
27393
  : "tw-text-grey-300";
27377
27394
  const BalanceChipTag = balanceChipClickable ? "button" : "div";
27378
27395
  const balanceFormatted = React$1.useMemo(() => {
27379
- return formatTokenAmount(balance !== null && balance !== void 0 ? balance : "0");
27380
- }, [balance]);
27396
+ switch (userInputType) {
27397
+ case UserInputType.TOKEN:
27398
+ return formatTokenAmount(balance !== null && balance !== void 0 ? balance : "0");
27399
+ case UserInputType.USD:
27400
+ return formatUsdAmount(convertTokenAmountToUSD(balance !== null && balance !== void 0 ? balance : "0", token === null || token === void 0 ? void 0 : token.price), {
27401
+ includeSign: false,
27402
+ });
27403
+ }
27404
+ }, [userInputType, balance, token.price]);
27381
27405
  const containerClassname = "tw-px-squid-xs !tw-h-full tw-pt-squid-xxs mobile-xs-height:tw-pb-squid-s tw-text-heading-small tw-font-regular mobile-lg:tw-px-squid-m tw-relative tw-h-[65px] mobile-sm-height:tw-h-[75px]";
27382
27406
  const inputRef = React$1.useRef(null);
27383
27407
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isInteractive && !isLoading ? (jsxRuntime.jsxs("form", { className: containerClassname, onSubmit: (e) => {
@@ -27396,7 +27420,7 @@ function NumericInput(_a) {
27396
27420
  ? "tw-opacity-0"
27397
27421
  : "" }), jsxRuntime.jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat("%") })] })) : null] }) }))), jsxRuntime.jsx(Tooltip, Object.assign({}, (isLoading ? undefined : balanceButton === null || balanceButton === void 0 ? void 0 : balanceButton.tooltip), { tooltipWidth: "max", childrenClassName: "tw-rounded-squid-s", containerClassName: "tw-rounded-squid-s", children: jsxRuntime.jsxs(BalanceChipTag, { onClick: onBalanceButtonClick, className: cn(buttonClassName, balanceChipClickable
27398
27422
  ? interactiveChipClassName
27399
- : notInteractiveChipClassName), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balanceFormatted }), !(balanceButton === null || balanceButton === void 0 ? void 0 : balanceButton.hideMaxChip) && jsxRuntime.jsx(Chip, { label: "Max" })] }) }))] }))] }));
27423
+ : notInteractiveChipClassName), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsxs("div", { children: [userInputType === UserInputType.USD && (jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "$" })), jsxRuntime.jsx(CaptionText, { children: balanceFormatted })] }), !(balanceButton === null || balanceButton === void 0 ? void 0 : balanceButton.hideMaxChip) && jsxRuntime.jsx(Chip, { label: "Max" })] }) }))] }))] }));
27400
27424
  }
27401
27425
 
27402
27426
  function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected = false, }) {
@@ -27788,6 +27812,45 @@ const List = ({ children }) => {
27788
27812
  return (jsxRuntime.jsx("ul", { className: "tw-flex tw-flex-col tw-gap-squid-xxs tw-pb-squid-xs", children: children }));
27789
27813
  };
27790
27814
 
27815
+ function useCountdown(initialSeconds) {
27816
+ const [secondsLeft, setSecondsLeft] = React$1.useState(initialSeconds);
27817
+ React$1.useEffect(() => {
27818
+ if (secondsLeft <= 0)
27819
+ return;
27820
+ const timer = setInterval(() => {
27821
+ setSecondsLeft((prev) => Math.max(prev - 1, 0));
27822
+ }, 1000);
27823
+ return () => {
27824
+ clearInterval(timer);
27825
+ };
27826
+ }, [secondsLeft]);
27827
+ return formatCountdown(secondsLeft);
27828
+ }
27829
+
27830
+ function DepositAddressView({ isOpen = true, fromToken, toToken, handleClose, openInWalletButton, fromChain, toChain, fromAmount, toAmount, depositAddress, depositAddressFormatted, timeRemainingSeconds = 0, tooltips, description, title, }) {
27831
+ return (jsxRuntime.jsxs(Modal, { isOpen: isOpen, onBackdropClick: handleClose, children: [jsxRuntime.jsxs(ModalContent, { style: {
27832
+ [CSS_VARS.SCALE_AND_FADE_DOWN_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE}ms`,
27833
+ [CSS_VARS.SCALE_AND_FADE_UP_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE}ms`,
27834
+ }, borderType: "outline", children: [jsxRuntime.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: {
27835
+ // box shadow simulating bottom outline (we do not use css outline because cannot apply it to only one side)
27836
+ boxShadow: "0 1px 0 currentColor",
27837
+ }, children: jsxRuntime.jsx("div", { className: "tw-absolute tw-right-squid-xs tw-top-squid-xs", children: jsxRuntime.jsx(Button$1, { size: "md", variant: "secondary", label: "Copy" }) }) }), jsxRuntime.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: jsxRuntime.jsx(Image$1, { src: fromToken.logoUrl, rounded: "full", shadow: true, size: "xlarge" }) }), jsxRuntime.jsx(TxProgressViewHeader, { title: title, description: description, isWarning: true }), jsxRuntime.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: [jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(WalletFilledIcon, { size: "24" }), label: "Deposit address", detail: jsxRuntime.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)
27838
+ ? {
27839
+ tooltipContent: tooltips.depositAddress,
27840
+ tooltipWidth: "max",
27841
+ }
27842
+ : undefined }), jsxRuntime.jsx(PropertyListItem, { iconClassName: "tw-flex tw-items-center tw-justify-center", icon: jsxRuntime.jsx(ArrowRightUpIcon, { size: "15", strokeWidth: "1.5" }), label: "Send exactly", detail: jsxRuntime.jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: jsxRuntime.jsx(CaptionText, { children: fromAmount }) }) }), jsxRuntime.jsx(PropertyListItem, { iconClassName: "tw-flex tw-items-center tw-justify-center", icon: jsxRuntime.jsx(ArrowRightDownIcon, { size: "15", strokeWidth: "1.5" }), label: "You receive", detail: jsxRuntime.jsx(IconLabel, { src: toToken.logoUrl, rounded: "full", children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(CaptionText, { children: toAmount }), jsxRuntime.jsx(Loader, { size: "16" })] }) }) }), jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(ChainLink, { size: "24", strokeWidth: "2" }), label: "Chain", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Image$1, { src: fromChain.logoUrl, rounded: "xxs", shadow: true, size: "medium" }), jsxRuntime.jsx(CaptionText, { children: fromChain.networkName })] }), to: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Image$1, { src: toChain.logoUrl, rounded: "xxs", shadow: true, size: "medium" }), jsxRuntime.jsx(CaptionText, { children: toChain.networkName })] }) }) }), jsxRuntime.jsx(TimeRemaining, { timeRemainingSeconds: timeRemainingSeconds, tooltipContent: tooltips === null || tooltips === void 0 ? void 0 : tooltips.timeRemaining })] })] }), jsxRuntime.jsx(Button$1, { size: "lg", variant: "primary", label: "Open in wallet", onClick: openInWalletButton === null || openInWalletButton === void 0 ? void 0 : openInWalletButton.onClick, disabled: openInWalletButton === null || openInWalletButton === void 0 ? void 0 : openInWalletButton.disabled, className: "tw-min-h-button" }), jsxRuntime.jsx(Button$1, { size: "lg", variant: "secondary", label: "Cancel", onClick: handleClose, className: "tw-min-h-button" })] }));
27843
+ }
27844
+ function TimeRemaining({ timeRemainingSeconds, tooltipContent, }) {
27845
+ const timeRemaining = useCountdown(timeRemainingSeconds);
27846
+ return (jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(TimeFliesIcon, {}), label: "Time remaining", detail: timeRemaining, tooltip: tooltipContent
27847
+ ? {
27848
+ tooltipWidth: "max",
27849
+ tooltipContent,
27850
+ }
27851
+ : undefined }));
27852
+ }
27853
+
27791
27854
  function MainView({ isLoading = false }) {
27792
27855
  return (jsxRuntime.jsxs(ProductCard, { children: [jsxRuntime.jsx(NavigationBar, { isLoading: isLoading, title: "Swap", actions: [
27793
27856
  {
@@ -69360,7 +69423,7 @@ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, s
69360
69423
  }, secondToken: {
69361
69424
  bgColor: toToken.bgColor,
69362
69425
  logoURI: toToken.logoUrl,
69363
- } })) }), jsxRuntime.jsx(SwapProgressViewHeader, { title: headerTitle, description: headerDescription }), jsxRuntime.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: [jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(ArrowsSwapIcon, {}), label: "Swap", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: fromAmount }), to: jsxRuntime.jsx(IconLabel, { src: toToken.logoUrl, rounded: "full", children: toAmount }) }) }), jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(ChainLink, { size: "24", strokeWidth: "2" }), label: "Chain", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("img", { className: "tw-h-squid-m tw-w-squid-m tw-rounded-squid-xxs", src: fromChain.logoUrl }), jsxRuntime.jsx(CaptionText, { children: fromChain.networkName })] }), to: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("img", { className: "tw-h-squid-m tw-w-squid-m tw-rounded-squid-xxs", src: toChain.logoUrl }), jsxRuntime.jsx(CaptionText, { children: toChain.networkName })] }) }) }), jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(WalletFilledIcon, { size: "24" }), label: "Wallet", detail: jsxRuntime.jsx(Transfer, { from: fromAddressFormatted, to: toAddressFormatted }) }), jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(TimeFliesIcon, {}), label: "Time to complete", detail: swapState === SwapState.PROGRESS ? (jsxRuntime.jsx(Transfer, { from: timer, to: estimatedTimeToComplete })) : swapState === SwapState.COMPLETED ? (jsxRuntime.jsx(CaptionText, { children: timer })) : (jsxRuntime.jsx(CaptionText, { children: estimatedTimeToComplete })) })] })] }), jsxRuntime.jsx(TrackTransactionView, { ref: trackTransactionViewRef, onTxEnd: () => {
69426
+ } })) }), jsxRuntime.jsx(TxProgressViewHeader, { title: headerTitle, description: headerDescription }), jsxRuntime.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: [jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(ArrowsSwapIcon, {}), label: "Swap", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: fromAmount }), to: jsxRuntime.jsx(IconLabel, { src: toToken.logoUrl, rounded: "full", children: toAmount }) }) }), jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(ChainLink, { size: "24", strokeWidth: "2" }), label: "Chain", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("img", { className: "tw-h-squid-m tw-w-squid-m tw-rounded-squid-xxs", src: fromChain.logoUrl }), jsxRuntime.jsx(CaptionText, { children: fromChain.networkName })] }), to: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("img", { className: "tw-h-squid-m tw-w-squid-m tw-rounded-squid-xxs", src: toChain.logoUrl }), jsxRuntime.jsx(CaptionText, { children: toChain.networkName })] }) }) }), jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(WalletFilledIcon, { size: "24" }), label: "Wallet", detail: jsxRuntime.jsx(Transfer, { from: fromAddressFormatted, to: toAddressFormatted }) }), jsxRuntime.jsx(PropertyListItem, { icon: jsxRuntime.jsx(TimeFliesIcon, {}), label: "Time to complete", detail: swapState === SwapState.PROGRESS ? (jsxRuntime.jsx(Transfer, { from: timer, to: estimatedTimeToComplete })) : swapState === SwapState.COMPLETED ? (jsxRuntime.jsx(CaptionText, { children: timer })) : (jsxRuntime.jsx(CaptionText, { children: estimatedTimeToComplete })) })] })] }), jsxRuntime.jsx(TrackTransactionView, { ref: trackTransactionViewRef, onTxEnd: () => {
69364
69427
  stopTimer();
69365
69428
  }, onTxStart: () => {
69366
69429
  startTimer();
@@ -69915,6 +69978,7 @@ exports.CopyOutlinedIcon = CopyOutlinedIcon;
69915
69978
  exports.CrossAnimatedIcon = CrossAnimatedIcon;
69916
69979
  exports.CrossedOutSunSolidIcon = CrossedOutSunSolidIcon;
69917
69980
  exports.DashboardFast = DashboardFast;
69981
+ exports.DepositAddressView = DepositAddressView;
69918
69982
  exports.DescriptionBlocks = DescriptionBlocks;
69919
69983
  exports.DetailsToolbar = DetailsToolbar;
69920
69984
  exports.DiscordIcon = DiscordIcon;
@@ -70065,7 +70129,6 @@ exports.SwapHeader = SwapHeader;
70065
70129
  exports.SwapIcon = SwapIcon;
70066
70130
  exports.SwapInputsIcon = SwapInputsIcon;
70067
70131
  exports.SwapProgressView = SwapProgressView;
70068
- exports.SwapProgressViewHeader = SwapProgressViewHeader;
70069
70132
  exports.SwapProperties = SwapProperties;
70070
70133
  exports.SwapStepItem = SwapStepItem;
70071
70134
  exports.SwapStepSeparator = SwapStepSeparator;
@@ -70105,6 +70168,7 @@ exports.TransactionViewLayout = TransactionViewLayout;
70105
70168
  exports.Transfer = Transfer;
70106
70169
  exports.TranslateIcon = TranslateIcon;
70107
70170
  exports.TriangleExclamation = TriangleExclamation;
70171
+ exports.TxProgressViewHeader = TxProgressViewHeader;
70108
70172
  exports.UsdAmount = UsdAmount;
70109
70173
  exports.WalletFilledIcon = WalletFilledIcon;
70110
70174
  exports.WalletIcon = WalletIcon;
@@ -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(): import("react/jsx-runtime").JSX.Element;
4
- export declare function ArrowRightUpIcon(): import("react/jsx-runtime").JSX.Element;
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 {};
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  interface JoinProps {
3
3
  children?: ReactNode;
4
4
  glue: () => ReactNode;
@@ -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 {};
@@ -20,7 +20,7 @@ export * from "./PipeSeparator";
20
20
  export * from "./ProductCard";
21
21
  export * from "./ProfileHeaderBackground";
22
22
  export * from "./SwapConfiguration";
23
- export * from "./SwapProgressViewHeader";
23
+ export * from "./TxProgressViewHeader";
24
24
  export * from "./SwapStepsCollapsed";
25
25
  export * from "./Toast";
26
26
  export * from "./TokenDetailsView";
@@ -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,33 @@
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, openInWalletButton, fromChain, toChain, fromAmount, toAmount, depositAddress, depositAddressFormatted, timeRemainingSeconds, tooltips, description, title, }: {
11
+ isOpen?: boolean;
12
+ fromToken: Token;
13
+ toToken: Token;
14
+ handleClose?: () => void;
15
+ openInWalletButton?: {
16
+ disabled?: boolean;
17
+ onClick?: () => void;
18
+ };
19
+ fromChain: ChainData;
20
+ toChain: ChainData;
21
+ fromAmount: string;
22
+ toAmount: string;
23
+ depositAddress: string;
24
+ depositAddressFormatted: string;
25
+ timeRemainingSeconds?: number;
26
+ tooltips?: {
27
+ depositAddress?: React.ReactNode;
28
+ timeRemaining?: React.ReactNode;
29
+ };
30
+ title: string;
31
+ description: string;
32
+ }): import("react/jsx-runtime").JSX.Element;
33
+ export {};
@@ -1,4 +1,5 @@
1
1
  export * from "./AssetsView";
2
+ export * from "./DepositAddressView";
2
3
  export * from "./MainView";
3
4
  export * from "./RecipientView";
4
5
  export * from "./SwapDetailsView";
@@ -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 { 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;