@0xsquid/ui 0.27.2-beta.0 → 0.27.3-alpha.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.
- package/README.md +4 -4
- package/dist/cjs/index.js +38 -181
- package/dist/cjs/types/components/icons/Generic.d.ts +0 -28
- package/dist/cjs/types/components/icons/Weather.d.ts +0 -4
- package/dist/cjs/types/components/layout/AppContainer.d.ts +1 -0
- package/dist/cjs/types/components/layout/PipeSeparator.d.ts +1 -1
- package/dist/cjs/types/components/views/SwapProgressView.d.ts +2 -2
- package/dist/cjs/types/hooks/index.d.ts +0 -1
- package/dist/cjs/types/providers/SquidConfigProvider.d.ts +9 -0
- package/dist/cjs/types/providers/index.d.ts +1 -1
- package/dist/cjs/types/types/components.d.ts +2 -2
- package/dist/cjs/types/types/index.d.ts +1 -1
- package/dist/esm/index.js +32 -166
- package/dist/esm/types/components/icons/Generic.d.ts +0 -28
- package/dist/esm/types/components/icons/Weather.d.ts +0 -4
- package/dist/esm/types/components/layout/AppContainer.d.ts +1 -0
- package/dist/esm/types/components/layout/PipeSeparator.d.ts +1 -1
- package/dist/esm/types/components/views/SwapProgressView.d.ts +2 -2
- package/dist/esm/types/hooks/index.d.ts +0 -1
- package/dist/esm/types/providers/SquidConfigProvider.d.ts +9 -0
- package/dist/esm/types/providers/index.d.ts +1 -1
- package/dist/esm/types/types/components.d.ts +2 -2
- package/dist/esm/types/types/index.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +9 -54
- package/package.json +5 -3
- package/dist/cjs/types/core/numbers.d.ts +0 -23
- package/dist/cjs/types/hooks/useUserTheme.d.ts +0 -13
- package/dist/cjs/types/providers/ThemeProvider.d.ts +0 -11
- package/dist/esm/types/core/numbers.d.ts +0 -23
- package/dist/esm/types/hooks/useUserTheme.d.ts +0 -13
- package/dist/esm/types/providers/ThemeProvider.d.ts +0 -11
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default$1, { useState, createContext, useContext, useMemo, useRef, useEffect, useLayoutEffect, useInsertionEffect, useCallback, forwardRef, Fragment as Fragment$1, createElement, useId as useId$1, Component, cloneElement, Children, isValidElement, useImperativeHandle } from 'react';
|
|
4
|
+
import { trimExtraDecimals, convertTokenAmountToUSD, formatUsdAmount, formatTokenAmount, convertUSDToTokenAmount } from '@0xsquid/react-hooks';
|
|
4
5
|
|
|
5
6
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
6
7
|
|
|
@@ -6575,59 +6576,6 @@ var debounce_1 = debounce;
|
|
|
6575
6576
|
|
|
6576
6577
|
var debounce$1 = /*@__PURE__*/getDefaultExportFromCjs(debounce_1);
|
|
6577
6578
|
|
|
6578
|
-
/**
|
|
6579
|
-
* Convert token amount to USD
|
|
6580
|
-
* @param {string|number} tokenAmount - The amount of tokens
|
|
6581
|
-
* @param {string|number} tokenPrice - The price of one token in USD
|
|
6582
|
-
* @returns {BigNumber} - The equivalent amount in USD
|
|
6583
|
-
*/
|
|
6584
|
-
function convertTokenAmountToUSD(tokenAmount, tokenPrice, maxDecimals = 2) {
|
|
6585
|
-
if (!tokenAmount || !tokenPrice)
|
|
6586
|
-
return "";
|
|
6587
|
-
const amount = new BigNumber(tokenAmount);
|
|
6588
|
-
const price = new BigNumber(tokenPrice);
|
|
6589
|
-
return amount.multipliedBy(price).decimalPlaces(maxDecimals).toString();
|
|
6590
|
-
}
|
|
6591
|
-
/**
|
|
6592
|
-
* Convert USD to token amount
|
|
6593
|
-
* @param {string|number} usdAmount - The amount in USD
|
|
6594
|
-
* @param {string|number} tokenPrice - The price of one token in USD
|
|
6595
|
-
* @param {number} maxDecimals - The maximum number of decimals
|
|
6596
|
-
* @returns {BigNumber} - The equivalent amount of tokens
|
|
6597
|
-
*/
|
|
6598
|
-
function convertUSDToTokenAmount(usdAmount, tokenPrice, maxDecimals) {
|
|
6599
|
-
if (!usdAmount || !tokenPrice || !maxDecimals)
|
|
6600
|
-
return "0";
|
|
6601
|
-
const amount = new BigNumber(usdAmount);
|
|
6602
|
-
const price = new BigNumber(tokenPrice);
|
|
6603
|
-
return amount.dividedBy(price).decimalPlaces(maxDecimals).toString();
|
|
6604
|
-
}
|
|
6605
|
-
const INTL_NUMBER_FORMATTER = new Intl.NumberFormat("en-US", {
|
|
6606
|
-
minimumFractionDigits: 2,
|
|
6607
|
-
maximumFractionDigits: 5,
|
|
6608
|
-
});
|
|
6609
|
-
/**
|
|
6610
|
-
* Formats a number to the en-US number format
|
|
6611
|
-
*
|
|
6612
|
-
* @param amount - The number to format
|
|
6613
|
-
* @returns The formatted string
|
|
6614
|
-
*/
|
|
6615
|
-
function formatAmount(amount) {
|
|
6616
|
-
return INTL_NUMBER_FORMATTER.format(amount);
|
|
6617
|
-
}
|
|
6618
|
-
function trimExtraDecimals(value, maxDecimals) {
|
|
6619
|
-
var _a;
|
|
6620
|
-
const split = value.split(".");
|
|
6621
|
-
if (split.length > 1) {
|
|
6622
|
-
const decimals = (_a = split[1]) !== null && _a !== void 0 ? _a : "";
|
|
6623
|
-
if (maxDecimals && decimals.length > maxDecimals) {
|
|
6624
|
-
const newValue = `${split[0]}.${decimals.slice(0, maxDecimals)}`;
|
|
6625
|
-
return newValue;
|
|
6626
|
-
}
|
|
6627
|
-
}
|
|
6628
|
-
return value;
|
|
6629
|
-
}
|
|
6630
|
-
|
|
6631
6579
|
function SwapInputsIcon() {
|
|
6632
6580
|
return (jsxs("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("g", { clipPath: "url(#clip0_40_7936)", children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20 10.5C20 16.0228 15.5228 20.5 10 20.5C4.47715 20.5 0 16.0228 0 10.5C0 4.97715 4.47715 0.5 10 0.5C15.5228 0.5 20 4.97715 20 10.5ZM8.38268 4.57612C8.75636 4.7309 9 5.09554 9 5.5V15.5C9 16.0523 8.55228 16.5 8 16.5C7.44772 16.5 7 16.0523 7 15.5V7.91421L5.70711 9.20711C5.31658 9.59763 4.68342 9.59763 4.29289 9.20711C3.90237 8.81658 3.90237 8.18342 4.29289 7.79289L7.29289 4.79289C7.57889 4.5069 8.00901 4.42134 8.38268 4.57612ZM11 15.5C11 15.9045 11.2436 16.2691 11.6173 16.4239C11.991 16.5787 12.4211 16.4931 12.7071 16.2071L15.7071 13.2071C16.0976 12.8166 16.0976 12.1834 15.7071 11.7929C15.3166 11.4024 14.6834 11.4024 14.2929 11.7929L13 13.0858V5.5C13 4.94771 12.5523 4.5 12 4.5C11.4477 4.5 11 4.94771 11 5.5V15.5Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: "clip0_40_7936", children: jsx("rect", { width: "20", height: "20", fill: "white", transform: "translate(0 0.5)" }) }) })] }));
|
|
6633
6581
|
}
|
|
@@ -17207,9 +17155,6 @@ function SunIcon({ size = "24", className, }) {
|
|
|
17207
17155
|
function MoonIcon({ size = "20", className, }) {
|
|
17208
17156
|
return (jsx("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M10.0463 2.99972C10.2292 2.73432 10.2427 2.38723 10.0809 2.10846C9.91903 1.8297 9.61096 1.66925 9.28979 1.69647C5.02109 2.05816 1.66992 5.63639 1.66992 9.9982C1.66992 14.5997 5.40018 18.33 10.0017 18.33C14.3636 18.33 17.9419 14.9787 18.3035 10.7098C18.3307 10.3887 18.1702 10.0806 17.8914 9.91879C17.6127 9.75698 17.2656 9.77044 17.0002 9.95336C16.1951 10.5083 15.2201 10.8331 14.1667 10.8331C11.4052 10.8331 9.16667 8.59452 9.16667 5.8331C9.16667 4.77977 9.49145 3.80481 10.0463 2.99972Z", fill: "currentColor" }) }));
|
|
17209
17157
|
}
|
|
17210
|
-
function SunOutlinedIcon({ size = "24", className, }) {
|
|
17211
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M12 3V2M12 22V21M18.3598 5.64005L19.0698 4.93005M4.93016 19.07L5.64016 18.36M21 12H22M2 12H3M18.3598 18.36L19.0698 19.07M4.93016 4.93005L5.64016 5.64005M15.5355 8.46447C17.4882 10.4171 17.4882 13.5829 15.5355 15.5355C13.5829 17.4882 10.4171 17.4882 8.46447 15.5355C6.51185 13.5829 6.51185 10.4171 8.46447 8.46447C10.4171 6.51185 13.5829 6.51185 15.5355 8.46447Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
17212
|
-
}
|
|
17213
17158
|
|
|
17214
17159
|
const dockIconClassname = "tw-text-grey-900";
|
|
17215
17160
|
const dockIconSelectedClassname = "group-data-[squid-theme-type=dark]:tw-text-royal-700 group-data-[squid-theme-type=light]:tw-text-volt-700";
|
|
@@ -17265,27 +17210,6 @@ function ImageIcon({ size = "20", className, }) {
|
|
|
17265
17210
|
function FilterTimelineIcon({ size = "20", className, }) {
|
|
17266
17211
|
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsx("path", { d: "M5.00117 3.33325C5.46141 3.33325 5.8345 3.70635 5.8345 4.16659V13.8206L6.91042 12.7442C7.23577 12.4186 7.76341 12.4185 8.08894 12.7438C8.41446 13.0692 8.4146 13.5968 8.08925 13.9224L5.59058 16.4224C5.43434 16.5787 5.22241 16.6665 5.00139 16.6666C4.78038 16.6666 4.56839 16.5789 4.41207 16.4227L1.91074 13.9227C1.58521 13.5973 1.58507 13.0697 1.91042 12.7442C2.23577 12.4186 2.76341 12.4185 3.08894 12.7438L4.16784 13.8222V4.16659C4.16784 3.70635 4.54093 3.33325 5.00117 3.33325Z", fill: "currentColor" }), jsx("path", { d: "M9.99984 4.99992C9.5396 4.99992 9.1665 5.37301 9.1665 5.83325C9.1665 6.29349 9.5396 6.66659 9.99984 6.66659H16.6665C17.1267 6.66659 17.4998 6.29349 17.4998 5.83325C17.4998 5.37301 17.1267 4.99992 16.6665 4.99992H9.99984Z", fill: "currentColor" }), jsx("path", { d: "M13.3332 13.3333C12.8729 13.3333 12.4998 13.7063 12.4998 14.1666C12.4998 14.6268 12.8729 14.9999 13.3332 14.9999H16.6665C17.1267 14.9999 17.4998 14.6268 17.4998 14.1666C17.4998 13.7063 17.1267 13.3333 16.6665 13.3333H13.3332Z", fill: "currentColor" }), jsx("path", { d: "M10.8332 9.99992C10.8332 9.53968 11.2063 9.16659 11.6665 9.16659H16.6665C17.1267 9.16659 17.4998 9.53968 17.4998 9.99992C17.4998 10.4602 17.1267 10.8333 16.6665 10.8333H11.6665C11.2063 10.8333 10.8332 10.4602 10.8332 9.99992Z", fill: "currentColor" })] }));
|
|
17267
17212
|
}
|
|
17268
|
-
function PhoneIcon({ size = "24", className, }) {
|
|
17269
|
-
return (jsx("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", children: jsx("path", { d: "M10.5 19H14.5M8.5 22H16.5C17.6046 22 18.5 21.1046 18.5 20V4C18.5 2.89543 17.6046 2 16.5 2H8.5C7.39543 2 6.5 2.89543 6.5 4V20C6.5 21.1046 7.39543 22 8.5 22Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
|
|
17270
|
-
}
|
|
17271
|
-
function LaptopIcon({ size = "24", className, }) {
|
|
17272
|
-
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: [jsx("path", { d: "M4.5 6C4.5 4.89543 5.39543 4 6.5 4H18.5C19.6046 4 20.5 4.89543 20.5 6V15C20.5 15.5523 20.0523 16 19.5 16H5.5C4.94772 16 4.5 15.5523 4.5 15V6Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" }), jsx("path", { d: "M2.5 16H22.5V18C22.5 19.1046 21.6046 20 20.5 20H4.5C3.39543 20 2.5 19.1046 2.5 18V16Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" })] }));
|
|
17273
|
-
}
|
|
17274
|
-
function CopyIcon({ size = "20", className, }) {
|
|
17275
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.16663 6.66666V3.54166C7.16663 2.50612 8.00609 1.66666 9.04163 1.66666H16.9583C17.9938 1.66666 18.8333 2.50612 18.8333 3.54166V11.4583C18.8333 12.4939 17.9938 13.3333 16.9583 13.3333H13.8333V16.4583C13.8333 17.4939 12.9938 18.3333 11.9583 18.3333H4.04163C3.00609 18.3333 2.16663 17.4939 2.16663 16.4583V8.54166C2.16663 7.50612 3.00609 6.66666 4.04163 6.66666H7.16663ZM9.04163 13.3333C8.00609 13.3333 7.16663 12.4939 7.16663 11.4583V8.33332H4.04163C3.92657 8.33332 3.83329 8.4266 3.83329 8.54166V16.4583C3.83329 16.5734 3.92657 16.6667 4.04163 16.6667H11.9583C12.0734 16.6667 12.1666 16.5734 12.1666 16.4583V13.3333H9.04163Z", fill: "currentColor" }) }));
|
|
17276
|
-
}
|
|
17277
|
-
function FileDownloadIcon({ size = "20", className, }) {
|
|
17278
|
-
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.33337 1.66666H10.5V5.83332C10.5 7.21404 11.6193 8.33332 13 8.33332H17.1667V15.8333C17.1667 17.214 16.0474 18.3333 14.6667 18.3333H6.33337C4.95266 18.3333 3.83337 17.214 3.83337 15.8333V4.16666C3.83337 2.78594 4.95266 1.66666 6.33337 1.66666ZM13.1726 14.3392L11.0893 16.4226C10.7639 16.748 10.2362 16.748 9.91079 16.4226L7.82745 14.3392C7.50201 14.0138 7.50201 13.4862 7.82745 13.1607C8.15289 12.8353 8.68053 12.8353 9.00596 13.1607L9.66671 13.8215V10.8333C9.66671 10.3731 10.0398 9.99999 10.5 9.99999C10.9603 9.99999 11.3334 10.3731 11.3334 10.8333V13.8215L11.9941 13.1607C12.3196 12.8353 12.8472 12.8353 13.1726 13.1607C13.4981 13.4862 13.4981 14.0138 13.1726 14.3392Z", fill: "currentColor" }), jsx("path", { d: "M12.1667 2.15481L16.6786 6.66666H13C12.5398 6.66666 12.1667 6.29356 12.1667 5.83332V2.15481Z", fill: "currentColor" })] }));
|
|
17279
|
-
}
|
|
17280
|
-
function CodeSolidSquareIcon({ size = "24", className, }) {
|
|
17281
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.5 6C3.5 4.34315 4.84315 3 6.5 3H18.5C20.1569 3 21.5 4.34315 21.5 6V18C21.5 19.6569 20.1569 21 18.5 21H6.5C4.84315 21 3.5 19.6569 3.5 18V6ZM11.2071 8.79289C11.5976 9.18342 11.5976 9.81658 11.2071 10.2071L9.41421 12L11.2071 13.7929C11.5976 14.1834 11.5976 14.8166 11.2071 15.2071C10.8166 15.5976 10.1834 15.5976 9.79289 15.2071L8 13.4142C7.21895 12.6332 7.21895 11.3668 8 10.5858L9.79289 8.79289C10.1834 8.40237 10.8166 8.40237 11.2071 8.79289ZM15.2071 8.79289C14.8166 8.40237 14.1834 8.40237 13.7929 8.79289C13.4024 9.18342 13.4024 9.81658 13.7929 10.2071L15.5858 12L13.7929 13.7929C13.4024 14.1834 13.4024 14.8166 13.7929 15.2071C14.1834 15.5976 14.8166 15.5976 15.2071 15.2071L17 13.4142C17.781 12.6332 17.781 11.3668 17 10.5858L15.2071 8.79289Z", fill: "currentColor" }) }));
|
|
17282
|
-
}
|
|
17283
|
-
function CodeBracketsIcon({ size = "20", className, }) {
|
|
17284
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.8688 2.5249C12.3153 2.63652 12.5867 3.08896 12.4751 3.53546L9.14178 16.8688C9.03015 17.3153 8.57771 17.5868 8.13121 17.4752C7.68472 17.3635 7.41325 16.9111 7.52487 16.4646L10.8582 3.13123C10.9698 2.68474 11.4223 2.41327 11.8688 2.5249ZM5.58925 6.07746C5.91469 6.4029 5.91469 6.93053 5.58925 7.25597L3.43443 9.41079C3.10899 9.73623 3.10899 10.2639 3.43443 10.5893L5.58925 12.7441C5.91469 13.0696 5.91469 13.5972 5.58925 13.9226C5.26381 14.2481 4.73617 14.2481 4.41074 13.9226L2.25591 11.7678C1.2796 10.7915 1.27961 9.20859 2.25592 8.23228L4.41074 6.07746C4.73617 5.75202 5.26381 5.75202 5.58925 6.07746ZM14.4107 6.07746C14.7362 5.75202 15.2638 5.75202 15.5892 6.07746L17.7441 8.23228C18.7204 9.20859 18.7204 10.7915 17.7441 11.7678L15.5892 13.9226C15.2638 14.2481 14.7362 14.2481 14.4107 13.9226C14.0853 13.5972 14.0853 13.0696 14.4107 12.7441L16.5656 10.5893C16.891 10.2639 16.891 9.73623 16.5656 9.41079L14.4107 7.25597C14.0853 6.93053 14.0853 6.4029 14.4107 6.07746Z", fill: "currentColor" }) }));
|
|
17285
|
-
}
|
|
17286
|
-
function CommandIcon({ size = "22", className, }) {
|
|
17287
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 22 22", fill: "none", className: className, children: jsx("path", { d: "M8 17V17C8 16.0219 8.28951 15.0657 8.83205 14.2519L13.1679 7.74808C13.7105 6.93427 14 5.97808 14 5V5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
17288
|
-
}
|
|
17289
17213
|
|
|
17290
17214
|
function FeeButton(_a) {
|
|
17291
17215
|
var { feeInUsd = "0", chipLabel = "Fee", className, tooltip } = _a, props = __rest$1(_a, ["feeInUsd", "chipLabel", "className", "tooltip"]);
|
|
@@ -17733,6 +17657,9 @@ const baseTailwindConfig = {
|
|
|
17733
17657
|
".highlight-adjacent:has(*:hover) .hide-on-parent-hover": {
|
|
17734
17658
|
opacity: "0",
|
|
17735
17659
|
},
|
|
17660
|
+
".h-d-screen": {
|
|
17661
|
+
height: "100dvh",
|
|
17662
|
+
},
|
|
17736
17663
|
});
|
|
17737
17664
|
}),
|
|
17738
17665
|
],
|
|
@@ -17870,9 +17797,8 @@ function NavigationBar(_a) {
|
|
|
17870
17797
|
: "tw-flex"), children: jsx(HeadingText, { size: "small", children: title }) })) : null] })));
|
|
17871
17798
|
}
|
|
17872
17799
|
|
|
17873
|
-
function PipeSeparator(
|
|
17874
|
-
|
|
17875
|
-
return (jsx("div", Object.assign({}, props, { className: cn("tw-h-[0.8em] tw-w-[2px] tw-rounded-full tw-bg-[currentColor]", className) })));
|
|
17800
|
+
function PipeSeparator(props) {
|
|
17801
|
+
return (jsx("div", Object.assign({}, props, { className: cn("tw-h-[0.8em] tw-w-[2px] tw-rounded-full tw-bg-[currentColor]", props.className) })));
|
|
17876
17802
|
}
|
|
17877
17803
|
|
|
17878
17804
|
function CollapsibleMenu({ children, menuRef, isOpen, transitionDuration, size, className, }) {
|
|
@@ -18705,69 +18631,6 @@ const useTimer = ({ immediateStart = true, }) => {
|
|
|
18705
18631
|
return { timer, stopTimer, startTimer };
|
|
18706
18632
|
};
|
|
18707
18633
|
|
|
18708
|
-
var ThemePreference;
|
|
18709
|
-
(function (ThemePreference) {
|
|
18710
|
-
ThemePreference["LIGHT"] = "light";
|
|
18711
|
-
ThemePreference["DARK"] = "dark";
|
|
18712
|
-
ThemePreference["SYSTEM"] = "system";
|
|
18713
|
-
})(ThemePreference || (ThemePreference = {}));
|
|
18714
|
-
const THEME_STORAGE_KEY = "__squid-app-theme-type__";
|
|
18715
|
-
const THEME_CHANGE_EVENT = "squid-app-theme-change";
|
|
18716
|
-
const THEME_MEDIA_QUERY = "(prefers-color-scheme: light)";
|
|
18717
|
-
function useUserTheme() {
|
|
18718
|
-
const [themePreference, setThemePreference] = useState(getInitialTheme);
|
|
18719
|
-
const [themeType, setThemeType] = useState(getEffectiveTheme(themePreference));
|
|
18720
|
-
useEffect(() => {
|
|
18721
|
-
const handleThemeChange = (e) => {
|
|
18722
|
-
setThemePreference(e.detail);
|
|
18723
|
-
};
|
|
18724
|
-
window.addEventListener(THEME_CHANGE_EVENT, handleThemeChange);
|
|
18725
|
-
return () => {
|
|
18726
|
-
window.removeEventListener(THEME_CHANGE_EVENT, handleThemeChange);
|
|
18727
|
-
};
|
|
18728
|
-
}, []);
|
|
18729
|
-
useEffect(() => {
|
|
18730
|
-
const mediaQuery = window.matchMedia(THEME_MEDIA_QUERY);
|
|
18731
|
-
const handleChange = () => {
|
|
18732
|
-
if (themePreference === ThemePreference.SYSTEM) {
|
|
18733
|
-
setThemeType(mediaQuery.matches ? "light" : "dark");
|
|
18734
|
-
}
|
|
18735
|
-
};
|
|
18736
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
18737
|
-
handleChange();
|
|
18738
|
-
return () => {
|
|
18739
|
-
mediaQuery.removeEventListener("change", handleChange);
|
|
18740
|
-
};
|
|
18741
|
-
}, [themePreference]);
|
|
18742
|
-
useEffect(() => {
|
|
18743
|
-
setThemeType(getEffectiveTheme(themePreference));
|
|
18744
|
-
}, [themePreference]);
|
|
18745
|
-
const setThemeManually = (theme) => {
|
|
18746
|
-
setThemePreference(theme);
|
|
18747
|
-
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
18748
|
-
window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme }));
|
|
18749
|
-
};
|
|
18750
|
-
const isDarkMode = useMemo(() => themeType === "dark", [themeType]);
|
|
18751
|
-
return {
|
|
18752
|
-
themePreference,
|
|
18753
|
-
themeType,
|
|
18754
|
-
theme: isDarkMode ? darkTheme : lightTheme,
|
|
18755
|
-
setThemeManually,
|
|
18756
|
-
isDarkMode,
|
|
18757
|
-
};
|
|
18758
|
-
}
|
|
18759
|
-
function getInitialTheme() {
|
|
18760
|
-
var _a;
|
|
18761
|
-
if (typeof window === "undefined")
|
|
18762
|
-
return ThemePreference.SYSTEM;
|
|
18763
|
-
return ((_a = localStorage.getItem(THEME_STORAGE_KEY)) !== null && _a !== void 0 ? _a : ThemePreference.SYSTEM);
|
|
18764
|
-
}
|
|
18765
|
-
function getEffectiveTheme(themeType) {
|
|
18766
|
-
if (themeType !== ThemePreference.SYSTEM)
|
|
18767
|
-
return themeType;
|
|
18768
|
-
return window.matchMedia(THEME_MEDIA_QUERY).matches ? "light" : "dark";
|
|
18769
|
-
}
|
|
18770
|
-
|
|
18771
18634
|
function BaseDropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, link, control, detail, isSelected, itemRef, children, contentRef, }) {
|
|
18772
18635
|
const ContentTag = link
|
|
18773
18636
|
? "a"
|
|
@@ -18860,7 +18723,7 @@ function ListItem(_a) {
|
|
|
18860
18723
|
});
|
|
18861
18724
|
return (jsxs("li", Object.assign({}, containerProps, { ref: itemRef, className: cn("tw-relative tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300 tw-highlight-adjacent", listItemSizeMap[size], extraPadding && "tw-px-squid-xs", compactOnMobile
|
|
18862
18725
|
? `${collapsedListItemClassMap[size]} mobile-lg:tw-w-full`
|
|
18863
|
-
: "tw-w-full", className), children: [jsxs(ItemTag, Object.assign({}, itemProps, { className: cn("tw-group/list-item tw-peer/list-item tw-relative tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", (isSelected || isDropdownOpen) && "tw-bg-material-light-thin", isInteractive && "hover:tw-bg-material-light-thin"), children: [size === "large" ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon
|
|
18726
|
+
: "tw-w-full", className), children: [jsxs(ItemTag, Object.assign({}, itemProps, { className: cn("tw-group/list-item tw-peer/list-item tw-relative tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", (isSelected || isDropdownOpen) && "tw-bg-material-light-thin", isInteractive && "hover:tw-bg-material-light-thin"), children: [size === "large" ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon || (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, placeholderImageUrl: placeholderImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon || (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn("tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs",
|
|
18864
18727
|
// 'large' variant has extra padding
|
|
18865
18728
|
size === "large" ? "tw-w-[56%] tw-pl-squid-xxs" : "tw-w-[67%]"), children: [typeof itemTitle === "string" ? (jsx(BodyText, { size: "small", className: cn("tw-max-w-full tw-truncate", subtitle && "tw-h-[17px] !tw-leading-[17px]", compactOnMobile ? "tw-hidden mobile-lg:tw-block" : "tw-block"), children: itemTitle })) : (itemTitle), size === "large" &&
|
|
18866
18729
|
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (loadingComponent()) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsx(CaptionText, { className: cn(subtitleClassName, "tw-hidden group-hover/list-item:tw-block"), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn("tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs", size === "large" ? "tw-h-squid-xl" : "tw-h-squid-l", showDetailOnHoverOnly
|
|
@@ -18868,10 +18731,9 @@ function ListItem(_a) {
|
|
|
18868
18731
|
: "tw-flex", isDetailInteractive && "hover:tw-bg-material-light-thin", detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })), !!dropdownMenuContent && (jsx(ListItemActionsButton, { ref: openDropdownButtonRef, onClick: openDropdown, isActive: isDropdownOpen, className: "peer-hover/list-item:tw-opacity-100" })), isDropdownOpen && !!dropdownMenuContent ? (jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
|
|
18869
18732
|
dropdownPositionClassMap$1[dropdownStyles.position]), dropdownRef: dropdownRef, children: dropdownMenuContent })) : null] })));
|
|
18870
18733
|
}
|
|
18871
|
-
const ListItemActionsButton = forwardRef((
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
: "tw-opacity-0", props.className), children: jsx(DotGrid1x3HorizontalIcon, { size: "24" }) })));
|
|
18734
|
+
const ListItemActionsButton = forwardRef((_a, ref) => {
|
|
18735
|
+
var { isActive, className } = _a, props = __rest$1(_a, ["isActive", "className"]);
|
|
18736
|
+
return (jsx("button", Object.assign({}, props, { ref: ref, className: cn("tw-peer tw-absolute tw-right-squid-s tw-top-squid-xxs tw-flex tw-h-squid-xl tw-w-squid-xl tw-items-center tw-justify-center tw-rounded-squid-xs tw-p-2 tw-text-grey-300 hover:tw-bg-material-light-thin hover:tw-opacity-100 focus-visible:tw-opacity-100", isActive ? "tw-bg-material-light-thin tw-opacity-100" : "tw-opacity-0", className), children: jsx(DotGrid1x3HorizontalIcon, { size: "24" }) })));
|
|
18875
18737
|
});
|
|
18876
18738
|
|
|
18877
18739
|
const dropdownPositionClassMap = {
|
|
@@ -18919,7 +18781,7 @@ function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount,
|
|
|
18919
18781
|
onClick,
|
|
18920
18782
|
}
|
|
18921
18783
|
: {};
|
|
18922
|
-
return (jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", isInteractive && "hover:tw-bg-material-light-thin"), children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), jsx("div", { className: cn("tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs
|
|
18784
|
+
return (jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", isInteractive && "hover:tw-bg-material-light-thin"), children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), jsx("div", { className: cn("tw-hide-on-parent-hover tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", !!dropdownMenuContent &&
|
|
18923
18785
|
"tw-transition-opacity group-hover/history-item:tw-hidden group-hover/history-item:tw-opacity-0 peer-focus:tw-hidden peer-focus:tw-opacity-0", isDropdownOpen && "tw-opacity-0"), children: statusLabel })] }), jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsx(BodyText, { size: "small", children: fromAmount }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronLargeRightIcon, {}) }), jsx(BodyText, { size: "small", children: toAmount })] })] })] })), !!dropdownMenuContent && (jsx(ListItemActionsButton, { ref: openDropdownButtonRef, onClick: openDropdown, isActive: isDropdownOpen, className: "peer-hover/history-item:tw-opacity-100" })), isDropdownOpen && !!dropdownMenuContent ? (jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
|
|
18924
18786
|
dropdownPositionClassMap[dropdownStyles.position]), dropdownRef: dropdownRef, children: dropdownMenuContent })) : null] }));
|
|
18925
18787
|
}
|
|
@@ -19287,6 +19149,7 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
|
|
|
19287
19149
|
// show separator for all steps except the first one
|
|
19288
19150
|
showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? "pending" : step.status }, index))) }), jsx("footer", { className: "tw-flex tw-max-h-[55px] tw-min-h-[55px] tw-w-full tw-justify-center tw-gap-squid-xs tw-self-stretch tw-px-squid-s tw-pb-squid-s", children: jsx(Button$1, { size: "md", variant: "secondary", onClick: footerButton === null || footerButton === void 0 ? void 0 : footerButton.onClick, link: footerButton === null || footerButton === void 0 ? void 0 : footerButton.link, label: footerButton === null || footerButton === void 0 ? void 0 : footerButton.label, className: "tw-w-full", containerClassName: "tw-w-full" }) })] }) })] }) }) }));
|
|
19289
19151
|
});
|
|
19152
|
+
SwapStepsCollapsed.displayName = "SwapStepsCollapsed";
|
|
19290
19153
|
|
|
19291
19154
|
const WIDTH_SM = "69";
|
|
19292
19155
|
const HEIGHT_SM = "31";
|
|
@@ -25242,7 +25105,9 @@ function PopLayout(props) {
|
|
|
25242
25105
|
}
|
|
25243
25106
|
|
|
25244
25107
|
function Toast({ headerContent, actionsContent, description, chipLabel, title, }) {
|
|
25245
|
-
return (jsxs(Menu, { contentClassName: "tw-px-squid-m tw-pb-squid-s tw-pt-squid-xxs",
|
|
25108
|
+
return (jsxs(Menu, { contentClassName: "tw-px-squid-m tw-pb-squid-s tw-pt-squid-xxs", contentWrapperProps: {
|
|
25109
|
+
className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs",
|
|
25110
|
+
}, rounded: "sm", children: [headerContent, jsx("header", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-self-stretch tw-px-0 tw-py-squid-xxs", children: jsx(BodyText, { size: "small", className: "tw-text-grey-100", children: title }) }), jsx(CaptionText, { className: "tw-text-center tw-text-material-light-thick", children: description }), jsx("menu", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xs", children: actionsContent }), chipLabel && (jsx(Chip, { label: chipLabel, className: "tw-absolute tw-right-squid-xs tw-top-squid-xs" }))] }));
|
|
25246
25111
|
}
|
|
25247
25112
|
|
|
25248
25113
|
var lib = {};
|
|
@@ -26356,10 +26221,7 @@ const tooltipThresholdPaddingMap = {
|
|
|
26356
26221
|
xl: "40px",
|
|
26357
26222
|
xxl: "60px",
|
|
26358
26223
|
};
|
|
26359
|
-
const TooltipContainer = (
|
|
26360
|
-
var { className } = _a, props = __rest$1(_a, ["className"]);
|
|
26361
|
-
return (jsx("div", Object.assign({}, props, { className: cn("tw-relative", className) })));
|
|
26362
|
-
};
|
|
26224
|
+
const TooltipContainer = (props) => (jsx("div", Object.assign({}, props, { className: cn("tw-relative", props.className) })));
|
|
26363
26225
|
const TooltipTriggerWrapper = (_a) => {
|
|
26364
26226
|
var { elementRef } = _a, props = __rest$1(_a, ["elementRef"]);
|
|
26365
26227
|
return jsx("div", Object.assign({}, props, { ref: elementRef }));
|
|
@@ -26566,7 +26428,7 @@ function NumericInput(_a) {
|
|
|
26566
26428
|
onAmountChange,
|
|
26567
26429
|
]);
|
|
26568
26430
|
const handleInputChange = (e) => {
|
|
26569
|
-
|
|
26431
|
+
const value = e.target.value.replace(/,/g, "."); // Replace commas with dots
|
|
26570
26432
|
const maxDecimalsForInputType = userInputType === UserInputType.TOKEN ? token.decimals : maxUsdDecimals;
|
|
26571
26433
|
const isValidAmount = new RegExp(`^\\d*\\.?\\d{0,${maxDecimalsForInputType}}$`).test(value);
|
|
26572
26434
|
if (isValidAmount) {
|
|
@@ -26646,14 +26508,18 @@ function NumericInput(_a) {
|
|
|
26646
26508
|
return "0";
|
|
26647
26509
|
if (userInputType === UserInputType.TOKEN) {
|
|
26648
26510
|
if (direction === "from") {
|
|
26649
|
-
return
|
|
26511
|
+
return formatUsdAmount(convertTokenAmountToUSD(inputValue, token.price, maxUsdDecimals), {
|
|
26512
|
+
includeSign: false,
|
|
26513
|
+
});
|
|
26650
26514
|
}
|
|
26651
26515
|
else {
|
|
26652
|
-
return
|
|
26516
|
+
return formatUsdAmount((_a = inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.amountUsd) !== null && _a !== void 0 ? _a : "0", {
|
|
26517
|
+
includeSign: false,
|
|
26518
|
+
});
|
|
26653
26519
|
}
|
|
26654
26520
|
}
|
|
26655
26521
|
else {
|
|
26656
|
-
return
|
|
26522
|
+
return formatTokenAmount(convertUSDToTokenAmount(inputValue, token.price, token.decimals));
|
|
26657
26523
|
}
|
|
26658
26524
|
}, [
|
|
26659
26525
|
inputValue,
|
|
@@ -26670,7 +26536,7 @@ function NumericInput(_a) {
|
|
|
26670
26536
|
: "tw-text-grey-300";
|
|
26671
26537
|
const BalanceChipTag = balanceChipClickable ? "button" : "div";
|
|
26672
26538
|
const balanceFormatted = useMemo(() => {
|
|
26673
|
-
return
|
|
26539
|
+
return formatTokenAmount(balance !== null && balance !== void 0 ? balance : "0");
|
|
26674
26540
|
}, [balance]);
|
|
26675
26541
|
const containerClassname = "tw-px-squid-xs tw-pb-[15px] tw-pt-[5px] tw-text-heading-small tw-font-heading-regular mobile-lg:tw-px-squid-m tw-relative tw-h-[65px] mobile-sm-height:tw-h-[75px]";
|
|
26676
26542
|
const inputRef = useRef(null);
|
|
@@ -62072,7 +61938,7 @@ const getSwapProgressTitle = ({ fromToken, toToken, swapState, }) => {
|
|
|
62072
61938
|
return "Needs gas on destination";
|
|
62073
61939
|
}
|
|
62074
61940
|
};
|
|
62075
|
-
const getSwapProgressDescriptions = ({ swapState, toAmount, toChain, toToken, toAddressFormatted, }) => {
|
|
61941
|
+
const getSwapProgressDescriptions = ({ swapState, toAmount, toChain, toToken, toAddressFormatted, refundTokenSymbol, }) => {
|
|
62076
61942
|
switch (swapState) {
|
|
62077
61943
|
case SwapState.CONFIRM: {
|
|
62078
61944
|
return "Authenticate the transaction in your wallet.";
|
|
@@ -62093,7 +61959,7 @@ const getSwapProgressDescriptions = ({ swapState, toAmount, toChain, toToken, to
|
|
|
62093
61959
|
return "You declined the transaction in your wallet.";
|
|
62094
61960
|
}
|
|
62095
61961
|
case SwapState.PARTIAL_SUCCESS: {
|
|
62096
|
-
return `You received a refund of
|
|
61962
|
+
return `You received a refund of ${refundTokenSymbol} to your wallet ${toAddressFormatted} on ${toChain === null || toChain === void 0 ? void 0 : toChain.networkName}.`;
|
|
62097
61963
|
}
|
|
62098
61964
|
case SwapState.NEEDS_GAS: {
|
|
62099
61965
|
return "Add gas to the transaction via Axelarscan to complete the swap";
|
|
@@ -62110,7 +61976,7 @@ const swapProgressButtonTexts = {
|
|
|
62110
61976
|
[SwapState.PARTIAL_SUCCESS]: "Cancel",
|
|
62111
61977
|
[SwapState.NEEDS_GAS]: "Go to Axelarscan",
|
|
62112
61978
|
};
|
|
62113
|
-
function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, }) {
|
|
61979
|
+
function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, }) {
|
|
62114
61980
|
const [showSwapInfoSection, setShowSwapInfoSection] = useState(true);
|
|
62115
61981
|
const isFirstRenderRef = useRef(true);
|
|
62116
61982
|
const { timer, stopTimer, startTimer } = useTimer({
|
|
@@ -62140,6 +62006,7 @@ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, s
|
|
|
62140
62006
|
toChain,
|
|
62141
62007
|
toToken,
|
|
62142
62008
|
toAddressFormatted,
|
|
62009
|
+
refundTokenSymbol,
|
|
62143
62010
|
});
|
|
62144
62011
|
return {
|
|
62145
62012
|
headerTitle,
|
|
@@ -62445,10 +62312,9 @@ function blendColors(foreground, background) {
|
|
|
62445
62312
|
return rgbToHex(r, g, b);
|
|
62446
62313
|
}
|
|
62447
62314
|
|
|
62448
|
-
function
|
|
62449
|
-
var { theme = lightTheme, children, themeType = "light" } = _a, props = __rest$1(_a, ["theme", "children", "themeType"]);
|
|
62315
|
+
function SquidConfigProvider({ theme = lightTheme, children, themeType = "light", }) {
|
|
62450
62316
|
const parsedStyle = parseSquidTheme(theme);
|
|
62451
|
-
return (jsx("div",
|
|
62317
|
+
return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-h-d-screen tw-group tw-relative tw-flex tw-font-geist mobile-lg:tw-h-auto", children: children }));
|
|
62452
62318
|
}
|
|
62453
62319
|
|
|
62454
|
-
export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, 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, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon,
|
|
62320
|
+
export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, 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, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CoinsAddIcon, CoinsIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CrossAnimatedIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidConfigProvider, SquidLogo, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunriseIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, TagIcon, TagIconFilled, TextSkeleton, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, cn, darkTheme, lightTheme, linkActionTimelineProps, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useVersion };
|
|
@@ -38,31 +38,3 @@ export declare function FilterTimelineIcon({ size, className, }: {
|
|
|
38
38
|
size?: string;
|
|
39
39
|
className?: string;
|
|
40
40
|
}): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
export declare function PhoneIcon({ size, className, }: {
|
|
42
|
-
size?: string;
|
|
43
|
-
className?: string;
|
|
44
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
export declare function LaptopIcon({ size, className, }: {
|
|
46
|
-
size?: string;
|
|
47
|
-
className?: string;
|
|
48
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
49
|
-
export declare function CopyIcon({ size, className, }: {
|
|
50
|
-
size?: string;
|
|
51
|
-
className?: string;
|
|
52
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
export declare function FileDownloadIcon({ size, className, }: {
|
|
54
|
-
size?: string;
|
|
55
|
-
className?: string;
|
|
56
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
export declare function CodeSolidSquareIcon({ size, className, }: {
|
|
58
|
-
size?: string;
|
|
59
|
-
className?: string;
|
|
60
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
61
|
-
export declare function CodeBracketsIcon({ size, className, }: {
|
|
62
|
-
size?: string;
|
|
63
|
-
className?: string;
|
|
64
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
65
|
-
export declare function CommandIcon({ size, className, }: {
|
|
66
|
-
size?: string;
|
|
67
|
-
className?: string;
|
|
68
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,3 @@ export declare function MoonIcon({ size, className, }: {
|
|
|
10
10
|
size?: string;
|
|
11
11
|
className?: string;
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare function SunOutlinedIcon({ size, className, }: {
|
|
14
|
-
size?: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
export declare function PipeSeparator(
|
|
2
|
+
export declare function PipeSeparator(props: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,14 +3,13 @@ import { SwapStepsCollapsedFooterButton } from "../layout/SwapStepsCollapsed";
|
|
|
3
3
|
type ChainData = {
|
|
4
4
|
networkName: string;
|
|
5
5
|
logoUrl: string;
|
|
6
|
-
bgColor: string;
|
|
7
6
|
};
|
|
8
7
|
type Token = {
|
|
9
8
|
symbol: string;
|
|
10
9
|
logoUrl: string;
|
|
11
10
|
bgColor: string;
|
|
12
11
|
};
|
|
13
|
-
export declare function SwapProgressView({ steps, isOpen, handleClose, handleComplete, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, }: {
|
|
12
|
+
export declare function SwapProgressView({ steps, isOpen, handleClose, handleComplete, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, }: {
|
|
14
13
|
steps: SwapStep[];
|
|
15
14
|
handleClose?: (swapState: SwapState) => void;
|
|
16
15
|
handleComplete?: () => void;
|
|
@@ -28,5 +27,6 @@ export declare function SwapProgressView({ steps, isOpen, handleClose, handleCom
|
|
|
28
27
|
swapState: SwapState;
|
|
29
28
|
estimatedTimeToComplete?: string;
|
|
30
29
|
footerButton?: SwapStepsCollapsedFooterButton;
|
|
30
|
+
refundTokenSymbol?: string;
|
|
31
31
|
}): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "../styles/compiled-tailwind.css";
|
|
3
|
+
import { ThemeType } from "../types/components";
|
|
4
|
+
import { SquidTheme } from "../types/config";
|
|
5
|
+
export declare function SquidConfigProvider({ theme, children, themeType, }: {
|
|
6
|
+
theme?: SquidTheme;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
themeType?: ThemeType;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./SquidConfigProvider";
|
|
@@ -13,11 +13,11 @@ export type DescriptionBlock = {
|
|
|
13
13
|
value: string;
|
|
14
14
|
rounded?: boolean;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export interface SwapStep {
|
|
17
17
|
descriptionBlocks: DescriptionBlock[];
|
|
18
18
|
link?: string;
|
|
19
19
|
status: ActionStatus;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
export declare enum SwapState {
|
|
22
22
|
CONFIRM = 0,
|
|
23
23
|
PROGRESS = 1,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { SquidTheme } from "./config";
|
|
2
2
|
export * from "./utils";
|
|
3
|
-
export type { SwapState, ThemeType, SwapStep, HistoryItemStatus, ActionStatus, AssetsButtonVariant, } from "./components";
|
|
3
|
+
export type { SwapState, ThemeType, SwapStep, HistoryItemStatus, ActionStatus, AssetsButtonVariant, DescriptionBlock, } from "./components";
|