@0xsquid/ui 2.6.4 → 2.6.6
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 +175 -125
- package/dist/cjs/types/components/buttons/Chip.d.ts +1 -1
- package/dist/cjs/types/components/controls/LargeNumericInput.d.ts +6 -0
- package/dist/cjs/types/components/controls/NumericInput.d.ts +2 -1
- package/dist/cjs/types/components/controls/index.d.ts +2 -1
- package/dist/cjs/types/components/layout/AnimationWrapper.d.ts +3 -0
- package/dist/cjs/types/components/layout/ModalTitle.d.ts +5 -0
- package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +3 -1
- package/dist/cjs/types/components/layout/index.d.ts +1 -0
- package/dist/cjs/types/stories/buttons/Chip.stories.d.ts +2 -1
- package/dist/cjs/types/stories/controls/Input.stories.d.ts +1 -1
- package/dist/cjs/types/stories/controls/LargeNumericInput.stories.d.ts +6 -0
- package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +2 -0
- package/dist/esm/index.js +174 -127
- package/dist/esm/types/components/buttons/Chip.d.ts +1 -1
- package/dist/esm/types/components/controls/LargeNumericInput.d.ts +6 -0
- package/dist/esm/types/components/controls/NumericInput.d.ts +2 -1
- package/dist/esm/types/components/controls/index.d.ts +2 -1
- package/dist/esm/types/components/layout/AnimationWrapper.d.ts +3 -0
- package/dist/esm/types/components/layout/ModalTitle.d.ts +5 -0
- package/dist/esm/types/components/layout/SwapConfiguration.d.ts +3 -1
- package/dist/esm/types/components/layout/index.d.ts +1 -0
- package/dist/esm/types/stories/buttons/Chip.stories.d.ts +2 -1
- package/dist/esm/types/stories/controls/Input.stories.d.ts +1 -1
- package/dist/esm/types/stories/controls/LargeNumericInput.stories.d.ts +6 -0
- package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +31 -14
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default$1, { useState, createContext, useContext, useMemo, useRef, useEffect, useLayoutEffect, useInsertionEffect,
|
|
3
|
+
import React__default$1, { useState, createContext, useContext, useMemo, useRef, useEffect, useCallback, useLayoutEffect, useInsertionEffect, forwardRef, Fragment as Fragment$1, createElement, useId as useId$1, Component, cloneElement, Children, isValidElement, useImperativeHandle } from 'react';
|
|
4
4
|
|
|
5
5
|
const CSS_VARS = {
|
|
6
6
|
MOVE_WITH_SPRING_BOUNCE_DURATION: "--squid-animation-move-with-spring-bounce-duration",
|
|
@@ -4431,7 +4431,9 @@ function ImageStack(_a) {
|
|
|
4431
4431
|
|
|
4432
4432
|
function Chip(_a) {
|
|
4433
4433
|
var { label, icon } = _a, props = __rest$1(_a, ["label", "icon"]);
|
|
4434
|
-
|
|
4434
|
+
const isInteractive = !!props.onClick;
|
|
4435
|
+
const ChipTag = isInteractive ? "button" : "div";
|
|
4436
|
+
return (jsx(ChipTag, Object.assign({}, props, { className: cn("tw-flex tw-h-squid-m tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-grey-500 tw-text-grey-900", icon && "tw-w-squid-m", isInteractive && "hover:tw-bg-grey-300", props.className), children: label ? (jsx(CaptionText, { className: "tw-min-w-squid-xl tw-text-nowrap tw-px-squid-xxs tw-text-center", children: label })) : (icon) })));
|
|
4435
4437
|
}
|
|
4436
4438
|
|
|
4437
4439
|
const loaderSizeMap = {
|
|
@@ -4581,6 +4583,40 @@ const InputActionButton = ({ onClick, variant = "tertiary", label = "Paste", })
|
|
|
4581
4583
|
return (jsx(Button$1, { size: "md", variant: variant, onClick: onClick, className: "!tw-h-[30px] !tw-w-fit !tw-min-w-0 !tw-rounded-input", children: jsx(CaptionText, { children: label }) }));
|
|
4582
4584
|
};
|
|
4583
4585
|
|
|
4586
|
+
const placeholder = "0";
|
|
4587
|
+
const suggestedAmounts = ["100", "500", "1000"];
|
|
4588
|
+
function LargeNumericInput({ onChange, value }) {
|
|
4589
|
+
const inputRef = useRef(null);
|
|
4590
|
+
const inputValueSpyRef = useRef(null);
|
|
4591
|
+
useEffect(() => {
|
|
4592
|
+
const observer = new ResizeObserver((entries) => {
|
|
4593
|
+
var _a;
|
|
4594
|
+
if (!inputRef.current)
|
|
4595
|
+
return;
|
|
4596
|
+
// update input width to match the width of the invisible span
|
|
4597
|
+
// this is needed to center the input
|
|
4598
|
+
inputRef.current.style.width = `${(_a = entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect.width}px`;
|
|
4599
|
+
});
|
|
4600
|
+
if (inputValueSpyRef.current) {
|
|
4601
|
+
observer.observe(inputValueSpyRef.current);
|
|
4602
|
+
}
|
|
4603
|
+
return () => {
|
|
4604
|
+
observer.disconnect();
|
|
4605
|
+
};
|
|
4606
|
+
}, []);
|
|
4607
|
+
const handleInputChange = useCallback((event) => {
|
|
4608
|
+
// Replace commas with dots
|
|
4609
|
+
const value = event.target.value.replace(/,/g, ".");
|
|
4610
|
+
// Check that the input value is a valid number
|
|
4611
|
+
const isValidAmount = /^\d*\.?\d{0,6}$/.test(value);
|
|
4612
|
+
if (isValidAmount)
|
|
4613
|
+
onChange(value || "");
|
|
4614
|
+
}, [onChange]);
|
|
4615
|
+
return (jsxs("section", { className: "tw-flex tw-flex-1 tw-flex-col tw-items-center tw-justify-center tw-self-stretch tw-px-squid-l tw-pb-squid-m", children: [jsx("div", { className: "tw-relative tw-flex tw-w-full tw-flex-1 tw-items-center tw-justify-center tw-self-stretch tw-text-7xl tw-text-royal-500", children: jsxs("label", { className: "tw-flex tw-max-w-full tw-cursor-text tw-items-center tw-overflow-hidden tw-rounded-squid-l tw-px-squid-s tw-py-squid-xxs focus-within:tw-bg-material-light-thin hover:tw-bg-material-light-thin", children: [jsx("span", { ref: inputValueSpyRef, className: "tw-pointer-events-none tw-absolute tw-opacity-0", children: value || placeholder }), jsx("span", { children: "$" }), jsx("input", { inputMode: "decimal", pattern: "[0-9.,]*", ref: inputRef, value: value, onChange: handleInputChange, className: "tw-max-w-[calc(100%-3.125rem)] tw-bg-transparent tw-placeholder-royal-500 tw-outline-none focus:tw-outline-none", placeholder: placeholder })] }) }), jsx("footer", { className: "tw-flex tw-h-squid-m tw-items-center tw-justify-center tw-gap-squid-xxs tw-self-stretch", children: suggestedAmounts.map((amount) => (jsx(Chip, { label: `$${amount}`, onClick: () => {
|
|
4616
|
+
onChange(amount);
|
|
4617
|
+
} }, amount))) })] }));
|
|
4618
|
+
}
|
|
4619
|
+
|
|
4584
4620
|
/*
|
|
4585
4621
|
* bignumber.js v9.1.2
|
|
4586
4622
|
* A JavaScript library for arbitrary-precision arithmetic.
|
|
@@ -8709,6 +8745,12 @@ const AnimationWrapper = (playerProps) => {
|
|
|
8709
8745
|
}, []);
|
|
8710
8746
|
return (jsx("div", { id: "squid-lottie-animation", className: clsx("tw-h-full [&>*]:tw-h-full", "tw-transition-all", display ? "tw-opacity-100" : "tw-opacity-0"), children: showAnimation && jsx(Player, Object.assign({}, playerProps)) }));
|
|
8711
8747
|
};
|
|
8748
|
+
function AnimationCard({ children }) {
|
|
8749
|
+
return (jsx("div", { className: "tw-flex tw-h-[130px] tw-w-full tw-items-center tw-justify-center tw-rounded-tl-modal tw-rounded-tr-modal tw-bg-animation-bg tw-py-squid-s tw-text-material-light-thin mobile-xs-height:tw-h-[160px]", style: {
|
|
8750
|
+
// box shadow simulating bottom outline (we do not use css outline because cannot apply it to only one side)
|
|
8751
|
+
boxShadow: "0 1px 0 currentColor",
|
|
8752
|
+
}, children: children }));
|
|
8753
|
+
}
|
|
8712
8754
|
|
|
8713
8755
|
const borderRadiusClassMap = {
|
|
8714
8756
|
sm: "tw-rounded-menu-sm before:tw-rounded-menu-sm",
|
|
@@ -19005,6 +19047,10 @@ function ModalContentDivider() {
|
|
|
19005
19047
|
return (jsx("svg", { width: "100%", height: "11", viewBox: "0 0 400 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("rect", { x: "1", y: "5", width: "398", height: "1", fill: "currentColor" }) }));
|
|
19006
19048
|
}
|
|
19007
19049
|
|
|
19050
|
+
function ModalTitle({ title }) {
|
|
19051
|
+
return (jsx("div", { className: "tw-flex tw-h-squid-xxl tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-px-squid-m tw-py-squid-xs", children: jsx(BodyText, { size: "small", children: title }) }));
|
|
19052
|
+
}
|
|
19053
|
+
|
|
19008
19054
|
function NavigationBar(_a) {
|
|
19009
19055
|
var { title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, actions, isLoading = false, subtitle, paddingRight = 0 } = _a, props = __rest$1(_a, ["title", "displayBackButton", "logoUrl", "transparent", "displayButtonShadows", "onBackButtonClick", "actions", "isLoading", "subtitle", "paddingRight"]);
|
|
19010
19056
|
return (jsxs("nav", Object.assign({}, props, { className: cn("tw-flex tw-max-h-[120px] tw-flex-row-reverse tw-text-grey-300 mobile-xs-height:tw-flex-col", transparent ? "tw-bg-transparent" : "tw-bg-grey-900", props.className), children: [jsxs("div", { className: cn("tw-flex tw-h-squid-xxl tw-items-center tw-justify-end tw-gap-x-squid-xs tw-pl-squid-m", displayBackButton
|
|
@@ -19062,7 +19108,7 @@ function LogoContainer({ children }) {
|
|
|
19062
19108
|
return (jsx("div", { className: "tw-flex tw-h-[60px] tw-w-[60px] tw-items-center tw-justify-center", children: children }));
|
|
19063
19109
|
}
|
|
19064
19110
|
|
|
19065
|
-
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, }) {
|
|
19111
|
+
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, }) {
|
|
19066
19112
|
var _a, _b;
|
|
19067
19113
|
const isWalletButtonInteractive = !isLoading && !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick);
|
|
19068
19114
|
const WalletButtonTag = isWalletButtonInteractive ? "button" : "div";
|
|
@@ -19071,13 +19117,13 @@ function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp
|
|
|
19071
19117
|
!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.disabled) &&
|
|
19072
19118
|
!!token &&
|
|
19073
19119
|
(!!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.address) || !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel));
|
|
19074
|
-
return (jsxs("section", { className: "tw-relative tw-flex tw-
|
|
19120
|
+
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("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-m tw-py-squid-xs tw-leading-5 tw-text-grey-300 mobile-lg:tw-px-squid-l", children: jsx(Tooltip, Object.assign({}, walletButton === null || walletButton === void 0 ? void 0 : walletButton.tooltip, { tooltipWidth: "max", childrenClassName: "tw-rounded-squid-s", containerClassName: "tw-rounded-squid-s", children: jsxs(WalletButtonTag, { onClick: isWalletButtonInteractive ? walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick : undefined, className: cn("-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs tw-text-grey-600", isWalletButtonInteractive && "hover:tw-bg-material-light-thin", isLoading && "tw-opacity-50"), children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === "from" ? "Pay" : "Receive" }), showWalletButtonLabel && (jsxs(Fragment, { children: [jsx(BodyText, { size: "small", children: ":" }), jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsx(BodyText, { size: "small", className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
19075
19121
|
? "tw-text-grey-300"
|
|
19076
19122
|
: "tw-text-royal-500", children: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
19077
19123
|
? walletButton === null || walletButton === void 0 ? void 0 : walletButton.address
|
|
19078
19124
|
: walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel }), jsx(ChevronArrowIcon, { className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
|
|
19079
19125
|
? "tw-text-grey-600"
|
|
19080
|
-
: "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 })) }),
|
|
19126
|
+
: "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: {
|
|
19081
19127
|
decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
|
|
19082
19128
|
symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : "",
|
|
19083
19129
|
price: tokenPrice,
|
|
@@ -19086,7 +19132,7 @@ function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp
|
|
|
19086
19132
|
}, balance: balance, criticalPriceImpactPercentage: criticalPriceImpactPercentage, error: error, formatIfVerySmall: {
|
|
19087
19133
|
token: "0.001",
|
|
19088
19134
|
usd: "0.01",
|
|
19089
|
-
}, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails: showNumericInputDetails, direction: direction, forcedAmount: amount, inputModeButton: inputModeButton, balanceButton: balanceButton, isInteractive: isInputInteractive && !isLoading })] }));
|
|
19135
|
+
}, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails: showNumericInputDetails, direction: direction, forcedAmount: amount, inputModeButton: inputModeButton, balanceButton: balanceButton, isInteractive: isInputInteractive && !isLoading, debounceInput: debounceInput })] }));
|
|
19090
19136
|
}
|
|
19091
19137
|
|
|
19092
19138
|
function AccountListItem({ isConnected, imageUrls = [], imageUrl, badgeUrl, actions, subtitle, title, }) {
|
|
@@ -27373,7 +27419,7 @@ function NumericInput(_a) {
|
|
|
27373
27419
|
var { priceImpactPercentage, balance = "0", error, criticalPriceImpactPercentage = 5, token, onAmountChange, forcedAmount, maxUsdDecimals = 2, formatIfVerySmall = {
|
|
27374
27420
|
token: "0.001",
|
|
27375
27421
|
usd: "0.01",
|
|
27376
|
-
}, showDetails = true, isLoading = false, direction, inputModeButton, isInteractive = false, balanceButton } = _a, props = __rest$1(_a, ["priceImpactPercentage", "balance", "error", "criticalPriceImpactPercentage", "token", "onAmountChange", "forcedAmount", "maxUsdDecimals", "formatIfVerySmall", "showDetails", "isLoading", "direction", "inputModeButton", "isInteractive", "balanceButton"]);
|
|
27422
|
+
}, 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"]);
|
|
27377
27423
|
const [inputValue, setInputValue] = useState("");
|
|
27378
27424
|
const [userInputType, setUserInputType] = useState(UserInputType.TOKEN);
|
|
27379
27425
|
const balanceChipClickable = isInteractive && parseFloat(balance) > 0;
|
|
@@ -27388,16 +27434,14 @@ function NumericInput(_a) {
|
|
|
27388
27434
|
? safeNewValue
|
|
27389
27435
|
: convertTokenAmountToUSD(safeNewValue, token.price, maxUsdDecimals);
|
|
27390
27436
|
setInputValue(formattedAmount);
|
|
27391
|
-
}, [userInputType, token.price,
|
|
27437
|
+
}, [userInputType, token.price, token.decimals]);
|
|
27392
27438
|
const onBalanceButtonClick = useCallback(() => {
|
|
27393
27439
|
if (balanceChipClickable) {
|
|
27394
27440
|
updateInputValue(balance);
|
|
27395
27441
|
onAmountChange(balance);
|
|
27396
27442
|
}
|
|
27397
|
-
}, [balance,
|
|
27398
|
-
const onAmountChangeDebounced = useCallback(debounce$1(onAmountChange, 1000), [
|
|
27399
|
-
onAmountChange,
|
|
27400
|
-
]);
|
|
27443
|
+
}, [balance, onAmountChange, updateInputValue]);
|
|
27444
|
+
const onAmountChangeDebounced = useCallback(debounce$1(onAmountChange, debounceInput ? 1000 : 0), [onAmountChange]);
|
|
27401
27445
|
const handleInputChange = (e) => {
|
|
27402
27446
|
const value = e.target.value.replace(/,/g, "."); // Replace commas with dots
|
|
27403
27447
|
const maxDecimalsForInputType = userInputType === UserInputType.TOKEN ? token.decimals : maxUsdDecimals;
|
|
@@ -27518,9 +27562,9 @@ function NumericInput(_a) {
|
|
|
27518
27562
|
}, [userInputType, balance, token.price]);
|
|
27519
27563
|
const containerClassname = "tw-px-squid-xs !tw-h-full tw-pt-squid-xxs mobile-xs-height:tw-pb-squid-s tw-text-heading-small tw-font-regular mobile-lg:tw-px-squid-m tw-relative tw-h-[65px] mobile-sm-height:tw-h-[75px]";
|
|
27520
27564
|
const inputRef = useRef(null);
|
|
27521
|
-
return (jsxs(
|
|
27565
|
+
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 ? (jsxs("form", { className: containerClassname, onSubmit: (e) => {
|
|
27522
27566
|
e.preventDefault();
|
|
27523
|
-
}, children: [userInputType === UserInputType.USD && (jsx("span", { className: "tw-absolute tw-left-5 tw-top-[11px] tw-leading-[43px] tw-text-grey-600 mobile-lg:tw-left-[30px]", children: "$" })), jsx("input", Object.assign({ ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, placeholder: "0", className: cn("tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs 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", userInputType === UserInputType.USD && "tw-pl-[33px]") }, props))] })) : (jsx("div", { className: cn(containerClassname, (isLoading || Number(inputValue || 0) === 0) && loadingClassName), children: jsx("div", { className: "tw-font-regular tw-flex tw-h-[55px] tw-w-full 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 || 0 }) }) })), !showDetails ? 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
|
|
27567
|
+
}, children: [userInputType === UserInputType.USD && (jsx("span", { className: "tw-absolute tw-left-5 tw-top-[11px] tw-leading-[43px] tw-text-grey-600 mobile-lg:tw-left-[30px]", children: "$" })), jsx("input", Object.assign({ ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, placeholder: "0", className: cn("tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs 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", userInputType === UserInputType.USD && "tw-pl-[33px]") }, props))] })) : (jsx("div", { className: cn(containerClassname, (isLoading || Number(inputValue || 0) === 0) && loadingClassName), 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 || 0 }) }) })), !showDetails ? 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
|
|
27524
27568
|
? undefined
|
|
27525
27569
|
: userInputType === UserInputType.TOKEN
|
|
27526
27570
|
? inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.tokenModeTooltip
|
|
@@ -27537,114 +27581,6 @@ function NumericInput(_a) {
|
|
|
27537
27581
|
: 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" })] }) }))] }))] }));
|
|
27538
27582
|
}
|
|
27539
27583
|
|
|
27540
|
-
function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected = false, }) {
|
|
27541
|
-
const [isInputVisible, setIsInputVisible] = useState(false);
|
|
27542
|
-
const [inputValue, setInputValue] = useState(String(value !== null && value !== void 0 ? value : 0));
|
|
27543
|
-
useEffect(() => {
|
|
27544
|
-
if (!isInputVisible)
|
|
27545
|
-
return;
|
|
27546
|
-
const handleOutsideClick = (event) => {
|
|
27547
|
-
var _a;
|
|
27548
|
-
const clickedElementIsDifferentThanMenu = event.target !== menuRef.current;
|
|
27549
|
-
const clickedElementIsDifferentThanSlider = event.target !== sliderRef.current;
|
|
27550
|
-
const sliderContainsClickedElement = (_a = sliderRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target);
|
|
27551
|
-
const hideInput = clickedElementIsDifferentThanMenu &&
|
|
27552
|
-
(!clickedElementIsDifferentThanSlider || !sliderContainsClickedElement);
|
|
27553
|
-
if (hideInput) {
|
|
27554
|
-
handleCloseInput();
|
|
27555
|
-
}
|
|
27556
|
-
};
|
|
27557
|
-
document.addEventListener("click", handleOutsideClick);
|
|
27558
|
-
return () => {
|
|
27559
|
-
document.removeEventListener("click", handleOutsideClick);
|
|
27560
|
-
};
|
|
27561
|
-
}, [isInputVisible]);
|
|
27562
|
-
const menuRef = useRef(null);
|
|
27563
|
-
const sliderRef = useRef(null);
|
|
27564
|
-
const handleSubmit = useCallback((value) => {
|
|
27565
|
-
handleCloseInput();
|
|
27566
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value === "" ? undefined : Number(value));
|
|
27567
|
-
}, [onChange]);
|
|
27568
|
-
const handleKeyDown = useCallback((e) => {
|
|
27569
|
-
// block unwanted (but still valid) characters
|
|
27570
|
-
if (["e", "E", "+", "-"].includes(e.key)) {
|
|
27571
|
-
e.preventDefault();
|
|
27572
|
-
return;
|
|
27573
|
-
}
|
|
27574
|
-
// close input when pressing escape
|
|
27575
|
-
if (e.key === "Escape") {
|
|
27576
|
-
handleCloseInput();
|
|
27577
|
-
}
|
|
27578
|
-
}, []);
|
|
27579
|
-
const handleOpenInput = useCallback(() => {
|
|
27580
|
-
setIsInputVisible(true);
|
|
27581
|
-
}, []);
|
|
27582
|
-
const handleCloseInput = useCallback(() => {
|
|
27583
|
-
setIsInputVisible(false);
|
|
27584
|
-
}, []);
|
|
27585
|
-
return (jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxs("button", { className: cn("tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption tw-font-caption tw-leading-[10px] -tw-outline-offset-2 placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin", value === 0 || value === undefined
|
|
27586
|
-
? "tw-text-grey-600"
|
|
27587
|
-
: "tw-text-grey-300", isInputVisible ? "tw-bg-material-light-thin" : "tw-bg-transparent", isSelected && "tw-outline tw-outline-2 tw-outline-royal-500"), children: [value !== null && value !== void 0 ? value : 0, jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === "percentage" ? "%" : "$" })] }), jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsx(Chip, { icon: jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsx("form", { onSubmit: (e) => {
|
|
27588
|
-
e.preventDefault();
|
|
27589
|
-
handleSubmit(inputValue);
|
|
27590
|
-
}, children: jsx(Input, { autoFocus: true, min: min, max: max, onKeyDown: handleKeyDown, step: decimalsFormat, placeholder: "0", type: "number", defaultValue: value, value: inputValue, onChange: (e) => {
|
|
27591
|
-
const isValid = e.target.checkValidity();
|
|
27592
|
-
if (!isValid)
|
|
27593
|
-
return;
|
|
27594
|
-
setInputValue(e.target.value);
|
|
27595
|
-
}, showIcon: false, actionButtonProps: {
|
|
27596
|
-
label: "Ok",
|
|
27597
|
-
onClick: () => {
|
|
27598
|
-
handleSubmit(inputValue);
|
|
27599
|
-
},
|
|
27600
|
-
variant: "primary",
|
|
27601
|
-
} }) }) }))] }));
|
|
27602
|
-
}
|
|
27603
|
-
|
|
27604
|
-
const switchSizeClassMap = {
|
|
27605
|
-
small: "tw-w-[36px] tw-h-squid-m tw-p-0.5",
|
|
27606
|
-
large: "tw-w-[54px] tw-h-squid-l tw-p-[3px]",
|
|
27607
|
-
};
|
|
27608
|
-
const switchKnobSizeClassMap = {
|
|
27609
|
-
small: "tw-w-4 tw-h-4",
|
|
27610
|
-
large: "tw-w-6 tw-h-6",
|
|
27611
|
-
};
|
|
27612
|
-
const switchKnobCheckedClassMap = {
|
|
27613
|
-
large: {
|
|
27614
|
-
checked: "tw-left-[26px]",
|
|
27615
|
-
unchecked: "tw-left-[2px]",
|
|
27616
|
-
},
|
|
27617
|
-
small: {
|
|
27618
|
-
checked: "tw-left-[17px]",
|
|
27619
|
-
unchecked: "tw-left-[1px]",
|
|
27620
|
-
},
|
|
27621
|
-
};
|
|
27622
|
-
function Switch({ checked = false, onChange, size, disabled = false, inputProps, }) {
|
|
27623
|
-
return (
|
|
27624
|
-
// Switch container
|
|
27625
|
-
jsxs("label", { className: clsx("tw-relative tw-inline-flex tw-items-center tw-justify-end tw-overflow-hidden tw-rounded-squid-m tw-border tw-border-material-light-thin tw-transition-colors",
|
|
27626
|
-
// size styles
|
|
27627
|
-
switchSizeClassMap[size],
|
|
27628
|
-
// checked styles
|
|
27629
|
-
disabled || !checked ? "tw-bg-grey-800" : "tw-bg-status-positive",
|
|
27630
|
-
// disabled styles
|
|
27631
|
-
disabled ? "tw-cursor-not-allowed" : "tw-cursor-pointer",
|
|
27632
|
-
// Focus visible styles
|
|
27633
|
-
"tw-focus-visible-within-outline"), children: [jsx("input", Object.assign({}, inputProps, { disabled: disabled, checked: checked, onChange: disabled ? undefined : (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked), type: "checkbox", className: "tw-peer tw-sr-only" })), jsx("span", { style: {
|
|
27634
|
-
filter: disabled
|
|
27635
|
-
? "drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.10)) drop-shadow(0px 1px 5px rgba(0, 0, 0, 0.10))"
|
|
27636
|
-
: "drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))",
|
|
27637
|
-
}, className: clsx("tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all",
|
|
27638
|
-
// size styles
|
|
27639
|
-
switchKnobSizeClassMap[size],
|
|
27640
|
-
// checked styles
|
|
27641
|
-
switchKnobCheckedClassMap[size][checked ? "checked" : "unchecked"], disabled
|
|
27642
|
-
? "group-data-[squid-theme-type=dark]:tw-bg-grey-700 group-data-[squid-theme-type=light]:tw-bg-grey-900"
|
|
27643
|
-
: checked
|
|
27644
|
-
? "group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900"
|
|
27645
|
-
: "tw-bg-grey-500") })] }));
|
|
27646
|
-
}
|
|
27647
|
-
|
|
27648
27584
|
function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarning = false, }) {
|
|
27649
27585
|
const [pressedButton, setPressedButton] = useState(null);
|
|
27650
27586
|
const inputRef = useRef(null);
|
|
@@ -27756,6 +27692,114 @@ function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarnin
|
|
|
27756
27692
|
}, onMouseLeave: handleUpdateValue, className: cn("tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xxs tw-text-left tw-text-caption tw-font-caption tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin"), children: jsx(CirclePlusIcon, {}) })] })] }) }));
|
|
27757
27693
|
}
|
|
27758
27694
|
|
|
27695
|
+
function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected = false, }) {
|
|
27696
|
+
const [isInputVisible, setIsInputVisible] = useState(false);
|
|
27697
|
+
const [inputValue, setInputValue] = useState(String(value !== null && value !== void 0 ? value : 0));
|
|
27698
|
+
useEffect(() => {
|
|
27699
|
+
if (!isInputVisible)
|
|
27700
|
+
return;
|
|
27701
|
+
const handleOutsideClick = (event) => {
|
|
27702
|
+
var _a;
|
|
27703
|
+
const clickedElementIsDifferentThanMenu = event.target !== menuRef.current;
|
|
27704
|
+
const clickedElementIsDifferentThanSlider = event.target !== sliderRef.current;
|
|
27705
|
+
const sliderContainsClickedElement = (_a = sliderRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target);
|
|
27706
|
+
const hideInput = clickedElementIsDifferentThanMenu &&
|
|
27707
|
+
(!clickedElementIsDifferentThanSlider || !sliderContainsClickedElement);
|
|
27708
|
+
if (hideInput) {
|
|
27709
|
+
handleCloseInput();
|
|
27710
|
+
}
|
|
27711
|
+
};
|
|
27712
|
+
document.addEventListener("click", handleOutsideClick);
|
|
27713
|
+
return () => {
|
|
27714
|
+
document.removeEventListener("click", handleOutsideClick);
|
|
27715
|
+
};
|
|
27716
|
+
}, [isInputVisible]);
|
|
27717
|
+
const menuRef = useRef(null);
|
|
27718
|
+
const sliderRef = useRef(null);
|
|
27719
|
+
const handleSubmit = useCallback((value) => {
|
|
27720
|
+
handleCloseInput();
|
|
27721
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value === "" ? undefined : Number(value));
|
|
27722
|
+
}, [onChange]);
|
|
27723
|
+
const handleKeyDown = useCallback((e) => {
|
|
27724
|
+
// block unwanted (but still valid) characters
|
|
27725
|
+
if (["e", "E", "+", "-"].includes(e.key)) {
|
|
27726
|
+
e.preventDefault();
|
|
27727
|
+
return;
|
|
27728
|
+
}
|
|
27729
|
+
// close input when pressing escape
|
|
27730
|
+
if (e.key === "Escape") {
|
|
27731
|
+
handleCloseInput();
|
|
27732
|
+
}
|
|
27733
|
+
}, []);
|
|
27734
|
+
const handleOpenInput = useCallback(() => {
|
|
27735
|
+
setIsInputVisible(true);
|
|
27736
|
+
}, []);
|
|
27737
|
+
const handleCloseInput = useCallback(() => {
|
|
27738
|
+
setIsInputVisible(false);
|
|
27739
|
+
}, []);
|
|
27740
|
+
return (jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxs("button", { className: cn("tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption tw-font-caption tw-leading-[10px] -tw-outline-offset-2 placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin", value === 0 || value === undefined
|
|
27741
|
+
? "tw-text-grey-600"
|
|
27742
|
+
: "tw-text-grey-300", isInputVisible ? "tw-bg-material-light-thin" : "tw-bg-transparent", isSelected && "tw-outline tw-outline-2 tw-outline-royal-500"), children: [value !== null && value !== void 0 ? value : 0, jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === "percentage" ? "%" : "$" })] }), jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsx(Chip, { icon: jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsx("form", { onSubmit: (e) => {
|
|
27743
|
+
e.preventDefault();
|
|
27744
|
+
handleSubmit(inputValue);
|
|
27745
|
+
}, children: jsx(Input, { autoFocus: true, min: min, max: max, onKeyDown: handleKeyDown, step: decimalsFormat, placeholder: "0", type: "number", defaultValue: value, value: inputValue, onChange: (e) => {
|
|
27746
|
+
const isValid = e.target.checkValidity();
|
|
27747
|
+
if (!isValid)
|
|
27748
|
+
return;
|
|
27749
|
+
setInputValue(e.target.value);
|
|
27750
|
+
}, showIcon: false, actionButtonProps: {
|
|
27751
|
+
label: "Ok",
|
|
27752
|
+
onClick: () => {
|
|
27753
|
+
handleSubmit(inputValue);
|
|
27754
|
+
},
|
|
27755
|
+
variant: "primary",
|
|
27756
|
+
} }) }) }))] }));
|
|
27757
|
+
}
|
|
27758
|
+
|
|
27759
|
+
const switchSizeClassMap = {
|
|
27760
|
+
small: "tw-w-[36px] tw-h-squid-m tw-p-0.5",
|
|
27761
|
+
large: "tw-w-[54px] tw-h-squid-l tw-p-[3px]",
|
|
27762
|
+
};
|
|
27763
|
+
const switchKnobSizeClassMap = {
|
|
27764
|
+
small: "tw-w-4 tw-h-4",
|
|
27765
|
+
large: "tw-w-6 tw-h-6",
|
|
27766
|
+
};
|
|
27767
|
+
const switchKnobCheckedClassMap = {
|
|
27768
|
+
large: {
|
|
27769
|
+
checked: "tw-left-[26px]",
|
|
27770
|
+
unchecked: "tw-left-[2px]",
|
|
27771
|
+
},
|
|
27772
|
+
small: {
|
|
27773
|
+
checked: "tw-left-[17px]",
|
|
27774
|
+
unchecked: "tw-left-[1px]",
|
|
27775
|
+
},
|
|
27776
|
+
};
|
|
27777
|
+
function Switch({ checked = false, onChange, size, disabled = false, inputProps, }) {
|
|
27778
|
+
return (
|
|
27779
|
+
// Switch container
|
|
27780
|
+
jsxs("label", { className: clsx("tw-relative tw-inline-flex tw-items-center tw-justify-end tw-overflow-hidden tw-rounded-squid-m tw-border tw-border-material-light-thin tw-transition-colors",
|
|
27781
|
+
// size styles
|
|
27782
|
+
switchSizeClassMap[size],
|
|
27783
|
+
// checked styles
|
|
27784
|
+
disabled || !checked ? "tw-bg-grey-800" : "tw-bg-status-positive",
|
|
27785
|
+
// disabled styles
|
|
27786
|
+
disabled ? "tw-cursor-not-allowed" : "tw-cursor-pointer",
|
|
27787
|
+
// Focus visible styles
|
|
27788
|
+
"tw-focus-visible-within-outline"), children: [jsx("input", Object.assign({}, inputProps, { disabled: disabled, checked: checked, onChange: disabled ? undefined : (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked), type: "checkbox", className: "tw-peer tw-sr-only" })), jsx("span", { style: {
|
|
27789
|
+
filter: disabled
|
|
27790
|
+
? "drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.10)) drop-shadow(0px 1px 5px rgba(0, 0, 0, 0.10))"
|
|
27791
|
+
: "drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))",
|
|
27792
|
+
}, className: clsx("tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all",
|
|
27793
|
+
// size styles
|
|
27794
|
+
switchKnobSizeClassMap[size],
|
|
27795
|
+
// checked styles
|
|
27796
|
+
switchKnobCheckedClassMap[size][checked ? "checked" : "unchecked"], disabled
|
|
27797
|
+
? "group-data-[squid-theme-type=dark]:tw-bg-grey-700 group-data-[squid-theme-type=light]:tw-bg-grey-900"
|
|
27798
|
+
: checked
|
|
27799
|
+
? "group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900"
|
|
27800
|
+
: "tw-bg-grey-500") })] }));
|
|
27801
|
+
}
|
|
27802
|
+
|
|
27759
27803
|
const imageWrapperClassName = "tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center";
|
|
27760
27804
|
const tokenImageClassName = "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full tw-object-cover";
|
|
27761
27805
|
const themeKeyVariantMap = {
|
|
@@ -69390,10 +69434,7 @@ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, s
|
|
|
69390
69434
|
? ""
|
|
69391
69435
|
: showSwapInfoSection
|
|
69392
69436
|
? "tw-animate-scale-and-fade-up"
|
|
69393
|
-
: "tw-animate-scale-and-fade-down"), children: [jsx(
|
|
69394
|
-
// box shadow simulating bottom outline (we do not use css outline because cannot apply it to only one side)
|
|
69395
|
-
boxShadow: "0 1px 0 currentColor",
|
|
69396
|
-
}, children: jsx(AnimationWrapper, { style: {
|
|
69437
|
+
: "tw-animate-scale-and-fade-down"), children: [jsx(AnimationCard, { children: jsx(AnimationWrapper, { style: {
|
|
69397
69438
|
height: "100%",
|
|
69398
69439
|
maxHeight: "100%",
|
|
69399
69440
|
width: "auto",
|
|
@@ -69730,6 +69771,12 @@ const parseSquidTheme = (userTheme, themeType) => {
|
|
|
69730
69771
|
"button-md-secondary-text": fullPublicTheme.color["grey-800"],
|
|
69731
69772
|
"button-md-tertiary-bg": fullPublicTheme.color["grey-800"],
|
|
69732
69773
|
"button-md-tertiary-text": fullPublicTheme.color["grey-300"],
|
|
69774
|
+
"button-sm-primary-bg": fullPublicTheme.color["royal-500"],
|
|
69775
|
+
"button-sm-primary-text": fullPublicTheme.color[themeType === "light" ? "grey-900" : "grey-100"],
|
|
69776
|
+
"button-sm-secondary-bg": fullPublicTheme.color["grey-100"],
|
|
69777
|
+
"button-sm-secondary-text": fullPublicTheme.color["grey-800"],
|
|
69778
|
+
"button-sm-tertiary-bg": fullPublicTheme.color["grey-800"],
|
|
69779
|
+
"button-sm-tertiary-text": fullPublicTheme.color["grey-300"],
|
|
69733
69780
|
};
|
|
69734
69781
|
const defaultInputColors = {
|
|
69735
69782
|
"input-placeholder": fullPublicTheme.color["grey-600"],
|
|
@@ -69885,4 +69932,4 @@ function ThemeProvider(_a) {
|
|
|
69885
69932
|
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 })));
|
|
69886
69933
|
}
|
|
69887
69934
|
|
|
69888
|
-
export { ANIMATION_DURATIONS, AccountListItem, AccountsButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, 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, LightningIcon, LimitIcon, LinkIcon, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, 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 };
|
|
69935
|
+
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 };
|
|
@@ -34,6 +34,7 @@ interface NumericInputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
34
34
|
tooltip?: Omit<TooltipProps, "children">;
|
|
35
35
|
hideMaxChip?: boolean;
|
|
36
36
|
};
|
|
37
|
+
debounceInput?: boolean;
|
|
37
38
|
}
|
|
38
|
-
export declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, showDetails, isLoading, direction, inputModeButton, isInteractive, balanceButton, ...props }: NumericInputProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, showDetails, isLoading, direction, inputModeButton, isInteractive, balanceButton, debounceInput, ...props }: NumericInputProps): import("react/jsx-runtime").JSX.Element;
|
|
39
40
|
export {};
|
|
@@ -3,4 +3,7 @@ import { Player } from "@lottiefiles/react-lottie-player";
|
|
|
3
3
|
interface Props extends React.ComponentProps<typeof Player> {
|
|
4
4
|
}
|
|
5
5
|
export declare const AnimationWrapper: (playerProps: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function AnimationCard({ children }: {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export {};
|
|
@@ -48,6 +48,8 @@ interface SwapConfigurationProps {
|
|
|
48
48
|
disabled?: boolean;
|
|
49
49
|
};
|
|
50
50
|
showNumericInputDetails?: boolean;
|
|
51
|
+
fullHeight?: boolean;
|
|
52
|
+
debounceInput?: boolean;
|
|
51
53
|
}
|
|
52
|
-
export declare function SwapConfiguration({ amount, tokenPrice, isFetching: isFetchingProp, chain, token, direction, onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive, isLoading, inputModeButton, balanceButton, assetsButton, walletButton, showNumericInputDetails, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare function SwapConfiguration({ amount, tokenPrice, isFetching: isFetchingProp, chain, token, direction, onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive, isLoading, inputModeButton, balanceButton, assetsButton, walletButton, showNumericInputDetails, fullHeight, debounceInput, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
|
|
53
55
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/react";
|
|
2
2
|
import { Chip } from "../../components/buttons/Chip";
|
|
3
3
|
declare const meta: Meta<typeof Chip>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Text: Story;
|
|
7
7
|
export declare const Icon: Story;
|
|
8
|
+
export declare const Interactive: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/react";
|
|
2
|
+
import { LargeNumericInput } from "../../components/controls/LargeNumericInput";
|
|
3
|
+
declare const meta: Meta<typeof LargeNumericInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
@@ -4,7 +4,9 @@ declare const meta: Meta<typeof SwapConfiguration>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const EmptyVariantPrimary: Story;
|
|
7
|
+
export declare const EmptyVariantPrimaryLoading: Story;
|
|
7
8
|
export declare const EmptyVariantWithoutNumericInputDetails: Story;
|
|
9
|
+
export declare const WithoutNumericInputDetailsLoading: Story;
|
|
8
10
|
export declare const EmptyVariantAccent: Story;
|
|
9
11
|
export declare const Loading: Story;
|
|
10
12
|
export declare const LoadingWithAllProps: Story;
|