@0xsquid/ui 2.6.8-send-beta.0 → 2.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +272 -88
- package/dist/cjs/types/components/badges/PriceChange.d.ts +3 -1
- package/dist/cjs/types/components/badges/index.d.ts +1 -1
- package/dist/cjs/types/components/buttons/Button.d.ts +2 -1
- package/dist/cjs/types/components/controls/NumericInput.d.ts +8 -1
- package/dist/cjs/types/components/feedback/LoadingText.d.ts +7 -0
- package/dist/cjs/types/components/icons/Loader.d.ts +1 -1
- package/dist/cjs/types/components/icons/PaymentIcons.d.ts +12 -0
- package/dist/cjs/types/components/icons/index.d.ts +1 -0
- package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +17 -1
- package/dist/cjs/types/core/index.d.ts +1 -1
- package/dist/cjs/types/core/utils.d.ts +16 -0
- package/dist/cjs/types/hooks/index.d.ts +3 -2
- package/dist/cjs/types/hooks/useNumericInput.d.ts +2 -1
- package/dist/cjs/types/services/internal/colorService.d.ts +0 -2
- package/dist/cjs/types/stories/buttons/Button.stories.d.ts +3 -0
- package/dist/cjs/types/stories/controls/NumericInput.stories.d.ts +17 -0
- package/dist/{esm/types/stories/badges → cjs/types/stories/feedback}/Loader.stories.d.ts +1 -1
- package/dist/cjs/types/stories/{badges → feedback}/LoadingSkeleton.stories.d.ts +2 -2
- package/dist/cjs/types/stories/feedback/LoadingText.stories.d.ts +6 -0
- package/dist/esm/index.js +250 -71
- package/dist/esm/types/components/badges/PriceChange.d.ts +3 -1
- package/dist/esm/types/components/badges/index.d.ts +1 -1
- package/dist/esm/types/components/buttons/Button.d.ts +2 -1
- package/dist/esm/types/components/controls/NumericInput.d.ts +8 -1
- package/dist/esm/types/components/feedback/LoadingText.d.ts +7 -0
- package/dist/esm/types/components/icons/Loader.d.ts +1 -1
- package/dist/esm/types/components/icons/PaymentIcons.d.ts +12 -0
- package/dist/esm/types/components/icons/index.d.ts +1 -0
- package/dist/esm/types/components/layout/SwapConfiguration.d.ts +17 -1
- package/dist/esm/types/core/index.d.ts +1 -1
- package/dist/esm/types/core/utils.d.ts +16 -0
- package/dist/esm/types/hooks/index.d.ts +3 -2
- package/dist/esm/types/hooks/useNumericInput.d.ts +2 -1
- package/dist/esm/types/services/internal/colorService.d.ts +0 -2
- package/dist/esm/types/stories/buttons/Button.stories.d.ts +3 -0
- package/dist/esm/types/stories/controls/NumericInput.stories.d.ts +17 -0
- package/dist/{cjs/types/stories/badges → esm/types/stories/feedback}/Loader.stories.d.ts +1 -1
- package/dist/esm/types/stories/{badges → feedback}/LoadingSkeleton.stories.d.ts +2 -2
- package/dist/esm/types/stories/feedback/LoadingText.stories.d.ts +6 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +87 -16
- package/package.json +1 -1
- /package/dist/cjs/types/components/{badges → feedback}/LoadingSkeleton.d.ts +0 -0
- /package/dist/esm/types/components/{badges → feedback}/LoadingSkeleton.d.ts +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -2980,6 +2980,39 @@ function hashStringToIndex(str, max) {
|
|
|
2980
2980
|
}
|
|
2981
2981
|
return index;
|
|
2982
2982
|
}
|
|
2983
|
+
/**
|
|
2984
|
+
* Formats a value for CSS properties by adding 'px' if no unit is present.
|
|
2985
|
+
* @param {string | number} value - The value to format (can be a number or string)
|
|
2986
|
+
* @returns {string} - The formatted CSS value with appropriate units
|
|
2987
|
+
*
|
|
2988
|
+
* @example
|
|
2989
|
+
* // Returns "20px"
|
|
2990
|
+
* formatCSSValue(20)
|
|
2991
|
+
*
|
|
2992
|
+
* @example
|
|
2993
|
+
* // Returns "5rem"
|
|
2994
|
+
* formatCSSValue("5rem")
|
|
2995
|
+
*/
|
|
2996
|
+
function formatCSSValue(value) {
|
|
2997
|
+
if (typeof value === "number" || /^\d+$/.test(value.toString())) {
|
|
2998
|
+
return `${value}px`;
|
|
2999
|
+
}
|
|
3000
|
+
const validCSSUnits = /(px|em|rem|%|vh|vw|vmin|vmax|ex|ch|cm|mm|in|pt|pc)$/i;
|
|
3001
|
+
if (validCSSUnits.test(String(value))) {
|
|
3002
|
+
return value;
|
|
3003
|
+
}
|
|
3004
|
+
return `${pxToRem(value)}rem`;
|
|
3005
|
+
}
|
|
3006
|
+
const remToPx = (rem, baseFontSize = 16) => {
|
|
3007
|
+
if (typeof rem === "string")
|
|
3008
|
+
return Number(rem.replace("rem", "")) * baseFontSize;
|
|
3009
|
+
return rem * baseFontSize;
|
|
3010
|
+
};
|
|
3011
|
+
const pxToRem = (px, baseFontSize = 16) => {
|
|
3012
|
+
if (typeof px === "string")
|
|
3013
|
+
return Number(px.replace("px", "")) / baseFontSize;
|
|
3014
|
+
return px / baseFontSize;
|
|
3015
|
+
};
|
|
2983
3016
|
|
|
2984
3017
|
const spacing$1 = {
|
|
2985
3018
|
"squid-xxs": "0.3125rem", // 5px
|
|
@@ -3043,6 +3076,15 @@ const backgrounds = {
|
|
|
3043
3076
|
rgba(223, 159, 196, 1) 91.82%,
|
|
3044
3077
|
rgba(180, 143, 233, 1) 100%
|
|
3045
3078
|
)`,
|
|
3079
|
+
shimmer: "linear-gradient(90deg, currentColor 0%, currentColor 50%, rgba(255, 255, 255, 0.4) 57.5%, currentColor 65%, currentColor 100%)",
|
|
3080
|
+
"shimmer-light": `linear-gradient(90deg, color-mix(in srgb, var(${themeKeysToCssVariables.color["grey-100"].cssVariable}) 40%, transparent) 0%, var(${themeKeysToCssVariables.color["grey-100"].cssVariable}) 10%, color-mix(in srgb, var(${themeKeysToCssVariables.color["grey-100"].cssVariable}) 40%, transparent) 60%)`,
|
|
3081
|
+
"shimmer-dark": `linear-gradient(90deg, color-mix(in srgb, var(${themeKeysToCssVariables.color["grey-900"].cssVariable}) 40%, transparent) 0%, var(${themeKeysToCssVariables.color["grey-900"].cssVariable}) 10%, color-mix(in srgb, var(${themeKeysToCssVariables.color["grey-900"].cssVariable}) 40%, transparent) 60%)`,
|
|
3082
|
+
"loading-gradient": `linear-gradient(
|
|
3083
|
+
to right,
|
|
3084
|
+
var(${themeKeysToCssVariables.color["material-light-thin"].cssVariable}) 43%,
|
|
3085
|
+
var(--mid-color) 52%,
|
|
3086
|
+
var(${themeKeysToCssVariables.color["material-light-thin"].cssVariable}) 56%
|
|
3087
|
+
)`,
|
|
3046
3088
|
};
|
|
3047
3089
|
// Format animation durations object to Tailwind config
|
|
3048
3090
|
// This way Tailwind can generate utility classes for each duration
|
|
@@ -3260,6 +3302,37 @@ const baseTailwindConfig = {
|
|
|
3260
3302
|
opacity: "1",
|
|
3261
3303
|
},
|
|
3262
3304
|
},
|
|
3305
|
+
shimmer: {
|
|
3306
|
+
"0%": {
|
|
3307
|
+
backgroundPosition: "100% center",
|
|
3308
|
+
},
|
|
3309
|
+
"100%": {
|
|
3310
|
+
backgroundPosition: "-100% center",
|
|
3311
|
+
},
|
|
3312
|
+
},
|
|
3313
|
+
"loading-gradient-scroll": {
|
|
3314
|
+
"0%": {
|
|
3315
|
+
transform: "translateX(-56%)",
|
|
3316
|
+
},
|
|
3317
|
+
"100%": {
|
|
3318
|
+
transform: "translateX(0)",
|
|
3319
|
+
},
|
|
3320
|
+
},
|
|
3321
|
+
"squid-animated-loader-dash-grow": {
|
|
3322
|
+
"0%": {
|
|
3323
|
+
"stroke-dasharray": "62.827" /* 1/4 circle visible */,
|
|
3324
|
+
"stroke-dashoffset": "0" /* Starting from the beginning of the path */,
|
|
3325
|
+
},
|
|
3326
|
+
"100%": {
|
|
3327
|
+
"stroke-dasharray": "4141.884" /* 1/2 circle visible */,
|
|
3328
|
+
"stroke-dashoffset": "-20.942" /* Move the beginning of the path to make it grow */,
|
|
3329
|
+
},
|
|
3330
|
+
},
|
|
3331
|
+
"rotate-360": {
|
|
3332
|
+
to: {
|
|
3333
|
+
transform: "rotate(360deg)",
|
|
3334
|
+
},
|
|
3335
|
+
},
|
|
3263
3336
|
},
|
|
3264
3337
|
animation: {
|
|
3265
3338
|
"move-to-right-with-spring-bounce": `move-to-right-with-spring-bounce var(${CSS_VARS.MOVE_WITH_SPRING_BOUNCE_DURATION}, 0s) ease-out both`,
|
|
@@ -3282,6 +3355,10 @@ const baseTailwindConfig = {
|
|
|
3282
3355
|
"display-delayed": `display 0s var(${CSS_VARS.DISPLAY_DELAYED_DURATION}, 0s) ease-out both`,
|
|
3283
3356
|
hide: `hide 0s ease-out forwards`,
|
|
3284
3357
|
"move-loading-cover-to-right": "move-loading-cover-to-right 1.4s linear infinite",
|
|
3358
|
+
shimmer: "shimmer 1.5s linear infinite",
|
|
3359
|
+
"loading-gradient-scroll": "loading-gradient-scroll 1s ease-in-out both infinite",
|
|
3360
|
+
"squid-animated-loader-dash-grow": "squid-animated-loader-dash-grow var(--squid-loader-rotate-duration) infinite alternate ease-in-out",
|
|
3361
|
+
"squid-animated-loader": "rotate-360 var(--squid-loader-rotate-duration) linear infinite",
|
|
3285
3362
|
},
|
|
3286
3363
|
opacity: {
|
|
3287
3364
|
33: "0.33",
|
|
@@ -3348,6 +3425,57 @@ const baseTailwindConfig = {
|
|
|
3348
3425
|
".h-d-screen": {
|
|
3349
3426
|
height: "100dvh",
|
|
3350
3427
|
},
|
|
3428
|
+
".assets-button-mask": {
|
|
3429
|
+
"mask-image": 'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzIiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA3MiA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMjBDMCAxNC44ODE2IDEuOTUyNjIgOS43NjMxMSA1Ljg1Nzg2IDUuODU3ODZDOS43NjMwOSAxLjk1MjY0IDE0Ljg4MTUgMi4yMDcwMmUtMDUgMTkuOTk5OSAxLjg3MzU2ZS0xMEMyNS4xMTg0IC0yLjIwNjkxZS0wNSAzMC4yMzY5IDEuOTUyNiAzNC4xNDIxIDUuODU3ODZDMzQuNjY5NiA2LjM4NTI5IDM1LjE4NzkgNi45MTg3MyAzNS43MDExIDcuNDQ2OTVDMzguOTg4OCAxMC44MzA2IDQyLjA2ODMgMTQgNDYgMTRDNDkuOTMxNyAxNCA1My4wMTEyIDEwLjgzMDYgNTYuMjk4OSA3LjQ0Njk1QzU2LjgxMjEgNi45MTg3MyA1Ny4zMzA0IDYuMzg1MjkgNTcuODU3OSA1Ljg1Nzg2QzYxLjc2MzEgMS45NTI2IDY2Ljg4MTYgLTIuMjA2OTFlLTA1IDcyLjAwMDEgMS44NzM1NmUtMTBWNDBDNjYuODgxNiA0MCA2MS43NjMxIDM4LjA0NzQgNTcuODU3OSAzNC4xNDIxQzU3LjMzMzEgMzMuNjE3MSA1Ni44MTc0IDMzLjA4NjEgNTYuMzA2NSAzMi41NjAyQzUzLjAxNzQgMjkuMTc0IDQ5LjkzNDQgMjYgNDYgMjZDNDIuMDY1NiAyNiAzOC45ODI2IDI5LjE3NCAzNS42OTM1IDMyLjU2MDJDMzUuMTgyNiAzMy4wODYxIDM0LjY2NjkgMzMuNjE3MSAzNC4xNDIxIDM0LjE0MjFDMzAuMjM2OSAzOC4wNDc0IDI1LjExODQgNDAgMTkuOTk5OSA0MEMxNC44ODE1IDQwIDkuNzYzMDkgMzguMDQ3NCA1Ljg1Nzg2IDM0LjE0MjFDMS45NTI2MiAzMC4yMzY5IDAgMjUuMTE4NCAwIDIwWiIgZmlsbD0iI0ZCRkJGRCIgc3R5bGU9ImZpbGw6I0ZCRkJGRDtmaWxsOmNvbG9yKGRpc3BsYXktcDMgMC45ODQwIDAuOTg2MSAwLjk5MDQpO2ZpbGwtb3BhY2l0eToxOyIvPgo8L3N2Zz4=")',
|
|
3430
|
+
"mask-repeat": "no-repeat",
|
|
3431
|
+
},
|
|
3432
|
+
li: {
|
|
3433
|
+
"list-style-type": "none",
|
|
3434
|
+
},
|
|
3435
|
+
".squid-property-gradient-bg-odd-container .squid-property-row-bg:nth-child(odd) > :is(div, button)": {
|
|
3436
|
+
background: `linear-gradient(
|
|
3437
|
+
91deg,
|
|
3438
|
+
/* grey-100 with 0.05 opacity */ var(${themeKeysToCssVariables.color["grey-100-005"].cssVariable}) 0%,
|
|
3439
|
+
transparent 100%
|
|
3440
|
+
)`,
|
|
3441
|
+
},
|
|
3442
|
+
".squid-property-gradient-bg-even-container .squid-property-row-bg:nth-child(even) > :is(div, button)": {
|
|
3443
|
+
background: `linear-gradient(
|
|
3444
|
+
91deg,
|
|
3445
|
+
/* grey-100 with 0.05 opacity */ var(${themeKeysToCssVariables.color["grey-100-005"].cssVariable}) 0%,
|
|
3446
|
+
transparent 100%
|
|
3447
|
+
)`,
|
|
3448
|
+
},
|
|
3449
|
+
":focus-visible": {
|
|
3450
|
+
"@apply tw-outline tw-outline-2 tw-outline-royal-500": {},
|
|
3451
|
+
},
|
|
3452
|
+
":invalid": {
|
|
3453
|
+
"@apply tw-outline-status-negative": {},
|
|
3454
|
+
},
|
|
3455
|
+
":disabled": {
|
|
3456
|
+
cursor: "not-allowed",
|
|
3457
|
+
},
|
|
3458
|
+
"*, *::before, *::after": {
|
|
3459
|
+
boxSizing: "border-box",
|
|
3460
|
+
},
|
|
3461
|
+
"input::-webkit-outer-spin-button, input::-webkit-inner-spin-button": {
|
|
3462
|
+
"-webkit-appearance": "none",
|
|
3463
|
+
margin: "0",
|
|
3464
|
+
},
|
|
3465
|
+
"input[type='number']": {
|
|
3466
|
+
"-moz-appearance": "textfield",
|
|
3467
|
+
},
|
|
3468
|
+
"#squid-lottie-animation #keystroke": {
|
|
3469
|
+
stroke: `var(${themeKeysToCssVariables.color["animation-text"].cssVariable})`,
|
|
3470
|
+
},
|
|
3471
|
+
"#squid-lottie-animation #keyfill": {
|
|
3472
|
+
fill: `var(${themeKeysToCssVariables.color["animation-bg"].cssVariable})`,
|
|
3473
|
+
},
|
|
3474
|
+
".squid-animated-loader-dash": {
|
|
3475
|
+
"@apply tw-animate-squid-animated-loader-dash-grow": {},
|
|
3476
|
+
"stroke-dasharray": "20.942, 62.827" /* Initial visible part: 1/4 circle */,
|
|
3477
|
+
"stroke-dashoffset": "0",
|
|
3478
|
+
},
|
|
3351
3479
|
});
|
|
3352
3480
|
}),
|
|
3353
3481
|
],
|
|
@@ -3643,12 +3771,17 @@ function BadgeImage({ image, badge, extraMarginForBadge = false, className, }) {
|
|
|
3643
3771
|
|
|
3644
3772
|
const LoadingContext = createContext(false);
|
|
3645
3773
|
const LoadingProvider = LoadingContext.Provider;
|
|
3774
|
+
const loadingGradientClassName = "tw-relative tw-overflow-hidden [--mid-color:transparent] data-[squid-theme-type=dark]:[--mid-color:var(--st-color-material-light-average)] after:tw-content-[''] after:tw-absolute after:tw-block after:tw-top-0 after:tw-left-0 after:tw-h-full after:tw-w-[230%] after:tw-animate-loading-gradient-scroll after:tw-bg-loading-gradient";
|
|
3646
3775
|
function LoadingSkeleton({ className, height = "20", isLoading: isLoadingProp, children, width = "100", }) {
|
|
3647
3776
|
const contextValue = useContext(LoadingContext);
|
|
3648
3777
|
const isLoading = isLoadingProp !== null && isLoadingProp !== void 0 ? isLoadingProp : contextValue;
|
|
3649
3778
|
if (children && !isLoading)
|
|
3650
3779
|
return children;
|
|
3651
|
-
return (
|
|
3780
|
+
return (jsx("div", { className: cn("tw-animate-shimmer tw-rounded-full tw-bg-shimmer tw-text-material-light-thin [--gradient-middle-color:transparent] group-data-[squid-theme-type='dark']:[--gradient-middle-color:rgba(255,255,255,0.5)]", className), style: {
|
|
3781
|
+
backgroundSize: "200% 100%",
|
|
3782
|
+
width: formatCSSValue(width),
|
|
3783
|
+
height: formatCSSValue(height),
|
|
3784
|
+
} }));
|
|
3652
3785
|
}
|
|
3653
3786
|
function TextSkeleton(_a) {
|
|
3654
3787
|
var { className, width = ["4em", "6em"], children, isLoading } = _a, props = __rest$1(_a, ["className", "width", "children", "isLoading"]);
|
|
@@ -3659,7 +3792,7 @@ function TextSkeleton(_a) {
|
|
|
3659
3792
|
const t = useMemo(Math.random, []);
|
|
3660
3793
|
if (isLoading === false)
|
|
3661
3794
|
return children;
|
|
3662
|
-
return (jsx("span", Object.assign({ className: cn("
|
|
3795
|
+
return (jsx("span", Object.assign({ className: cn("tw-inline-flex tw-rounded-full", loadingGradientClassName, className), style: {
|
|
3663
3796
|
["--min-width"]: minWidth,
|
|
3664
3797
|
["--max-width"]: maxWidth,
|
|
3665
3798
|
width: calcLerp(`var(${minWidthVar})`, `var(${maxWidthVar})`, t),
|
|
@@ -3669,7 +3802,7 @@ function BlockSkeleton(_a) {
|
|
|
3669
3802
|
var { isLoading, className, children } = _a, props = __rest$1(_a, ["isLoading", "className", "children"]);
|
|
3670
3803
|
if (isLoading === false)
|
|
3671
3804
|
return children;
|
|
3672
|
-
return (jsx("div", Object.assign({ className: cn("
|
|
3805
|
+
return (jsx("div", Object.assign({ className: cn("tw-rounded-squid-s", loadingGradientClassName, className) }, props)));
|
|
3673
3806
|
}
|
|
3674
3807
|
|
|
3675
3808
|
// font size, line height, and letter spacing classes
|
|
@@ -4153,8 +4286,8 @@ function Loader(_a) {
|
|
|
4153
4286
|
var { size = "24", strokeWidth = "2", className, rotateDuration = "0.8s" } = _a, props = __rest$1(_a, ["size", "strokeWidth", "className", "rotateDuration"]);
|
|
4154
4287
|
return (jsxs("svg", Object.assign({ width: size, height: size, viewBox: "0 0 32 32", fill: "none" }, props, { style: {
|
|
4155
4288
|
"--squid-loader-rotate-duration": rotateDuration,
|
|
4156
|
-
}, className: cn("squid-animated-loader", className), children: [jsx("style", { children: `
|
|
4157
|
-
` }), jsxs("g", { id: "Spinner", children: [jsx("circle", { id: "Groove", cx: "16.0001", cy: "16", r: "13.3333", stroke: "currentColor", strokeOpacity: "0.1", strokeWidth: strokeWidth }), jsx("path", { className: "squid-animated-loader-dash", d: "M16,2.66666 A13.3334,13.3334 0 0,1 16,29.3334", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round" })] })] })));
|
|
4289
|
+
}, className: cn("tw-animate-squid-animated-loader", className), children: [jsx("style", { children: `
|
|
4290
|
+
` }), jsxs("g", { id: "Spinner", children: [jsx("circle", { id: "Groove", cx: "16.0001", cy: "16", r: "13.3333", stroke: "currentColor", strokeOpacity: "0.1", strokeWidth: strokeWidth }), jsx("path", { className: "tw-squid-animated-loader-dash", d: "M16,2.66666 A13.3334,13.3334 0 0,1 16,29.3334", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round" })] })] })));
|
|
4158
4291
|
}
|
|
4159
4292
|
|
|
4160
4293
|
function MarketCapIcon({ size = "20", className, }) {
|
|
@@ -4172,6 +4305,16 @@ function NotAllowedIcon() {
|
|
|
4172
4305
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none", viewBox: "0 0 16 16", children: jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: "2", d: "M12.243 3.757a6 6 0 00-8.485 8.485m8.485-8.485a6 6 0 11-8.485 8.485m8.485-8.485l-8.486 8.486" }) }));
|
|
4173
4306
|
}
|
|
4174
4307
|
|
|
4308
|
+
function GooglePayIcon({ className, size = "40", }) {
|
|
4309
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 40 40", fill: "none", className: className, children: [jsx("rect", { width: "40", height: "40", fill: "white" }), jsx("path", { d: "M31.9805 20.2842C31.9805 19.3978 31.901 18.5454 31.7532 17.7273H19.9805V22.5682H26.7077C26.4122 24.125 25.5258 25.4432 24.1963 26.3295V29.4773H28.2532C30.6168 27.2954 31.9805 24.0909 31.9805 20.2842Z", fill: "#4285F4" }), jsx("path", { d: "M19.9775 32.4999C23.3525 32.4999 26.182 31.3862 28.2502 29.4771L24.1934 26.3294C23.0797 27.0794 21.6592 27.534 19.9775 27.534C16.7275 27.534 13.9661 25.3407 12.9774 22.3862H8.81836V25.6135C10.8752 29.6931 15.0911 32.4999 19.9775 32.4999Z", fill: "#34A853" }), jsx("path", { d: "M12.9805 22.375C12.7305 21.625 12.5827 20.8295 12.5827 20C12.5827 19.1704 12.7305 18.375 12.9805 17.625V14.3977H8.82137C7.96909 16.0795 7.48047 17.9773 7.48047 20C7.48047 22.0228 7.96909 23.9205 8.82137 25.6023L12.06 23.0795L12.9805 22.375Z", fill: "#FABB05" }), jsx("path", { d: "M19.9775 12.4773C21.8184 12.4773 23.4547 13.1136 24.7615 14.3409L28.3411 10.7614C26.1706 8.73864 23.3525 7.5 19.9775 7.5C15.0911 7.5 10.8752 10.3068 8.81836 14.3977L12.9774 17.625C13.9661 14.6705 16.7275 12.4773 19.9775 12.4773Z", fill: "#E94235" })] }));
|
|
4310
|
+
}
|
|
4311
|
+
function ApplePayIcon({ className, size = "40", }) {
|
|
4312
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 40 40", fill: "none", className: className, children: [jsx("rect", { width: "40", height: "40", fill: "black" }), jsx("path", { d: "M30.0044 13.9477C29.1463 14.473 28.4356 15.2074 27.9387 16.0822C27.4418 16.957 27.175 17.9436 27.1632 18.9496C27.1666 20.0819 27.502 21.1883 28.128 22.1318C28.754 23.0753 29.643 23.8144 30.6849 24.2576C30.2741 25.583 29.6661 26.839 28.8814 27.9835C27.7587 29.5998 26.5846 31.2159 24.7983 31.2159C23.012 31.2159 22.5526 30.1781 20.494 30.1781C18.4865 30.1781 17.7719 31.25 16.1386 31.25C14.5053 31.25 13.3656 29.7528 12.0555 27.9154C10.325 25.3415 9.37391 22.3228 9.31641 19.2218C9.31641 14.1178 12.634 11.4128 15.9004 11.4128C17.6358 11.4128 19.082 12.5526 20.1708 12.5526C21.2086 12.5526 22.8249 11.3446 24.7983 11.3446C25.813 11.3185 26.8185 11.5422 27.7264 11.9961C28.6342 12.45 29.4165 13.1202 30.0044 13.9477ZM23.8627 9.18408C24.7326 8.16073 25.2251 6.86987 25.2578 5.52713C25.2592 5.35012 25.2421 5.17344 25.2067 5C23.7124 5.14597 22.3306 5.85819 21.3447 6.99057C20.4663 7.97314 19.9553 9.22953 19.8985 10.5462C19.8992 10.7063 19.9163 10.866 19.9496 11.0226C20.0674 11.0449 20.187 11.0563 20.3069 11.0567C20.9955 11.0019 21.6659 10.8076 22.2772 10.4857C22.8884 10.1638 23.4279 9.72095 23.8627 9.18408Z", fill: "#FBFBFD" })] }));
|
|
4313
|
+
}
|
|
4314
|
+
function CreditCardIcon({ className, size = "30", }) {
|
|
4315
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 30 30", fill: "none", className: className, children: [jsx("path", { d: "M6.25 5C4.17893 5 2.5 6.67893 2.5 8.75L2.5 11.25L27.5 11.25V8.74969C27.5 6.67842 25.8209 5 23.75 5L6.25 5Z", fill: "currentColor" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.5 21.25L2.5 13.75L27.5 13.75L27.5 21.25C27.5 23.3211 25.8211 25 23.75 25L6.25 25C4.17893 25 2.5 23.3211 2.5 21.25ZM8.75 16.25C8.05964 16.25 7.5 16.8096 7.5 17.5C7.5 18.1904 8.05964 18.75 8.75 18.75H12.5C13.1904 18.75 13.75 18.1904 13.75 17.5C13.75 16.8096 13.1904 16.25 12.5 16.25H8.75Z", fill: "currentColor" })] }));
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4175
4318
|
function PercentIcon({ size = "24", className, }) {
|
|
4176
4319
|
return (jsxs("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: "M15.5 8.5L8.5 15.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M9 9.875C9.48325 9.875 9.875 9.48325 9.875 9C9.875 8.51675 9.48325 8.125 9 8.125C8.51675 8.125 8.125 8.51675 8.125 9C8.125 9.48325 8.51675 9.875 9 9.875Z", fill: "currentColor", stroke: "currentColor", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M15 15.875C15.4832 15.875 15.875 15.4832 15.875 15C15.875 14.5168 15.4832 14.125 15 14.125C14.5168 14.125 14.125 14.5168 14.125 15C14.125 15.4832 14.5168 15.875 15 15.875Z", fill: "currentColor", stroke: "currentColor", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
4177
4320
|
}
|
|
@@ -4353,14 +4496,23 @@ const priceChangeSignToIconMap = {
|
|
|
4353
4496
|
[PriceChangeSign.NEGATIVE]: (jsx(ArrowTriangle, { className: "tw-text-status-negative" })),
|
|
4354
4497
|
[PriceChangeSign.NEUTRAL]: jsx(PauseIcon, {}),
|
|
4355
4498
|
};
|
|
4356
|
-
|
|
4499
|
+
const priceChangeSignToTextColorMap = {
|
|
4500
|
+
[PriceChangeSign.POSITIVE]: "tw-text-status-positive",
|
|
4501
|
+
[PriceChangeSign.NEGATIVE]: "tw-text-status-negative",
|
|
4502
|
+
[PriceChangeSign.NEUTRAL]: "tw-text-grey-500",
|
|
4503
|
+
};
|
|
4504
|
+
function PriceChange({ value: rawValue = 0, variant = "small", highlightText = false, triangle = "suffix", }) {
|
|
4357
4505
|
const valueFormatted = Math.abs(Number(rawValue)).toFixed(2);
|
|
4358
4506
|
const sign = Number(rawValue) > 0
|
|
4359
4507
|
? PriceChangeSign.POSITIVE
|
|
4360
4508
|
: Number(rawValue) < 0
|
|
4361
4509
|
? PriceChangeSign.NEGATIVE
|
|
4362
4510
|
: PriceChangeSign.NEUTRAL;
|
|
4363
|
-
|
|
4511
|
+
const textColorClass = highlightText
|
|
4512
|
+
? priceChangeSignToTextColorMap[sign]
|
|
4513
|
+
: "tw-text-grey-500";
|
|
4514
|
+
const triangleElement = triangle !== "none" ? priceChangeSignToIconMap[sign] : null;
|
|
4515
|
+
return (jsx("div", { className: cn("tw-flex tw-h-squid-xs tw-items-center tw-justify-end", textColorClass), children: jsxs("div", { className: "tw-flex tw-items-center tw-justify-center tw-gap-[2px]", children: [triangle === "prefix" && triangleElement, variant === "small" ? (jsx(CaptionText, { className: valueWrapperClassName, children: valueFormatted })) : (jsx(BodyText, { size: "small", className: valueWrapperClassName, children: valueFormatted })), variant === "small" ? (jsx(CaptionText, { className: cn("!tw-leading-[10px]", highlightText ? textColorClass : "tw-text-grey-600"), children: "%" })) : (jsx(BodyText, { size: "small", className: cn("!tw-leading-[10px]", highlightText ? textColorClass : "tw-text-grey-600"), children: "%" })), triangle === "suffix" && triangleElement] }) }));
|
|
4364
4516
|
}
|
|
4365
4517
|
|
|
4366
4518
|
const statusBgClassMap$1 = {
|
|
@@ -4451,6 +4603,23 @@ function ImageStack(_a) {
|
|
|
4451
4603
|
: undefined }, imageProps), index))) })));
|
|
4452
4604
|
}
|
|
4453
4605
|
|
|
4606
|
+
const renderGradient = (variant) => {
|
|
4607
|
+
switch (variant) {
|
|
4608
|
+
case "primary":
|
|
4609
|
+
return "group-data-[squid-theme-type=light]:tw-bg-shimmer-dark group-data-[squid-theme-type=dark]:tw-bg-shimmer-light";
|
|
4610
|
+
case "secondary":
|
|
4611
|
+
return "tw-bg-shimmer-dark";
|
|
4612
|
+
default:
|
|
4613
|
+
return "tw-bg-shimmer-light";
|
|
4614
|
+
}
|
|
4615
|
+
};
|
|
4616
|
+
function LoadingText(_a) {
|
|
4617
|
+
var { children, className } = _a, props = __rest$1(_a, ["children", "className"]);
|
|
4618
|
+
return (jsx("span", Object.assign({}, props, { className: cn("tw-animate-shimmer tw-bg-clip-text tw-text-transparent ", renderGradient(props.variant), className), style: {
|
|
4619
|
+
backgroundSize: "200% 100%",
|
|
4620
|
+
}, children: children })));
|
|
4621
|
+
}
|
|
4622
|
+
|
|
4454
4623
|
function Chip(_a) {
|
|
4455
4624
|
var { label, icon } = _a, props = __rest$1(_a, ["label", "icon"]);
|
|
4456
4625
|
const isInteractive = !!props.onClick;
|
|
@@ -4513,12 +4682,12 @@ const buttonVariantClassMap = {
|
|
|
4513
4682
|
const buttonDisabledClass = "!tw-bg-grey-800 !tw-text-grey-600 tw-cursor-not-allowed";
|
|
4514
4683
|
const loadingClassname = "tw-invisible tw-opacity-0";
|
|
4515
4684
|
function Button$1(_a) {
|
|
4516
|
-
var { label, disabled = false, size, variant, icon, link, isLoading = false, showLoader = false, loaderSize = "md", chip, containerClassName, anchorRef, buttonRef } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "showLoader", "loaderSize", "chip", "containerClassName", "anchorRef", "buttonRef"]);
|
|
4685
|
+
var { label, disabled = false, size, variant, icon, link, isLoading = false, isShimmering = false, showLoader = false, loaderSize = "md", chip, containerClassName, anchorRef, buttonRef } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "isShimmering", "showLoader", "loaderSize", "chip", "containerClassName", "anchorRef", "buttonRef"]);
|
|
4517
4686
|
const chipElement = chip != null ? (jsx(Chip, Object.assign({}, chip, { className: cn("tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10", chip.className) }))) : null;
|
|
4687
|
+
const TextWrap = isShimmering ? LoadingText : "span";
|
|
4518
4688
|
const children = (jsxs(Fragment, { children: [!disabled && !isLoading && (jsx(ButtonHoverOverlay, { className: buttonRoundedClassMap[size][variant] })), jsx("div", { className: "tw-relative tw-z-[5] tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", children: label == null && icon == null && !showLoader ? (props.children) : (jsxs("span", { className: cn("tw-flex tw-items-center tw-justify-center", size === "lg"
|
|
4519
4689
|
? "tw-gap-squid-xs tw-px-squid-m"
|
|
4520
|
-
: "tw-gap-squid-xxs"), children: [showLoader && jsx(Loader, { size: loaderSizeMap[loaderSize] }), !isLoading && icon, label != null &&
|
|
4521
|
-
(size === "sm" ? (jsx(CaptionText, { className: cn(isLoading && loadingClassname, icon != null && "tw-pr-1"), children: label })) : (jsx(BodyText, { className: cn(isLoading && loadingClassname, icon != null && "tw-pr-1"), size: size === "lg" ? "medium" : "small", children: label })))] })) })] }));
|
|
4690
|
+
: "tw-gap-squid-xxs"), children: [showLoader && jsx(Loader, { size: loaderSizeMap[loaderSize] }), !isLoading && icon, label != null && (jsx(TextWrap, { variant: variant, children: size === "sm" ? (jsx(CaptionText, { className: cn(isLoading && loadingClassname, icon != null && "tw-pr-1"), children: label })) : (jsx(BodyText, { className: cn(isLoading && loadingClassname, icon != null && "tw-pr-1"), size: size === "lg" ? "medium" : "small", children: label })) }))] })) })] }));
|
|
4522
4691
|
const className = cn(baseButtonClassName, buttonSizeClassMap[size], buttonWidthClassnameMap[size], buttonVariantClassMap[size][variant], "tw-border-material-light-thin", !disabled && !isLoading && "hover:tw-border-material-light-average", buttonRoundedClassMap[size][variant],
|
|
4523
4692
|
// disabled styles
|
|
4524
4693
|
disabled && buttonDisabledClass, isLoading && "tw-cursor-not-allowed",
|
|
@@ -7615,9 +7784,9 @@ var UserInputType;
|
|
|
7615
7784
|
UserInputType[UserInputType["TOKEN"] = 0] = "TOKEN";
|
|
7616
7785
|
UserInputType[UserInputType["USD"] = 1] = "USD";
|
|
7617
7786
|
})(UserInputType || (UserInputType = {}));
|
|
7618
|
-
function useNumericInput({ onAmountChange, token, balance, debounceInput, forcedAmount, formatIfVerySmall, inputModeButton, maxUsdDecimals, direction, }) {
|
|
7787
|
+
function useNumericInput({ onAmountChange, token, balance, debounceInput, forcedAmount, formatIfVerySmall, inputModeButton, maxUsdDecimals, direction, initialInputMode = UserInputType.TOKEN, }) {
|
|
7619
7788
|
const [inputValue, setInputValue] = useState("");
|
|
7620
|
-
const [userInputType, setUserInputType] = useState(
|
|
7789
|
+
const [userInputType, setUserInputType] = useState(initialInputMode);
|
|
7621
7790
|
useEffect(() => {
|
|
7622
7791
|
if (forcedAmount !== undefined) {
|
|
7623
7792
|
updateInputValue(forcedAmount);
|
|
@@ -20031,24 +20200,19 @@ function LogoContainer({ children }) {
|
|
|
20031
20200
|
return (jsx("div", { className: "tw-flex tw-h-[60px] tw-w-[60px] tw-items-center tw-justify-center", children: children }));
|
|
20032
20201
|
}
|
|
20033
20202
|
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20203
|
+
const AddressHeader = ({ direction, onClick, isDisabled, tooltip, label, walletIconUrl, isLoading, displayLabel = true, highlightLabel = false, showIcon = true, }) => {
|
|
20204
|
+
const ButtonTag = onClick && !isDisabled ? "button" : "div";
|
|
20205
|
+
return (jsx("header", { className: "tw-flex tw-h-squid-xl2 tw-items-center tw-self-stretch tw-px-squid-m tw-py-squid-xxs", children: jsx(Tooltip, { tooltipContent: tooltip, tooltipWidth: "max", childrenClassName: "tw-rounded-squid-s", containerClassName: "tw-rounded-squid-s", children: jsxs(ButtonTag, { onClick: onClick, disabled: isDisabled, type: onClick ? "button" : undefined, className: cn("tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs", onClick && !isDisabled && "hover:tw-bg-material-light-thin", isLoading && "tw-opacity-50"), children: [jsx(BodyText, { size: "small", className: "tw-text-grey-500", children: direction === "from" ? "Pay" : "Receive" }), displayLabel && !isLoading && (jsxs(Fragment, { children: [jsx(BodyText, { size: "small", className: "tw-text-grey-600", children: ":" }), jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [showIcon &&
|
|
20206
|
+
(walletIconUrl ? (jsx(Image$1, { width: 24, height: 24, rounded: "xxs", src: walletIconUrl })) : (jsx("div", { className: "tw-flex tw-h-6 tw-w-6 tw-items-center tw-justify-center tw-rounded-lg tw-bg-royal-500 tw-px-0.5 tw-outline tw-outline-1 tw-outline-material-light-thin", children: jsx(WalletFilledIcon, { size: "18" }) }))), jsx(BodyText, { size: "small", className: cn(highlightLabel ? "tw-text-royal-500" : "tw-text-grey-300"), children: label }), jsx(ChevronArrowIcon, { className: cn(highlightLabel ? "tw-text-royal-500" : "tw-text-grey-600"), size: "16" })] })] }))] }) }) }));
|
|
20207
|
+
};
|
|
20208
|
+
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, fullHeight = true, debounceInput = true, showWalletButtonHeader = true, }) {
|
|
20209
|
+
var _a, _b, _c, _d;
|
|
20038
20210
|
const isFetching = isFetchingProp || isLoading;
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
? "tw-text-grey-300"
|
|
20045
|
-
: "tw-text-royal-500", children: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
20046
|
-
? walletButton === null || walletButton === void 0 ? void 0 : walletButton.address
|
|
20047
|
-
: walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel }), jsx(ChevronArrowIcon, { className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
20048
|
-
? "tw-text-grey-600"
|
|
20049
|
-
: "tw-text-royal-500" })] })] }))] }) })) }), jsx("div", { className: "tw-px-squid-m mobile-lg:tw-px-squid-l", children: jsx(AssetsButton, Object.assign({}, assetsButton, { chain: chain, token: token, isLoading: isLoading })) }), jsx(NumericInput, { inputMode: "decimal", pattern: "[0-9.,]*", token: {
|
|
20050
|
-
decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
|
|
20051
|
-
symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : "",
|
|
20211
|
+
return (jsxs("section", { className: cn("tw-relative tw-flex tw-w-full tw-flex-col tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 mobile-lg:tw-w-card-large", fullHeight && "tw-h-full tw-pb-squid-m"), children: [jsx(AddressHeader, { direction: direction, onClick: walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick, isDisabled: walletButton === null || walletButton === void 0 ? void 0 : walletButton.disabled, tooltip: (_a = walletButton === null || walletButton === void 0 ? void 0 : walletButton.tooltip) === null || _a === void 0 ? void 0 : _a.tooltipContent, label: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address) ||
|
|
20212
|
+
(walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel) ||
|
|
20213
|
+
(direction === "from" ? "Connect wallet" : "Select recipient"), walletIconUrl: walletButton === null || walletButton === void 0 ? void 0 : walletButton.walletIconUrl, isLoading: isLoading, displayLabel: showWalletButtonHeader, highlightLabel: !(walletButton === null || walletButton === void 0 ? void 0 : walletButton.address), showIcon: (_b = walletButton === null || walletButton === void 0 ? void 0 : walletButton.showIcon) !== null && _b !== void 0 ? _b : true }), jsx("div", { className: "tw-px-squid-m mobile-lg:tw-px-squid-l", children: jsx(AssetsButton, Object.assign({}, assetsButton, { chain: chain, token: token, isLoading: isLoading })) }), jsx(NumericInput, { inputMode: "decimal", pattern: "[0-9.,]*", token: {
|
|
20214
|
+
decimals: (_c = token === null || token === void 0 ? void 0 : token.decimals) !== null && _c !== void 0 ? _c : 18,
|
|
20215
|
+
symbol: (_d = token === null || token === void 0 ? void 0 : token.symbol) !== null && _d !== void 0 ? _d : "",
|
|
20052
20216
|
price: tokenPrice,
|
|
20053
20217
|
}, onAmountChange: (value) => {
|
|
20054
20218
|
onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value);
|
|
@@ -20074,6 +20238,28 @@ function AccountListItem({ isConnected, imageUrls = [], imageUrl, badgeUrl, acti
|
|
|
20074
20238
|
}, badge: badge })) : (jsx(ImageGroup, { imageUrls: imageUrls, badge: badge })), jsxs("div", { className: "tw-flex tw-flex-1 tw-flex-col tw-items-start tw-gap-squid-xs", children: [jsx(BodyText, { size: "small", className: "tw-h-[13px] !tw-leading-[13px]", children: title }), jsx(BodyText, { size: "small", className: "tw-h-[13px] !tw-leading-[13px] tw-text-grey-500", children: subtitle })] }), jsx("menu", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: actions })] }));
|
|
20075
20239
|
}
|
|
20076
20240
|
|
|
20241
|
+
function useCollapsibleMenu() {
|
|
20242
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
20243
|
+
const menuRef = useRef(null);
|
|
20244
|
+
const toggleMenu = () => {
|
|
20245
|
+
setIsMenuOpen(!isMenuOpen);
|
|
20246
|
+
};
|
|
20247
|
+
useEffect(() => {
|
|
20248
|
+
const handleClickOutside = (event) => {
|
|
20249
|
+
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
20250
|
+
setIsMenuOpen(false);
|
|
20251
|
+
}
|
|
20252
|
+
};
|
|
20253
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
20254
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
20255
|
+
}, []);
|
|
20256
|
+
return {
|
|
20257
|
+
isMenuOpen,
|
|
20258
|
+
toggleMenu,
|
|
20259
|
+
menuRef,
|
|
20260
|
+
};
|
|
20261
|
+
}
|
|
20262
|
+
|
|
20077
20263
|
const SPACING = 10;
|
|
20078
20264
|
function useDropdownMenu(props) {
|
|
20079
20265
|
const { initialIsDropdownOpen, itemsContainerRef } = props !== null && props !== void 0 ? props : {};
|
|
@@ -20230,28 +20416,6 @@ function useMediaQuery(query, { defaultValue = false, initializeWithValue = true
|
|
|
20230
20416
|
return matches;
|
|
20231
20417
|
}
|
|
20232
20418
|
|
|
20233
|
-
function useCollapsibleMenu() {
|
|
20234
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
20235
|
-
const menuRef = useRef(null);
|
|
20236
|
-
const toggleMenu = () => {
|
|
20237
|
-
setIsMenuOpen(!isMenuOpen);
|
|
20238
|
-
};
|
|
20239
|
-
useEffect(() => {
|
|
20240
|
-
const handleClickOutside = (event) => {
|
|
20241
|
-
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
20242
|
-
setIsMenuOpen(false);
|
|
20243
|
-
}
|
|
20244
|
-
};
|
|
20245
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
20246
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
20247
|
-
}, []);
|
|
20248
|
-
return {
|
|
20249
|
-
isMenuOpen,
|
|
20250
|
-
toggleMenu,
|
|
20251
|
-
menuRef,
|
|
20252
|
-
};
|
|
20253
|
-
}
|
|
20254
|
-
|
|
20255
20419
|
const useTimer = ({ immediateStart = true, }) => {
|
|
20256
20420
|
const [timer, setTimer] = useState("0s");
|
|
20257
20421
|
const intervalRef = useRef(null);
|
|
@@ -20583,7 +20747,7 @@ function PropertyListItem(_a) {
|
|
|
20583
20747
|
const Text = variant === "small" ? CaptionText : SmallBodyText;
|
|
20584
20748
|
const isCollapsible = !!collapsibleContent;
|
|
20585
20749
|
const ContentWrapperTag = isCollapsible ? "button" : "div";
|
|
20586
|
-
return (jsx("li", Object.assign({}, props, { className: cn("tw-flex tw-w-full tw-gap-squid-xs tw-rounded-squid-xs tw-text-grey-300", showGradientBg && "squid-property-row-bg", addExtraPadding && containerPaddingClassNameMap[variant], className), children: jsxs(ContentWrapperTag, { onClick: isCollapsible ? handleToggleCollapsed : undefined, className: "tw-w-full tw-rounded-squid-xs", children: [jsxs("div", { className: cn("tw-flex tw-h-squid-l tw-w-full tw-items-center tw-justify-between tw-gap-squid-xs", childrenVariantClassNameMap[variant]), children: [jsx("div", { className: cn("tw-w-6 tw-text-grey-500", iconClassName), children: icon }), jsxs(Text, { className: cn("tw-flex tw-min-w-fit tw-flex-1 tw-gap-squid-xxs tw-text-grey-500", labelClassName), children: [jsx(TextSkeleton, { isLoading: isLoading, children: label }), !!tooltip && (jsx(Tooltip, Object.assign({}, tooltip, { children: jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-500" }) })))] }), jsx(Text, { truncate: variant === "small" || undefined, className: cn("tw-flex tw-text-grey-300", detailClassName), children: jsx(TextSkeleton, { isLoading: isLoading, children: detail }) }), isCollapsible && (jsx(ChevronLargeRightIcon, { className: cn("tw-text-grey-600 tw-duration-generic", !isCollapsed && "tw-rotate-90"), size: "16" }))] }), isCollapsible && (jsx(Collapse, { collapsed: isCollapsed, children: collapsibleContent }))] }) })));
|
|
20750
|
+
return (jsx("li", Object.assign({}, props, { className: cn("tw-flex tw-w-full tw-gap-squid-xs tw-rounded-squid-xs tw-text-grey-300", showGradientBg && "tw-squid-property-row-bg", addExtraPadding && containerPaddingClassNameMap[variant], className), children: jsxs(ContentWrapperTag, { onClick: isCollapsible ? handleToggleCollapsed : undefined, className: "tw-w-full tw-rounded-squid-xs", children: [jsxs("div", { className: cn("tw-flex tw-h-squid-l tw-w-full tw-items-center tw-justify-between tw-gap-squid-xs", childrenVariantClassNameMap[variant]), children: [jsx("div", { className: cn("tw-w-6 tw-text-grey-500", iconClassName), children: icon }), jsxs(Text, { className: cn("tw-flex tw-min-w-fit tw-flex-1 tw-gap-squid-xxs tw-text-grey-500", labelClassName), children: [jsx(TextSkeleton, { isLoading: isLoading, children: label }), !!tooltip && (jsx(Tooltip, Object.assign({}, tooltip, { children: jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-500" }) })))] }), jsx(Text, { truncate: variant === "small" || undefined, className: cn("tw-flex tw-text-grey-300", detailClassName), children: jsx(TextSkeleton, { isLoading: isLoading, children: detail }) }), isCollapsible && (jsx(ChevronLargeRightIcon, { className: cn("tw-text-grey-600 tw-duration-generic", !isCollapsed && "tw-rotate-90"), size: "16" }))] }), isCollapsible && (jsx(Collapse, { collapsed: isCollapsed, children: collapsibleContent }))] }) })));
|
|
20587
20751
|
}
|
|
20588
20752
|
|
|
20589
20753
|
function RouteStep({ imageUrl, descriptionBlocks, subtitle, showStepSeparator = false, }) {
|
|
@@ -27050,7 +27214,7 @@ function UnsupportedPairNotice({ description, fromImageUrl, toImageUrl, }) {
|
|
|
27050
27214
|
return (jsxs("article", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs", children: [jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs -tw-space-x-[18px] tw-p-squid-xs", children: [jsx(Image$1, { src: fromImageUrl, size: "large", rounded: "xs" }), jsx("span", { className: "tw-z-[1] tw-rounded-full tw-bg-grey-900", children: jsx(CircleXFilledIcon, {}) }), jsx(Image$1, { src: toImageUrl, size: "large", rounded: "xs" })] }), jsx(CaptionText, { className: "tw-max-w-[260px] tw-text-balance tw-text-center tw-text-grey-500", children: description })] }));
|
|
27051
27215
|
}
|
|
27052
27216
|
|
|
27053
|
-
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
|
|
27217
|
+
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-h-[65px] mobile-sm-height:tw-h-[75px]";
|
|
27054
27218
|
const buttonClassName = "tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs";
|
|
27055
27219
|
const interactiveChipClassName = "hover:tw-bg-material-light-thin";
|
|
27056
27220
|
const notInteractiveChipClassName = "tw-cursor-not-allowed";
|
|
@@ -27060,7 +27224,7 @@ function NumericInput(_a) {
|
|
|
27060
27224
|
var { priceImpactPercentage, balance = "0", error, criticalPriceImpactPercentage = 5, token, onAmountChange, forcedAmount, maxUsdDecimals = 2, formatIfVerySmall = {
|
|
27061
27225
|
token: "0.001",
|
|
27062
27226
|
usd: "0.01",
|
|
27063
|
-
}, showDetails = true, isLoading = false, direction, inputModeButton, isInteractive = false, balanceButton, debounceInput = true } = _a, props = __rest$1(_a, ["priceImpactPercentage", "balance", "error", "criticalPriceImpactPercentage", "token", "onAmountChange", "forcedAmount", "maxUsdDecimals", "formatIfVerySmall", "showDetails", "isLoading", "direction", "inputModeButton", "isInteractive", "balanceButton", "debounceInput"]);
|
|
27227
|
+
}, showDetails = true, isLoading = false, direction, inputModeButton, isInteractive = false, balanceButton, debounceInput = true, initialInputMode = UserInputType.TOKEN, customSymbol, hideControls = false, hideBalance = false, containerClassName, inputClassName } = _a, props = __rest$1(_a, ["priceImpactPercentage", "balance", "error", "criticalPriceImpactPercentage", "token", "onAmountChange", "forcedAmount", "maxUsdDecimals", "formatIfVerySmall", "showDetails", "isLoading", "direction", "inputModeButton", "isInteractive", "balanceButton", "debounceInput", "initialInputMode", "customSymbol", "hideControls", "hideBalance", "containerClassName", "inputClassName"]);
|
|
27064
27228
|
const { userInputType, inputValue, handleInputChange, handleSwitchInputMode, isTokenAmountVerySmall, isUsdAmountVerySmall, amountFormatted, onBalanceButtonClick, balanceFormatted, } = useNumericInput({
|
|
27065
27229
|
onAmountChange,
|
|
27066
27230
|
token,
|
|
@@ -27071,6 +27235,7 @@ function NumericInput(_a) {
|
|
|
27071
27235
|
inputModeButton,
|
|
27072
27236
|
maxUsdDecimals,
|
|
27073
27237
|
direction,
|
|
27238
|
+
initialInputMode,
|
|
27074
27239
|
});
|
|
27075
27240
|
const balanceChipClickable = isInteractive && parseFloat(balance) > 0;
|
|
27076
27241
|
const AmountChip = isInteractive ? "button" : "div";
|
|
@@ -27079,9 +27244,33 @@ function NumericInput(_a) {
|
|
|
27079
27244
|
: "tw-text-grey-300";
|
|
27080
27245
|
const BalanceChipTag = balanceChipClickable ? "button" : "div";
|
|
27081
27246
|
const inputRef = useRef(null);
|
|
27082
|
-
|
|
27247
|
+
const symbolRef = useRef(null);
|
|
27248
|
+
const [symbolWidth, setSymbolWidth] = useState(0);
|
|
27249
|
+
const displaySymbol = customSymbol !== null && customSymbol !== void 0 ? customSymbol : (userInputType === UserInputType.USD ? "$" : undefined);
|
|
27250
|
+
// Calculate symbol width when it changes
|
|
27251
|
+
useEffect(() => {
|
|
27252
|
+
if (symbolRef.current && displaySymbol) {
|
|
27253
|
+
const width = symbolRef.current.getBoundingClientRect().width;
|
|
27254
|
+
setSymbolWidth(width);
|
|
27255
|
+
}
|
|
27256
|
+
}, [displaySymbol]);
|
|
27257
|
+
// Calculate left padding based on symbol width plus some spacing
|
|
27258
|
+
const getInputPadding = () => {
|
|
27259
|
+
if (!displaySymbol)
|
|
27260
|
+
return undefined;
|
|
27261
|
+
const basePadding = 5; // Base padding in pixels
|
|
27262
|
+
const totalPadding = Math.ceil(symbolWidth) + basePadding;
|
|
27263
|
+
return `${totalPadding}px`;
|
|
27264
|
+
};
|
|
27265
|
+
return (jsxs("div", { className: "tw-relative tw-flex tw-w-full tw-flex-col", children: [isLoading && (jsx("div", { className: "tw-pointer-events-none tw-absolute tw-inset-0 tw-top-squid-xxs tw-z-10 tw-overflow-hidden", children: jsx("div", { className: "tw-h-full tw-w-[78.75rem] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), isInteractive && !isLoading ? (jsx("form", { className: cn(containerClassname, containerClassName), onSubmit: (e) => {
|
|
27083
27266
|
e.preventDefault();
|
|
27084
|
-
}, children:
|
|
27267
|
+
}, children: jsxs("span", { className: "tw-relative tw-w-full", children: [displaySymbol && (jsx("span", { ref: symbolRef, style: {
|
|
27268
|
+
transform: "translateY(-50%)",
|
|
27269
|
+
}, className: "tw-absolute tw-top-1/2 tw-pl-squid-xs tw-text-grey-600", children: displaySymbol })), jsx("input", Object.assign({ ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, placeholder: "0", style: displaySymbol
|
|
27270
|
+
? {
|
|
27271
|
+
paddingLeft: getInputPadding(),
|
|
27272
|
+
}
|
|
27273
|
+
: undefined, className: cn("tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-py-squid-s tw-text-grey-300 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-500 focus:tw-outline-none", displaySymbol ? "tw-pr-squid-xs" : "tw-px-squid-xs", inputClassName) }, props))] }) })) : (jsx("div", { className: cn(containerClassname, (isLoading || Number(inputValue || 0) === 0) && loadingClassName, containerClassName), children: jsx("div", { className: "tw-font-regular tw-flex tw-h-[55px] tw-w-full tw-cursor-default tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-text-grey-300", children: jsx("span", { children: inputValue }) }) })), !showDetails || hideControls ? null : (jsxs("footer", { className: cn("tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-xs tw-text-grey-500 mobile-lg:tw-px-squid-m", isLoading && loadingClassName), children: [error ? (jsx("div", { className: "tw-px-squid-xs", children: jsx(ErrorMessage, { message: error.message }) })) : (jsx(Tooltip, Object.assign({}, (isLoading
|
|
27085
27274
|
? undefined
|
|
27086
27275
|
: userInputType === UserInputType.TOKEN
|
|
27087
27276
|
? inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.tokenModeTooltip
|
|
@@ -27099,9 +27288,9 @@ function NumericInput(_a) {
|
|
|
27099
27288
|
? formatIfVerySmall.token
|
|
27100
27289
|
: amountFormatted }), " ", jsx(CaptionText, { className: "tw-opacity-66", children: token.symbol })] })), priceImpactPercentage && direction === "to" ? (jsxs("span", { className: cn("tw-flex tw-items-center", priceImpactClass), children: [jsx(ArrowTriangle, { className: Number(priceImpactPercentage) === 0
|
|
27101
27290
|
? "tw-opacity-0"
|
|
27102
|
-
: "" }), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat("%") })] })) : null] }) }))), 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: jsxs(BalanceChipTag, { disabled: !balanceChipClickable, onClick: balanceChipClickable ? onBalanceButtonClick : undefined, className: cn(buttonClassName, balanceChipClickable
|
|
27291
|
+
: "" }), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat("%") })] })) : null] }) }))), !hideBalance && (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: jsxs(BalanceChipTag, { disabled: !balanceChipClickable, onClick: balanceChipClickable ? onBalanceButtonClick : undefined, className: cn(buttonClassName, balanceChipClickable
|
|
27103
27292
|
? interactiveChipClassName
|
|
27104
|
-
: notInteractiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxs("div", { children: [userInputType === UserInputType.USD && (jsx(CaptionText, { className: "tw-opacity-66", children: "$" })), jsx(CaptionText, { children: balanceFormatted })] }), !(balanceButton === null || balanceButton === void 0 ? void 0 : balanceButton.hideMaxChip) && jsx(Chip, { label: "Max" })] }) }))] }))] }));
|
|
27293
|
+
: notInteractiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxs("div", { children: [userInputType === UserInputType.USD && (jsx(CaptionText, { className: "tw-opacity-66", children: "$" })), jsx(CaptionText, { children: balanceFormatted })] }), !(balanceButton === null || balanceButton === void 0 ? void 0 : balanceButton.hideMaxChip) && jsx(Chip, { label: "Max" })] }) })))] }))] }));
|
|
27105
27294
|
}
|
|
27106
27295
|
|
|
27107
27296
|
function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarning = false, }) {
|
|
@@ -27539,7 +27728,7 @@ function DepositAddressView({ isOpen = true, fromToken, toToken, handleClose, fr
|
|
|
27539
27728
|
}, borderType: "outline", children: [jsxs("div", { className: "tw-relative tw-flex tw-h-[160px] 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", style: {
|
|
27540
27729
|
// box shadow simulating bottom outline (we do not use css outline because cannot apply it to only one side)
|
|
27541
27730
|
boxShadow: "0 1px 0 currentColor",
|
|
27542
|
-
}, children: [jsx("div", { className: "tw-absolute tw-right-squid-xs tw-top-squid-xs", children: jsx(Button$1, { size: "md", variant: "secondary", label: "Copy" }) }), headerContent] }), jsx("div", { className: "tw-relative tw-flex tw-h-squid-m tw-w-full tw-items-end tw-justify-between tw-self-stretch tw-px-squid-m", children: jsx(Image$1, { src: fromToken.logoUrl, rounded: "full", shadow: true, size: "xlarge" }) }), jsx(TxProgressViewHeader, { title: title, description: description, isWarning: true }), jsxs("ul", { className: "squid-property-gradient-bg-even-container tw-flex tw-w-full tw-flex-col tw-items-center tw-justify-start tw-gap-squid-xxs tw-overflow-auto tw-rounded-squid-l tw-pb-squid-s tw-scrollbar-hidden", children: [jsx(PropertyListItem, { icon: jsx(WalletFilledIcon, { size: "24" }), label: "Deposit address", detail: jsx(HashLink, { className: "tw-text-royal-500", formattedHash: depositAddressFormatted, hash: depositAddress, showCopyButton: true, copyIconSize: "24" }), tooltip: (tooltips === null || tooltips === void 0 ? void 0 : tooltips.depositAddress)
|
|
27731
|
+
}, children: [jsx("div", { className: "tw-absolute tw-right-squid-xs tw-top-squid-xs", children: jsx(Button$1, { size: "md", variant: "secondary", label: "Copy" }) }), headerContent] }), jsx("div", { className: "tw-relative tw-flex tw-h-squid-m tw-w-full tw-items-end tw-justify-between tw-self-stretch tw-px-squid-m", children: jsx(Image$1, { src: fromToken.logoUrl, rounded: "full", shadow: true, size: "xlarge" }) }), jsx(TxProgressViewHeader, { title: title, description: description, isWarning: true }), jsxs("ul", { className: "tw-squid-property-gradient-bg-even-container tw-flex tw-w-full tw-flex-col tw-items-center tw-justify-start tw-gap-squid-xxs tw-overflow-auto tw-rounded-squid-l tw-pb-squid-s tw-scrollbar-hidden", children: [jsx(PropertyListItem, { icon: jsx(WalletFilledIcon, { size: "24" }), label: "Deposit address", detail: jsx(HashLink, { className: "tw-text-royal-500", formattedHash: depositAddressFormatted, hash: depositAddress, showCopyButton: true, copyIconSize: "24" }), tooltip: (tooltips === null || tooltips === void 0 ? void 0 : tooltips.depositAddress)
|
|
27543
27732
|
? {
|
|
27544
27733
|
tooltipContent: tooltips.depositAddress,
|
|
27545
27734
|
tooltipWidth: "max",
|
|
@@ -68990,7 +69179,7 @@ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, s
|
|
|
68990
69179
|
}, secondToken: {
|
|
68991
69180
|
bgColor: toToken.bgColor,
|
|
68992
69181
|
logoURI: toToken.logoUrl,
|
|
68993
|
-
} })) }), jsx(TxProgressViewHeader, { title: headerTitle, description: headerDescription }), jsxs("ul", { className: "squid-property-gradient-bg-odd-container tw-flex tw-w-full tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xxs tw-rounded-squid-l tw-pb-squid-s tw-pt-squid-xs mobile-xs-height:tw-h-[195px] mobile-sm-height:tw-py-squid-s", children: [jsx(PropertyListItem, { icon: isSendTransaction ? (jsx(ArrowRightUpCircleIcon, {})) : (jsx(ArrowsSwapIcon, {})), label: isSendTransaction ? "Send" : "Swap", detail: isSendTransaction ? (jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: fromAmount })) : (jsx(Transfer, { from: jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: fromAmount }), to: jsx(IconLabel, { src: toToken.logoUrl, rounded: "full", children: toAmount }) })) }), jsx(PropertyListItem, { icon: jsx(ChainLink, { size: "24", strokeWidth: "2" }), label: "Chain", detail: isSendTransaction ? (jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(Image$1, { size: "medium", rounded: "xxs", src: fromChain.logoUrl }), jsx(CaptionText, { children: fromChain.networkName })] })) : (jsx(Transfer, { from: jsxs(Fragment, { children: [jsx(Image$1, { size: "medium", rounded: "xxs", src: fromChain.logoUrl }), jsx(CaptionText, { children: fromChain.networkName })] }), to: jsxs(Fragment, { children: [jsx(Image$1, { size: "medium", rounded: "xxs", src: toChain.logoUrl }), jsx(CaptionText, { children: toChain.networkName })] }) })) }), jsx(PropertyListItem, { icon: jsx(WalletFilledIcon, { size: "24" }), label: "Wallet", detail: jsx(Transfer, { from: fromAddressFormatted, to: toAddressFormatted }) }), jsx(PropertyListItem, { icon: jsx(TimeFliesIcon, {}), label: "Time to complete", detail: swapState === SwapState.PROGRESS ? (jsx(Transfer, { from: timer, to: estimatedTimeToComplete })) : swapState === SwapState.COMPLETED ? (jsx(CaptionText, { children: timer })) : (jsx(CaptionText, { children: estimatedTimeToComplete })) })] })] }), jsx(TrackTransactionView, { ref: trackTransactionViewRef, onTxEnd: () => {
|
|
69182
|
+
} })) }), jsx(TxProgressViewHeader, { title: headerTitle, description: headerDescription }), jsxs("ul", { className: "tw-squid-property-gradient-bg-odd-container tw-flex tw-w-full tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xxs tw-rounded-squid-l tw-pb-squid-s tw-pt-squid-xs mobile-xs-height:tw-h-[195px] mobile-sm-height:tw-py-squid-s", children: [jsx(PropertyListItem, { icon: isSendTransaction ? (jsx(ArrowRightUpCircleIcon, {})) : (jsx(ArrowsSwapIcon, {})), label: isSendTransaction ? "Send" : "Swap", detail: isSendTransaction ? (jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: fromAmount })) : (jsx(Transfer, { from: jsx(IconLabel, { src: fromToken.logoUrl, rounded: "full", children: fromAmount }), to: jsx(IconLabel, { src: toToken.logoUrl, rounded: "full", children: toAmount }) })) }), jsx(PropertyListItem, { icon: jsx(ChainLink, { size: "24", strokeWidth: "2" }), label: "Chain", detail: isSendTransaction ? (jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(Image$1, { size: "medium", rounded: "xxs", src: fromChain.logoUrl }), jsx(CaptionText, { children: fromChain.networkName })] })) : (jsx(Transfer, { from: jsxs(Fragment, { children: [jsx(Image$1, { size: "medium", rounded: "xxs", src: fromChain.logoUrl }), jsx(CaptionText, { children: fromChain.networkName })] }), to: jsxs(Fragment, { children: [jsx(Image$1, { size: "medium", rounded: "xxs", src: toChain.logoUrl }), jsx(CaptionText, { children: toChain.networkName })] }) })) }), jsx(PropertyListItem, { icon: jsx(WalletFilledIcon, { size: "24" }), label: "Wallet", detail: jsx(Transfer, { from: fromAddressFormatted, to: toAddressFormatted }) }), jsx(PropertyListItem, { icon: jsx(TimeFliesIcon, {}), label: "Time to complete", detail: swapState === SwapState.PROGRESS ? (jsx(Transfer, { from: timer, to: estimatedTimeToComplete })) : swapState === SwapState.COMPLETED ? (jsx(CaptionText, { children: timer })) : (jsx(CaptionText, { children: estimatedTimeToComplete })) })] })] }), jsx(TrackTransactionView, { ref: trackTransactionViewRef, onTxEnd: () => {
|
|
68994
69183
|
stopTimer();
|
|
68995
69184
|
}, onTxStart: () => {
|
|
68996
69185
|
startTimer();
|
|
@@ -69350,16 +69539,6 @@ const parseSquidTheme = (userTheme, themeType) => {
|
|
|
69350
69539
|
prefix: THEME_CSS_VARIABLE_PREFIX,
|
|
69351
69540
|
});
|
|
69352
69541
|
};
|
|
69353
|
-
const remToPx = (rem, baseFontSize = 16) => {
|
|
69354
|
-
if (typeof rem === "string")
|
|
69355
|
-
return Number(rem.replace("rem", "")) * baseFontSize;
|
|
69356
|
-
return rem * baseFontSize;
|
|
69357
|
-
};
|
|
69358
|
-
const pxToRem = (px, baseFontSize = 16) => {
|
|
69359
|
-
if (typeof px === "string")
|
|
69360
|
-
return Number(px.replace("px", "")) / baseFontSize;
|
|
69361
|
-
return px / baseFontSize;
|
|
69362
|
-
};
|
|
69363
69542
|
function getContrastColor({ r, g, b, }, threshold = 128) {
|
|
69364
69543
|
const brightness = (r * 299 + g * 587 + b * 114) / 1000;
|
|
69365
69544
|
return brightness >= threshold ? "dark" : "light";
|
|
@@ -69478,4 +69657,4 @@ function ThemeProvider(_a) {
|
|
|
69478
69657
|
return (jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-group tw-relative tw-flex tw-font-squid-main tw-h-d-screen mobile-lg:tw-h-auto", props.className), children: children })));
|
|
69479
69658
|
}
|
|
69480
69659
|
|
|
69481
|
-
export { ANIMATION_DURATIONS, AccountListItem, AccountsButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationCard, AnimationWrapper, Announcement, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowExpandIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, CelebrateIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleCheckIcon, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy2Icon, CopyOutlinedIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DepositAddressView, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FarcasterIcon, FavouriteFilterIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HighestPriceRangeIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageGroup, ImageIcon, ImageSparkle, ImageStack, ImageState, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LargeNumericInput, LightningIcon, LimitIcon, LinkIcon, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, ModalTitle, MoneyBagIcon, MoonIcon, NavigationBar, NewsIcon, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PauseIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PluginIcon, PlusIcon, PoopIcon, PowerIcon, PriceChange, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, QrCodeIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileFilledIcon, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, SquidVector, StakeAction, StarLinesIcon, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, Tab, Tabs, TagIcon, TagIconFilled, TelegramIcon, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenDetailsView, TokenGroup, TokenGroups, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, TxProgressViewHeader, UnsupportedPairNotice, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WrapAction, XSocialIcon, adjustColorForContrast, baseTailwindConfig, blendColors, buttonRoundedClassMap, cn, darkTheme, getColorBrightness, getContrastColor, getHexColorFromOpacityPercentage, getWalletCardBackground, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseColor, parseSquidTheme, pxToRem, remToPx, rgbToHex, spacing$1 as spacing, statusTextClassMap, themeKeysToCssVariables, transactionErrorPauseAnimation, transactionFailureAnimation, transactionHalfSuccessAnimation, transactionPendingAnimation, transactionProcessingAnimation, transactionRejectedAnimation, transactionSuccessAnimation, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
|
|
69660
|
+
export { ANIMATION_DURATIONS, AccountListItem, AccountsButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AddressHeader, AnimationCard, AnimationWrapper, Announcement, AppContainer, ApplePayIcon, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowExpandIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, CelebrateIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleCheckIcon, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy2Icon, CopyOutlinedIcon, CreditCardIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DepositAddressView, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FarcasterIcon, FavouriteFilterIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, GooglePayIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HighestPriceRangeIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageGroup, ImageIcon, ImageSparkle, ImageStack, ImageState, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LargeNumericInput, LightningIcon, LimitIcon, LinkIcon, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, ModalTitle, MoneyBagIcon, MoonIcon, NavigationBar, NewsIcon, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PauseIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PluginIcon, PlusIcon, PoopIcon, PowerIcon, PriceChange, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, QrCodeIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileFilledIcon, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, SquidVector, StakeAction, StarLinesIcon, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, Tab, Tabs, TagIcon, TagIconFilled, TelegramIcon, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenDetailsView, TokenGroup, TokenGroups, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, TxProgressViewHeader, UnsupportedPairNotice, UsdAmount, UserInputType, WalletFilledIcon, WalletIcon, WalletLink, WrapAction, XSocialIcon, adjustColorForContrast, baseTailwindConfig, blendColors, buttonRoundedClassMap, cn, darkTheme, getColorBrightness, getContrastColor, getHexColorFromOpacityPercentage, getWalletCardBackground, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseColor, parseSquidTheme, pxToRem, remToPx, rgbToHex, spacing$1 as spacing, statusTextClassMap, themeKeysToCssVariables, transactionErrorPauseAnimation, transactionFailureAnimation, transactionHalfSuccessAnimation, transactionPendingAnimation, transactionProcessingAnimation, transactionRejectedAnimation, transactionSuccessAnimation, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useNumericInput, useOnResize, useRect, useTimer, useUserTheme, useVersion };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface PriceChangeProps {
|
|
2
2
|
variant?: "small" | "large";
|
|
3
3
|
value: string | number;
|
|
4
|
+
highlightText?: boolean;
|
|
5
|
+
triangle?: "none" | "prefix" | "suffix";
|
|
4
6
|
}
|
|
5
|
-
export declare function PriceChange({ value: rawValue, variant, }: PriceChangeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function PriceChange({ value: rawValue, variant, highlightText, triangle, }: PriceChangeProps): import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export {};
|