@0xsquid/ui 0.19.5 → 0.20.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/index.js +393 -296
  2. package/dist/cjs/types/components/badges/BadgeImage.d.ts +6 -1
  3. package/dist/cjs/types/components/buttons/AssetsButton.d.ts +3 -1
  4. package/dist/cjs/types/components/buttons/BoostButton.d.ts +1 -3
  5. package/dist/cjs/types/components/buttons/FeeButton.d.ts +3 -1
  6. package/dist/cjs/types/components/controls/NumericInput.d.ts +10 -2
  7. package/dist/cjs/types/components/controls/Tooltip.d.ts +1 -1
  8. package/dist/cjs/types/components/icons/index.d.ts +1 -0
  9. package/dist/cjs/types/components/index.d.ts +1 -0
  10. package/dist/cjs/types/components/layout/Boost.d.ts +3 -3
  11. package/dist/cjs/types/components/layout/DetailsToolbar.d.ts +18 -14
  12. package/dist/cjs/types/components/layout/NavigationBar.d.ts +2 -0
  13. package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +21 -7
  14. package/dist/cjs/types/components/lists/ListItem.d.ts +2 -1
  15. package/dist/cjs/types/stories/badges/BadgeImage.stories.d.ts +4 -0
  16. package/dist/cjs/types/stories/buttons/AssetsButton.stories.d.ts +1 -0
  17. package/dist/cjs/types/stories/buttons/FeeButton.stories.d.ts +1 -0
  18. package/dist/cjs/types/stories/layout/Boost.stories.d.ts +1 -0
  19. package/dist/cjs/types/stories/layout/DetailsToolbar.stories.d.ts +4 -1
  20. package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +1 -0
  21. package/dist/esm/index.js +393 -297
  22. package/dist/esm/types/components/badges/BadgeImage.d.ts +6 -1
  23. package/dist/esm/types/components/buttons/AssetsButton.d.ts +3 -1
  24. package/dist/esm/types/components/buttons/BoostButton.d.ts +1 -3
  25. package/dist/esm/types/components/buttons/FeeButton.d.ts +3 -1
  26. package/dist/esm/types/components/controls/NumericInput.d.ts +10 -2
  27. package/dist/esm/types/components/controls/Tooltip.d.ts +1 -1
  28. package/dist/esm/types/components/icons/index.d.ts +1 -0
  29. package/dist/esm/types/components/index.d.ts +1 -0
  30. package/dist/esm/types/components/layout/Boost.d.ts +3 -3
  31. package/dist/esm/types/components/layout/DetailsToolbar.d.ts +18 -14
  32. package/dist/esm/types/components/layout/NavigationBar.d.ts +2 -0
  33. package/dist/esm/types/components/layout/SwapConfiguration.d.ts +21 -7
  34. package/dist/esm/types/components/lists/ListItem.d.ts +2 -1
  35. package/dist/esm/types/stories/badges/BadgeImage.stories.d.ts +4 -0
  36. package/dist/esm/types/stories/buttons/AssetsButton.stories.d.ts +1 -0
  37. package/dist/esm/types/stories/buttons/FeeButton.stories.d.ts +1 -0
  38. package/dist/esm/types/stories/layout/Boost.stories.d.ts +1 -0
  39. package/dist/esm/types/stories/layout/DetailsToolbar.stories.d.ts +4 -1
  40. package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +1 -0
  41. package/dist/index.d.ts +141 -105
  42. package/package.json +1 -1
package/dist/esm/index.js CHANGED
@@ -2617,24 +2617,41 @@ const mainImageSizeClassMap = {
2617
2617
  md: 'tw-w-10 tw-h-10',
2618
2618
  };
2619
2619
  const loadingSkeletonClassName = 'tw-bg-grey-500';
2620
- function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, rounded = false, }) {
2620
+ var ImageState;
2621
+ (function (ImageState) {
2622
+ ImageState[ImageState["LOADING"] = 0] = "LOADING";
2623
+ ImageState[ImageState["LOADED"] = 1] = "LOADED";
2624
+ ImageState[ImageState["ERROR"] = 2] = "ERROR";
2625
+ })(ImageState || (ImageState = {}));
2626
+ function BadgeImage({ imageUrl: _imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, rounded = false, placeholderImageUrl, }) {
2627
+ const imageUrl = (_imageUrl === null || _imageUrl === void 0 ? void 0 : _imageUrl.trim()) || placeholderImageUrl;
2621
2628
  const [imagesLoadState, setImageLoadState] = useState({
2622
- badgeLoaded: false,
2623
- mainImageLoaded: false,
2629
+ badge: ImageState.LOADING,
2630
+ mainImage: ImageState.LOADING,
2624
2631
  });
2625
2632
  const badgeImageClassName = cn('tw-absolute -tw-right-1/3 tw-bottom-0 tw-z-10 tw-m-0 -tw-translate-x-1/3 tw-rounded-md tw-border-[1px] tw-border-grey-800', badgeSizeClassMap[size]);
2626
2633
  const mainImageClassName = cn('tw-h-full tw-w-full tw-absolute', rounded ? ' tw-rounded-full' : 'tw-rounded-squid-xs');
2627
- return imageUrl ? (jsxs("div", { className: cn('tw-relative', extraMarginForBadge && badgeUrl ? 'tw-mr-1.5' : null, mainImageSizeClassMap[size]), children: [!imagesLoadState.mainImageLoaded && (jsx("div", { className: cn(mainImageClassName, loadingSkeletonClassName) })), jsx("img", { src: imageUrl, alt: "", onLoad: () => {
2634
+ return imageUrl ? (jsxs("div", { className: cn('tw-relative', extraMarginForBadge && badgeUrl ? 'tw-mr-1.5' : null, mainImageSizeClassMap[size]), children: [imagesLoadState.mainImage !== ImageState.LOADED &&
2635
+ (placeholderImageUrl ? (jsx("img", { src: placeholderImageUrl, alt: "", className: mainImageClassName })) : (jsx("div", { className: cn(mainImageClassName, loadingSkeletonClassName) }))), jsx("img", { src: imageUrl, alt: "", onError: () => {
2636
+ setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { mainImage: ImageState.ERROR })));
2637
+ }, onLoad: () => {
2628
2638
  // update state when image is fully loaded
2629
- setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { mainImageLoaded: true })));
2639
+ setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { mainImage: ImageState.LOADED })));
2630
2640
  }, className: cn(mainImageClassName,
2631
2641
  // hide main image while it is loading, and display it when it is loaded
2632
- imagesLoadState.mainImageLoaded ? 'tw-block' : 'tw-hidden') }), badgeUrl ? (jsxs(Fragment, { children: [!imagesLoadState.badgeLoaded && (jsx("div", { className: cn(badgeImageClassName, loadingSkeletonClassName) })), jsx("img", { src: badgeUrl, alt: "", onLoad: () => {
2642
+ imagesLoadState.mainImage === ImageState.LOADED
2643
+ ? 'tw-block'
2644
+ : 'tw-hidden') }), badgeUrl ? (jsxs(Fragment, { children: [imagesLoadState.badge !== ImageState.LOADED &&
2645
+ (placeholderImageUrl ? (jsx("img", { src: placeholderImageUrl, alt: "", className: badgeImageClassName })) : (jsx("div", { className: cn(badgeImageClassName, loadingSkeletonClassName) }))), jsx("img", { src: badgeUrl, alt: "", onError: () => {
2646
+ setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { badge: ImageState.ERROR })));
2647
+ }, onLoad: () => {
2633
2648
  // update state when badge image is fully loaded
2634
- setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { badgeLoaded: true })));
2649
+ setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { badge: ImageState.LOADED })));
2635
2650
  }, className: cn(badgeImageClassName,
2636
2651
  // hide badge image while it is loading, and display it when it is loaded
2637
- imagesLoadState.badgeLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
2652
+ imagesLoadState.badge === ImageState.LOADED
2653
+ ? 'tw-block'
2654
+ : 'tw-hidden') })] })) : null] })) : null;
2638
2655
  }
2639
2656
 
2640
2657
  /******************************************************************************
@@ -3055,92 +3072,6 @@ const themeTypesKeys = {
3055
3072
  },
3056
3073
  };
3057
3074
 
3058
- function PlusIcon() {
3059
- return (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M12 17V12M12 12V7M12 12H17M12 12H7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
3060
- }
3061
-
3062
- const imageClass = 'tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center';
3063
- const themeKeyVariantMap = {
3064
- primary: 'grey-800',
3065
- accent: 'royal-500',
3066
- };
3067
- const buttonTextClassNameMap = {
3068
- primary: 'tw-text-grey-300',
3069
- accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
3070
- };
3071
- const emptyChainIconTextClassNameMap = {
3072
- primary: 'tw-text-grey-100',
3073
- accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
3074
- };
3075
- function AssetsButton({ chain, token, onClick, variant = 'primary', isLoading = false, }) {
3076
- var _a;
3077
- const defaultBgColor = `var(${themeTypesKeys[themeKeyVariantMap[variant]].cssVariable})`;
3078
- const chainBgColor = (_a = (chain && chain.bgColor)) !== null && _a !== void 0 ? _a : defaultBgColor;
3079
- const tokenBgColor = (chain && token && !isLoading && token.bgColor) || defaultBgColor;
3080
- const bgGradient = useMemo(() => {
3081
- if (!chain || isLoading) {
3082
- return `linear-gradient(to right, ${defaultBgColor}, ${defaultBgColor})`;
3083
- }
3084
- if (!token) {
3085
- return `linear-gradient(90deg, ${chainBgColor} 54.86%, ${tokenBgColor} 95.83%)`;
3086
- }
3087
- return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
3088
- }, [chainBgColor, tokenBgColor, chain, token, isLoading]);
3089
- const ButtonTag = isLoading ? 'div' : 'button';
3090
- return (jsxs(ButtonTag, { onClick: isLoading ? undefined : onClick, disabled: isLoading, "aria-disabled": isLoading, className: cn('tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center focus:tw-outline-none', buttonTextClassNameMap[variant], isLoading && 'tw-cursor-not-allowed'), children: [jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-text-material-light-thin", viewBox: "0 0 72 40", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: jsx("path", { d: "m57.86 5.86c-.53.53-1.05 1.06-1.56 1.59-3.29 3.38-6.37 6.55-10.3 6.55s-7.01-3.17-10.3-6.55c-.51-.53-1.03-1.06-1.56-1.59-3.9-3.91-9.02-5.86-14.14-5.86s-10.24 1.95-14.14 5.86c-3.91 3.9-5.86 9.02-5.86 14.14s1.95 10.24 5.86 14.14c3.91 3.91 9.02 5.86 14.14 5.86s10.24-1.95 14.14-5.86c.52-.53 1.04-1.06 1.55-1.58 3.29-3.39 6.37-6.56 10.31-6.56s7.02 3.17 10.31 6.56c.51.53 1.03 1.06 1.55 1.58 3.91 3.91 9.02 5.86 14.14 5.86v-40c-5.12 0-10.24 1.95-14.14 5.86zm14.14 33.14c-5.07 0-9.85-1.98-13.43-5.56-.52-.52-1.02-1.04-1.54-1.57-3.43-3.53-6.67-6.86-11.02-6.86s-7.6 3.33-11.04 6.88c-.5.52-1.01 1.04-1.53 1.56-3.59 3.59-8.36 5.57-13.44 5.57s-9.85-1.98-13.43-5.57c-3.59-3.59-5.56-8.36-5.56-13.43s1.98-9.85 5.56-13.44c3.58-3.6 8.35-5.58 13.43-5.58s9.85 1.98 13.44 5.57c.52.52 1.04 1.05 1.55 1.58 3.43 3.53 6.66 6.86 11.02 6.86s7.59-3.33 11.02-6.86c.51-.52 1.02-1.05 1.55-1.58 3.59-3.59 8.36-5.56 13.43-5.56v38z" }) }), jsx("div", { className: cn('tw-assets-button-mask tw-flex tw-h-squid-xl tw-w-[92px] tw-items-center tw-justify-between', chain && token && !isLoading
3091
- ? 'tw-w-[90px]'
3092
- : 'tw-w-full tw-max-w-[72px]'), style: {
3093
- backgroundImage: bgGradient,
3094
- }, children: jsx("div", { className: clsx(imageClass), children: chain && !isLoading ? (jsx("img", { src: chain.iconUrl, alt: "", className: "tw-rounded-full" })) : (!isLoading && (jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsx(PlusIcon, {}) }))) }) }), chain && token && !isLoading ? (jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-overflow-hidden'), children: [jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
3095
- backgroundColor: tokenBgColor,
3096
- } }), jsx("img", { src: token.iconUrl, alt: token.symbol, className: "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full" }), jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px] tw-border-b\n tw-border-t tw-border-material-light-thin" })] })) : null, jsxs("div", { className: cn('tw-flex tw-h-squid-xl tw-w-fit tw-min-w-squid-xl tw-items-center tw-gap-squid-xxs tw-rounded-br-full tw-rounded-tr-full tw-border-b tw-border-r tw-border-t tw-border-material-light-thin tw-py-squid-xs tw-pr-squid-xs', chain && token && !isLoading && 'tw-pl-[7px]'), style: {
3097
- backgroundColor: tokenBgColor,
3098
- color: token === null || token === void 0 ? void 0 : token.textColor,
3099
- }, children: [jsx(BodyText, { size: "small", className: cn('tw-leading-[13px]', (!token || !chain || isLoading) && 'tw-w-[135px]'), children: chain && token && !isLoading
3100
- ? token.symbol
3101
- : !isLoading && 'Select token' }), !isLoading && jsx(ChevronLargeRightIcon, { className: "tw-opacity-66" })] })] }));
3102
- }
3103
-
3104
- const CSS_VARS = {
3105
- MOVE_WITH_SPRING_BOUNCE_DURATION: '--squid-animation-move-with-spring-bounce-duration',
3106
- DISPLAY_DELAYED_DURATION: '--squid-animation-display-delayed-duration',
3107
- COLLAPSE_ROUTE_DURATION: '--squid-animation-collapse-to-bottom-duration',
3108
- EXPAND_ROUTE_DURATION: '--squid-animation-expand-to-top-duration',
3109
- FADE_IN_DURATION: '--squid-animation-fade-in-duration',
3110
- FADE_OUT_DURATION: '--squid-animation-fade-out-duration',
3111
- SCALE_AND_FADE_UP_DURATION: '--squid-animation-scale-and-fade-up-duration',
3112
- SCALE_AND_FADE_DOWN_DURATION: '--squid-animation-scale-and-fade-down-duration',
3113
- TRANSLATE_TOP_OR_BOTTOM: '--squid-animation-translate-top-or-bottom',
3114
- SHOW_MODAL_DURATION: '--squid-animation-show-modal-duration',
3115
- HIDE_MODAL_DURATION: '--squid-animation-hide-modal-duration',
3116
- SLIDE_TO_TOP_DURATION: '--squid-animation-slide-to-top-duration',
3117
- SLIDE_TO_BOTTOM_DURATION: '--squid-animation-slide-to-bottom-duration',
3118
- BLUR_IN_DURATION: '--squid-animation-blur-in-duration',
3119
- BLUR_OUT_DURATION: '--squid-animation-blur-out-duration',
3120
- };
3121
- const ANIMATION_DURATIONS = {
3122
- SHOW_ROUTE: 300,
3123
- HIDE_ROUTE: 300,
3124
- CHANGE_SWAP_STEP: 300,
3125
- SHOW_MODAL: 400,
3126
- HIDE_MODAL: 400,
3127
- BOOST_BUTTON: 500,
3128
- };
3129
- const ANIMATION_TIMINGS = {
3130
- EXPAND_ROUTE: 'linear', //'cubic-bezier(.32, .72, 0, 1)',
3131
- COLLAPSE_ROUTE: 'linear', //'cubic-bezier(.32, .72, 0, 1)',
3132
- CHANGE_SWAP_STEP: 'linear', //'cubic-bezier(.4,0,.2,1)',
3133
- SHOW_ROUTE: 'cubic-bezier(.165,.84,.44,1)',
3134
- HIDE_ROUTE: 'cubic-bezier(.165,.84,.44,1)',
3135
- };
3136
- const MEDIA_QUERIES = {
3137
- MOBILE_LG: {
3138
- media: '(min-width: 480px)',
3139
- key: 'mobile-lg',
3140
- value: '480px',
3141
- },
3142
- };
3143
-
3144
3075
  function SearchIcon() {
3145
3076
  return (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M20 20L16.05 16.05M18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
3146
3077
  }
@@ -16701,12 +16632,73 @@ AppContainer.Content = (props) => (jsx(motion.div, Object.assign({ transformTemp
16701
16632
  }, layout: "position", layoutDependency: useContext(LayoutDependencyContext), layoutId: "app-container-content" }, props)));
16702
16633
  const elementKey = (child) => isValidElement(child) ? child.key : null;
16703
16634
 
16635
+ const CSS_VARS = {
16636
+ MOVE_WITH_SPRING_BOUNCE_DURATION: '--squid-animation-move-with-spring-bounce-duration',
16637
+ DISPLAY_DELAYED_DURATION: '--squid-animation-display-delayed-duration',
16638
+ COLLAPSE_ROUTE_DURATION: '--squid-animation-collapse-to-bottom-duration',
16639
+ EXPAND_ROUTE_DURATION: '--squid-animation-expand-to-top-duration',
16640
+ FADE_IN_DURATION: '--squid-animation-fade-in-duration',
16641
+ FADE_OUT_DURATION: '--squid-animation-fade-out-duration',
16642
+ SCALE_AND_FADE_UP_DURATION: '--squid-animation-scale-and-fade-up-duration',
16643
+ SCALE_AND_FADE_DOWN_DURATION: '--squid-animation-scale-and-fade-down-duration',
16644
+ TRANSLATE_TOP_OR_BOTTOM: '--squid-animation-translate-top-or-bottom',
16645
+ SHOW_MODAL_DURATION: '--squid-animation-show-modal-duration',
16646
+ HIDE_MODAL_DURATION: '--squid-animation-hide-modal-duration',
16647
+ SLIDE_TO_TOP_DURATION: '--squid-animation-slide-to-top-duration',
16648
+ SLIDE_TO_BOTTOM_DURATION: '--squid-animation-slide-to-bottom-duration',
16649
+ BLUR_IN_DURATION: '--squid-animation-blur-in-duration',
16650
+ BLUR_OUT_DURATION: '--squid-animation-blur-out-duration',
16651
+ };
16652
+ const ANIMATION_DURATIONS = {
16653
+ SHOW_ROUTE: 300,
16654
+ HIDE_ROUTE: 300,
16655
+ CHANGE_SWAP_STEP: 300,
16656
+ SHOW_MODAL: 400,
16657
+ HIDE_MODAL: 400,
16658
+ BOOST_BUTTON: 500,
16659
+ };
16660
+ const ANIMATION_TIMINGS = {
16661
+ EXPAND_ROUTE: 'linear', //'cubic-bezier(.32, .72, 0, 1)',
16662
+ COLLAPSE_ROUTE: 'linear', //'cubic-bezier(.32, .72, 0, 1)',
16663
+ CHANGE_SWAP_STEP: 'linear', //'cubic-bezier(.4,0,.2,1)',
16664
+ SHOW_ROUTE: 'cubic-bezier(.165,.84,.44,1)',
16665
+ HIDE_ROUTE: 'cubic-bezier(.165,.84,.44,1)',
16666
+ };
16667
+ const MEDIA_QUERIES = {
16668
+ MOBILE_LG: {
16669
+ media: '(min-width: 480px)',
16670
+ key: 'mobile-lg',
16671
+ value: '480px',
16672
+ },
16673
+ };
16674
+
16675
+ function BoostButton({ boostMode, canToggleBoostMode = true, boostIndicatorRef, }) {
16676
+ return (jsx("div", { className: "tw-w-[106.5px] tw-pr-squid-xxs mobile-lg:tw-w-[140px]", children: jsxs("div", { className: "tw-relative tw-flex tw-h-squid-xl tw-w-full tw-flex-col tw-justify-between tw-overflow-hidden tw-rounded-squid-m tw-pb-squid-xxs tw-text-grey-300 focus:tw-outline-none", children: [jsx("span", { className: cn('tw-absolute tw-left-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-r tw-from-grey-900 tw-to-transparent', canToggleBoostMode &&
16677
+ 'group-hover/boost-toggle:tw-from-material-light-blend-grey-900') }), jsx("span", { className: cn('tw-absolute tw-right-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-l tw-from-grey-900 tw-to-transparent', canToggleBoostMode &&
16678
+ 'group-hover/boost-toggle:tw-from-material-light-blend-grey-900') }), jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-relative -tw-left-[20px] tw-flex tw-h-full tw-w-[140px] tw-items-center tw-justify-between tw-transition-transform group-disabled/boost-toggle:tw-grayscale data-[boost-mode=boost]:tw-animate-move-to-left-with-spring-bounce data-[boost-mode=normal]:tw-animate-move-to-right-with-spring-bounce mobile-lg:-tw-left-[3px]", children: [jsx("div", { className: "tw-w-[70px] tw-text-center group-disabled/boost-toggle:tw-grayscale", children: jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxs("div", { className: "tw-w-[70px] tw-text-center group-disabled/boost-toggle:tw-grayscale", children: [jsx(BodyText, { size: "small", className: "tw-text-status-positive", children: "Boost" }), ' '] }), jsx("div", { className: "tw-absolute tw-bottom-0 tw-h-1.5 tw-w-[1.5px] tw-rounded-sm tw-bg-grey-500 tw-text-grey-500 group-data-[boost-mode=boost]:tw-left-[calc(50%-2px)] group-data-[boost-mode=normal]:tw-left-[calc(50%-6px)]", style: {
16679
+ boxShadow: generateMarkerLines(40),
16680
+ } })] }), jsx("div", { className: cn('tw-absolute tw-bottom-0.5 tw-left-[calc(50%-2px)] tw-z-20 tw-h-[10px] tw-w-[3px] tw-rounded-sm tw-transition-colors group-disabled/boost-toggle:tw-grayscale peer-data-[boost-mode=boost]:tw-bg-status-positive peer-data-[boost-mode=normal]:tw-bg-current'), style: {
16681
+ transitionDuration: `${ANIMATION_DURATIONS.BOOST_BUTTON}ms`,
16682
+ } })] }) }));
16683
+ }
16684
+ function generateMarkerLines(count) {
16685
+ const halfCount = Math.ceil(count / 2);
16686
+ const rightShadows = Array.from({ length: halfCount }, (_, index) => {
16687
+ return `-${(index + 1) * 6}px 0 currentColor`;
16688
+ });
16689
+ const leftShadows = Array.from({ length: halfCount }, (_, index) => {
16690
+ return `${(index + 1) * 6}px 0 currentColor`;
16691
+ });
16692
+ const allShadows = [...rightShadows, ...leftShadows];
16693
+ return allShadows.join(', ');
16694
+ }
16695
+
16704
16696
  function Chip(_a) {
16705
16697
  var { label, icon } = _a, props = __rest$1(_a, ["label", "icon"]);
16706
16698
  return (jsx("div", 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', 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) })));
16707
16699
  }
16708
16700
 
16709
- function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, boostTooltipDisplayDelayMs = 0, }) {
16701
+ function Boost({ boostMode, onToggleBoostMode, estimatedTime, canToggleBoostMode = true, tooltip, }) {
16710
16702
  const boostIndicatorRef = useRef(null);
16711
16703
  function handleToggleBoostMode() {
16712
16704
  if (!boostIndicatorRef.current || !canToggleBoostMode)
@@ -16723,9 +16715,9 @@ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessa
16723
16715
  onToggleBoostMode === null || onToggleBoostMode === void 0 ? void 0 : onToggleBoostMode({ boostMode: 'normal' });
16724
16716
  }
16725
16717
  }
16726
- return (jsx("div", { className: "mobile-lg:tw-w-[190px] tw-w-[157px]", children: jsxs("button", { onClick: handleToggleBoostMode, disabled: !canToggleBoostMode, className: cn('tw-group/boost-toggle tw-flex tw-h-squid-xl tw-w-full tw-items-center tw-rounded-squid-m tw-bg-grey-900 tw-pr-squid-xs', canToggleBoostMode && 'hover:tw-bg-material-light-thin'), children: [jsx(BoostButton, { boostIndicatorRef: boostIndicatorRef, boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, tooltipDisplayDelayMs: boostTooltipDisplayDelayMs }), jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
16718
+ return (jsx(Tooltip, Object.assign({}, tooltip, { tooltipWidth: "max", containerClassName: "tw-w-[157px] mobile-lg:tw-w-[190px] tw-rounded-squid-m", childrenClassName: "tw-rounded-squid-m", children: jsxs("button", { onClick: handleToggleBoostMode, disabled: !canToggleBoostMode, className: cn('tw-group/boost-toggle tw-flex tw-h-squid-xl tw-w-full tw-items-center tw-rounded-squid-m tw-bg-grey-900 tw-pr-squid-xs', canToggleBoostMode && 'hover:tw-bg-material-light-thin'), children: [jsx(BoostButton, { boostIndicatorRef: boostIndicatorRef, boostMode: boostMode, canToggleBoostMode: canToggleBoostMode }), jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
16727
16719
  ? 'tw-bg-grey-300'
16728
- : 'tw-bg-status-positive') })] }) }));
16720
+ : 'tw-bg-status-positive') })] }) })));
16729
16721
  }
16730
16722
 
16731
16723
  function Join({ children, glue }) {
@@ -16837,8 +16829,8 @@ function EthereumIcon() {
16837
16829
  }
16838
16830
 
16839
16831
  function FeeButton(_a) {
16840
- var { feeInUsd = '0', chipLabel = 'Fee', className } = _a, props = __rest$1(_a, ["feeInUsd", "chipLabel", "className"]);
16841
- return (jsxs("button", Object.assign({}, props, { className: cn('tw-flex tw-h-squid-xl tw-w-full tw-items-center tw-gap-x-squid-xs tw-rounded-squid-m tw-px-squid-xs hover:tw-bg-material-light-thin', className), children: [jsx(Chip, { label: chipLabel }), jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(Chip, { icon: jsx(EthereumIcon, {}) }), jsx(UsdAmount, { usdAmount: feeInUsd })] })] })));
16832
+ var { feeInUsd = '0', chipLabel = 'Fee', className, tooltip } = _a, props = __rest$1(_a, ["feeInUsd", "chipLabel", "className", "tooltip"]);
16833
+ return (jsx(Tooltip, Object.assign({}, tooltip, { tooltipWidth: "max", containerClassName: "tw-rounded-squid-m", childrenClassName: "tw-rounded-squid-m", children: jsxs("button", Object.assign({}, props, { className: cn('tw-flex tw-h-squid-xl tw-w-full tw-items-center tw-gap-x-squid-xs tw-rounded-squid-m tw-px-squid-xs hover:tw-bg-material-light-thin', className), children: [jsx(Chip, { label: chipLabel }), jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(Chip, { icon: jsx(EthereumIcon, {}) }), jsx(UsdAmount, { usdAmount: feeInUsd })] })] })) })));
16842
16834
  }
16843
16835
 
16844
16836
  function EmojiSadIcon({ className, size = '20', }) {
@@ -16858,7 +16850,8 @@ const detailStateClassMap = {
16858
16850
  error: 'tw-opacity-33 tw-pointer-events-none',
16859
16851
  full: '',
16860
16852
  };
16861
- function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, isLoading, isEmpty, boostTooltipDisplayDelayMs = 0, flipButton, }) {
16853
+ function DetailsToolbar({ errorMessage, estimatedTime, helpButton, isLoading, isEmpty, flipButton, feeButton, boostButton, }) {
16854
+ var _a;
16862
16855
  const state = useMemo(() => {
16863
16856
  if (errorMessage)
16864
16857
  return 'error';
@@ -16871,10 +16864,8 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
16871
16864
  const detailClassName = cn('tw-w-[157px] mobile-lg:tw-w-[190px]', detailStateClassMap[state]);
16872
16865
  return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-full tw-items-center tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500 mobile-lg:tw-w-card-large', state === 'error'
16873
16866
  ? 'tw-px-squid-m mobile-lg:tw-px-squid-l'
16874
- : 'tw-px-squid-xs mobile-lg:tw-px-squid-m', isEmpty ? 'tw-justify-center' : 'tw-justify-between'), children: state === 'error' && errorMessage ? (jsxs(Fragment, { children: [jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsx(Button$1, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: isLoading ? (jsx(Loader, { size: "32" })) : (jsx(Tooltip, { tooltipContent: (flipButton === null || flipButton === void 0 ? void 0 : flipButton.isDisabled)
16875
- ? flipButton.disabledMessage
16876
- : undefined, tooltipWidth: "max", displayDelayMs: flipButton === null || flipButton === void 0 ? void 0 : flipButton.tooltipDisplayDelayMs, children: jsx("button", { disabled: flipButton === null || flipButton === void 0 ? void 0 : flipButton.isDisabled, onClick: onInvertSwapButtonClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !(flipButton === null || flipButton === void 0 ? void 0 : flipButton.isDisabled) &&
16877
- 'group-hover/flip-button:tw-rotate-180') }) }) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
16867
+ : 'tw-px-squid-xs mobile-lg:tw-px-squid-m', isEmpty ? 'tw-justify-center' : 'tw-justify-between'), children: state === 'error' && errorMessage ? (jsxs(Fragment, { children: [jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsx(Button$1, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, Object.assign({}, feeButton)) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: isLoading ? (jsx(Loader, { size: "32" })) : (jsx(Tooltip, Object.assign({}, flipButton === null || flipButton === void 0 ? void 0 : flipButton.tooltip, { tooltipWidth: "max", containerClassName: "tw-rounded-squid-m", childrenClassName: "tw-rounded-squid-m", children: jsx("button", { disabled: flipButton === null || flipButton === void 0 ? void 0 : flipButton.isDisabled, onClick: flipButton === null || flipButton === void 0 ? void 0 : flipButton.onClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !(flipButton === null || flipButton === void 0 ? void 0 : flipButton.isDisabled) &&
16868
+ 'group-hover/flip-button:tw-rotate-180') }) }) }))) }), jsx("div", { className: detailClassName, children: jsx(Boost, { tooltip: boostButton === null || boostButton === void 0 ? void 0 : boostButton.tooltip, estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: (_a = boostButton === null || boostButton === void 0 ? void 0 : boostButton.boostMode) !== null && _a !== void 0 ? _a : 'normal', onToggleBoostMode: boostButton === null || boostButton === void 0 ? void 0 : boostButton.onClick, canToggleBoostMode: state === 'loading' ? false : boostButton === null || boostButton === void 0 ? void 0 : boostButton.canToggleBoostMode }) })] })) }));
16878
16869
  }
16879
16870
 
16880
16871
  function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }) {
@@ -17074,7 +17065,7 @@ const collapsedListItemClassMap = {
17074
17065
  large: 'tw-w-[80px]',
17075
17066
  };
17076
17067
  function ListItem(_a) {
17077
- var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps, compactOnMobile } = _a, props = __rest$1(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps", "compactOnMobile"]);
17068
+ var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, placeholderImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps, compactOnMobile } = _a, props = __rest$1(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "placeholderImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps", "compactOnMobile"]);
17078
17069
  const subtitleClassName = cn('tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500', compactOnMobile ? 'tw-hidden mobile-lg:tw-block' : 'tw-block');
17079
17070
  // 'small' variant does not have detail
17080
17071
  const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
@@ -17107,7 +17098,7 @@ function ListItem(_a) {
17107
17098
  const itemProps = isInteractive ? props : {};
17108
17099
  return (jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], compactOnMobile
17109
17100
  ? `${collapsedListItemClassMap[size]} mobile-lg:tw-w-full`
17110
- : 'tw-w-full', className), children: jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
17101
+ : 'tw-w-full', className), children: jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, placeholderImageUrl: placeholderImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
17111
17102
  // 'large' variant has extra padding
17112
17103
  size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]', compactOnMobile ? 'tw-hidden mobile-lg:tw-block' : 'tw-block'), children: itemTitle })) : (itemTitle), size === 'large' &&
17113
17104
  ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (loadingComponent()) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
@@ -17493,11 +17484,11 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
17493
17484
  ? 'tw-px-squid-m'
17494
17485
  : 'tw-pl-squid-m tw-pr-squid-m mobile-lg:tw-pl-squid-l'), children: [displayBackButton ? (jsx(Button$1, { className: displayButtonShadows
17495
17486
  ? 'group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-2 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-2'
17496
- : undefined, variant: "tertiary", size: "md", isLoading: isLoading, icon: jsx(ArrowLeftIcon, {}), onClick: onBackButtonClick })) : null, logoUrl ? (jsx("img", { src: logoUrl, className: "tw-h-squid-xl tw-min-w-squid-xl" })) : null, jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end tw-gap-squid-xxs", children: actions === null || actions === void 0 ? void 0 : actions.map((action) => (jsx(Button$1, { size: "md", variant: "tertiary", isLoading: isLoading, label: typeof action.labelOrIcon === 'string'
17497
- ? action.labelOrIcon
17498
- : undefined, className: "tw-text-grey-300", icon: typeof action.labelOrIcon === 'string'
17499
- ? null
17500
- : action.labelOrIcon, onClick: action.onClick }, action.id))) })] }), title ? (jsx("div", { className: "tw-flex tw-h-squid-xxl tw-items-center tw-px-squid-m tw-py-squid-xxs mobile-lg:tw-px-squid-l", children: jsx(HeadingText, { size: "small", children: title }) })) : null] }));
17487
+ : undefined, variant: "tertiary", size: "md", isLoading: isLoading, icon: jsx(ArrowLeftIcon, {}), onClick: onBackButtonClick })) : null, logoUrl ? (jsx("img", { src: logoUrl, className: "tw-h-squid-xl tw-min-w-squid-xl" })) : null, jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end tw-gap-squid-xxs", children: actions === null || actions === void 0 ? void 0 : actions.map((action) => (jsx(Tooltip, Object.assign({}, action.tooltip, { childrenClassName: "tw-rounded-squid-m", containerClassName: "tw-rounded-squid-m", tooltipWidth: "max", children: jsx(Button$1, { size: "md", variant: "tertiary", isLoading: isLoading, label: typeof action.labelOrIcon === 'string'
17488
+ ? action.labelOrIcon
17489
+ : undefined, className: "tw-text-grey-300", icon: typeof action.labelOrIcon === 'string'
17490
+ ? null
17491
+ : action.labelOrIcon, onClick: action.onClick }) }), action.id))) })] }), title ? (jsx("div", { className: "tw-flex tw-h-squid-xxl tw-items-center tw-px-squid-m tw-py-squid-xxs mobile-lg:tw-px-squid-l", children: jsx(HeadingText, { size: "small", children: title }) })) : null] }));
17501
17492
  }
17502
17493
 
17503
17494
  const createStoreImpl = (createState) => {
@@ -18086,21 +18077,27 @@ function LogoContainer({ children }) {
18086
18077
  return (jsx("div", { className: "tw-flex tw-h-[60px] tw-w-[60px] tw-items-center tw-justify-center", children: children }));
18087
18078
  }
18088
18079
 
18089
- function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp = false, chain, token, direction = 'from', onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, emptyAddressLabel = 'Connect wallet', balance, criticalPriceImpactPercentage, error, priceImpactPercentage, amountUsd, assetsButtonVariant, maxUsdDecimals, isInputInteractive = true, isLoading = false, }) {
18090
- var _a, _b;
18091
- const isWalletButtonInteractive = !isLoading && !!onWalletButtonClick;
18080
+ 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, }) {
18081
+ var _a, _b, _c;
18082
+ const isWalletButtonInteractive = !isLoading && !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick);
18092
18083
  const WalletButtonTag = isWalletButtonInteractive ? 'button' : 'div';
18093
18084
  const isFetching = isFetchingProp || isLoading;
18094
- return (jsxs("section", { className: "tw-relative tw-h-[211px] tw-max-h-[211px] tw-w-full tw-overflow-hidden tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-pb-squid-m mobile-lg:tw-h-[205px] mobile-lg:tw-max-h-[205px] mobile-lg:tw-w-card-large", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-m tw-py-squid-xs tw-leading-5 tw-text-grey-300 mobile-lg:tw-px-squid-l", children: jsxs(WalletButtonTag, { onClick: isWalletButtonInteractive ? onWalletButtonClick : 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' }), jsx(BodyText, { size: "small", children: ":" }), !isLoading && (jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsx(BodyText, { size: "small", className: address ? 'tw-text-grey-300' : 'tw-text-royal-400', children: address ? address : emptyAddressLabel }), jsx(ChevronArrowIcon, { className: address ? 'tw-text-grey-600' : 'tw-text-royal-400' })] }))] }) }), jsx("div", { className: "tw-px-squid-m mobile-lg:tw-px-squid-l", children: jsx(AssetsButton, { onClick: onAssetsButtonClick, chain: chain, token: token, isLoading: isLoading, variant: assetsButtonVariant }) }), isFetching && (jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-m tw-z-10 tw-overflow-hidden mobile-lg:tw-left-squid-l", children: jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsx(NumericInput, { token: {
18095
- decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
18096
- symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : '',
18085
+ return (jsxs("section", { className: "tw-relative tw-h-[211px] tw-max-h-[211px] tw-w-full tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-pb-squid-m mobile-lg:tw-h-[205px] mobile-lg:tw-max-h-[205px] mobile-lg:tw-w-card-large", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-m tw-py-squid-xs tw-leading-5 tw-text-grey-300 mobile-lg:tw-px-squid-l", children: jsx(Tooltip, Object.assign({}, walletButton === null || walletButton === void 0 ? void 0 : walletButton.tooltip, { tooltipWidth: "max", childrenClassName: "tw-rounded-squid-s", containerClassName: "tw-rounded-squid-s", children: jsxs(WalletButtonTag, { onClick: isWalletButtonInteractive ? walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick : undefined, className: cn('-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs tw-text-grey-600', isWalletButtonInteractive && 'hover:tw-bg-material-light-thin', isLoading && 'tw-opacity-50'), children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), jsx(BodyText, { size: "small", children: ":" }), !isLoading && (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)
18086
+ ? 'tw-text-grey-300'
18087
+ : 'tw-text-royal-400', children: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
18088
+ ? walletButton === null || walletButton === void 0 ? void 0 : walletButton.address
18089
+ : (_a = walletButton === null || walletButton === void 0 ? void 0 : walletButton.emptyAddressLabel) !== null && _a !== void 0 ? _a : 'Connect wallet' }), jsx(ChevronArrowIcon, { className: (walletButton === null || walletButton === void 0 ? void 0 : walletButton.address)
18090
+ ? 'tw-text-grey-600'
18091
+ : 'tw-text-royal-400' })] }))] }) })) }), jsx("div", { className: "tw-px-squid-m mobile-lg:tw-px-squid-l", children: jsx(AssetsButton, Object.assign({}, assetsButton, { chain: chain, token: token, isLoading: isLoading })) }), isFetching && (jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-m tw-z-10 tw-overflow-hidden mobile-lg:tw-left-squid-l", children: jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsx(NumericInput, { token: {
18092
+ decimals: (_b = token === null || token === void 0 ? void 0 : token.decimals) !== null && _b !== void 0 ? _b : 18,
18093
+ symbol: (_c = token === null || token === void 0 ? void 0 : token.symbol) !== null && _c !== void 0 ? _c : '',
18097
18094
  price: tokenPrice,
18098
18095
  }, onAmountChange: (value) => {
18099
18096
  onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value);
18100
18097
  }, balance: balance, criticalPriceImpactPercentage: criticalPriceImpactPercentage, error: error, formatIfVerySmall: {
18101
18098
  token: '0.001',
18102
18099
  usd: '0.01',
18103
- }, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails: !!token, direction: direction, forcedAmount: amount, amountUsd: amountUsd, isInteractive: isInputInteractive && !isLoading })] }));
18100
+ }, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails: !!token, direction: direction, forcedAmount: amount, inputModeButton: inputModeButton, balanceButton: balanceButton, isInteractive: isInputInteractive && !isLoading })] }));
18104
18101
  }
18105
18102
 
18106
18103
  function SwapProgressViewHeader({ title, description, }) {
@@ -24205,6 +24202,153 @@ function Toast({ headerContent, actionsContent, description, chipLabel, title, }
24205
24202
  return (jsxs(Menu, { contentClassName: "tw-px-squid-m tw-pb-squid-s tw-pt-squid-xxs", contentWrapperClassName: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs", rounded: "sm", children: [headerContent, jsx("header", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-self-stretch tw-px-0 tw-py-squid-xxs", children: jsx(BodyText, { size: "small", className: "tw-text-grey-100", children: title }) }), jsx(CaptionText, { className: "tw-text-center tw-text-material-light-thick", children: description }), jsx("menu", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xs", children: actionsContent }), chipLabel && (jsx(Chip, { label: chipLabel, className: "tw-absolute tw-right-squid-xs tw-top-squid-xs" }))] }));
24206
24203
  }
24207
24204
 
24205
+ const gapBetweenTooltipAndContainer = 10;
24206
+ const tooltipWidthClassMap = {
24207
+ max: 'tw-w-max',
24208
+ container: 'tw-w-full',
24209
+ };
24210
+ const tooltipThresholdPaddingMap = {
24211
+ xxs: '5px',
24212
+ xs: '10px',
24213
+ s: '15px',
24214
+ m: '20px',
24215
+ l: '30px',
24216
+ xl: '40px',
24217
+ xxl: '60px',
24218
+ };
24219
+ function Tooltip({ children, tooltipContent, tooltipWidth = 'container', threshold = 'xxs', containerClassName, childrenClassName, tooltipClassName, displayDelayMs = 0, containerRef: containerRefProp, }) {
24220
+ const containerRefState = useContainerStore((state) => state.containerRef);
24221
+ const containerRef = (containerRefProp === null || containerRefProp === void 0 ? void 0 : containerRefProp.current)
24222
+ ? containerRefProp
24223
+ : containerRefState;
24224
+ const [tooltipPositionStyle, setTooltipPositionStyle] = useState({});
24225
+ const [isTooltipVisible, setIsTooltipVisible] = useState(false);
24226
+ const [isTooltipVisibleDelayed, setIsTooltipVisibleDelayed] = useState(false);
24227
+ const tooltipRef = useRef(null);
24228
+ const tooltipTriggerRef = useRef(null);
24229
+ const delayTimeoutRef = useRef(null);
24230
+ useEffect(() => {
24231
+ const adjustTooltipPosition = () => {
24232
+ if (!(containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) ||
24233
+ !tooltipRef.current ||
24234
+ !tooltipTriggerRef.current) {
24235
+ // if any of the refs is not defined, we can't calculate the position
24236
+ // so we just try to center the tooltip
24237
+ return setTooltipPositionStyle({
24238
+ bottom: '100%',
24239
+ left: '50%',
24240
+ transform: 'translateX(-50%)',
24241
+ paddingBottom: tooltipThresholdPaddingMap[threshold],
24242
+ });
24243
+ }
24244
+ // get the bounding rects of the container, tooltip and trigger
24245
+ const containerRect = containerRef.current.getBoundingClientRect();
24246
+ const tooltipRect = tooltipRef.current.getBoundingClientRect();
24247
+ const tooltipTriggerRect = tooltipTriggerRef.current.getBoundingClientRect();
24248
+ // check if the tooltip fits below the trigger
24249
+ const tooltipFitsBelow = containerRect.bottom - tooltipTriggerRect.bottom > tooltipRect.height;
24250
+ // check if the tooltip fits above the trigger
24251
+ const tooltipFitsAbove = tooltipTriggerRect.top - containerRect.top > tooltipRect.height;
24252
+ // get the y position of the center of the tooltip trigger
24253
+ const triggerMiddleY = tooltipTriggerRect.y + tooltipTriggerRect.height / 2;
24254
+ // get the x position of the center of the tooltip trigger
24255
+ const triggerMiddleX = tooltipTriggerRect.x + tooltipTriggerRect.width / 2;
24256
+ let tooltipYPosition = 'top';
24257
+ if (tooltipFitsAbove) {
24258
+ tooltipYPosition = 'top';
24259
+ }
24260
+ else if (tooltipFitsBelow) {
24261
+ tooltipYPosition = 'bottom';
24262
+ }
24263
+ else if (
24264
+ // if the tooltip doesn't fit above or below the trigger,
24265
+ // we just place it where there's more space available
24266
+ triggerMiddleY - containerRect.top >
24267
+ containerRect.bottom - triggerMiddleY) {
24268
+ tooltipYPosition = 'top';
24269
+ }
24270
+ else {
24271
+ tooltipYPosition = 'bottom';
24272
+ }
24273
+ const top = tooltipYPosition === 'top'
24274
+ ? -tooltipRect.height
24275
+ : tooltipTriggerRect.height;
24276
+ const paddingStyles = tooltipYPosition === 'top'
24277
+ ? {
24278
+ paddingBottom: tooltipThresholdPaddingMap[threshold],
24279
+ }
24280
+ : {
24281
+ paddingTop: tooltipThresholdPaddingMap[threshold],
24282
+ };
24283
+ let left = tooltipTriggerRect.width / 2 - tooltipRect.width / 2;
24284
+ const tooltipLeftSideX = triggerMiddleX - tooltipRect.width / 2 - gapBetweenTooltipAndContainer;
24285
+ const tooltipRightSideX = triggerMiddleX + tooltipRect.width / 2 + gapBetweenTooltipAndContainer;
24286
+ const tooltipOverflowsContainerLeft = tooltipLeftSideX < containerRect.left;
24287
+ const tooltipOverflowsContainerRight = tooltipRightSideX > containerRect.right;
24288
+ // if the tooltip is too far to the left, we need to move it to the right the amount of pixels overflowing the container + the gap between the tooltip and the container
24289
+ if (tooltipOverflowsContainerLeft) {
24290
+ left =
24291
+ -(tooltipTriggerRect.left - containerRect.left) +
24292
+ gapBetweenTooltipAndContainer;
24293
+ }
24294
+ else if (tooltipOverflowsContainerRight) {
24295
+ left =
24296
+ -(containerRect.right - tooltipTriggerRect.right) +
24297
+ gapBetweenTooltipAndContainer;
24298
+ }
24299
+ setTooltipPositionStyle(Object.assign(Object.assign({ top }, (tooltipOverflowsContainerLeft
24300
+ ? { left }
24301
+ : tooltipOverflowsContainerRight
24302
+ ? { right: left }
24303
+ : // if the tooltip doesn't overflow the container, we just center it
24304
+ {
24305
+ left: '50%',
24306
+ transform: 'translateX(-50%)',
24307
+ })), paddingStyles));
24308
+ };
24309
+ adjustTooltipPosition();
24310
+ const timeoutId = setTimeout(() => {
24311
+ adjustTooltipPosition();
24312
+ }, 300);
24313
+ window.addEventListener('resize', adjustTooltipPosition);
24314
+ return () => {
24315
+ clearTimeout(timeoutId);
24316
+ window.removeEventListener('resize', adjustTooltipPosition);
24317
+ };
24318
+ }, [
24319
+ containerRef,
24320
+ tooltipContent,
24321
+ threshold,
24322
+ tooltipWidth,
24323
+ displayDelayMs,
24324
+ isTooltipVisible,
24325
+ ]);
24326
+ const handleMouseEnter = useCallback((e) => {
24327
+ var _a;
24328
+ if (e.target === tooltipRef.current ||
24329
+ ((_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
24330
+ return;
24331
+ }
24332
+ setIsTooltipVisible(true);
24333
+ if (delayTimeoutRef.current) {
24334
+ clearTimeout(delayTimeoutRef.current);
24335
+ }
24336
+ delayTimeoutRef.current = setTimeout(() => {
24337
+ setIsTooltipVisibleDelayed(true);
24338
+ }, displayDelayMs);
24339
+ }, [displayDelayMs, tooltipRef, delayTimeoutRef]);
24340
+ const handleMouseLeave = useCallback(() => {
24341
+ setIsTooltipVisible(false);
24342
+ setIsTooltipVisibleDelayed(false);
24343
+ if (delayTimeoutRef.current) {
24344
+ clearTimeout(delayTimeoutRef.current);
24345
+ }
24346
+ }, [delayTimeoutRef]);
24347
+ return (jsxs("div", { className: cn('tw-relative', containerClassName), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [jsx("div", { ref: tooltipTriggerRef, className: childrenClassName, children: children }), tooltipContent ? (jsx(Menu, { style: tooltipPositionStyle, menuRef: tooltipRef, containerClassName: cn('tw-absolute tw-flex tw-items-center tw-justify-center', isTooltipVisibleDelayed
24348
+ ? '!tw-opacity-100 tw-z-40 tw-visible'
24349
+ : 'tw-opacity-0 -tw-z-40 tw-select-none tw-pointer-events-none tw-invisible', tooltipWidthClassMap[tooltipWidth], tooltipClassName), children: tooltipContent })) : null] }));
24350
+ }
24351
+
24208
24352
  const buttonClassName = 'tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs';
24209
24353
  // checks that the value includes at least one character different than `0` (zero), or `.` (dot)
24210
24354
  const RegExpNonZeroValue = /[^0.]/;
@@ -24219,7 +24363,7 @@ var InputMode;
24219
24363
  function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPriceImpactPercentage = 5, token, onAmountChange, forcedAmount, maxUsdDecimals = 4, formatIfVerySmall = {
24220
24364
  token: '0.001',
24221
24365
  usd: '0.01',
24222
- }, showDetails = true, isLoading = false, direction, amountUsd, isInteractive = false, }) {
24366
+ }, showDetails = true, isLoading = false, direction, inputModeButton, isInteractive = false, balanceButton, }) {
24223
24367
  var _a;
24224
24368
  const [inputValue, setInputValue] = useState('');
24225
24369
  const [inputMode, setInputMode] = useState(InputMode.TOKEN);
@@ -24317,6 +24461,7 @@ function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPri
24317
24461
  };
24318
24462
  const { isTokenAmountVerySmall, isUsdAmountVerySmall } = getRawAmounts(inputValue);
24319
24463
  const amountFormatted = useMemo(() => {
24464
+ var _a;
24320
24465
  if (inputValue === '')
24321
24466
  return '0';
24322
24467
  if (inputMode === InputMode.TOKEN) {
@@ -24324,13 +24469,19 @@ function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPri
24324
24469
  return formatAmount(convertTokenAmountToUSD(inputValue, token.price, maxUsdDecimals));
24325
24470
  }
24326
24471
  else {
24327
- return formatAmount(amountUsd !== null && amountUsd !== void 0 ? amountUsd : '0');
24472
+ return formatAmount((_a = inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.amountUsd) !== null && _a !== void 0 ? _a : '0');
24328
24473
  }
24329
24474
  }
24330
24475
  else {
24331
24476
  return formatAmount(convertUSDToTokenAmount(inputValue, token.price, token.decimals));
24332
24477
  }
24333
- }, [inputValue, inputMode, token.price, direction, amountUsd]);
24478
+ }, [
24479
+ inputValue,
24480
+ inputMode,
24481
+ token.price,
24482
+ direction,
24483
+ inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.amountUsd,
24484
+ ]);
24334
24485
  const AmountChip = isInteractive ? 'button' : 'div';
24335
24486
  const priceImpactClass = ((_a = Number(priceImpactPercentage)) !== null && _a !== void 0 ? _a : 0) > Number(criticalPriceImpactPercentage)
24336
24487
  ? 'tw-text-status-negative'
@@ -24341,15 +24492,21 @@ function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPri
24341
24492
  }, [balance]);
24342
24493
  return (jsxs(Fragment, { children: [isInteractive && !isLoading ? (jsxs("form", { className: "tw-relative tw-h-[80.6px] tw-px-squid-xs tw-pb-[15px] tw-pt-[5px] tw-text-heading-small tw-font-heading-regular mobile-lg:tw-h-[75px] mobile-lg:tw-px-squid-m", onSubmit: (e) => {
24343
24494
  e.preventDefault();
24344
- }, children: [inputMode === InputMode.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", { 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-400 focus:tw-outline-none', inputMode === InputMode.USD && 'tw-pl-[33px]') })] })) : (jsx("div", { className: cn('tw-w-full tw-px-squid-xs tw-pb-[15px] tw-pt-[5px] mobile-lg:tw-px-squid-m', isLoading && loadingClassName), children: jsx("div", { className: "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-font-heading-regular 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 }) })) : (jsxs(AmountChip, { onClick: isInteractive ? handleSwitchInputMode : undefined, className: cn(buttonClassName, isInteractive
24345
- ? interactiveChipClassName
24346
- : notInteractiveChipClassName), children: [jsx(SwapInputsIcon, {}), inputMode === InputMode.TOKEN ? (jsx(Fragment, { children: jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsxs(CaptionText, { className: "tw-opacity-66", children: [isUsdAmountVerySmall ? '<' : '', "$"] }), jsx(CaptionText, { children: isUsdAmountVerySmall
24495
+ }, children: [inputMode === InputMode.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", { 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-400 focus:tw-outline-none', inputMode === InputMode.USD && 'tw-pl-[33px]') })] })) : (jsx("div", { className: cn('tw-w-full tw-px-squid-xs tw-pb-[15px] tw-pt-[5px] mobile-lg:tw-px-squid-m', isLoading && loadingClassName), children: jsx("div", { className: "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-font-heading-regular 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
24496
+ ? undefined
24497
+ : inputMode === InputMode.TOKEN
24498
+ ? inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.tokenModeTooltip
24499
+ : inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.usdModeTooltip), { tooltipWidth: "max", childrenClassName: "tw-rounded-squid-s", containerClassName: "tw-rounded-squid-s", children: jsxs(AmountChip, { onClick: isInteractive ? handleSwitchInputMode : undefined, className: cn(buttonClassName, isInteractive
24500
+ ? interactiveChipClassName
24501
+ : notInteractiveChipClassName), children: [jsx(SwapInputsIcon, {}), inputMode === InputMode.TOKEN ? (jsx(Fragment, { children: jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsxs(CaptionText, { className: "tw-opacity-66", children: [isUsdAmountVerySmall ? '<' : '', "$"] }), jsx(CaptionText, { children: isUsdAmountVerySmall
24502
+ ? formatIfVerySmall.token
24503
+ : amountFormatted })] }) })) : (jsxs("span", { className: "tw-text-grey-500", children: [isTokenAmountVerySmall ? '<' : '', jsx(CaptionText, { children: isTokenAmountVerySmall
24347
24504
  ? formatIfVerySmall.token
24348
- : amountFormatted })] }) })) : (jsxs("span", { className: "tw-text-grey-500", children: [isTokenAmountVerySmall ? '<' : '', jsx(CaptionText, { children: isTokenAmountVerySmall
24349
- ? formatIfVerySmall.token
24350
- : 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 ? 'tw-opacity-0' : '' }), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] })), jsxs(BalanceChipTag, { onClick: onBalanceButtonClick, className: cn(buttonClassName, balanceChipClickable
24351
- ? interactiveChipClassName
24352
- : notInteractiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balanceFormatted }), jsx(Chip, { label: "Max" })] })] }))] }));
24505
+ : 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
24506
+ ? 'tw-opacity-0'
24507
+ : '' }), 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, { onClick: onBalanceButtonClick, className: cn(buttonClassName, balanceChipClickable
24508
+ ? interactiveChipClassName
24509
+ : notInteractiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balanceFormatted }), jsx(Chip, { label: "Max" })] }) }))] }))] }));
24353
24510
  }
24354
24511
 
24355
24512
  function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }) {
@@ -24451,172 +24608,50 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
24451
24608
  : 'tw-bg-grey-500') })] }));
24452
24609
  }
24453
24610
 
24454
- const gapBetweenTooltipAndContainer = 10;
24455
- const tooltipWidthClassMap = {
24456
- max: 'tw-w-max',
24457
- container: 'tw-w-full',
24611
+ function PlusIcon() {
24612
+ return (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M12 17V12M12 12V7M12 12H17M12 12H7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
24613
+ }
24614
+
24615
+ const imageClass = 'tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center';
24616
+ const themeKeyVariantMap = {
24617
+ primary: 'grey-800',
24618
+ accent: 'royal-500',
24458
24619
  };
24459
- const tooltipThresholdPaddingMap = {
24460
- xxs: '5px',
24461
- xs: '10px',
24462
- s: '15px',
24463
- m: '20px',
24464
- l: '30px',
24465
- xl: '40px',
24466
- xxl: '60px',
24620
+ const buttonTextClassNameMap = {
24621
+ primary: 'tw-text-grey-300',
24622
+ accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
24467
24623
  };
24468
- function Tooltip({ children, tooltipContent, tooltipWidth = 'container', threshold = 'xxs', containerClassName, childrenClassName, tooltipClassName, displayDelayMs = 0, containerRef: containerRefProp, }) {
24469
- const containerRefState = useContainerStore((state) => state.containerRef);
24470
- const containerRef = (containerRefProp === null || containerRefProp === void 0 ? void 0 : containerRefProp.current)
24471
- ? containerRefProp
24472
- : containerRefState;
24473
- const [tooltipPositionStyle, setTooltipPositionStyle] = useState({});
24474
- const [isTooltipVisible, setIsTooltipVisible] = useState(false);
24475
- const [isTooltipVisibleDelayed, setIsTooltipVisibleDelayed] = useState(false);
24476
- const tooltipRef = useRef(null);
24477
- const tooltipTriggerRef = useRef(null);
24478
- const delayTimeoutRef = useRef(null);
24479
- useEffect(() => {
24480
- const adjustTooltipPosition = () => {
24481
- if (!(containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) ||
24482
- !tooltipRef.current ||
24483
- !tooltipTriggerRef.current) {
24484
- // if any of the refs is not defined, we can't calculate the position
24485
- // so we just try to center the tooltip
24486
- return setTooltipPositionStyle({
24487
- bottom: '100%',
24488
- left: '50%',
24489
- transform: 'translateX(-50%)',
24490
- paddingBottom: tooltipThresholdPaddingMap[threshold],
24491
- });
24492
- }
24493
- // get the bounding rects of the container, tooltip and trigger
24494
- const containerRect = containerRef.current.getBoundingClientRect();
24495
- const tooltipRect = tooltipRef.current.getBoundingClientRect();
24496
- const tooltipTriggerRect = tooltipTriggerRef.current.getBoundingClientRect();
24497
- // check if the tooltip fits below the trigger
24498
- const tooltipFitsBelow = containerRect.bottom - tooltipTriggerRect.bottom > tooltipRect.height;
24499
- // check if the tooltip fits above the trigger
24500
- const tooltipFitsAbove = tooltipTriggerRect.top - containerRect.top > tooltipRect.height;
24501
- // get the y position of the center of the tooltip trigger
24502
- const triggerMiddleY = tooltipTriggerRect.y + tooltipTriggerRect.height / 2;
24503
- // get the x position of the center of the tooltip trigger
24504
- const triggerMiddleX = tooltipTriggerRect.x + tooltipTriggerRect.width / 2;
24505
- let tooltipYPosition = 'top';
24506
- if (tooltipFitsAbove) {
24507
- tooltipYPosition = 'top';
24508
- }
24509
- else if (tooltipFitsBelow) {
24510
- tooltipYPosition = 'bottom';
24511
- }
24512
- else if (
24513
- // if the tooltip doesn't fit above or below the trigger,
24514
- // we just place it where there's more space available
24515
- triggerMiddleY - containerRect.top >
24516
- containerRect.bottom - triggerMiddleY) {
24517
- tooltipYPosition = 'top';
24518
- }
24519
- else {
24520
- tooltipYPosition = 'bottom';
24521
- }
24522
- const top = tooltipYPosition === 'top'
24523
- ? -tooltipRect.height
24524
- : tooltipTriggerRect.height;
24525
- const paddingStyles = tooltipYPosition === 'top'
24526
- ? {
24527
- paddingBottom: tooltipThresholdPaddingMap[threshold],
24528
- }
24529
- : {
24530
- paddingTop: tooltipThresholdPaddingMap[threshold],
24531
- };
24532
- let left = tooltipTriggerRect.width / 2 - tooltipRect.width / 2;
24533
- const tooltipLeftSideX = triggerMiddleX - tooltipRect.width / 2 - gapBetweenTooltipAndContainer;
24534
- const tooltipRightSideX = triggerMiddleX + tooltipRect.width / 2 + gapBetweenTooltipAndContainer;
24535
- const tooltipOverflowsContainerLeft = tooltipLeftSideX < containerRect.left;
24536
- const tooltipOverflowsContainerRight = tooltipRightSideX > containerRect.right;
24537
- // if the tooltip is too far to the left, we need to move it to the right the amount of pixels overflowing the container + the gap between the tooltip and the container
24538
- if (tooltipOverflowsContainerLeft) {
24539
- left =
24540
- -(tooltipTriggerRect.left - containerRect.left) +
24541
- gapBetweenTooltipAndContainer;
24542
- }
24543
- else if (tooltipOverflowsContainerRight) {
24544
- left =
24545
- -(containerRect.right - tooltipTriggerRect.right) +
24546
- gapBetweenTooltipAndContainer;
24547
- }
24548
- setTooltipPositionStyle(Object.assign(Object.assign({ top }, (tooltipOverflowsContainerLeft
24549
- ? { left }
24550
- : tooltipOverflowsContainerRight
24551
- ? { right: left }
24552
- : // if the tooltip doesn't overflow the container, we just center it
24553
- {
24554
- left: '50%',
24555
- transform: 'translateX(-50%)',
24556
- })), paddingStyles));
24557
- };
24558
- adjustTooltipPosition();
24559
- const timeoutId = setTimeout(() => {
24560
- adjustTooltipPosition();
24561
- }, 300);
24562
- window.addEventListener('resize', adjustTooltipPosition);
24563
- return () => {
24564
- clearTimeout(timeoutId);
24565
- window.removeEventListener('resize', adjustTooltipPosition);
24566
- };
24567
- }, [
24568
- containerRef,
24569
- tooltipContent,
24570
- threshold,
24571
- tooltipWidth,
24572
- displayDelayMs,
24573
- isTooltipVisible,
24574
- ]);
24575
- const handleMouseEnter = useCallback((e) => {
24576
- var _a;
24577
- if (e.target === tooltipRef.current ||
24578
- ((_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
24579
- return;
24580
- }
24581
- setIsTooltipVisible(true);
24582
- if (delayTimeoutRef.current) {
24583
- clearTimeout(delayTimeoutRef.current);
24624
+ const emptyChainIconTextClassNameMap = {
24625
+ primary: 'tw-text-grey-100',
24626
+ accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
24627
+ };
24628
+ function AssetsButton({ chain, token, onClick, variant = 'primary', isLoading = false, tooltip, }) {
24629
+ var _a;
24630
+ const defaultBgColor = `var(${themeTypesKeys[themeKeyVariantMap[variant]].cssVariable})`;
24631
+ const chainBgColor = (_a = (chain && chain.bgColor)) !== null && _a !== void 0 ? _a : defaultBgColor;
24632
+ const tokenBgColor = (chain && token && !isLoading && token.bgColor) || defaultBgColor;
24633
+ const bgGradient = useMemo(() => {
24634
+ if (!chain || isLoading) {
24635
+ return `linear-gradient(to right, ${defaultBgColor}, ${defaultBgColor})`;
24584
24636
  }
24585
- delayTimeoutRef.current = setTimeout(() => {
24586
- setIsTooltipVisibleDelayed(true);
24587
- }, displayDelayMs);
24588
- }, [displayDelayMs, tooltipRef, delayTimeoutRef]);
24589
- const handleMouseLeave = useCallback(() => {
24590
- setIsTooltipVisible(false);
24591
- setIsTooltipVisibleDelayed(false);
24592
- if (delayTimeoutRef.current) {
24593
- clearTimeout(delayTimeoutRef.current);
24637
+ if (!token) {
24638
+ return `linear-gradient(90deg, ${chainBgColor} 54.86%, ${tokenBgColor} 95.83%)`;
24594
24639
  }
24595
- }, [delayTimeoutRef]);
24596
- return (jsxs("div", { className: cn('tw-relative', containerClassName), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [jsx("div", { ref: tooltipTriggerRef, className: childrenClassName, children: children }), tooltipContent ? (jsx(Menu, { style: tooltipPositionStyle, menuRef: tooltipRef, containerClassName: cn('tw-absolute tw-flex tw-items-center tw-justify-center', isTooltipVisibleDelayed
24597
- ? '!tw-opacity-100 tw-z-40 tw-visible'
24598
- : 'tw-opacity-0 -tw-z-40 tw-select-none tw-pointer-events-none tw-invisible', tooltipWidthClassMap[tooltipWidth], tooltipClassName), children: tooltipContent })) : null] }));
24599
- }
24600
-
24601
- function BoostButton({ boostMode, canToggleBoostMode = true, boostDisabledMessage = 'Boost disabled', tooltipDisplayDelayMs = 0, boostIndicatorRef, }) {
24602
- return (jsx(Tooltip, { tooltipWidth: "max", displayDelayMs: tooltipDisplayDelayMs, containerClassName: "tw-pr-squid-xxs mobile-lg:tw-w-[140px] tw-w-[106.5px]", tooltipContent: canToggleBoostMode ? null : boostDisabledMessage, children: jsxs("div", { className: "tw-relative tw-flex tw-h-squid-xl tw-w-full tw-flex-col tw-justify-between tw-overflow-hidden tw-rounded-squid-m tw-pb-squid-xxs tw-text-grey-300 focus:tw-outline-none", children: [jsx("span", { className: cn('tw-absolute tw-left-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-r tw-from-grey-900 tw-to-transparent', canToggleBoostMode &&
24603
- 'group-hover/boost-toggle:tw-from-material-light-blend-grey-900') }), jsx("span", { className: cn('tw-absolute tw-right-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-l tw-from-grey-900 tw-to-transparent', canToggleBoostMode &&
24604
- 'group-hover/boost-toggle:tw-from-material-light-blend-grey-900') }), jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-relative -tw-left-[20px] tw-flex tw-h-full tw-w-[140px] tw-items-center tw-justify-between tw-transition-transform group-disabled/boost-toggle:tw-grayscale data-[boost-mode=boost]:tw-animate-move-to-left-with-spring-bounce data-[boost-mode=normal]:tw-animate-move-to-right-with-spring-bounce mobile-lg:-tw-left-[3px]", children: [jsx("div", { className: "tw-w-[70px] tw-text-center group-disabled/boost-toggle:tw-grayscale", children: jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxs("div", { className: "tw-w-[70px] tw-text-center group-disabled/boost-toggle:tw-grayscale", children: [jsx(BodyText, { size: "small", className: "tw-text-status-positive", children: "Boost" }), ' '] }), jsx("div", { className: "tw-absolute tw-bottom-0 tw-h-1.5 tw-w-[1.5px] tw-rounded-sm tw-bg-grey-500 tw-text-grey-500 group-data-[boost-mode=boost]:tw-left-[calc(50%-2px)] group-data-[boost-mode=normal]:tw-left-[calc(50%-6px)]", style: {
24605
- boxShadow: generateMarkerLines(40),
24606
- } })] }), jsx("div", { className: cn('tw-absolute tw-bottom-0.5 tw-left-[calc(50%-2px)] tw-z-20 tw-h-[10px] tw-w-[3px] tw-rounded-sm tw-transition-colors group-disabled/boost-toggle:tw-grayscale peer-data-[boost-mode=boost]:tw-bg-status-positive peer-data-[boost-mode=normal]:tw-bg-current'), style: {
24607
- transitionDuration: `${ANIMATION_DURATIONS.BOOST_BUTTON}ms`,
24608
- } })] }) }));
24609
- }
24610
- function generateMarkerLines(count) {
24611
- const halfCount = Math.ceil(count / 2);
24612
- const rightShadows = Array.from({ length: halfCount }, (_, index) => {
24613
- return `-${(index + 1) * 6}px 0 currentColor`;
24614
- });
24615
- const leftShadows = Array.from({ length: halfCount }, (_, index) => {
24616
- return `${(index + 1) * 6}px 0 currentColor`;
24617
- });
24618
- const allShadows = [...rightShadows, ...leftShadows];
24619
- return allShadows.join(', ');
24640
+ return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
24641
+ }, [chainBgColor, tokenBgColor, chain, token, isLoading]);
24642
+ const ButtonTag = isLoading ? 'div' : 'button';
24643
+ return (jsx(Tooltip, Object.assign({}, tooltip, { tooltipWidth: "max", containerClassName: "tw-w-fit", children: jsxs(ButtonTag, { onClick: isLoading ? undefined : onClick, disabled: isLoading, "aria-disabled": isLoading, className: cn('tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center focus:tw-outline-none', buttonTextClassNameMap[variant], isLoading && 'tw-cursor-not-allowed'), children: [jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-text-material-light-thin", viewBox: "0 0 72 40", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: jsx("path", { d: "m57.86 5.86c-.53.53-1.05 1.06-1.56 1.59-3.29 3.38-6.37 6.55-10.3 6.55s-7.01-3.17-10.3-6.55c-.51-.53-1.03-1.06-1.56-1.59-3.9-3.91-9.02-5.86-14.14-5.86s-10.24 1.95-14.14 5.86c-3.91 3.9-5.86 9.02-5.86 14.14s1.95 10.24 5.86 14.14c3.91 3.91 9.02 5.86 14.14 5.86s10.24-1.95 14.14-5.86c.52-.53 1.04-1.06 1.55-1.58 3.29-3.39 6.37-6.56 10.31-6.56s7.02 3.17 10.31 6.56c.51.53 1.03 1.06 1.55 1.58 3.91 3.91 9.02 5.86 14.14 5.86v-40c-5.12 0-10.24 1.95-14.14 5.86zm14.14 33.14c-5.07 0-9.85-1.98-13.43-5.56-.52-.52-1.02-1.04-1.54-1.57-3.43-3.53-6.67-6.86-11.02-6.86s-7.6 3.33-11.04 6.88c-.5.52-1.01 1.04-1.53 1.56-3.59 3.59-8.36 5.57-13.44 5.57s-9.85-1.98-13.43-5.57c-3.59-3.59-5.56-8.36-5.56-13.43s1.98-9.85 5.56-13.44c3.58-3.6 8.35-5.58 13.43-5.58s9.85 1.98 13.44 5.57c.52.52 1.04 1.05 1.55 1.58 3.43 3.53 6.66 6.86 11.02 6.86s7.59-3.33 11.02-6.86c.51-.52 1.02-1.05 1.55-1.58 3.59-3.59 8.36-5.56 13.43-5.56v38z" }) }), jsx("div", { className: cn('tw-assets-button-mask tw-flex tw-h-squid-xl tw-w-[92px] tw-items-center tw-justify-between', chain && token && !isLoading
24644
+ ? 'tw-w-[90px]'
24645
+ : 'tw-w-full tw-max-w-[72px]'), style: {
24646
+ backgroundImage: bgGradient,
24647
+ }, children: jsx("div", { className: clsx(imageClass), children: chain && !isLoading ? (jsx("img", { src: chain.iconUrl, alt: "", className: "tw-rounded-full" })) : (!isLoading && (jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsx(PlusIcon, {}) }))) }) }), chain && token && !isLoading ? (jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-overflow-hidden'), children: [jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
24648
+ backgroundColor: tokenBgColor,
24649
+ } }), jsx("img", { src: token.iconUrl, alt: token.symbol, className: "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full" }), jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px] tw-border-b\n tw-border-t tw-border-material-light-thin" })] })) : null, jsxs("div", { className: cn('tw-flex tw-h-squid-xl tw-w-fit tw-min-w-squid-xl tw-items-center tw-gap-squid-xxs tw-rounded-br-full tw-rounded-tr-full tw-border-b tw-border-r tw-border-t tw-border-material-light-thin tw-py-squid-xs tw-pr-squid-xs', chain && token && !isLoading && 'tw-pl-[7px]'), style: {
24650
+ backgroundColor: tokenBgColor,
24651
+ color: token === null || token === void 0 ? void 0 : token.textColor,
24652
+ }, children: [jsx(BodyText, { size: "small", className: cn('tw-leading-[13px]', (!token || !chain || isLoading) && 'tw-w-[135px]'), children: chain && token && !isLoading
24653
+ ? token.symbol
24654
+ : !isLoading && 'Select token' }), !isLoading && jsx(ChevronLargeRightIcon, { className: "tw-opacity-66" })] })] }) })));
24620
24655
  }
24621
24656
 
24622
24657
  function FilterIcon() {
@@ -24668,10 +24703,16 @@ function MainView({ isLoading }) {
24668
24703
  {
24669
24704
  labelOrIcon: jsx(ClockOutlineIcon, {}),
24670
24705
  id: 'history',
24706
+ tooltip: {
24707
+ tooltipContent: 'Swap history',
24708
+ },
24671
24709
  },
24672
24710
  {
24673
24711
  labelOrIcon: jsx(SettingsGearIcon, {}),
24674
24712
  id: 'settings',
24713
+ tooltip: {
24714
+ tooltipContent: 'Swap preferences',
24715
+ },
24675
24716
  },
24676
24717
  ] }), jsx(SwapConfiguration, { isLoading: isLoading, direction: "from", chain: {
24677
24718
  iconUrl: 'https://raw.githubusercontent.com/0xsquid/assets/main/images/tokens/blast.svg',
@@ -24682,11 +24723,45 @@ function MainView({ isLoading }) {
24682
24723
  bgColor: '#627eea',
24683
24724
  textColor: '#fff',
24684
24725
  decimals: 18,
24685
- }, priceImpactPercentage: '0.3', balance: '4.57', address: "so-so.eth" }), jsx(DetailsToolbar, { canToggleBoostMode: false, flipButton: {
24726
+ }, priceImpactPercentage: '0.3', balance: '4.57', walletButton: {
24727
+ address: 'so-so.eth',
24728
+ onClick: () => { },
24729
+ tooltip: {
24730
+ tooltipContent: 'Connect wallet',
24731
+ },
24732
+ }, assetsButton: {
24733
+ tooltip: {
24734
+ tooltipContent: 'Select token',
24735
+ },
24736
+ }, balanceButton: {
24737
+ tooltip: {
24738
+ tooltipContent: 'Max balance',
24739
+ },
24740
+ }, inputModeButton: {
24741
+ usdModeTooltip: {
24742
+ tooltipContent: 'Enter token amount',
24743
+ },
24744
+ tokenModeTooltip: {
24745
+ tooltipContent: 'Enter in USD',
24746
+ },
24747
+ } }), jsx(DetailsToolbar, { flipButton: {
24686
24748
  isDisabled: true,
24687
- disabledMessage: 'Not enough USDC to flip the swap',
24688
- tooltipDisplayDelayMs: 0,
24689
- }, boostDisabledMessage: "Boost not supported for this route", isLoading: isLoading, isEmpty: isLoading }), jsx(SwapConfiguration, { isLoading: isLoading, direction: "to", chain: {
24749
+ tooltip: {
24750
+ tooltipContent: 'Not enough USDC to flip the swap',
24751
+ displayDelayMs: 0,
24752
+ },
24753
+ }, boostButton: {
24754
+ canToggleBoostMode: false,
24755
+ tooltip: {
24756
+ tooltipContent: 'Boost not supported for this route',
24757
+ },
24758
+ }, feeButton: {
24759
+ feeInUsd: '0.4',
24760
+ onClick: () => { },
24761
+ tooltip: {
24762
+ tooltipContent: 'View fees',
24763
+ },
24764
+ }, isLoading: isLoading, isEmpty: isLoading }), jsx(SwapConfiguration, { isLoading: isLoading, direction: "to", chain: {
24690
24765
  iconUrl: 'https://raw.githubusercontent.com/0xsquid/assets/main/images/tokens/avax.svg',
24691
24766
  bgColor: '#e84142',
24692
24767
  }, token: {
@@ -24695,7 +24770,28 @@ function MainView({ isLoading }) {
24695
24770
  bgColor: '#2775ca',
24696
24771
  textColor: '#fff',
24697
24772
  decimals: 6,
24698
- }, priceImpactPercentage: isLoading ? undefined : '7.2', balance: '2854', address: "so-so.eth", amount: isLoading ? undefined : '100' }), jsx("div", { className: "tw-h-full tw-max-h-[80px] tw-px-squid-m tw-pb-squid-m", children: jsx(Button$1, { variant: isLoading ? 'tertiary' : 'primary', size: "lg", label: "Swap", isLoading: isLoading }) })] }));
24773
+ }, priceImpactPercentage: isLoading ? undefined : '7.2', balance: '2854', walletButton: {
24774
+ address: 'so-so.eth',
24775
+ onClick: () => { },
24776
+ tooltip: {
24777
+ tooltipContent: 'Connect wallet',
24778
+ },
24779
+ }, amount: isLoading ? undefined : '100', assetsButton: {
24780
+ tooltip: {
24781
+ tooltipContent: 'Select token',
24782
+ },
24783
+ }, balanceButton: {
24784
+ tooltip: {
24785
+ tooltipContent: 'Max balance',
24786
+ },
24787
+ }, inputModeButton: {
24788
+ usdModeTooltip: {
24789
+ tooltipContent: 'Enter token amount',
24790
+ },
24791
+ tokenModeTooltip: {
24792
+ tooltipContent: 'Enter in USD',
24793
+ },
24794
+ } }), jsx("div", { className: "tw-h-full tw-max-h-[80px] tw-px-squid-m tw-pb-squid-m", children: jsx(Button$1, { variant: isLoading ? 'tertiary' : 'primary', size: "lg", label: "Swap", isLoading: isLoading }) })] }));
24699
24795
  }
24700
24796
 
24701
24797
  function PunkIcon({ size = '16' }) {
@@ -60118,4 +60214,4 @@ function SquidConfigProvider({ theme = lightTheme, children, themeType = 'light'
60118
60214
  return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-h-screen tw-font-geist mobile-lg:tw-h-auto", children: children }));
60119
60215
  }
60120
60216
 
60121
- export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, ApproveAction, ArrowButton, AssetsButton, AssetsView, BadgeImage, BlockSkeleton, BodyText, Boost, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CaptionText, Chip, Collapse, DescriptionBlocks, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, FeesAction, FeesLines, FeesTotal, FilterButton, HashLink, HeadingText, HistoryItem, IconLabel, ImageIcon, IncompleteAction, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, List, ListItem, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, PipeSeparator, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, ReceiveNFTAction, ReceiveTokensAction, RecipientView, STEP_ITEM_HEIGHT, SectionTitle, SendTokensAction, SettingsButton, SettingsItem, SettingsSlider, SizeTransition, SquidConfigProvider, StakeAction, StartAction, SuccessAction, SwapAction, SwapConfiguration, SwapDetailsView, SwapHeader, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepsCollapsed, SwapTransactionView, Switch, TextSkeleton, Timestamp, Toast, TokenPair, Tooltip, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, UsdAmount, WalletLink, WalletsView, WrapAction, linkActionTimelineProps, statusBgClassMap$1 as statusBgClassMap, statusColorClassMap, statusTextClassMap, useDropdownMenu, useMediaQuery };
60217
+ export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, ApproveAction, ArrowButton, AssetsButton, AssetsView, BadgeImage, BlockSkeleton, BodyText, Boost, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CaptionText, Chip, Collapse, DescriptionBlocks, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, FeesAction, FeesLines, FeesTotal, FilterButton, HashLink, HeadingText, HistoryItem, IconLabel, ImageIcon, IncompleteAction, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, List, ListItem, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, PipeSeparator, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, ReceiveNFTAction, ReceiveTokensAction, RecipientView, STEP_ITEM_HEIGHT, SectionTitle, SendTokensAction, SettingsButton, SettingsItem, SettingsSlider, SizeTransition, SquidConfigProvider, StakeAction, StartAction, SuccessAction, SwapAction, SwapConfiguration, SwapDetailsView, SwapHeader, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepsCollapsed, SwapTransactionView, Switch, TextSkeleton, Timestamp, Toast, TokenPair, Tooltip, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, UsdAmount, WalletLink, WalletsView, WrapAction, linkActionTimelineProps, statusBgClassMap$1 as statusBgClassMap, statusColorClassMap, statusTextClassMap, useDropdownMenu, useMediaQuery };