@0xsquid/ui 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/index.js +43 -34
  2. package/dist/cjs/types/components/icons/Arrow.d.ts +4 -1
  3. package/dist/cjs/types/components/icons/Percent.d.ts +8 -0
  4. package/dist/cjs/types/components/layout/Modal.d.ts +3 -1
  5. package/dist/cjs/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
  6. package/dist/cjs/types/components/layout/index.d.ts +0 -1
  7. package/dist/cjs/types/components/lists/SwapDetailListItem.d.ts +2 -1
  8. package/dist/cjs/types/components/typography/CaptionText.d.ts +0 -1
  9. package/dist/cjs/types/components/views/SwapDetailsView.d.ts +3 -1
  10. package/dist/cjs/types/services/internal/colorService.d.ts +1 -18
  11. package/dist/cjs/types/stories/layout/Boost.stories.d.ts +1 -0
  12. package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +2 -0
  13. package/dist/{esm/types/stories/layout/SwapProgressView.stories.d.ts → cjs/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
  14. package/dist/cjs/types/stories/lists/SwapDetailListItem.stories.d.ts +1 -0
  15. package/dist/cjs/types/stories/views/SwapDetailsView.stories.d.ts +1 -0
  16. package/dist/cjs/types/types/components.d.ts +0 -1
  17. package/dist/esm/index.js +44 -34
  18. package/dist/esm/types/components/icons/Arrow.d.ts +4 -1
  19. package/dist/esm/types/components/icons/Percent.d.ts +8 -0
  20. package/dist/esm/types/components/layout/Modal.d.ts +3 -1
  21. package/dist/esm/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
  22. package/dist/esm/types/components/layout/index.d.ts +0 -1
  23. package/dist/esm/types/components/lists/SwapDetailListItem.d.ts +2 -1
  24. package/dist/esm/types/components/typography/CaptionText.d.ts +0 -1
  25. package/dist/esm/types/components/views/SwapDetailsView.d.ts +3 -1
  26. package/dist/esm/types/services/internal/colorService.d.ts +1 -18
  27. package/dist/esm/types/stories/layout/Boost.stories.d.ts +1 -0
  28. package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +2 -0
  29. package/dist/{cjs/types/stories/layout/SwapProgressView.stories.d.ts → esm/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
  30. package/dist/esm/types/stories/lists/SwapDetailListItem.stories.d.ts +1 -0
  31. package/dist/esm/types/stories/views/SwapDetailsView.stories.d.ts +1 -0
  32. package/dist/esm/types/types/components.d.ts +0 -1
  33. package/dist/index.css +94 -17
  34. package/dist/index.d.ts +8 -13
  35. package/package.json +1 -1
  36. package/dist/cjs/types/components/layout/WalletAddress.d.ts +0 -6
  37. package/dist/cjs/types/services/internal/walletService.d.ts +0 -1
  38. package/dist/esm/types/components/layout/WalletAddress.d.ts +0 -6
  39. package/dist/esm/types/services/internal/walletService.d.ts +0 -1
package/dist/cjs/index.js CHANGED
@@ -2588,7 +2588,7 @@ function CaptionText(_a) {
2588
2588
  }
2589
2589
 
2590
2590
  function UsdAmount({ usdAmount }) {
2591
- return (jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsxRuntime.jsx(CaptionText, { className: "tw-text-grey-500/65", children: "$" }), jsxRuntime.jsx(CaptionText, { children: usdAmount.toString() })] }));
2591
+ return (jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "$" }), jsxRuntime.jsx(CaptionText, { children: usdAmount.toString() })] }));
2592
2592
  }
2593
2593
 
2594
2594
  // font size, line height, and letter spacing classes
@@ -2619,8 +2619,8 @@ function AddressButton(_a) {
2619
2619
  function ArrowRightIcon() {
2620
2620
  return (jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M14 6L20 12L14 18M19 12H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2621
2621
  }
2622
- function ChevronArrowIcon() {
2623
- return (jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2622
+ function ChevronArrowIcon({ size = '16', className, }) {
2623
+ return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2624
2624
  }
2625
2625
  function ArrowTriangle() {
2626
2626
  return (jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M2.87921 5.55701C2.21562 4.22933 3.18052 2.6665 4.66531 2.6665H11.3348C12.8196 2.6665 13.7845 4.22933 13.1209 5.55701L9.78615 12.229C9.05029 13.7012 6.94983 13.7012 6.21397 12.229L2.87921 5.55701Z", fill: "currentColor" }) }));
@@ -2772,7 +2772,7 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
2772
2772
  }
2773
2773
  return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
2774
2774
  }, [chainBgColor, tokenBgColor]);
2775
- return (jsxRuntime.jsxs("div", { onClick: onClick, className: "tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center tw-text-grey-100", children: [jsxRuntime.jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-cursor-pointer tw-text-material-light-thin", viewBox: "0 0 72 40", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: jsxRuntime.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" }) }), jsxRuntime.jsx("div", { className: cn('tw-assets-button-mask tw-flex tw-h-squid-xl tw-w-[92px] tw-cursor-pointer tw-items-center tw-justify-between', tokenImageUrl ? 'tw-w-[90px]' : 'tw-w-full tw-max-w-[72px]'), style: {
2775
+ return (jsxRuntime.jsxs("button", { onClick: onClick, className: "tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center tw-text-grey-100 focus:tw-outline-none", children: [jsxRuntime.jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-cursor-pointer tw-text-material-light-thin", viewBox: "0 0 72 40", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: jsxRuntime.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" }) }), jsxRuntime.jsx("div", { className: cn('tw-assets-button-mask tw-flex tw-h-squid-xl tw-w-[92px] tw-cursor-pointer tw-items-center tw-justify-between', tokenImageUrl ? 'tw-w-[90px]' : 'tw-w-full tw-max-w-[72px]'), style: {
2776
2776
  backgroundImage: bgGradient,
2777
2777
  }, children: jsxRuntime.jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsxRuntime.jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(PlusIcon, {}) })) }) }), tokenImageUrl && chainImageUrl ? (jsxRuntime.jsx("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-rounded-bl-full tw-rounded-tl-full tw-border-b tw-border-t tw-border-material-light-thin'), style: {
2778
2778
  backgroundColor: tokenBgColor,
@@ -2822,19 +2822,19 @@ const switchCircleSizeClassMap = {
2822
2822
  function Switch({ checked = false, onChange, size }) {
2823
2823
  return (
2824
2824
  // Switch container
2825
- jsxRuntime.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',
2825
+ jsxRuntime.jsxs("label", { className: clsx('tw-relative tw-inline-flex tw-cursor-pointer tw-items-center tw-justify-end tw-overflow-hidden tw-rounded-squid-m tw-border tw-border-material-light-thin tw-transition-colors',
2826
2826
  // size styles
2827
2827
  switchSizeClassMap[size],
2828
2828
  // checked styles
2829
2829
  checked ? 'tw-bg-status-positive' : 'tw-bg-grey-800'), children: [jsxRuntime.jsx("input", { checked: checked, onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked), type: "checkbox", className: "tw-peer tw-sr-only" }), jsxRuntime.jsx("span", { style: {
2830
2830
  filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
2831
- }, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin',
2831
+ }, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
2832
2832
  // size styles
2833
2833
  switchCircleSizeClassMap[size],
2834
2834
  // disabled and checked styles
2835
2835
  checked
2836
- ? 'tw-right-0.5 tw-bg-grey-100'
2837
- : 'tw-left-0.5 tw-bg-grey-500') })] }));
2836
+ ? 'tw-translate-x-0 tw-bg-grey-100'
2837
+ : '-tw-translate-x-full tw-bg-grey-500') })] }));
2838
2838
  }
2839
2839
 
2840
2840
  const borderRadiusClassMap = {
@@ -2883,9 +2883,9 @@ function BoostButton({ boostMode: _boostMode, onToggleBoostMode, canToggleBoostM
2883
2883
  onToggleBoostMode === null || onToggleBoostMode === void 0 ? void 0 : onToggleBoostMode({ boostMode: 'normal' });
2884
2884
  }
2885
2885
  }
2886
- return (jsxRuntime.jsx(Tooltip, { tooltipWidth: "max", tooltipContent: canToggleBoostMode ? null : boostDisabledMessage, children: jsxRuntime.jsxs("div", { onClick: handleToggleBoostMode, className: "tw-relative tw-flex tw-h-squid-xl tw-w-[140px] tw-flex-col tw-justify-between tw-overflow-hidden tw-bg-grey-900 tw-pb-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 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" }), jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 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" }), jsxRuntime.jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-flex tw-h-full tw-items-center tw-justify-between tw-transition-transform data-[boost-mode=boost]:tw-animate-move-to-left-with-spring-bounce data-[boost-mode=normal]:tw-animate-move-to-right-with-spring-bounce", children: [jsxRuntime.jsx("div", { className: "tw-w-1/2 tw-text-center", children: jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxRuntime.jsxs("div", { className: "tw-w-1/2 tw-text-center", children: [jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-status-positive", children: "Boost" }), ' '] }), jsxRuntime.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: {
2886
+ return (jsxRuntime.jsx(Tooltip, { tooltipWidth: "max", tooltipContent: canToggleBoostMode ? null : boostDisabledMessage, children: jsxRuntime.jsxs("button", { onClick: handleToggleBoostMode, disabled: !canToggleBoostMode, className: "tw-group tw-relative tw-flex tw-h-squid-xl tw-w-[140px] tw-flex-col tw-justify-between tw-overflow-hidden tw-bg-grey-900 tw-pb-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 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" }), jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 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" }), jsxRuntime.jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-flex tw-h-full tw-w-full tw-items-center tw-justify-between tw-transition-transform group-disabled: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", children: [jsxRuntime.jsx("div", { className: "tw-w-1/2 tw-text-center group-disabled:tw-grayscale", children: jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxRuntime.jsxs("div", { className: "tw-w-1/2 tw-text-center group-disabled:tw-grayscale", children: [jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-status-positive", children: "Boost" }), ' '] }), jsxRuntime.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: {
2887
2887
  boxShadow: generateMarkerLines(40),
2888
- } })] }), jsxRuntime.jsx("div", { className: cn('tw-absolute tw-bottom-0.5 tw-left-[calc(50%-1.5px)] tw-z-20 tw-h-[10px] tw-w-[3px] tw-rounded-sm tw-transition-colors peer-data-[boost-mode=boost]:tw-bg-status-positive peer-data-[boost-mode=normal]:tw-bg-current'), style: {
2888
+ } })] }), jsxRuntime.jsx("div", { className: cn('tw-absolute tw-bottom-0.5 tw-left-[calc(50%-1.5px)] tw-z-20 tw-h-[10px] tw-w-[3px] tw-rounded-sm tw-transition-colors group-disabled:tw-grayscale peer-data-[boost-mode=boost]:tw-bg-status-positive peer-data-[boost-mode=normal]:tw-bg-current'), style: {
2889
2889
  transitionDuration: animationDuration,
2890
2890
  } })] }) }));
2891
2891
  }
@@ -2946,8 +2946,10 @@ function SettingsButton({ label }) {
2946
2946
  return (jsxRuntime.jsx("button", { className: "tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs", children: jsxRuntime.jsx(CaptionText, { children: label }) }));
2947
2947
  }
2948
2948
 
2949
- function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode, }) {
2950
- return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' ? 'tw-bg-grey-300' : 'tw-bg-status-positive') })] }));
2949
+ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, }) {
2950
+ return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
2951
+ ? 'tw-bg-grey-300'
2952
+ : 'tw-bg-status-positive') })] }));
2951
2953
  }
2952
2954
 
2953
2955
  function EmojiSadIcon() {
@@ -2962,7 +2964,7 @@ const detailStateClassMap = {
2962
2964
  };
2963
2965
  function DetailsToolbar({ state = 'full', errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }) {
2964
2966
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
2965
- return (jsxRuntime.jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsxRuntime.jsx(ErrorMessage, { message: errorMessage })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsxRuntime.jsx(Loader, { size: "32" })) : (jsxRuntime.jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, {}) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2967
+ return (jsxRuntime.jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsxRuntime.jsx(ErrorMessage, { message: errorMessage })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsxRuntime.jsx(Loader, { size: "32" })) : (jsxRuntime.jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, {}) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2966
2968
  }
2967
2969
  const ErrorMessage = ({ message }) => {
2968
2970
  return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-status-negative", children: [jsxRuntime.jsx(EmojiSadIcon, {}), jsxRuntime.jsx(CaptionText, { children: message })] }));
@@ -3067,8 +3069,11 @@ function SettingsItem({ icon, label, controls, transparentControls = false, show
3067
3069
  return (jsxRuntime.jsxs("li", { className: "tw-flex tw-h-[50px] tw-scroll-px-5 tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-grey-900 tw-px-5 tw-py-squid-xs tw-text-grey-300", children: [icon, jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: [jsxRuntime.jsx(BodyText, { size: "small", children: label }), showHelpIcon ? jsxRuntime.jsx(HelpIcon, { className: "tw-text-grey-600" }) : null] }), jsxRuntime.jsx("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-rounded-squid-xs', transparentControls ? '' : 'tw-bg-grey-800'), children: controls })] }));
3068
3070
  }
3069
3071
 
3070
- function SwapDetailListItem({ label, detail, icon, }) {
3071
- return (jsxRuntime.jsx("li", { className: "tw-swap-detail-list-item-gradient tw-h-squid-l tw-w-full tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-l tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs tw-px-squid-xs", children: [jsxRuntime.jsx("div", { className: "tw-h-6 tw-w-6 tw-text-grey-500", children: icon }), jsxRuntime.jsx(CaptionText, { className: "tw-flex-1 tw-text-grey-500", children: label }), typeof detail === 'string' ? (jsxRuntime.jsx(CaptionText, { children: detail })) : (detail)] }) }));
3072
+ function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
3073
+ return (jsxRuntime.jsx("li", { className: "tw-swap-detail-list-item-gradient tw-h-squid-l tw-w-full tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-l tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs tw-px-squid-xs", children: [jsxRuntime.jsx("div", { className: "tw-h-6 tw-w-6 tw-text-grey-500", children: icon }), jsxRuntime.jsx(CaptionText, { className: "tw-flex-1 tw-text-grey-500", children: label }), isLoading ? (jsxRuntime.jsx(LoadingSkeleton, {})) : typeof detail === 'string' ? (jsxRuntime.jsx(CaptionText, { children: detail })) : (detail)] }) }));
3074
+ }
3075
+ function LoadingSkeleton() {
3076
+ return (jsxRuntime.jsx("div", { className: "tw-h-squid-xs tw-w-16 tw-animate-pulse tw-rounded-full tw-bg-grey-700" }));
3072
3077
  }
3073
3078
 
3074
3079
  function SwapStepSeparator() {
@@ -3098,10 +3103,16 @@ function DropdownMenu({ dropdownRef, items, className, }) {
3098
3103
  return (jsxRuntime.jsx("div", { ref: dropdownRef, className: "tw-relative", children: jsxRuntime.jsx(Menu, { rounded: "sm", containerClassName: cn('tw-absolute tw-right-0 tw-z-20', className), contentClassName: "!tw-p-0", children: jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[144px] tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-px-0 tw-py-squid-xxs", children: items.map((item) => (jsxRuntime.jsx(DropdownMenuItem, Object.assign({}, item), item.label))) }) }) }));
3099
3104
  }
3100
3105
 
3101
- function Modal({ children }) {
3106
+ function Modal({ children, className, onBackdropClick }) {
3102
3107
  return (
3103
- // modal container
3104
- jsxRuntime.jsx("div", { className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-thick tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsxRuntime.jsx("div", { className: "tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end", children: children }) }));
3108
+ // modal container (backdrop)
3109
+ jsxRuntime.jsx("div", { onClick: onBackdropClick
3110
+ ? (event) => {
3111
+ if (event.target === event.currentTarget) {
3112
+ onBackdropClick();
3113
+ }
3114
+ }
3115
+ : undefined, className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsxRuntime.jsx("div", { className: cn('tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className), children: children }) }));
3105
3116
  }
3106
3117
 
3107
3118
  function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
@@ -3124,10 +3135,6 @@ function SwapInputsIcon() {
3124
3135
  return (jsxRuntime.jsxs("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_40_7936)", children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20 10.5C20 16.0228 15.5228 20.5 10 20.5C4.47715 20.5 0 16.0228 0 10.5C0 4.97715 4.47715 0.5 10 0.5C15.5228 0.5 20 4.97715 20 10.5ZM8.38268 4.57612C8.75636 4.7309 9 5.09554 9 5.5V15.5C9 16.0523 8.55228 16.5 8 16.5C7.44772 16.5 7 16.0523 7 15.5V7.91421L5.70711 9.20711C5.31658 9.59763 4.68342 9.59763 4.29289 9.20711C3.90237 8.81658 3.90237 8.18342 4.29289 7.79289L7.29289 4.79289C7.57889 4.5069 8.00901 4.42134 8.38268 4.57612ZM11 15.5C11 15.9045 11.2436 16.2691 11.6173 16.4239C11.991 16.5787 12.4211 16.4931 12.7071 16.2071L15.7071 13.2071C16.0976 12.8166 16.0976 12.1834 15.7071 11.7929C15.3166 11.4024 14.6834 11.4024 14.2929 11.7929L13 13.0858V5.5C13 4.94771 12.5523 4.5 12 4.5C11.4477 4.5 11 4.94771 11 5.5V15.5Z", fill: "currentColor" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_40_7936", children: jsxRuntime.jsx("rect", { width: "20", height: "20", fill: "white", transform: "translate(0 0.5)" }) }) })] }));
3125
3136
  }
3126
3137
 
3127
- function WalletAddress({ address, ens }) {
3128
- return (jsxRuntime.jsx("div", { className: "tw-flex tw-items-center tw-gap-1", children: ens || address ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BodyText, { size: "small", children: ens ? ens : (address === null || address === void 0 ? void 0 : address.slice(0, 6)) + '...' + (address === null || address === void 0 ? void 0 : address.slice(-4)) }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronArrowIcon, {}) })] })) : null }));
3129
- }
3130
-
3131
3138
  function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }) {
3132
3139
  var _a;
3133
3140
  const priceImpactClass = ((_a = Number(priceImpactPercentage)) !== null && _a !== void 0 ? _a : 0) > 5
@@ -3136,22 +3143,22 @@ function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0',
3136
3143
  const isInteractive = direction === 'from';
3137
3144
  // improve accessibility
3138
3145
  const BalanceButtonTag = isInteractive ? 'button' : 'div';
3139
- return (jsxRuntime.jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsxRuntime.jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxRuntime.jsxs("button", { onClick: onWalletButtonClick, className: "-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 hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), address ? (jsxRuntime.jsx(BodyText, { className: "tw-text-grey-600", size: "small", children: ":" })) : null, jsxRuntime.jsx(WalletAddress, { ens: address })] }) }), jsxRuntime.jsx("div", { className: "tw-px-squid-l", children: jsxRuntime.jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsxRuntime.jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.jsx("input", { className: "tw-h-[55px] tw-w-full 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 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", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsxRuntime.jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.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: jsxRuntime.jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxRuntime.jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsxRuntime.jsx(SwapInputsIcon, {}), jsxRuntime.jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxRuntime.jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsxRuntime.jsx(ArrowTriangle, {}), jsxRuntime.jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxRuntime.jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balance }), jsxRuntime.jsx(MaxIcon, {})] })] }))] }));
3146
+ return (jsxRuntime.jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsxRuntime.jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxRuntime.jsxs("button", { onClick: onWalletButtonClick, className: "-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 hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), jsxRuntime.jsx(BodyText, { size: "small", children: ":" }), jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsxRuntime.jsx(BodyText, { size: "small", className: address ? 'tw-text-grey-300' : 'tw-text-royal-400', children: address ? address : 'Connect wallet' }), jsxRuntime.jsx(ChevronArrowIcon, { className: address ? 'tw-text-grey-600' : 'tw-text-royal-400' })] })] }) }), jsxRuntime.jsx("div", { className: "tw-px-squid-l", children: jsxRuntime.jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsxRuntime.jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.jsx("input", { className: "tw-h-[55px] tw-w-full 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 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", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsxRuntime.jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.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: jsxRuntime.jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxRuntime.jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsxRuntime.jsx(SwapInputsIcon, {}), jsxRuntime.jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxRuntime.jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsxRuntime.jsx(ArrowTriangle, {}), jsxRuntime.jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxRuntime.jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin', direction === 'to' && 'tw-pointer-events-none'), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balance }), jsxRuntime.jsx(MaxIcon, {})] })] }))] }));
3140
3147
  }
3141
3148
 
3142
3149
  function SwapProgressViewHeader({ title, description, }) {
3143
3150
  return (jsxRuntime.jsxs("header", { className: "tw-flex tw-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsxRuntime.jsx(BodyText, { size: "large", className: "tw-h-squid-m !tw-leading-[20px] tw-text-grey-300", children: title }), jsxRuntime.jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
3144
3151
  }
3145
3152
 
3146
- function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3153
+ function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3147
3154
  // handles if route component is mounted
3148
3155
  const [isRouteVisible, setIsRouteVisible] = react.useState(false);
3149
- const currentStepCount = Math.round(_currentStepCount);
3156
+ const currentStepIndex = Math.round(_currentStepIndex);
3150
3157
  // handles if route component is animating to show
3151
3158
  const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = react.useState(false);
3152
- const currentStep = steps[currentStepCount - 1];
3153
- const isLastStep = currentStepCount === steps.length;
3154
- const isFirstStep = currentStepCount === 1;
3159
+ const currentStep = steps[currentStepIndex];
3160
+ const isLastStep = currentStepIndex === steps.length - 1;
3161
+ const isFirstStep = currentStepIndex === 0;
3155
3162
  react.useEffect(() => {
3156
3163
  // we do not want to unmount the route component if the animation to show route is running
3157
3164
  if (isShowRouteAnimationRunning)
@@ -3159,18 +3166,21 @@ function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3159
3166
  // unmount route component when the animation of hiding is done
3160
3167
  const timeoutId = setTimeout(() => {
3161
3168
  setIsRouteVisible(false);
3162
- }, 350);
3169
+ }, 200);
3163
3170
  return () => {
3164
3171
  clearTimeout(timeoutId);
3165
3172
  };
3166
3173
  }, [isShowRouteAnimationRunning]);
3174
+ const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3167
3175
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full tw-rounded-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { onClick: () => {
3168
3176
  // mount route component and start animation
3169
3177
  setIsRouteVisible(true);
3170
3178
  setIsShowRouteAnimationRunning(true);
3171
- }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsxRuntime.jsx(SwapStepSeparator, {})] })), jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent }), !isFirstStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsxRuntime.jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: cn('tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800', isShowRouteAnimationRunning
3172
- ? 'tw-animate-slide-to-top'
3173
- : 'tw-animate-slide-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: () => setIsShowRouteAnimationRunning(false), className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsxRuntime.jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] }))] }));
3179
+ }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsxRuntime.jsx(SwapStepSeparator, {})] })), currentStep && (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent })), !isFirstStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsxRuntime.jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3180
+ ? 'tw-animate-fade-in'
3181
+ : 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
3182
+ ? 'tw-animate-slide-to-top'
3183
+ : 'tw-animate-slide-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: collapseRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsxRuntime.jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3174
3184
  }
3175
3185
 
3176
3186
  function TokenPair({ firstToken, secondToken }) {
@@ -3180,7 +3190,7 @@ function TokenPair({ firstToken, secondToken }) {
3180
3190
  }
3181
3191
 
3182
3192
  /**
3183
- * Parsing the user readable config to css variables with HSL values
3193
+ * Parsing the user readable config to css variables
3184
3194
  * @param style
3185
3195
  */
3186
3196
  const getParsedStyle = (style) => {
@@ -3274,5 +3284,4 @@ exports.Switch = Switch;
3274
3284
  exports.TokenPair = TokenPair;
3275
3285
  exports.Tooltip = Tooltip;
3276
3286
  exports.UsdAmount = UsdAmount;
3277
- exports.WalletAddress = WalletAddress;
3278
3287
  exports.useModal = useModal;
@@ -1,5 +1,8 @@
1
1
  export declare function ArrowRightIcon(): import("react/jsx-runtime").JSX.Element;
2
- export declare function ChevronArrowIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChevronArrowIcon({ size, className, }: {
3
+ size?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
3
6
  export declare function ArrowTriangle(): import("react/jsx-runtime").JSX.Element;
4
7
  export declare function ChevronTopSmallIcon(): import("react/jsx-runtime").JSX.Element;
5
8
  export declare function ChevronLargeDownIcon({ size }: {
@@ -0,0 +1,8 @@
1
+ export declare function PercentIcon({ size, className, }: {
2
+ size?: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function PathSquareIcon({ size, className, }: {
6
+ size?: string;
7
+ className?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface ModalProps {
3
3
  children: React.ReactNode;
4
+ className?: string;
5
+ onBackdropClick?: () => void;
4
6
  }
5
- export declare function Modal({ children }: ModalProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Modal({ children, className, onBackdropClick }: ModalProps): import("react/jsx-runtime").JSX.Element;
6
8
  export {};
@@ -1,5 +1,5 @@
1
1
  import { SwapStep } from '../../types/components';
2
- export declare function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }: {
2
+ export declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
3
3
  steps: SwapStep[];
4
- currentStepCount: number;
4
+ currentStepIndex: number;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -9,4 +9,3 @@ export * from './SwapConfiguration';
9
9
  export * from './SwapProgressViewHeader';
10
10
  export * from './SwapStepsCollapsed';
11
11
  export * from './TokenPair';
12
- export * from './WalletAddress';
@@ -3,6 +3,7 @@ interface SwapDetailListItemProps {
3
3
  label: string;
4
4
  icon: React.ReactNode;
5
5
  detail?: React.ReactNode;
6
+ isLoading?: boolean;
6
7
  }
7
- export declare function SwapDetailListItem({ label, detail, icon, }: SwapDetailListItemProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function SwapDetailListItem({ label, detail, icon, isLoading, }: SwapDetailListItemProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- children?: string;
4
3
  bold?: boolean;
5
4
  }
6
5
  export declare function CaptionText({ children, bold, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1,3 @@
1
- export declare function SwapDetailsView(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function SwapDetailsView({ isLoading }: {
2
+ isLoading?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,28 +1,11 @@
1
1
  import { ConfigTheme } from '../../types/config';
2
2
  /**
3
- * Converts Hex color to HSL
4
- * Because the current daisy theme only accepts HSL css variables
5
- * @param hex
6
- * @returns HSL string
7
- */
8
- export declare const toHSL: (hex: string) => string;
9
- export declare const generateForegroundColorFrom: (input: string, percentage?: number) => string;
10
- export declare const generateFocusColorFrom: (input: string) => string;
11
- /**
12
- * Parsing the user readable config to css variables with HSL values
3
+ * Parsing the user readable config to css variables
13
4
  * @param style
14
5
  */
15
6
  export declare const getParsedStyle: (style?: ConfigTheme) => {
16
7
  [key: string]: string | undefined;
17
8
  } | undefined;
18
- export declare const isColorDark: (colorHEX: string | undefined) => boolean;
19
- export declare const getListItemHoverClassName: ({ transparentWidget }: {
20
- transparentWidget?: boolean | undefined;
21
- }) => string;
22
- export declare function getDominantColor({ imageUrl, sampleSize, }: {
23
- imageUrl: string;
24
- sampleSize?: number;
25
- }): Promise<number[]>;
26
9
  export declare function getContrastColor({ r, g, b, }: {
27
10
  r: number;
28
11
  g: number;
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const Boosted: Story;
8
+ export declare const Disabled: Story;
@@ -14,3 +14,5 @@ export declare const HighPriceImpact: Story;
14
14
  export declare const IsFetching: Story;
15
15
  export declare const AllProps: Story;
16
16
  export declare const ToDirection: Story;
17
+ export declare const FromAddressEmpty: Story;
18
+ export declare const ToAddressEmpty: Story;
@@ -6,4 +6,5 @@ type Story = StoryObj<typeof meta>;
6
6
  export declare const FirstStep: Story;
7
7
  export declare const MiddleStep: Story;
8
8
  export declare const LastStep: Story;
9
- export declare const LongerRoute: Story;
9
+ export declare const ShortRoute: Story;
10
+ export declare const LongRoute: Story;
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const WithDetail: Story;
8
+ export declare const Loading: Story;
@@ -4,3 +4,4 @@ declare const meta: Meta<typeof SwapDetailsView>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
+ export declare const Loading: Story;
@@ -12,7 +12,6 @@ export type SwapStepDescriptionBlock = {
12
12
  export type SwapStep = {
13
13
  descriptionBlocks: SwapStepDescriptionBlock[];
14
14
  chipContent: React.ReactNode;
15
- routeStepOrder: number;
16
15
  };
17
16
  export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
18
17
  export type ThemeType = 'light' | 'dark';
package/dist/esm/index.js CHANGED
@@ -2586,7 +2586,7 @@ function CaptionText(_a) {
2586
2586
  }
2587
2587
 
2588
2588
  function UsdAmount({ usdAmount }) {
2589
- return (jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsx(CaptionText, { className: "tw-text-grey-500/65", children: "$" }), jsx(CaptionText, { children: usdAmount.toString() })] }));
2589
+ return (jsxs("span", { className: "tw-flex tw-items-center tw-text-grey-500", children: [jsx(CaptionText, { className: "tw-opacity-66", children: "$" }), jsx(CaptionText, { children: usdAmount.toString() })] }));
2590
2590
  }
2591
2591
 
2592
2592
  // font size, line height, and letter spacing classes
@@ -2617,8 +2617,8 @@ function AddressButton(_a) {
2617
2617
  function ArrowRightIcon() {
2618
2618
  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: "M14 6L20 12L14 18M19 12H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2619
2619
  }
2620
- function ChevronArrowIcon() {
2621
- return (jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2620
+ function ChevronArrowIcon({ size = '16', className, }) {
2621
+ return (jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2622
2622
  }
2623
2623
  function ArrowTriangle() {
2624
2624
  return (jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M2.87921 5.55701C2.21562 4.22933 3.18052 2.6665 4.66531 2.6665H11.3348C12.8196 2.6665 13.7845 4.22933 13.1209 5.55701L9.78615 12.229C9.05029 13.7012 6.94983 13.7012 6.21397 12.229L2.87921 5.55701Z", fill: "currentColor" }) }));
@@ -2770,7 +2770,7 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
2770
2770
  }
2771
2771
  return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
2772
2772
  }, [chainBgColor, tokenBgColor]);
2773
- return (jsxs("div", { onClick: onClick, className: "tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center tw-text-grey-100", children: [jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-cursor-pointer 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-cursor-pointer tw-items-center tw-justify-between', tokenImageUrl ? 'tw-w-[90px]' : 'tw-w-full tw-max-w-[72px]'), style: {
2773
+ return (jsxs("button", { onClick: onClick, className: "tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center tw-text-grey-100 focus:tw-outline-none", children: [jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-cursor-pointer 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-cursor-pointer tw-items-center tw-justify-between', tokenImageUrl ? 'tw-w-[90px]' : 'tw-w-full tw-max-w-[72px]'), style: {
2774
2774
  backgroundImage: bgGradient,
2775
2775
  }, children: jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsx(Fragment, { children: jsx(PlusIcon, {}) })) }) }), tokenImageUrl && chainImageUrl ? (jsx("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-rounded-bl-full tw-rounded-tl-full tw-border-b tw-border-t tw-border-material-light-thin'), style: {
2776
2776
  backgroundColor: tokenBgColor,
@@ -2820,19 +2820,19 @@ const switchCircleSizeClassMap = {
2820
2820
  function Switch({ checked = false, onChange, size }) {
2821
2821
  return (
2822
2822
  // Switch container
2823
- 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',
2823
+ jsxs("label", { className: clsx('tw-relative tw-inline-flex tw-cursor-pointer tw-items-center tw-justify-end tw-overflow-hidden tw-rounded-squid-m tw-border tw-border-material-light-thin tw-transition-colors',
2824
2824
  // size styles
2825
2825
  switchSizeClassMap[size],
2826
2826
  // checked styles
2827
2827
  checked ? 'tw-bg-status-positive' : 'tw-bg-grey-800'), children: [jsx("input", { checked: checked, onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked), type: "checkbox", className: "tw-peer tw-sr-only" }), jsx("span", { style: {
2828
2828
  filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
2829
- }, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin',
2829
+ }, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
2830
2830
  // size styles
2831
2831
  switchCircleSizeClassMap[size],
2832
2832
  // disabled and checked styles
2833
2833
  checked
2834
- ? 'tw-right-0.5 tw-bg-grey-100'
2835
- : 'tw-left-0.5 tw-bg-grey-500') })] }));
2834
+ ? 'tw-translate-x-0 tw-bg-grey-100'
2835
+ : '-tw-translate-x-full tw-bg-grey-500') })] }));
2836
2836
  }
2837
2837
 
2838
2838
  const borderRadiusClassMap = {
@@ -2881,9 +2881,9 @@ function BoostButton({ boostMode: _boostMode, onToggleBoostMode, canToggleBoostM
2881
2881
  onToggleBoostMode === null || onToggleBoostMode === void 0 ? void 0 : onToggleBoostMode({ boostMode: 'normal' });
2882
2882
  }
2883
2883
  }
2884
- return (jsx(Tooltip, { tooltipWidth: "max", tooltipContent: canToggleBoostMode ? null : boostDisabledMessage, children: jsxs("div", { onClick: handleToggleBoostMode, className: "tw-relative tw-flex tw-h-squid-xl tw-w-[140px] tw-flex-col tw-justify-between tw-overflow-hidden tw-bg-grey-900 tw-pb-squid-xxs tw-text-grey-300", children: [jsx("span", { className: "tw-via-grey-900/70 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" }), jsx("span", { className: "tw-via-grey-900/70 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" }), jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-flex tw-h-full tw-items-center tw-justify-between tw-transition-transform data-[boost-mode=boost]:tw-animate-move-to-left-with-spring-bounce data-[boost-mode=normal]:tw-animate-move-to-right-with-spring-bounce", children: [jsx("div", { className: "tw-w-1/2 tw-text-center", children: jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxs("div", { className: "tw-w-1/2 tw-text-center", 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: {
2884
+ return (jsx(Tooltip, { tooltipWidth: "max", tooltipContent: canToggleBoostMode ? null : boostDisabledMessage, children: jsxs("button", { onClick: handleToggleBoostMode, disabled: !canToggleBoostMode, className: "tw-group tw-relative tw-flex tw-h-squid-xl tw-w-[140px] tw-flex-col tw-justify-between tw-overflow-hidden tw-bg-grey-900 tw-pb-squid-xxs tw-text-grey-300", children: [jsx("span", { className: "tw-via-grey-900/70 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" }), jsx("span", { className: "tw-via-grey-900/70 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" }), jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-flex tw-h-full tw-w-full tw-items-center tw-justify-between tw-transition-transform group-disabled: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", children: [jsx("div", { className: "tw-w-1/2 tw-text-center group-disabled:tw-grayscale", children: jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxs("div", { className: "tw-w-1/2 tw-text-center group-disabled: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: {
2885
2885
  boxShadow: generateMarkerLines(40),
2886
- } })] }), jsx("div", { className: cn('tw-absolute tw-bottom-0.5 tw-left-[calc(50%-1.5px)] tw-z-20 tw-h-[10px] tw-w-[3px] tw-rounded-sm tw-transition-colors peer-data-[boost-mode=boost]:tw-bg-status-positive peer-data-[boost-mode=normal]:tw-bg-current'), style: {
2886
+ } })] }), jsx("div", { className: cn('tw-absolute tw-bottom-0.5 tw-left-[calc(50%-1.5px)] tw-z-20 tw-h-[10px] tw-w-[3px] tw-rounded-sm tw-transition-colors group-disabled:tw-grayscale peer-data-[boost-mode=boost]:tw-bg-status-positive peer-data-[boost-mode=normal]:tw-bg-current'), style: {
2887
2887
  transitionDuration: animationDuration,
2888
2888
  } })] }) }));
2889
2889
  }
@@ -2944,8 +2944,10 @@ function SettingsButton({ label }) {
2944
2944
  return (jsx("button", { className: "tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs", children: jsx(CaptionText, { children: label }) }));
2945
2945
  }
2946
2946
 
2947
- function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode, }) {
2948
- return (jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' ? 'tw-bg-grey-300' : 'tw-bg-status-positive') })] }));
2947
+ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, }) {
2948
+ return (jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
2949
+ ? 'tw-bg-grey-300'
2950
+ : 'tw-bg-status-positive') })] }));
2949
2951
  }
2950
2952
 
2951
2953
  function EmojiSadIcon() {
@@ -2960,7 +2962,7 @@ const detailStateClassMap = {
2960
2962
  };
2961
2963
  function DetailsToolbar({ state = 'full', errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }) {
2962
2964
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
2963
- return (jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsx(ErrorMessage, { message: errorMessage })) : (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: state === 'loading' ? (jsx(Loader, { size: "32" })) : (jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsx(ChevronLargeDownIcon, {}) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2965
+ return (jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsx(ErrorMessage, { message: errorMessage })) : (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: state === 'loading' ? (jsx(Loader, { size: "32" })) : (jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsx(ChevronLargeDownIcon, {}) })) }), 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 }) })] })) }));
2964
2966
  }
2965
2967
  const ErrorMessage = ({ message }) => {
2966
2968
  return (jsxs("div", { className: "tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-status-negative", children: [jsx(EmojiSadIcon, {}), jsx(CaptionText, { children: message })] }));
@@ -3065,8 +3067,11 @@ function SettingsItem({ icon, label, controls, transparentControls = false, show
3065
3067
  return (jsxs("li", { className: "tw-flex tw-h-[50px] tw-scroll-px-5 tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-grey-900 tw-px-5 tw-py-squid-xs tw-text-grey-300", children: [icon, jsxs("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: [jsx(BodyText, { size: "small", children: label }), showHelpIcon ? jsx(HelpIcon, { className: "tw-text-grey-600" }) : null] }), jsx("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-rounded-squid-xs', transparentControls ? '' : 'tw-bg-grey-800'), children: controls })] }));
3066
3068
  }
3067
3069
 
3068
- function SwapDetailListItem({ label, detail, icon, }) {
3069
- return (jsx("li", { className: "tw-swap-detail-list-item-gradient tw-h-squid-l tw-w-full tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: jsxs("div", { className: "tw-flex tw-h-squid-l tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs tw-px-squid-xs", children: [jsx("div", { className: "tw-h-6 tw-w-6 tw-text-grey-500", children: icon }), jsx(CaptionText, { className: "tw-flex-1 tw-text-grey-500", children: label }), typeof detail === 'string' ? (jsx(CaptionText, { children: detail })) : (detail)] }) }));
3070
+ function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
3071
+ return (jsx("li", { className: "tw-swap-detail-list-item-gradient tw-h-squid-l tw-w-full tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: jsxs("div", { className: "tw-flex tw-h-squid-l tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs tw-px-squid-xs", children: [jsx("div", { className: "tw-h-6 tw-w-6 tw-text-grey-500", children: icon }), jsx(CaptionText, { className: "tw-flex-1 tw-text-grey-500", children: label }), isLoading ? (jsx(LoadingSkeleton, {})) : typeof detail === 'string' ? (jsx(CaptionText, { children: detail })) : (detail)] }) }));
3072
+ }
3073
+ function LoadingSkeleton() {
3074
+ return (jsx("div", { className: "tw-h-squid-xs tw-w-16 tw-animate-pulse tw-rounded-full tw-bg-grey-700" }));
3070
3075
  }
3071
3076
 
3072
3077
  function SwapStepSeparator() {
@@ -3096,10 +3101,16 @@ function DropdownMenu({ dropdownRef, items, className, }) {
3096
3101
  return (jsx("div", { ref: dropdownRef, className: "tw-relative", children: jsx(Menu, { rounded: "sm", containerClassName: cn('tw-absolute tw-right-0 tw-z-20', className), contentClassName: "!tw-p-0", children: jsx("ul", { className: "tw-flex tw-w-[144px] tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-px-0 tw-py-squid-xxs", children: items.map((item) => (jsx(DropdownMenuItem, Object.assign({}, item), item.label))) }) }) }));
3097
3102
  }
3098
3103
 
3099
- function Modal({ children }) {
3104
+ function Modal({ children, className, onBackdropClick }) {
3100
3105
  return (
3101
- // modal container
3102
- jsx("div", { className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-thick tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsx("div", { className: "tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end", children: children }) }));
3106
+ // modal container (backdrop)
3107
+ jsx("div", { onClick: onBackdropClick
3108
+ ? (event) => {
3109
+ if (event.target === event.currentTarget) {
3110
+ onBackdropClick();
3111
+ }
3112
+ }
3113
+ : undefined, className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsx("div", { className: cn('tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className), children: children }) }));
3103
3114
  }
3104
3115
 
3105
3116
  function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
@@ -3122,10 +3133,6 @@ function SwapInputsIcon() {
3122
3133
  return (jsxs("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("g", { "clip-path": "url(#clip0_40_7936)", children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20 10.5C20 16.0228 15.5228 20.5 10 20.5C4.47715 20.5 0 16.0228 0 10.5C0 4.97715 4.47715 0.5 10 0.5C15.5228 0.5 20 4.97715 20 10.5ZM8.38268 4.57612C8.75636 4.7309 9 5.09554 9 5.5V15.5C9 16.0523 8.55228 16.5 8 16.5C7.44772 16.5 7 16.0523 7 15.5V7.91421L5.70711 9.20711C5.31658 9.59763 4.68342 9.59763 4.29289 9.20711C3.90237 8.81658 3.90237 8.18342 4.29289 7.79289L7.29289 4.79289C7.57889 4.5069 8.00901 4.42134 8.38268 4.57612ZM11 15.5C11 15.9045 11.2436 16.2691 11.6173 16.4239C11.991 16.5787 12.4211 16.4931 12.7071 16.2071L15.7071 13.2071C16.0976 12.8166 16.0976 12.1834 15.7071 11.7929C15.3166 11.4024 14.6834 11.4024 14.2929 11.7929L13 13.0858V5.5C13 4.94771 12.5523 4.5 12 4.5C11.4477 4.5 11 4.94771 11 5.5V15.5Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: "clip0_40_7936", children: jsx("rect", { width: "20", height: "20", fill: "white", transform: "translate(0 0.5)" }) }) })] }));
3123
3134
  }
3124
3135
 
3125
- function WalletAddress({ address, ens }) {
3126
- return (jsx("div", { className: "tw-flex tw-items-center tw-gap-1", children: ens || address ? (jsxs(Fragment, { children: [jsx(BodyText, { size: "small", children: ens ? ens : (address === null || address === void 0 ? void 0 : address.slice(0, 6)) + '...' + (address === null || address === void 0 ? void 0 : address.slice(-4)) }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronArrowIcon, {}) })] })) : null }));
3127
- }
3128
-
3129
3136
  function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }) {
3130
3137
  var _a;
3131
3138
  const priceImpactClass = ((_a = Number(priceImpactPercentage)) !== null && _a !== void 0 ? _a : 0) > 5
@@ -3134,22 +3141,22 @@ function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0',
3134
3141
  const isInteractive = direction === 'from';
3135
3142
  // improve accessibility
3136
3143
  const BalanceButtonTag = isInteractive ? 'button' : 'div';
3137
- return (jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxs("button", { onClick: onWalletButtonClick, className: "-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 hover:tw-bg-material-light-thin", children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), address ? (jsx(BodyText, { className: "tw-text-grey-600", size: "small", children: ":" })) : null, jsx(WalletAddress, { ens: address })] }) }), jsx("div", { className: "tw-px-squid-l", children: jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsx("input", { className: "tw-h-[55px] tw-w-full 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 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", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", 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: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsx(SwapInputsIcon, {}), jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsx(ArrowTriangle, {}), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balance }), jsx(MaxIcon, {})] })] }))] }));
3144
+ return (jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxs("button", { onClick: onWalletButtonClick, className: "-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 hover:tw-bg-material-light-thin", children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), jsx(BodyText, { size: "small", children: ":" }), 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 : 'Connect wallet' }), jsx(ChevronArrowIcon, { className: address ? 'tw-text-grey-600' : 'tw-text-royal-400' })] })] }) }), jsx("div", { className: "tw-px-squid-l", children: jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsx("input", { className: "tw-h-[55px] tw-w-full 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 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", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", 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: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsx(SwapInputsIcon, {}), jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsx(ArrowTriangle, {}), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin', direction === 'to' && 'tw-pointer-events-none'), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balance }), jsx(MaxIcon, {})] })] }))] }));
3138
3145
  }
3139
3146
 
3140
3147
  function SwapProgressViewHeader({ title, description, }) {
3141
3148
  return (jsxs("header", { className: "tw-flex tw-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsx(BodyText, { size: "large", className: "tw-h-squid-m !tw-leading-[20px] tw-text-grey-300", children: title }), jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
3142
3149
  }
3143
3150
 
3144
- function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3151
+ function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3145
3152
  // handles if route component is mounted
3146
3153
  const [isRouteVisible, setIsRouteVisible] = useState(false);
3147
- const currentStepCount = Math.round(_currentStepCount);
3154
+ const currentStepIndex = Math.round(_currentStepIndex);
3148
3155
  // handles if route component is animating to show
3149
3156
  const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = useState(false);
3150
- const currentStep = steps[currentStepCount - 1];
3151
- const isLastStep = currentStepCount === steps.length;
3152
- const isFirstStep = currentStepCount === 1;
3157
+ const currentStep = steps[currentStepIndex];
3158
+ const isLastStep = currentStepIndex === steps.length - 1;
3159
+ const isFirstStep = currentStepIndex === 0;
3153
3160
  useEffect(() => {
3154
3161
  // we do not want to unmount the route component if the animation to show route is running
3155
3162
  if (isShowRouteAnimationRunning)
@@ -3157,18 +3164,21 @@ function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3157
3164
  // unmount route component when the animation of hiding is done
3158
3165
  const timeoutId = setTimeout(() => {
3159
3166
  setIsRouteVisible(false);
3160
- }, 350);
3167
+ }, 200);
3161
3168
  return () => {
3162
3169
  clearTimeout(timeoutId);
3163
3170
  };
3164
3171
  }, [isShowRouteAnimationRunning]);
3172
+ const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3165
3173
  return (jsxs(Fragment, { children: [jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full tw-rounded-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxs("button", { onClick: () => {
3166
3174
  // mount route component and start animation
3167
3175
  setIsRouteVisible(true);
3168
3176
  setIsShowRouteAnimationRunning(true);
3169
- }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsx(SwapStepSeparator, {})] })), jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent }), !isFirstStep && (jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxs("div", { className: cn('tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800', isShowRouteAnimationRunning
3170
- ? 'tw-animate-slide-to-top'
3171
- : 'tw-animate-slide-to-bottom'), children: [jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsx("button", { onClick: () => setIsShowRouteAnimationRunning(false), className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] }))] }));
3177
+ }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsx(SwapStepSeparator, {})] })), currentStep && (jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent })), !isFirstStep && (jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3178
+ ? 'tw-animate-fade-in'
3179
+ : 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
3180
+ ? 'tw-animate-slide-to-top'
3181
+ : 'tw-animate-slide-to-bottom'), children: [jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsx("button", { onClick: collapseRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3172
3182
  }
3173
3183
 
3174
3184
  function TokenPair({ firstToken, secondToken }) {
@@ -3178,7 +3188,7 @@ function TokenPair({ firstToken, secondToken }) {
3178
3188
  }
3179
3189
 
3180
3190
  /**
3181
- * Parsing the user readable config to css variables with HSL values
3191
+ * Parsing the user readable config to css variables
3182
3192
  * @param style
3183
3193
  */
3184
3194
  const getParsedStyle = (style) => {
@@ -3235,4 +3245,4 @@ function SquidConfigProvider({ theme, children, themeType = 'light', }) {
3235
3245
  return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: clsx('tw-text-base-content tw-group tw-relative tw-font-geist'), children: children }));
3236
3246
  }
3237
3247
 
3238
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, WalletAddress, useModal };
3248
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useModal };
@@ -1,5 +1,8 @@
1
1
  export declare function ArrowRightIcon(): import("react/jsx-runtime").JSX.Element;
2
- export declare function ChevronArrowIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChevronArrowIcon({ size, className, }: {
3
+ size?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
3
6
  export declare function ArrowTriangle(): import("react/jsx-runtime").JSX.Element;
4
7
  export declare function ChevronTopSmallIcon(): import("react/jsx-runtime").JSX.Element;
5
8
  export declare function ChevronLargeDownIcon({ size }: {
@@ -0,0 +1,8 @@
1
+ export declare function PercentIcon({ size, className, }: {
2
+ size?: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function PathSquareIcon({ size, className, }: {
6
+ size?: string;
7
+ className?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface ModalProps {
3
3
  children: React.ReactNode;
4
+ className?: string;
5
+ onBackdropClick?: () => void;
4
6
  }
5
- export declare function Modal({ children }: ModalProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Modal({ children, className, onBackdropClick }: ModalProps): import("react/jsx-runtime").JSX.Element;
6
8
  export {};
@@ -1,5 +1,5 @@
1
1
  import { SwapStep } from '../../types/components';
2
- export declare function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }: {
2
+ export declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
3
3
  steps: SwapStep[];
4
- currentStepCount: number;
4
+ currentStepIndex: number;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -9,4 +9,3 @@ export * from './SwapConfiguration';
9
9
  export * from './SwapProgressViewHeader';
10
10
  export * from './SwapStepsCollapsed';
11
11
  export * from './TokenPair';
12
- export * from './WalletAddress';
@@ -3,6 +3,7 @@ interface SwapDetailListItemProps {
3
3
  label: string;
4
4
  icon: React.ReactNode;
5
5
  detail?: React.ReactNode;
6
+ isLoading?: boolean;
6
7
  }
7
- export declare function SwapDetailListItem({ label, detail, icon, }: SwapDetailListItemProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function SwapDetailListItem({ label, detail, icon, isLoading, }: SwapDetailListItemProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- children?: string;
4
3
  bold?: boolean;
5
4
  }
6
5
  export declare function CaptionText({ children, bold, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1,3 @@
1
- export declare function SwapDetailsView(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function SwapDetailsView({ isLoading }: {
2
+ isLoading?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,28 +1,11 @@
1
1
  import { ConfigTheme } from '../../types/config';
2
2
  /**
3
- * Converts Hex color to HSL
4
- * Because the current daisy theme only accepts HSL css variables
5
- * @param hex
6
- * @returns HSL string
7
- */
8
- export declare const toHSL: (hex: string) => string;
9
- export declare const generateForegroundColorFrom: (input: string, percentage?: number) => string;
10
- export declare const generateFocusColorFrom: (input: string) => string;
11
- /**
12
- * Parsing the user readable config to css variables with HSL values
3
+ * Parsing the user readable config to css variables
13
4
  * @param style
14
5
  */
15
6
  export declare const getParsedStyle: (style?: ConfigTheme) => {
16
7
  [key: string]: string | undefined;
17
8
  } | undefined;
18
- export declare const isColorDark: (colorHEX: string | undefined) => boolean;
19
- export declare const getListItemHoverClassName: ({ transparentWidget }: {
20
- transparentWidget?: boolean | undefined;
21
- }) => string;
22
- export declare function getDominantColor({ imageUrl, sampleSize, }: {
23
- imageUrl: string;
24
- sampleSize?: number;
25
- }): Promise<number[]>;
26
9
  export declare function getContrastColor({ r, g, b, }: {
27
10
  r: number;
28
11
  g: number;
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const Boosted: Story;
8
+ export declare const Disabled: Story;
@@ -14,3 +14,5 @@ export declare const HighPriceImpact: Story;
14
14
  export declare const IsFetching: Story;
15
15
  export declare const AllProps: Story;
16
16
  export declare const ToDirection: Story;
17
+ export declare const FromAddressEmpty: Story;
18
+ export declare const ToAddressEmpty: Story;
@@ -6,4 +6,5 @@ type Story = StoryObj<typeof meta>;
6
6
  export declare const FirstStep: Story;
7
7
  export declare const MiddleStep: Story;
8
8
  export declare const LastStep: Story;
9
- export declare const LongerRoute: Story;
9
+ export declare const ShortRoute: Story;
10
+ export declare const LongRoute: Story;
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const WithDetail: Story;
8
+ export declare const Loading: Story;
@@ -4,3 +4,4 @@ declare const meta: Meta<typeof SwapDetailsView>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
+ export declare const Loading: Story;
@@ -12,7 +12,6 @@ export type SwapStepDescriptionBlock = {
12
12
  export type SwapStep = {
13
13
  descriptionBlocks: SwapStepDescriptionBlock[];
14
14
  chipContent: React.ReactNode;
15
- routeStepOrder: number;
16
15
  };
17
16
  export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
18
17
  export type ThemeType = 'light' | 'dark';
package/dist/index.css CHANGED
@@ -653,10 +653,6 @@ video {
653
653
  left: 0px;
654
654
  }
655
655
 
656
- .tw-left-0\.5 {
657
- left: 0.125rem;
658
- }
659
-
660
656
  .tw-left-1\/2 {
661
657
  left: 50%;
662
658
  }
@@ -665,12 +661,16 @@ video {
665
661
  left: 1.25rem;
666
662
  }
667
663
 
668
- .tw-left-\[54px\] {
669
- left: 54px;
664
+ .tw-left-\[-14px\] {
665
+ left: -14px;
670
666
  }
671
667
 
672
- .tw-left-\[70\%\] {
673
- left: 70%;
668
+ .tw-left-\[16px\] {
669
+ left: 16px;
670
+ }
671
+
672
+ .tw-left-\[54px\] {
673
+ left: 54px;
674
674
  }
675
675
 
676
676
  .tw-left-\[calc\(50\%-1\.5px\)\] {
@@ -681,10 +681,6 @@ video {
681
681
  right: 0px;
682
682
  }
683
683
 
684
- .tw-right-0\.5 {
685
- right: 0.125rem;
686
- }
687
-
688
684
  .tw-right-1 {
689
685
  right: 0.25rem;
690
686
  }
@@ -987,6 +983,10 @@ video {
987
983
  max-height: 535px;
988
984
  }
989
985
 
986
+ .tw-max-h-\[536px\] {
987
+ max-height: 536px;
988
+ }
989
+
990
990
  .tw-max-h-\[540px\] {
991
991
  max-height: 540px;
992
992
  }
@@ -1051,6 +1051,10 @@ video {
1051
1051
  width: 3rem;
1052
1052
  }
1053
1053
 
1054
+ .tw-w-16 {
1055
+ width: 4rem;
1056
+ }
1057
+
1054
1058
  .tw-w-36 {
1055
1059
  width: 9rem;
1056
1060
  }
@@ -1075,6 +1079,10 @@ video {
1075
1079
  width: 2rem;
1076
1080
  }
1077
1081
 
1082
+ .tw-w-96 {
1083
+ width: 24rem;
1084
+ }
1085
+
1078
1086
  .tw-w-\[1\.5px\] {
1079
1087
  width: 1.5px;
1080
1088
  }
@@ -1288,6 +1296,16 @@ video {
1288
1296
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1289
1297
  }
1290
1298
 
1299
+ .-tw-translate-x-full {
1300
+ --tw-translate-x: -100%;
1301
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1302
+ }
1303
+
1304
+ .tw-translate-x-0 {
1305
+ --tw-translate-x: 0px;
1306
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1307
+ }
1308
+
1291
1309
  .tw-translate-x-1\/4 {
1292
1310
  --tw-translate-x: 25%;
1293
1311
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
@@ -1298,6 +1316,44 @@ video {
1298
1316
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1299
1317
  }
1300
1318
 
1319
+ @keyframes tw-fade-in {
1320
+ 0% {
1321
+ opacity: 0;
1322
+ }
1323
+
1324
+ 100% {
1325
+ opacity: 1;
1326
+ }
1327
+ }
1328
+
1329
+ .tw-animate-fade-in {
1330
+ animation: tw-fade-in 0.2s ease-out both;
1331
+ }
1332
+
1333
+ @keyframes tw-fade-out {
1334
+ 0% {
1335
+ opacity: 1;
1336
+ }
1337
+
1338
+ 100% {
1339
+ opacity: 0;
1340
+ }
1341
+ }
1342
+
1343
+ .tw-animate-fade-out {
1344
+ animation: tw-fade-out 0.2s ease-out both;
1345
+ }
1346
+
1347
+ @keyframes tw-pulse {
1348
+ 50% {
1349
+ opacity: .5;
1350
+ }
1351
+ }
1352
+
1353
+ .tw-animate-pulse {
1354
+ animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
1355
+ }
1356
+
1301
1357
  @keyframes tw-slide-to-bottom {
1302
1358
  0% {
1303
1359
  transform: translateY(0);
@@ -1311,7 +1367,7 @@ video {
1311
1367
  }
1312
1368
 
1313
1369
  .tw-animate-slide-to-bottom {
1314
- animation: tw-slide-to-bottom 0.35s ease-out both;
1370
+ animation: tw-slide-to-bottom 0.2s ease-out both;
1315
1371
  }
1316
1372
 
1317
1373
  @keyframes tw-slide-to-top {
@@ -1644,6 +1700,10 @@ video {
1644
1700
  background-color: var(--squid-theme-grey-500);
1645
1701
  }
1646
1702
 
1703
+ .tw-bg-grey-700 {
1704
+ background-color: var(--squid-theme-grey-700);
1705
+ }
1706
+
1647
1707
  .tw-bg-grey-800 {
1648
1708
  background-color: var(--squid-theme-grey-800);
1649
1709
  }
@@ -1656,6 +1716,10 @@ video {
1656
1716
  background-color: inherit;
1657
1717
  }
1658
1718
 
1719
+ .tw-bg-material-dark-average {
1720
+ background-color: var(--squid-theme-material-dark-average);
1721
+ }
1722
+
1659
1723
  .tw-bg-material-dark-thick {
1660
1724
  background-color: var(--squid-theme-material-dark-thick);
1661
1725
  }
@@ -1694,10 +1758,6 @@ video {
1694
1758
  background-color: transparent;
1695
1759
  }
1696
1760
 
1697
- .tw-bg-opacity-70 {
1698
- --tw-bg-opacity: 0.7;
1699
- }
1700
-
1701
1761
  .tw-bg-gradient-to-b {
1702
1762
  background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
1703
1763
  }
@@ -2261,6 +2321,12 @@ video {
2261
2321
  outline-color: var(--squid-theme-material-light-thin);
2262
2322
  }
2263
2323
 
2324
+ .tw-backdrop-blur-2xl {
2325
+ --tw-backdrop-blur: blur(40px);
2326
+ -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2327
+ backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2328
+ }
2329
+
2264
2330
  .tw-backdrop-blur\/10 {
2265
2331
  --tw-backdrop-blur: blur(10px);
2266
2332
  -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
@@ -2279,6 +2345,12 @@ video {
2279
2345
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2280
2346
  }
2281
2347
 
2348
+ .tw-transition-all {
2349
+ transition-property: all;
2350
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2351
+ transition-duration: 150ms;
2352
+ }
2353
+
2282
2354
  .tw-transition-colors {
2283
2355
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
2284
2356
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -2422,6 +2494,11 @@ li {
2422
2494
  opacity: 1;
2423
2495
  }
2424
2496
 
2497
+ .tw-group:disabled .group-disabled\:tw-grayscale {
2498
+ --tw-grayscale: grayscale(100%);
2499
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2500
+ }
2501
+
2425
2502
  .tw-peer:hover ~ .peer-hover\:tw-block {
2426
2503
  display: block;
2427
2504
  }
package/dist/index.d.ts CHANGED
@@ -55,7 +55,6 @@ type SwapStepDescriptionBlock = {
55
55
  type SwapStep = {
56
56
  descriptionBlocks: SwapStepDescriptionBlock[];
57
57
  chipContent: React.ReactNode;
58
- routeStepOrder: number;
59
58
  };
60
59
  type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
61
60
  type ThemeType = 'light' | 'dark';
@@ -222,8 +221,9 @@ interface SwapDetailListItemProps {
222
221
  label: string;
223
222
  icon: React.ReactNode;
224
223
  detail?: React.ReactNode;
224
+ isLoading?: boolean;
225
225
  }
226
- declare function SwapDetailListItem({ label, detail, icon, }: SwapDetailListItemProps): react_jsx_runtime.JSX.Element;
226
+ declare function SwapDetailListItem({ label, detail, icon, isLoading, }: SwapDetailListItemProps): react_jsx_runtime.JSX.Element;
227
227
 
228
228
  interface SwapStepItemProps {
229
229
  descriptionBlocks: SwapStepDescriptionBlock[];
@@ -251,8 +251,10 @@ declare function Menu({ children, containerClassName, contentClassName, title, d
251
251
 
252
252
  interface ModalProps {
253
253
  children: React.ReactNode;
254
+ className?: string;
255
+ onBackdropClick?: () => void;
254
256
  }
255
- declare function Modal({ children }: ModalProps): react_jsx_runtime.JSX.Element;
257
+ declare function Modal({ children, className, onBackdropClick }: ModalProps): react_jsx_runtime.JSX.Element;
256
258
 
257
259
  interface NavigationBarProps {
258
260
  title?: string;
@@ -302,9 +304,9 @@ interface SwapProgressViewHeaderProps {
302
304
  }
303
305
  declare function SwapProgressViewHeader({ title, description, }: SwapProgressViewHeaderProps): react_jsx_runtime.JSX.Element;
304
306
 
305
- declare function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }: {
307
+ declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
306
308
  steps: SwapStep[];
307
- currentStepCount: number;
309
+ currentStepIndex: number;
308
310
  }): react_jsx_runtime.JSX.Element;
309
311
 
310
312
  interface TokenPairProps {
@@ -319,12 +321,6 @@ interface TokenPairProps {
319
321
  }
320
322
  declare function TokenPair({ firstToken, secondToken }: TokenPairProps): react_jsx_runtime.JSX.Element;
321
323
 
322
- interface WalletAddressProps {
323
- ens?: string;
324
- address?: string;
325
- }
326
- declare function WalletAddress({ address, ens }: WalletAddressProps): react_jsx_runtime.JSX.Element;
327
-
328
324
  interface BodyTextProps extends React.HTMLAttributes<HTMLSpanElement> {
329
325
  children: string | undefined;
330
326
  size: TextSize;
@@ -333,7 +329,6 @@ interface BodyTextProps extends React.HTMLAttributes<HTMLSpanElement> {
333
329
  declare function BodyText({ size, children, bold, ...props }: BodyTextProps): react_jsx_runtime.JSX.Element;
334
330
 
335
331
  interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
336
- children?: string;
337
332
  bold?: boolean;
338
333
  }
339
334
  declare function CaptionText({ children, bold, ...props }: CaptionProps): react_jsx_runtime.JSX.Element;
@@ -397,4 +392,4 @@ declare function useModal(props?: {
397
392
  openModalButtonRef: React.RefObject<HTMLButtonElement>;
398
393
  };
399
394
 
400
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipThreshold, type TooltipWidth, UsdAmount, WalletAddress, useModal };
395
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipThreshold, type TooltipWidth, UsdAmount, useModal };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/squid-ui.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.6.1",
8
+ "version": "0.6.3",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "scripts": {
@@ -1,6 +0,0 @@
1
- interface WalletAddressProps {
2
- ens?: string;
3
- address?: string;
4
- }
5
- export declare function WalletAddress({ address, ens }: WalletAddressProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1 +0,0 @@
1
- export declare const formatWalletAddress: (walletAddress: string | undefined, trimLength?: number) => string;
@@ -1,6 +0,0 @@
1
- interface WalletAddressProps {
2
- ens?: string;
3
- address?: string;
4
- }
5
- export declare function WalletAddress({ address, ens }: WalletAddressProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1 +0,0 @@
1
- export declare const formatWalletAddress: (walletAddress: string | undefined, trimLength?: number) => string;