@0xsquid/ui 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/cjs/index.js +49 -41
  2. package/dist/cjs/types/components/buttons/BoostButton.d.ts +1 -1
  3. package/dist/cjs/types/components/controls/Switch.d.ts +2 -1
  4. package/dist/cjs/types/components/icons/Arrow.d.ts +4 -1
  5. package/dist/cjs/types/components/icons/Heart.d.ts +9 -3
  6. package/dist/cjs/types/components/layout/DetailsToolbar.d.ts +6 -2
  7. package/dist/cjs/types/components/layout/ErrorMessage.d.ts +3 -0
  8. package/dist/cjs/types/components/layout/Modal.d.ts +3 -1
  9. package/dist/cjs/types/components/layout/ProductCard.d.ts +1 -5
  10. package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +4 -1
  11. package/dist/cjs/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
  12. package/dist/cjs/types/components/layout/index.d.ts +1 -1
  13. package/dist/cjs/types/components/lists/ListItem.d.ts +3 -1
  14. package/dist/cjs/types/components/views/AssetsView.d.ts +2 -6
  15. package/dist/cjs/types/services/internal/colorService.d.ts +1 -18
  16. package/dist/cjs/types/stories/controls/Switch.stories.d.ts +2 -0
  17. package/dist/cjs/types/stories/layout/DetailsToolbar.stories.d.ts +1 -0
  18. package/dist/cjs/types/stories/layout/ErrorMessage.stories.d.ts +6 -0
  19. package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +3 -0
  20. package/dist/{esm/types/stories/layout/SwapProgressView.stories.d.ts → cjs/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
  21. package/dist/cjs/types/stories/lists/ListItem.stories.d.ts +3 -0
  22. package/dist/cjs/types/types/components.d.ts +0 -1
  23. package/dist/esm/index.js +49 -41
  24. package/dist/esm/types/components/buttons/BoostButton.d.ts +1 -1
  25. package/dist/esm/types/components/controls/Switch.d.ts +2 -1
  26. package/dist/esm/types/components/icons/Arrow.d.ts +4 -1
  27. package/dist/esm/types/components/icons/Heart.d.ts +9 -3
  28. package/dist/esm/types/components/layout/DetailsToolbar.d.ts +6 -2
  29. package/dist/esm/types/components/layout/ErrorMessage.d.ts +3 -0
  30. package/dist/esm/types/components/layout/Modal.d.ts +3 -1
  31. package/dist/esm/types/components/layout/ProductCard.d.ts +1 -5
  32. package/dist/esm/types/components/layout/SwapConfiguration.d.ts +4 -1
  33. package/dist/esm/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
  34. package/dist/esm/types/components/layout/index.d.ts +1 -1
  35. package/dist/esm/types/components/lists/ListItem.d.ts +3 -1
  36. package/dist/esm/types/components/views/AssetsView.d.ts +2 -6
  37. package/dist/esm/types/services/internal/colorService.d.ts +1 -18
  38. package/dist/esm/types/stories/controls/Switch.stories.d.ts +2 -0
  39. package/dist/esm/types/stories/layout/DetailsToolbar.stories.d.ts +1 -0
  40. package/dist/esm/types/stories/layout/ErrorMessage.stories.d.ts +6 -0
  41. package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +3 -0
  42. package/dist/{cjs/types/stories/layout/SwapProgressView.stories.d.ts → esm/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
  43. package/dist/esm/types/stories/lists/ListItem.stories.d.ts +3 -0
  44. package/dist/esm/types/types/components.d.ts +0 -1
  45. package/dist/index.css +73 -39
  46. package/dist/index.d.ts +27 -21
  47. package/package.json +1 -1
  48. package/dist/cjs/types/components/layout/WalletAddress.d.ts +0 -6
  49. package/dist/cjs/types/services/internal/walletService.d.ts +0 -1
  50. package/dist/esm/types/components/layout/WalletAddress.d.ts +0 -6
  51. package/dist/esm/types/services/internal/walletService.d.ts +0 -1
package/dist/esm/index.js CHANGED
@@ -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" }) }));
@@ -2817,14 +2817,16 @@ const switchCircleSizeClassMap = {
2817
2817
  small: 'tw-w-4 tw-h-4',
2818
2818
  large: 'tw-w-6 tw-h-6',
2819
2819
  };
2820
- function Switch({ checked = false, onChange, size }) {
2820
+ function Switch({ checked = false, onChange, size, disabled = false, }) {
2821
2821
  return (
2822
2822
  // Switch container
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',
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 tw-transition-colors',
2824
2824
  // size styles
2825
2825
  switchSizeClassMap[size],
2826
2826
  // checked styles
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: {
2827
+ checked ? 'tw-bg-status-positive' : 'tw-bg-grey-800',
2828
+ // disabled styles
2829
+ disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'), children: [jsx("input", { disabled: disabled, checked: checked, onChange: disabled ? undefined : (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked), type: "checkbox", className: "tw-peer tw-sr-only" }), jsx("span", { style: {
2828
2830
  filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
2829
2831
  }, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
2830
2832
  // size styles
@@ -2862,10 +2864,8 @@ function Tooltip({ children, tooltipContent, tooltipWidth = 'container', thresho
2862
2864
  }
2863
2865
 
2864
2866
  const animationDuration = '500ms';
2865
- function BoostButton({ boostMode: _boostMode, onToggleBoostMode, canToggleBoostMode = true, boostDisabledMessage = 'Boost disabled', }) {
2867
+ function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode = true, boostDisabledMessage = 'Boost disabled', }) {
2866
2868
  const boostIndicatorRef = useRef(null);
2867
- // force normal mode if canToggleBoostMode is false
2868
- const boostMode = canToggleBoostMode ? _boostMode : 'normal';
2869
2869
  function handleToggleBoostMode() {
2870
2870
  if (!boostIndicatorRef.current || !canToggleBoostMode)
2871
2871
  return;
@@ -2944,8 +2944,8 @@ 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' || boostDisabledMessage
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
2949
  ? 'tw-bg-grey-300'
2950
2950
  : 'tw-bg-status-positive') })] }));
2951
2951
  }
@@ -2954,19 +2954,20 @@ function EmojiSadIcon() {
2954
2954
  return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20ZM13.5341 12.4645C11.5815 10.5118 8.41568 10.5118 6.46306 12.4645C6.07254 12.855 6.07254 13.4882 6.46306 13.8787C6.85358 14.2692 7.48675 14.2692 7.87727 13.8787C9.04885 12.7071 10.9483 12.7071 12.1199 13.8787C12.5104 14.2692 13.1436 14.2692 13.5341 13.8787C13.9247 13.4882 13.9247 12.855 13.5341 12.4645ZM8.5 7.5C8.5 8.32843 7.94036 9 7.25 9C6.55964 9 6 8.32843 6 7.5C6 6.67157 6.55964 6 7.25 6C7.94036 6 8.5 6.67157 8.5 7.5ZM12.75 9C13.4404 9 14 8.32843 14 7.5C14 6.67157 13.4404 6 12.75 6C12.0596 6 11.5 6.67157 11.5 7.5C11.5 8.32843 12.0596 9 12.75 9Z", fill: "currentColor" }) }));
2955
2955
  }
2956
2956
 
2957
+ function ErrorMessage({ message }) {
2958
+ 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 })] }));
2959
+ }
2960
+
2957
2961
  const detailStateClassMap = {
2958
2962
  loading: 'tw-opacity-33 tw-pointer-events-none',
2959
2963
  empty: 'tw-pointer-events-none tw-hidden',
2960
2964
  error: 'tw-opacity-33 tw-pointer-events-none',
2961
2965
  full: '',
2962
2966
  };
2963
- function DetailsToolbar({ state = 'full', errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }) {
2967
+ function DetailsToolbar({ state = 'full', errorMessage = 'Something went wrong', boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, }) {
2964
2968
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
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: canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2969
+ return (jsx("aside", { className: cn('tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500', state === 'error' ? 'tw-px-squid-l' : 'tw-px-squid-m'), children: state === 'error' && errorMessage ? (jsxs(Fragment, { children: [jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsx(Button, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: 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 }) })] })) }));
2966
2970
  }
2967
- const ErrorMessage = ({ message }) => {
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 })] }));
2969
- };
2970
2971
 
2971
2972
  function DropdownMenuItem({ label, imageUrl, icon, labelClassName, }) {
2972
2973
  return (jsx("li", { className: "tw-max-h-squid-xl tw-w-full tw-px-squid-xxs", children: jsxs("div", { className: "tw-flex tw-h-squid-l tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-squid-xs tw-pl-squid-xxs hover:tw-bg-material-light-thin", children: [jsx("div", { className: "tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-between tw-rounded-squid-xs", children: imageUrl ? (jsx("img", { src: imageUrl, className: "tw-h-full tw-w-full tw-rounded-squid-xxs" })) : (icon) }), jsx(CaptionText, { className: labelClassName, children: label })] }) }));
@@ -3045,10 +3046,12 @@ const listItemSizeMap = {
3045
3046
  large: 'tw-max-w-list-item-large tw-h-list-item-large tw-px-squid-xs',
3046
3047
  };
3047
3048
  function ListItem(_a) {
3048
- var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected"]);
3049
- return (jsx("li", Object.assign({}, props, { className: cn('tw-flex tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs("div", { className: cn('tw-flex tw-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && 'tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: false })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-w-full tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xs',
3049
+ var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly"]);
3050
+ return (jsx("li", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs("div", { className: cn('tw-flex tw-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && 'tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: false })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-w-full tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xs',
3050
3051
  // 'large' variant has extra padding
3051
- size === 'large' && 'tw-px-squid-xxs'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: "tw-truncate !tw-leading-[18px]", children: itemTitle })) : (itemTitle), size === 'large' && subtitle ? (jsx(CaptionText, { className: "tw-h-squid-xs !tw-leading-[10px] tw-text-grey-500", children: subtitle })) : null] }), jsxs("span", { className: "tw-flex tw-max-h-4 tw-items-center", children: [size === 'large' ? (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })) : null, jsx("span", { className: "min-tw-w-4 min-tw-h-4", children: icon ? icon : null })] })] }) })));
3052
+ size === 'large' && 'tw-px-squid-xxs'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: "tw-truncate !tw-leading-[18px]", children: itemTitle })) : (itemTitle), size === 'large' && subtitle ? (jsx(CaptionText, { className: "tw-h-squid-xs !tw-leading-[10px] tw-text-grey-500", children: subtitle })) : null] }), jsxs("button", { onClick: onDetailClick, className: cn('tw-cursor-pointer tw-items-center tw-justify-center tw-rounded-squid-xs hover:tw-bg-material-light-thin', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
3053
+ ? 'tw-hidden group-hover/list-item:tw-flex'
3054
+ : 'tw-flex'), children: [size === 'large' && detail ? (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })) : null, icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })] }) })));
3052
3055
  }
3053
3056
 
3054
3057
  function MenuItem({ label, imageUrl, icon }) {
@@ -3068,10 +3071,10 @@ function SettingsItem({ icon, label, controls, transparentControls = false, show
3068
3071
  }
3069
3072
 
3070
3073
  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)] }) }));
3074
+ 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, { className: "tw-text-grey-500" })) : typeof detail === 'string' ? (jsx(CaptionText, { children: detail })) : (detail)] }) }));
3072
3075
  }
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" }));
3076
+ function LoadingSkeleton({ className }) {
3077
+ return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: "20", viewBox: "0 0 100 20", fill: "none", className: className, children: [jsxs("g", { "clip-path": "url(#clip0_1083_18992)", children: [jsx("mask", { id: "mask0_1083_18992", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "100", height: "20", children: jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1083_18992)" }) }), jsx("g", { mask: "url(#mask0_1083_18992)", children: jsx("rect", { width: "100", height: "20", fill: "currentColor" }) })] }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_1083_18992", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient", children: [jsx("stop", { "stop-color": "#D9D9D9", "stop-opacity": "0.33" }), jsx("stop", { offset: "0.395881", "stop-color": "#737373", "stop-opacity": "0.33" }), jsx("stop", { offset: "0.597867", "stop-color": "#737373", "stop-opacity": "0.66" }), jsx("stop", { offset: "0.697004", "stop-color": "#737373", "stop-opacity": "0.33" })] }), jsx("clipPath", { id: "clip0_1083_18992", children: jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] })] }));
3075
3078
  }
3076
3079
 
3077
3080
  function SwapStepSeparator() {
@@ -3101,10 +3104,16 @@ function DropdownMenu({ dropdownRef, items, className, }) {
3101
3104
  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))) }) }) }));
3102
3105
  }
3103
3106
 
3104
- function Modal({ children }) {
3107
+ function Modal({ children, className, onBackdropClick }) {
3105
3108
  return (
3106
- // modal container
3107
- 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 }) }));
3109
+ // modal container (backdrop)
3110
+ jsx("div", { onClick: onBackdropClick
3111
+ ? (event) => {
3112
+ if (event.target === event.currentTarget) {
3113
+ onBackdropClick();
3114
+ }
3115
+ }
3116
+ : 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 }) }));
3108
3117
  }
3109
3118
 
3110
3119
  function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
@@ -3127,11 +3136,7 @@ function SwapInputsIcon() {
3127
3136
  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)" }) }) })] }));
3128
3137
  }
3129
3138
 
3130
- function WalletAddress({ address, ens }) {
3131
- 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 }));
3132
- }
3133
-
3134
- function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }) {
3139
+ function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, error, }) {
3135
3140
  var _a;
3136
3141
  const priceImpactClass = ((_a = Number(priceImpactPercentage)) !== null && _a !== void 0 ? _a : 0) > 5
3137
3142
  ? 'tw-text-status-negative'
@@ -3139,22 +3144,22 @@ function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0',
3139
3144
  const isInteractive = direction === 'from';
3140
3145
  // improve accessibility
3141
3146
  const BalanceButtonTag = isInteractive ? 'button' : 'div';
3142
- 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, {})] })] }))] }));
3147
+ 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: [error ? (jsx("div", { className: "tw-px-squid-xs", children: jsx(ErrorMessage, { message: error.message }) })) : (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, {})] })] }))] }));
3143
3148
  }
3144
3149
 
3145
3150
  function SwapProgressViewHeader({ title, description, }) {
3146
3151
  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 })] }));
3147
3152
  }
3148
3153
 
3149
- function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3154
+ function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3150
3155
  // handles if route component is mounted
3151
3156
  const [isRouteVisible, setIsRouteVisible] = useState(false);
3152
- const currentStepCount = Math.round(_currentStepCount);
3157
+ const currentStepIndex = Math.round(_currentStepIndex);
3153
3158
  // handles if route component is animating to show
3154
3159
  const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = useState(false);
3155
- const currentStep = steps[currentStepCount - 1];
3156
- const isLastStep = currentStepCount === steps.length;
3157
- const isFirstStep = currentStepCount === 1;
3160
+ const currentStep = steps[currentStepIndex];
3161
+ const isLastStep = currentStepIndex === steps.length - 1;
3162
+ const isFirstStep = currentStepIndex === 0;
3158
3163
  useEffect(() => {
3159
3164
  // we do not want to unmount the route component if the animation to show route is running
3160
3165
  if (isShowRouteAnimationRunning)
@@ -3162,18 +3167,21 @@ function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3162
3167
  // unmount route component when the animation of hiding is done
3163
3168
  const timeoutId = setTimeout(() => {
3164
3169
  setIsRouteVisible(false);
3165
- }, 350);
3170
+ }, 200);
3166
3171
  return () => {
3167
3172
  clearTimeout(timeoutId);
3168
3173
  };
3169
3174
  }, [isShowRouteAnimationRunning]);
3175
+ const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3170
3176
  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: () => {
3171
3177
  // mount route component and start animation
3172
3178
  setIsRouteVisible(true);
3173
3179
  setIsShowRouteAnimationRunning(true);
3174
- }, 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
3175
- ? 'tw-animate-slide-to-top'
3176
- : '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" }) })] }))] }));
3180
+ }, 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
3181
+ ? 'tw-animate-fade-in'
3182
+ : '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
3183
+ ? 'tw-animate-slide-to-top'
3184
+ : '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" }) })] })] }))] }));
3177
3185
  }
3178
3186
 
3179
3187
  function TokenPair({ firstToken, secondToken }) {
@@ -3183,7 +3191,7 @@ function TokenPair({ firstToken, secondToken }) {
3183
3191
  }
3184
3192
 
3185
3193
  /**
3186
- * Parsing the user readable config to css variables with HSL values
3194
+ * Parsing the user readable config to css variables
3187
3195
  * @param style
3188
3196
  */
3189
3197
  const getParsedStyle = (style) => {
@@ -3240,4 +3248,4 @@ function SquidConfigProvider({ theme, children, themeType = 'light', }) {
3240
3248
  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 }));
3241
3249
  }
3242
3250
 
3243
- 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 };
3251
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, 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 };
@@ -7,5 +7,5 @@ interface BoostButtonProps {
7
7
  }) => void;
8
8
  boostDisabledMessage?: string;
9
9
  }
10
- export declare function BoostButton({ boostMode: _boostMode, onToggleBoostMode, canToggleBoostMode, boostDisabledMessage, }: BoostButtonProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode, boostDisabledMessage, }: BoostButtonProps): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -3,6 +3,7 @@ interface SwitchProps {
3
3
  checked?: boolean;
4
4
  onChange?: (checked: boolean) => void;
5
5
  size: SwitchSize;
6
+ disabled?: boolean;
6
7
  }
7
- export declare function Switch({ checked, onChange, size }: SwitchProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function Switch({ checked, onChange, size, disabled, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -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 }: {
@@ -1,4 +1,10 @@
1
- export declare function EmptyHeartIcon(): import("react/jsx-runtime").JSX.Element;
2
- export declare function FilledHeartIcon(): import("react/jsx-runtime").JSX.Element;
3
- export declare function BrokenHeartIcon(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function EmptyHeartIcon({ className }: {
2
+ className?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export declare function FilledHeartIcon({ className }: {
5
+ className?: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export declare function BrokenHeartIcon({ className }: {
8
+ className?: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
4
10
  export declare function HeartSmallIcon(): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { BoostMode, DetailsToolbarState } from '../../types/components';
2
2
  interface DetailsToolbarProps {
3
3
  state?: DetailsToolbarState;
4
- errorMessage: string;
4
+ errorMessage?: string;
5
5
  boostMode?: BoostMode;
6
6
  onToggleBoostMode?: ({ boostMode }: {
7
7
  boostMode: BoostMode;
@@ -12,6 +12,10 @@ interface DetailsToolbarProps {
12
12
  estimatedTime?: string;
13
13
  canToggleBoostMode?: boolean;
14
14
  boostDisabledMessage?: string;
15
+ helpButton?: {
16
+ label: string;
17
+ onClick: () => void;
18
+ };
15
19
  }
16
- export declare function DetailsToolbar({ state, errorMessage, boostMode, onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }: DetailsToolbarProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function DetailsToolbar({ state, errorMessage, boostMode, onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, }: DetailsToolbarProps): import("react/jsx-runtime").JSX.Element;
17
21
  export {};
@@ -0,0 +1,3 @@
1
+ export declare function ErrorMessage({ message }: {
2
+ message: string;
3
+ }): 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,6 +1,2 @@
1
1
  /// <reference types="react" />
2
- interface ProductCardProps {
3
- children?: React.ReactNode;
4
- }
5
- export declare function ProductCard({ children }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
2
+ export declare function ProductCard({ children }: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -21,6 +21,9 @@ interface SwapConfigurationProps {
21
21
  onAmountChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
22
22
  onWalletButtonClick?: () => void;
23
23
  onAssetsButtonClick?: () => void;
24
+ error?: {
25
+ message: string;
26
+ };
24
27
  }
25
- export declare function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd, balance, isFetching, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd, balance, isFetching, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, error, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
26
29
  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;
@@ -1,6 +1,7 @@
1
1
  export * from './Boost';
2
2
  export * from './DetailsToolbar';
3
3
  export * from './DropdownMenu';
4
+ export * from './ErrorMessage';
4
5
  export * from './Menu';
5
6
  export * from './Modal';
6
7
  export * from './NavigationBar';
@@ -9,4 +10,3 @@ export * from './SwapConfiguration';
9
10
  export * from './SwapProgressViewHeader';
10
11
  export * from './SwapStepsCollapsed';
11
12
  export * from './TokenPair';
12
- export * from './WalletAddress';
@@ -10,7 +10,9 @@ interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
10
10
  mainIcon?: React.ReactNode;
11
11
  isSelected?: boolean;
12
12
  className?: string;
13
+ onDetailClick?: () => void;
14
+ showDetailOnHoverOnly?: boolean;
13
15
  }
14
16
  type ListItemSize = 'small' | 'large';
15
- export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
16
18
  export {};
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  interface AssetsViewProps {
3
3
  chains: {
4
4
  name: string;
@@ -25,9 +25,5 @@ interface AssetsViewProps {
25
25
  }[];
26
26
  }
27
27
  export declare function AssetsView({ chains, favoriteTokens, popularTokens, userTokens, }: AssetsViewProps): import("react/jsx-runtime").JSX.Element;
28
- export declare const List: ({ children }: {
29
- children: ReactNode;
30
- }) => import("react/jsx-runtime").JSX.Element;
31
- export declare const AddFavoriteToken: () => import("react/jsx-runtime").JSX.Element;
32
- export declare const RemoveFavoriteToken: () => import("react/jsx-runtime").JSX.Element;
28
+ export declare const List: ({ children }: React.PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
33
29
  export {};
@@ -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,5 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const LargeChecked: Story;
7
7
  export declare const LargeUnchecked: Story;
8
+ export declare const LargeDisabled: Story;
8
9
  export declare const SmallChecked: Story;
9
10
  export declare const SmallUnchecked: Story;
11
+ export declare const SmallDisabled: Story;
@@ -7,4 +7,5 @@ export declare const Default: Story;
7
7
  export declare const Loading: Story;
8
8
  export declare const Empty: Story;
9
9
  export declare const Error: Story;
10
+ export declare const ErrorHelpButton: Story;
10
11
  export declare const BoostDisabled: Story;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { ErrorMessage } from '../../components/layout/ErrorMessage';
3
+ declare const meta: Meta<typeof ErrorMessage>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
@@ -14,3 +14,6 @@ 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;
19
+ export declare const Error: 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;
@@ -7,10 +7,13 @@ export declare const Large: Story;
7
7
  export declare const LargeWithSubtitle: Story;
8
8
  export declare const LargeWithDetail: Story;
9
9
  export declare const LargeWithIcon: Story;
10
+ export declare const LargeWithDetailAndIcon: Story;
11
+ export declare const LargeShowDetailOnHoverOnly: Story;
10
12
  export declare const LargeWithSecondaryImage: Story;
11
13
  export declare const LargeSelected: Story;
12
14
  export declare const LargeWithCustomIconAsImage: Story;
13
15
  export declare const Small: Story;
14
16
  export declare const SmallWithIcon: Story;
17
+ export declare const SmallShowDetailOnHoverOnly: Story;
15
18
  export declare const SmallSelected: Story;
16
19
  export declare const SmallWithCustomIconAsImage: 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';