@0xsquid/ui 0.15.4 → 0.15.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/cjs/index.js +83 -38
  2. package/dist/cjs/types/components/buttons/AssetsButton.d.ts +3 -1
  3. package/dist/cjs/types/components/lists/HistoryItem.d.ts +1 -1
  4. package/dist/cjs/types/components/lists/ListItem.d.ts +2 -1
  5. package/dist/cjs/types/components/lists/SwapStepItem.d.ts +1 -0
  6. package/dist/cjs/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
  7. package/dist/cjs/types/stories/layout/SwapStepsCollapsed.stories.d.ts +1 -0
  8. package/dist/cjs/types/stories/lists/ListItem.stories.d.ts +2 -0
  9. package/dist/cjs/types/stories/lists/SwapStepItem.stories.d.ts +1 -0
  10. package/dist/cjs/types/stories/views/SwapProgressView.stories.d.ts +1 -0
  11. package/dist/cjs/types/types/components.d.ts +1 -0
  12. package/dist/cjs/types/types/index.d.ts +1 -1
  13. package/dist/esm/index.js +83 -39
  14. package/dist/esm/types/components/buttons/AssetsButton.d.ts +3 -1
  15. package/dist/esm/types/components/lists/HistoryItem.d.ts +1 -1
  16. package/dist/esm/types/components/lists/ListItem.d.ts +2 -1
  17. package/dist/esm/types/components/lists/SwapStepItem.d.ts +1 -0
  18. package/dist/esm/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
  19. package/dist/esm/types/stories/layout/SwapStepsCollapsed.stories.d.ts +1 -0
  20. package/dist/esm/types/stories/lists/ListItem.stories.d.ts +2 -0
  21. package/dist/esm/types/stories/lists/SwapStepItem.stories.d.ts +1 -0
  22. package/dist/esm/types/stories/views/SwapProgressView.stories.d.ts +1 -0
  23. package/dist/esm/types/types/components.d.ts +1 -0
  24. package/dist/esm/types/types/index.d.ts +1 -1
  25. package/dist/index.css +44 -40
  26. package/dist/index.d.ts +8 -4
  27. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -2588,7 +2588,7 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
2588
2588
  setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { badgeLoaded: true })));
2589
2589
  }, className: cn(badgeImageClassName,
2590
2590
  // hide badge image while it is loading, and display it when it is loaded
2591
- imagesLoadState.mainImageLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
2591
+ imagesLoadState.badgeLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
2592
2592
  }
2593
2593
 
2594
2594
  function LoadingSkeleton({ className, height = '20', }) {
@@ -2845,8 +2845,22 @@ function PlusIcon() {
2845
2845
  }
2846
2846
 
2847
2847
  const imageClass = 'tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center';
2848
- const defaultBgColor = `var(${themeTypesKeys['royal-500'].cssVariable})`;
2849
- function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor = defaultBgColor, tokenBgColor = defaultBgColor, tokenTextColor, onClick, }) {
2848
+ const themeKeyVariantMap = {
2849
+ primary: 'grey-800',
2850
+ accent: 'royal-500',
2851
+ };
2852
+ const buttonTextClassNameMap = {
2853
+ primary: 'tw-text-grey-300',
2854
+ accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
2855
+ };
2856
+ const emptyChainIconTextClassNameMap = {
2857
+ primary: 'tw-text-grey-100',
2858
+ accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
2859
+ };
2860
+ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant = 'primary', }) {
2861
+ const defaultBgColor = `var(${themeTypesKeys[themeKeyVariantMap[variant]].cssVariable})`;
2862
+ const chainBgColor = _chainBgColor !== null && _chainBgColor !== void 0 ? _chainBgColor : defaultBgColor;
2863
+ const tokenBgColor = _tokenBgColor !== null && _tokenBgColor !== void 0 ? _tokenBgColor : defaultBgColor;
2850
2864
  const bgGradient = React.useMemo(() => {
2851
2865
  if (!chainImageUrl) {
2852
2866
  return `linear-gradient(to right, ${defaultBgColor}, ${defaultBgColor})`;
@@ -2856,9 +2870,9 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
2856
2870
  }
2857
2871
  return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
2858
2872
  }, [chainBgColor, tokenBgColor]);
2859
- 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: {
2873
+ return (jsxRuntime.jsxs("button", { onClick: onClick, className: cn('tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center focus:tw-outline-none', buttonTextClassNameMap[variant]), 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: {
2860
2874
  backgroundImage: bgGradient,
2861
- }, 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.jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-overflow-hidden'), children: [jsxRuntime.jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
2875
+ }, children: jsxRuntime.jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsxRuntime.jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsxRuntime.jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsxRuntime.jsx(PlusIcon, {}) })) }) }), tokenImageUrl && chainImageUrl ? (jsxRuntime.jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-overflow-hidden'), children: [jsxRuntime.jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
2862
2876
  backgroundColor: tokenBgColor,
2863
2877
  } }), jsxRuntime.jsx("img", { src: tokenImageUrl, alt: tokenSymbol, className: "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full" }), jsxRuntime.jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px] tw-border-b\n tw-border-t tw-border-material-light-thin" })] })) : null, jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-xl tw-w-fit tw-min-w-squid-xl tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-br-full tw-rounded-tr-full tw-border-b tw-border-r tw-border-t tw-border-material-light-thin tw-py-squid-xs tw-pr-squid-xs', tokenImageUrl && 'tw-pl-[7px]'), style: {
2864
2878
  backgroundColor: tokenBgColor,
@@ -6502,7 +6516,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
6502
6516
  return 'full';
6503
6517
  }, [errorMessage, isLoading, isEmpty]);
6504
6518
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
6505
- return (jsxRuntime.jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-[480px] tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin 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 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsxRuntime.jsx(Button, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (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(Tooltip, { tooltipContent: isFlipButtonDisabled ? flipButtonDisabledMessage : undefined, tooltipWidth: "max", children: jsxRuntime.jsx("button", { disabled: isFlipButtonDisabled, onClick: onInvertSwapButtonClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsxRuntime.jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !isFlipButtonDisabled &&
6519
+ return (jsxRuntime.jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-card tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin 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 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsxRuntime.jsx(Button, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (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(Tooltip, { tooltipContent: isFlipButtonDisabled ? flipButtonDisabledMessage : undefined, tooltipWidth: "max", children: jsxRuntime.jsx("button", { disabled: isFlipButtonDisabled, onClick: onInvertSwapButtonClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsxRuntime.jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !isFlipButtonDisabled &&
6506
6520
  'group-hover/flip-button:tw-rotate-180') }) }) })) }), 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, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
6507
6521
  }
6508
6522
 
@@ -6648,8 +6662,9 @@ const listItemSizeMap = {
6648
6662
  small: 'tw-h-list-item-small tw-px-squid-xs',
6649
6663
  large: 'tw-h-list-item-large tw-px-squid-xs',
6650
6664
  };
6665
+ const subtitleClassName = 'tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500';
6651
6666
  function ListItem(_a) {
6652
- var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
6667
+ var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
6653
6668
  // 'small' variant does not have detail
6654
6669
  const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
6655
6670
  const isDetailInteractive = !!onDetailClick;
@@ -6669,7 +6684,7 @@ function ListItem(_a) {
6669
6684
  return (jsxRuntime.jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsxRuntime.jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
6670
6685
  // 'large' variant has extra padding
6671
6686
  size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
6672
- ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsxRuntime.jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxRuntime.jsx(CaptionText, { className: "tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500", children: subtitle })) : null)] }), showDetail && (jsxRuntime.jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6687
+ ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsxRuntime.jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxRuntime.jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsxRuntime.jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxRuntime.jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6673
6688
  ? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
6674
6689
  : 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsxRuntime.jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsxRuntime.jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
6675
6690
  }
@@ -6714,6 +6729,7 @@ function SwapStepSeparator() {
6714
6729
  return (jsxRuntime.jsx("span", { className: "tw-flex tw-h-squid-m tw-w-squid-xxl tw-items-center tw-justify-center tw-self-stretch tw-py-0.5", children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "4", height: "21", viewBox: "0 0 4 21", fill: "none", children: jsxRuntime.jsx("path", { d: "M2 2.5V18.5", stroke: "currentColor", "stroke-width": "4", "stroke-linecap": "round" }) }) }));
6715
6730
  }
6716
6731
 
6732
+ const STEP_ITEM_HEIGHT = 52;
6717
6733
  const statusBgClassMap = {
6718
6734
  executed: '!tw-bg-grey-300',
6719
6735
  ongoing: '!tw-bg-grey-300',
@@ -6765,23 +6781,26 @@ function SwapStepItem({ descriptionBlocks, showStepSeparator = false, link, stat
6765
6781
  return 'tw-text-grey-300';
6766
6782
  }
6767
6783
  }, [status]);
6768
- return (jsxRuntime.jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-text-grey-300 tw-transition-colors tw-duration-1000", children: [jsxRuntime.jsxs("a", { href: link, target: "_blank", style: transitionStyle, className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs', !!link && 'hover:tw-bg-material-light-thin', statusTextClass), children: [jsxRuntime.jsx("span", { className: "tw-relative tw-flex tw-min-h-squid-l tw-items-center tw-justify-center tw-gap-squid-xxs tw-px-squid-xs", children: jsxRuntime.jsx(Chip, { style: transitionStyle, className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: chipContent }) }), jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-squid-l tw-flex-1 tw-flex-wrap tw-items-center tw-justify-start tw-gap-squid-xxs tw-py-squid-xxs", children: descriptionBlocks.map((block, index) => {
6769
- const { type, value } = block;
6770
- if (type === 'string') {
6771
- return (
6772
- // Instead of displaying the string into a single <BodyText />
6773
- // we split it into multiple <BodyText />
6774
- // for edge case where the string is too long to fit in one line
6775
- value
6776
- .trim()
6777
- .split(' ')
6778
- .map((word, i) => (jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
6779
- }
6780
- else if (type === 'image') {
6781
- return (jsxRuntime.jsx("img", { src: value, className: cn('tw-h-squid-m tw-w-squid-m', block.rounded ? 'tw-rounded-full' : 'tw-rounded-squid-xxs') }, index));
6782
- }
6783
- return null;
6784
- }) })] }), showStepSeparator && (jsxRuntime.jsx("span", { className: cn(separatorClassMap[status]), style: transitionStyle, children: jsxRuntime.jsx(SwapStepSeparator, {}) }))] }));
6784
+ return (jsxRuntime.jsx("li", { style: {
6785
+ maxHeight: `${STEP_ITEM_HEIGHT}px`,
6786
+ minHeight: `${STEP_ITEM_HEIGHT}px`,
6787
+ }, className: "tw-relative tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-justify-center tw-text-grey-300 tw-transition-colors tw-duration-1000", children: jsxRuntime.jsxs("a", { href: link, target: "_blank", style: Object.assign(Object.assign({}, transitionStyle), { maxHeight: `${STEP_ITEM_HEIGHT}px` }), className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs tw-py-squid-xxs', !!link && 'hover:tw-bg-material-light-thin', statusTextClass), children: [jsxRuntime.jsxs("span", { className: "tw-relative tw-flex tw-min-h-squid-l tw-items-center tw-justify-center tw-gap-squid-xxs tw-px-squid-xs", children: [jsxRuntime.jsx(Chip, { style: transitionStyle, className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: chipContent }), showStepSeparator && (jsxRuntime.jsx("span", { className: cn(separatorClassMap[status], 'tw-absolute tw-left-0 tw-top-full tw-mt-0.5'), style: transitionStyle, children: jsxRuntime.jsx(SwapStepSeparator, {}) }))] }), jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-squid-l tw-flex-1 tw-flex-wrap tw-items-center tw-justify-start tw-gap-squid-xxs tw-py-squid-xxs tw-pr-squid-xs", children: descriptionBlocks.map((block, index) => {
6788
+ const { type, value } = block;
6789
+ if (type === 'string') {
6790
+ return (
6791
+ // Instead of displaying the string into a single <BodyText />
6792
+ // we split it into multiple <BodyText />
6793
+ // for edge case where the string is too long to fit in one line
6794
+ value
6795
+ .trim()
6796
+ .split(' ')
6797
+ .map((word, i) => (jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
6798
+ }
6799
+ else if (type === 'image') {
6800
+ return (jsxRuntime.jsx("img", { src: value, className: cn('tw-h-squid-m tw-w-squid-m', block.rounded ? 'tw-rounded-full' : 'tw-rounded-squid-xxs') }, index));
6801
+ }
6802
+ return null;
6803
+ }) })] }) }));
6785
6804
  }
6786
6805
 
6787
6806
  const borderRadiusClassMap = {
@@ -6853,7 +6872,7 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
6853
6872
  }
6854
6873
 
6855
6874
  function ProductCard({ children }) {
6856
- return (jsxRuntime.jsx("div", { className: "tw-h-card tw-min-h-card tw-w-card tw-rounded-squid-xl tw-border-[1px] tw-border-solid tw-border-material-light-thick tw-bg-material-light-thick tw-p-squid-xs tw-backdrop-blur/10 tw-backdrop-saturate-150", children: jsxRuntime.jsx("div", { className: "tw-relative tw-flex tw-h-[660px] tw-w-full tw-flex-col tw-overflow-hidden tw-rounded-squid-l tw-bg-grey-900 tw-text-grey-300", children: children }) }));
6875
+ return (jsxRuntime.jsx("div", { className: "group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-3 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-3 tw-relative tw-flex tw-h-card tw-min-h-card tw-w-card tw-flex-col tw-overflow-hidden tw-rounded-squid-l tw-bg-grey-900 tw-text-grey-300 tw-outline tw-outline-1 tw-outline-material-light-thin", children: children }));
6857
6876
  }
6858
6877
  function BorderedContainer({ children, className, }) {
6859
6878
  return (jsxRuntime.jsx("section", { className: cn('tw-border-t tw-border-t-material-light-thin', className), children: children }));
@@ -6877,7 +6896,7 @@ function LogoContainer({ children }) {
6877
6896
 
6878
6897
  function SwapConfiguration({ amount, tokenPrice = 0, isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, emptyAddressLabel = 'Connect wallet', balance, criticalPriceImpactPercentage, error, priceImpactPercentage, amountUsd, }) {
6879
6898
  var _a, _b;
6880
- return (jsxRuntime.jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-[480px] tw-overflow-hidden tw-border-t tw-border-t-material-light-thin 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 : emptyAddressLabel }), 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 }) }), isFetching && (jsxRuntime.jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-l tw-z-10 tw-overflow-hidden", children: jsxRuntime.jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsxRuntime.jsx(NumericInput, { token: {
6899
+ return (jsxRuntime.jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-card tw-overflow-hidden tw-border-t tw-border-t-material-light-thin 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 : emptyAddressLabel }), 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 }) }), isFetching && (jsxRuntime.jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-l tw-z-10 tw-overflow-hidden", children: jsxRuntime.jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsxRuntime.jsx(NumericInput, { token: {
6881
6900
  decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
6882
6901
  symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : '',
6883
6902
  price: tokenPrice,
@@ -6896,9 +6915,10 @@ function SwapProgressViewHeader({ title, description, }) {
6896
6915
  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 })] }));
6897
6916
  }
6898
6917
 
6918
+ const STEPS_LIST_HEIGHT = 400;
6899
6919
  const SwapStepsCollapsed = React.forwardRef((props, ref) => {
6900
6920
  const { steps, currentStepIndex: _newStepIndex, onOpen, onClose, footerButton, } = props;
6901
- const newStepIndex = Math.round(_newStepIndex);
6921
+ const newStepIndex = Math.round(_newStepIndex < 0 ? 0 : _newStepIndex);
6902
6922
  React.useImperativeHandle(ref, () => ({
6903
6923
  handleToggleRouteSteps,
6904
6924
  }));
@@ -6918,6 +6938,16 @@ const SwapStepsCollapsed = React.forwardRef((props, ref) => {
6918
6938
  clearTimeout(timeoutId);
6919
6939
  };
6920
6940
  }, [isShowRouteAnimationRunning]);
6941
+ React.useEffect(() => {
6942
+ var _a;
6943
+ if (!isRouteVisible)
6944
+ return;
6945
+ // scroll in the steps list so the current step is visible at the middle
6946
+ (_a = routeStepsListRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
6947
+ top: -((newStepIndex - 1) * STEP_ITEM_HEIGHT) + STEPS_LIST_HEIGHT / 2,
6948
+ behavior: 'smooth',
6949
+ });
6950
+ }, [newStepIndex]);
6921
6951
  const routeStepsListRef = React.useRef(null);
6922
6952
  const handleToggleRouteSteps = () => {
6923
6953
  if (isRouteVisible) {
@@ -6948,9 +6978,13 @@ const SwapStepsCollapsed = React.forwardRef((props, ref) => {
6948
6978
  }, onClick: handleToggleRouteSteps, className: "tw-absolute tw-inset-0 tw-h-[60px] tw-cursor-pointer tw-rounded-squid-l tw-border tw-border-material-light-thin" }), jsxRuntime.jsx("div", { onClick: isShowRouteAnimationRunning ? undefined : handleToggleRouteSteps, style: {
6949
6979
  [CSS_VARS.COLLAPSE_ROUTE_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE}ms`,
6950
6980
  [CSS_VARS.EXPAND_ROUTE_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE}ms`,
6951
- }, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
6952
- ? 'tw-animate-expand-route'
6953
- : 'tw-animate-collapse-route'), children: jsxRuntime.jsxs("div", { className: "tw-flex tw-max-h-[535px] tw-grow-0 tw-flex-col tw-gap-squid-xxs tw-pt-[52px]", style: {
6981
+ }, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isRouteVisible &&
6982
+ (isShowRouteAnimationRunning
6983
+ ? 'tw-animate-expand-route'
6984
+ : 'tw-animate-collapse-route')), children: jsxRuntime.jsxs("div", { className: cn('tw-flex tw-flex-col tw-gap-squid-xxs', isRouteVisible || isShowRouteAnimationRunning
6985
+ ? 'tw-max-h-[535px]'
6986
+ : ''), style: {
6987
+ paddingTop: `${STEP_ITEM_HEIGHT}px`,
6954
6988
  transition: isShowRouteAnimationRunning
6955
6989
  ? `transform ${ANIMATION_DURATIONS.SHOW_ROUTE}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`
6956
6990
  : isRouteVisible
@@ -6958,13 +6992,16 @@ const SwapStepsCollapsed = React.forwardRef((props, ref) => {
6958
6992
  : `transform ${ANIMATION_DURATIONS.CHANGE_SWAP_STEP}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`,
6959
6993
  transform: isShowRouteAnimationRunning
6960
6994
  ? 'translateY(0)'
6961
- : `translateY(calc(-100% + 85px + ${(newStepIndex + 1) * 50}px))`,
6962
- }, children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-z-10 tw-flex tw-h-[52px] tw-w-full tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-transparent tw-p-squid-xs'), children: jsxRuntime.jsx("button", { onClick: handleToggleRouteSteps, 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", { ref: routeStepsListRef, style: {
6995
+ : `translateY(calc(-100% + 69px + ${(newStepIndex + 1) * STEP_ITEM_HEIGHT}px))`,
6996
+ }, children: [jsxRuntime.jsx("div", { style: {
6997
+ display: isRouteVisible ? 'flex' : 'none',
6998
+ height: `${STEP_ITEM_HEIGHT}px`,
6999
+ }, className: cn('tw-absolute tw-top-0 tw-z-10 tw-flex tw-w-full tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-grey-800 tw-p-squid-xs'), children: jsxRuntime.jsx("button", { onClick: handleToggleRouteSteps, 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", { ref: routeStepsListRef, style: {
6963
7000
  zIndex: isRouteVisible ? 0 : -10,
6964
7001
  scrollbarWidth: 'none',
6965
- }, className: "tw-relative tw-flex tw-max-h-[413px] tw-w-[400px] tw-flex-1 tw-grow-0 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs tw-py-[15px]", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks,
7002
+ }, className: "tw-relative tw-flex tw-w-[400px] tw-flex-1 tw-grow-0 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs tw-pb-squid-xxs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks,
6966
7003
  // show separator for all steps except the first one
6967
- showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-w-full 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", onClick: footerButton === null || footerButton === void 0 ? void 0 : footerButton.onClick, link: footerButton === null || footerButton === void 0 ? void 0 : footerButton.link, label: footerButton === null || footerButton === void 0 ? void 0 : footerButton.label, className: "tw-w-full" }) })] }) })] }) }) }));
7004
+ showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-max-h-[55px] tw-min-h-[55px] tw-w-full tw-justify-center tw-gap-squid-xs tw-self-stretch tw-px-squid-s tw-pb-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", onClick: footerButton === null || footerButton === void 0 ? void 0 : footerButton.onClick, link: footerButton === null || footerButton === void 0 ? void 0 : footerButton.link, label: footerButton === null || footerButton === void 0 ? void 0 : footerButton.label, className: "tw-w-full" }) })] }) })] }) }) }));
6968
7005
  });
6969
7006
 
6970
7007
  function TokenPair({ firstToken, secondToken }) {
@@ -42361,6 +42398,13 @@ const TrackTransactionView = React.forwardRef((props, ref) => {
42361
42398
  currentStepIndex: rawSteps.length - 1,
42362
42399
  };
42363
42400
  }
42401
+ if (swapState === SwapState.ERROR) {
42402
+ const firstErrorStepIndex = rawSteps.findIndex((s) => s.status === 'error');
42403
+ return {
42404
+ steps: rawSteps,
42405
+ currentStepIndex: firstErrorStepIndex,
42406
+ };
42407
+ }
42364
42408
  return {
42365
42409
  steps: rawSteps,
42366
42410
  currentStepIndex: 0,
@@ -42379,8 +42423,8 @@ const lightTheme = {
42379
42423
  // content
42380
42424
  'content-100': '#17191C',
42381
42425
  'content-200': '#292C32',
42382
- 'content-300': '#4C515D',
42383
- 'content-400': '#626784',
42426
+ 'content-300': '#292C32',
42427
+ 'content-400': '#676B7E',
42384
42428
  'content-500': '#8A8FA8',
42385
42429
  'content-600': '#A7ABBE',
42386
42430
  'content-700': '#D1D6E0',
@@ -42390,7 +42434,7 @@ const lightTheme = {
42390
42434
  'accent-400': '#9E79D2',
42391
42435
  'accent-500': '#B893EC',
42392
42436
  // status
42393
- 'status-positive': '#11D421',
42437
+ 'status-positive': '#17CF26',
42394
42438
  'status-negative': '#FF5B4D',
42395
42439
  'status-warning': '#EC9213',
42396
42440
  };
@@ -42591,6 +42635,7 @@ exports.NavigationBar = NavigationBar;
42591
42635
  exports.NumericInput = NumericInput;
42592
42636
  exports.ProductCard = ProductCard;
42593
42637
  exports.ProfileHeaderBackground = ProfileHeaderBackground;
42638
+ exports.STEP_ITEM_HEIGHT = STEP_ITEM_HEIGHT;
42594
42639
  exports.SectionTitle = SectionTitle;
42595
42640
  exports.SettingsButton = SettingsButton;
42596
42641
  exports.SettingsItem = SettingsItem;
@@ -1,3 +1,4 @@
1
+ type AssetsButtonVariant = 'primary' | 'accent';
1
2
  interface AssetsButtonProps {
2
3
  tokenImageUrl?: string;
3
4
  chainImageUrl?: string;
@@ -6,6 +7,7 @@ interface AssetsButtonProps {
6
7
  tokenBgColor?: string;
7
8
  tokenTextColor?: string;
8
9
  onClick?: () => void;
10
+ variant?: AssetsButtonVariant;
9
11
  }
10
- export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor, tokenBgColor, tokenTextColor, onClick, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DropdownMenuItemProps } from './DropdownMenuItem';
3
- type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
3
+ import { HistoryItemStatus } from '../../types/components';
4
4
  interface HistoryItemProps {
5
5
  firstImageUrl: string;
6
6
  secondImageUrl: string;
@@ -4,6 +4,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
4
4
  mainImageUrl?: string;
5
5
  secondaryImageUrl?: string;
6
6
  subtitle?: string;
7
+ subtitleOnHover?: React.ReactNode;
7
8
  detail?: string;
8
9
  icon?: React.ReactNode;
9
10
  size?: ListItemSize;
@@ -20,5 +21,5 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
20
21
  containerProps?: React.HTMLAttributes<HTMLLIElement>;
21
22
  }
22
23
  type ListItemSize = 'small' | 'large';
23
- export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
24
25
  export {};
@@ -5,5 +5,6 @@ interface SwapStepItemProps {
5
5
  link?: string;
6
6
  status?: SwapStepItemStatus;
7
7
  }
8
+ export declare const STEP_ITEM_HEIGHT = 52;
8
9
  export declare function SwapStepItem({ descriptionBlocks, showStepSeparator, link, status, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -3,7 +3,8 @@ import { AssetsButton } from '../../components/buttons/AssetsButton';
3
3
  declare const meta: Meta<typeof AssetsButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
- export declare const Empty: Story;
6
+ export declare const PrimaryVariantEmpty: Story;
7
+ export declare const AccentVariantEmpty: Story;
7
8
  export declare const ChainOnly: Story;
8
9
  export declare const ChainAndTokenLightText: Story;
9
10
  export declare const ChainAndTokenDarkText: Story;
@@ -10,3 +10,4 @@ export declare const ShortRoute: Story;
10
10
  export declare const LongRoute: Story;
11
11
  export declare const Error: Story;
12
12
  export declare const Warning: Story;
13
+ export declare const LongDescriptionSteps: Story;
@@ -9,6 +9,8 @@ export declare const LargeWithLongTitle: Story;
9
9
  export declare const LargeWithLongTitleAndSubtitle: Story;
10
10
  export declare const LargeRoundedFull: Story;
11
11
  export declare const LargeWithSubtitle: Story;
12
+ export declare const SubtitleOnHover: Story;
13
+ export declare const SubtitleOnHoverTokenBalance: Story;
12
14
  export declare const LargeWithDetail: Story;
13
15
  export declare const LargeWithIcon: Story;
14
16
  export declare const LargeWithDetailAndIconInteractive: Story;
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Executed: Story;
7
7
  export declare const ExecutedWithSeparator: Story;
8
+ export declare const ExecutedWithSeparatorAndLink: Story;
8
9
  export declare const Success: Story;
9
10
  export declare const SuccessWithSeparator: Story;
10
11
  export declare const Pending: Story;
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const WithControls: Story;
7
7
  export declare const ShortRoute: Story;
8
+ export declare const LongDescriptionSteps: Story;
8
9
  export declare const LongRoute: Story;
9
10
  export declare const Completed: Story;
10
11
  export declare const Error: Story;
@@ -4,6 +4,7 @@ export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
4
4
  export type ButtonSize = 'md' | 'lg';
5
5
  export type SwapDirection = 'from' | 'to';
6
6
  export type BoostMode = 'normal' | 'boost';
7
+ export type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
7
8
  export type SwapStepDescriptionBlock = {
8
9
  type: 'string';
9
10
  value: string;
@@ -1,2 +1,2 @@
1
1
  export type { SquidTheme } from './config';
2
- export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, } from './components';
2
+ export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, HistoryItemStatus, } from './components';
package/dist/esm/index.js CHANGED
@@ -2568,7 +2568,7 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
2568
2568
  setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { badgeLoaded: true })));
2569
2569
  }, className: cn(badgeImageClassName,
2570
2570
  // hide badge image while it is loading, and display it when it is loaded
2571
- imagesLoadState.mainImageLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
2571
+ imagesLoadState.badgeLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
2572
2572
  }
2573
2573
 
2574
2574
  function LoadingSkeleton({ className, height = '20', }) {
@@ -2825,8 +2825,22 @@ function PlusIcon() {
2825
2825
  }
2826
2826
 
2827
2827
  const imageClass = 'tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center';
2828
- const defaultBgColor = `var(${themeTypesKeys['royal-500'].cssVariable})`;
2829
- function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor = defaultBgColor, tokenBgColor = defaultBgColor, tokenTextColor, onClick, }) {
2828
+ const themeKeyVariantMap = {
2829
+ primary: 'grey-800',
2830
+ accent: 'royal-500',
2831
+ };
2832
+ const buttonTextClassNameMap = {
2833
+ primary: 'tw-text-grey-300',
2834
+ accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
2835
+ };
2836
+ const emptyChainIconTextClassNameMap = {
2837
+ primary: 'tw-text-grey-100',
2838
+ accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
2839
+ };
2840
+ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant = 'primary', }) {
2841
+ const defaultBgColor = `var(${themeTypesKeys[themeKeyVariantMap[variant]].cssVariable})`;
2842
+ const chainBgColor = _chainBgColor !== null && _chainBgColor !== void 0 ? _chainBgColor : defaultBgColor;
2843
+ const tokenBgColor = _tokenBgColor !== null && _tokenBgColor !== void 0 ? _tokenBgColor : defaultBgColor;
2830
2844
  const bgGradient = useMemo(() => {
2831
2845
  if (!chainImageUrl) {
2832
2846
  return `linear-gradient(to right, ${defaultBgColor}, ${defaultBgColor})`;
@@ -2836,9 +2850,9 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
2836
2850
  }
2837
2851
  return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
2838
2852
  }, [chainBgColor, tokenBgColor]);
2839
- 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: {
2853
+ return (jsxs("button", { onClick: onClick, className: cn('tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center focus:tw-outline-none', buttonTextClassNameMap[variant]), 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: {
2840
2854
  backgroundImage: bgGradient,
2841
- }, children: jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsx(Fragment, { children: jsx(PlusIcon, {}) })) }) }), tokenImageUrl && chainImageUrl ? (jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-overflow-hidden'), children: [jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
2855
+ }, children: jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsx(PlusIcon, {}) })) }) }), tokenImageUrl && chainImageUrl ? (jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-overflow-hidden'), children: [jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
2842
2856
  backgroundColor: tokenBgColor,
2843
2857
  } }), jsx("img", { src: tokenImageUrl, alt: tokenSymbol, className: "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full" }), jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px] tw-border-b\n tw-border-t tw-border-material-light-thin" })] })) : null, jsxs("div", { className: cn('tw-flex tw-h-squid-xl tw-w-fit tw-min-w-squid-xl tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-br-full tw-rounded-tr-full tw-border-b tw-border-r tw-border-t tw-border-material-light-thin tw-py-squid-xs tw-pr-squid-xs', tokenImageUrl && 'tw-pl-[7px]'), style: {
2844
2858
  backgroundColor: tokenBgColor,
@@ -6482,7 +6496,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
6482
6496
  return 'full';
6483
6497
  }, [errorMessage, isLoading, isEmpty]);
6484
6498
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
6485
- return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-[480px] tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin 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(Tooltip, { tooltipContent: isFlipButtonDisabled ? flipButtonDisabledMessage : undefined, tooltipWidth: "max", children: jsx("button", { disabled: isFlipButtonDisabled, onClick: onInvertSwapButtonClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !isFlipButtonDisabled &&
6499
+ return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-card tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin 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(Tooltip, { tooltipContent: isFlipButtonDisabled ? flipButtonDisabledMessage : undefined, tooltipWidth: "max", children: jsx("button", { disabled: isFlipButtonDisabled, onClick: onInvertSwapButtonClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !isFlipButtonDisabled &&
6486
6500
  'group-hover/flip-button:tw-rotate-180') }) }) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
6487
6501
  }
6488
6502
 
@@ -6628,8 +6642,9 @@ const listItemSizeMap = {
6628
6642
  small: 'tw-h-list-item-small tw-px-squid-xs',
6629
6643
  large: 'tw-h-list-item-large tw-px-squid-xs',
6630
6644
  };
6645
+ const subtitleClassName = 'tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500';
6631
6646
  function ListItem(_a) {
6632
- var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
6647
+ var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
6633
6648
  // 'small' variant does not have detail
6634
6649
  const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
6635
6650
  const isDetailInteractive = !!onDetailClick;
@@ -6649,7 +6664,7 @@ function ListItem(_a) {
6649
6664
  return (jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
6650
6665
  // 'large' variant has extra padding
6651
6666
  size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
6652
- ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsx(CaptionText, { className: "tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500", children: subtitle })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6667
+ ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6653
6668
  ? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
6654
6669
  : 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
6655
6670
  }
@@ -6694,6 +6709,7 @@ function SwapStepSeparator() {
6694
6709
  return (jsx("span", { className: "tw-flex tw-h-squid-m tw-w-squid-xxl tw-items-center tw-justify-center tw-self-stretch tw-py-0.5", children: jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "4", height: "21", viewBox: "0 0 4 21", fill: "none", children: jsx("path", { d: "M2 2.5V18.5", stroke: "currentColor", "stroke-width": "4", "stroke-linecap": "round" }) }) }));
6695
6710
  }
6696
6711
 
6712
+ const STEP_ITEM_HEIGHT = 52;
6697
6713
  const statusBgClassMap = {
6698
6714
  executed: '!tw-bg-grey-300',
6699
6715
  ongoing: '!tw-bg-grey-300',
@@ -6745,23 +6761,26 @@ function SwapStepItem({ descriptionBlocks, showStepSeparator = false, link, stat
6745
6761
  return 'tw-text-grey-300';
6746
6762
  }
6747
6763
  }, [status]);
6748
- return (jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-text-grey-300 tw-transition-colors tw-duration-1000", children: [jsxs("a", { href: link, target: "_blank", style: transitionStyle, className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs', !!link && 'hover:tw-bg-material-light-thin', statusTextClass), children: [jsx("span", { className: "tw-relative tw-flex tw-min-h-squid-l tw-items-center tw-justify-center tw-gap-squid-xxs tw-px-squid-xs", children: jsx(Chip, { style: transitionStyle, className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: chipContent }) }), jsx("div", { className: "tw-flex tw-min-h-squid-l tw-flex-1 tw-flex-wrap tw-items-center tw-justify-start tw-gap-squid-xxs tw-py-squid-xxs", children: descriptionBlocks.map((block, index) => {
6749
- const { type, value } = block;
6750
- if (type === 'string') {
6751
- return (
6752
- // Instead of displaying the string into a single <BodyText />
6753
- // we split it into multiple <BodyText />
6754
- // for edge case where the string is too long to fit in one line
6755
- value
6756
- .trim()
6757
- .split(' ')
6758
- .map((word, i) => (jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
6759
- }
6760
- else if (type === 'image') {
6761
- return (jsx("img", { src: value, className: cn('tw-h-squid-m tw-w-squid-m', block.rounded ? 'tw-rounded-full' : 'tw-rounded-squid-xxs') }, index));
6762
- }
6763
- return null;
6764
- }) })] }), showStepSeparator && (jsx("span", { className: cn(separatorClassMap[status]), style: transitionStyle, children: jsx(SwapStepSeparator, {}) }))] }));
6764
+ return (jsx("li", { style: {
6765
+ maxHeight: `${STEP_ITEM_HEIGHT}px`,
6766
+ minHeight: `${STEP_ITEM_HEIGHT}px`,
6767
+ }, className: "tw-relative tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-justify-center tw-text-grey-300 tw-transition-colors tw-duration-1000", children: jsxs("a", { href: link, target: "_blank", style: Object.assign(Object.assign({}, transitionStyle), { maxHeight: `${STEP_ITEM_HEIGHT}px` }), className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs tw-py-squid-xxs', !!link && 'hover:tw-bg-material-light-thin', statusTextClass), children: [jsxs("span", { className: "tw-relative tw-flex tw-min-h-squid-l tw-items-center tw-justify-center tw-gap-squid-xxs tw-px-squid-xs", children: [jsx(Chip, { style: transitionStyle, className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: chipContent }), showStepSeparator && (jsx("span", { className: cn(separatorClassMap[status], 'tw-absolute tw-left-0 tw-top-full tw-mt-0.5'), style: transitionStyle, children: jsx(SwapStepSeparator, {}) }))] }), jsx("div", { className: "tw-flex tw-min-h-squid-l tw-flex-1 tw-flex-wrap tw-items-center tw-justify-start tw-gap-squid-xxs tw-py-squid-xxs tw-pr-squid-xs", children: descriptionBlocks.map((block, index) => {
6768
+ const { type, value } = block;
6769
+ if (type === 'string') {
6770
+ return (
6771
+ // Instead of displaying the string into a single <BodyText />
6772
+ // we split it into multiple <BodyText />
6773
+ // for edge case where the string is too long to fit in one line
6774
+ value
6775
+ .trim()
6776
+ .split(' ')
6777
+ .map((word, i) => (jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
6778
+ }
6779
+ else if (type === 'image') {
6780
+ return (jsx("img", { src: value, className: cn('tw-h-squid-m tw-w-squid-m', block.rounded ? 'tw-rounded-full' : 'tw-rounded-squid-xxs') }, index));
6781
+ }
6782
+ return null;
6783
+ }) })] }) }));
6765
6784
  }
6766
6785
 
6767
6786
  const borderRadiusClassMap = {
@@ -6833,7 +6852,7 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
6833
6852
  }
6834
6853
 
6835
6854
  function ProductCard({ children }) {
6836
- return (jsx("div", { className: "tw-h-card tw-min-h-card tw-w-card tw-rounded-squid-xl tw-border-[1px] tw-border-solid tw-border-material-light-thick tw-bg-material-light-thick tw-p-squid-xs tw-backdrop-blur/10 tw-backdrop-saturate-150", children: jsx("div", { className: "tw-relative tw-flex tw-h-[660px] tw-w-full tw-flex-col tw-overflow-hidden tw-rounded-squid-l tw-bg-grey-900 tw-text-grey-300", children: children }) }));
6855
+ return (jsx("div", { className: "group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-3 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-3 tw-relative tw-flex tw-h-card tw-min-h-card tw-w-card tw-flex-col tw-overflow-hidden tw-rounded-squid-l tw-bg-grey-900 tw-text-grey-300 tw-outline tw-outline-1 tw-outline-material-light-thin", children: children }));
6837
6856
  }
6838
6857
  function BorderedContainer({ children, className, }) {
6839
6858
  return (jsx("section", { className: cn('tw-border-t tw-border-t-material-light-thin', className), children: children }));
@@ -6857,7 +6876,7 @@ function LogoContainer({ children }) {
6857
6876
 
6858
6877
  function SwapConfiguration({ amount, tokenPrice = 0, isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, emptyAddressLabel = 'Connect wallet', balance, criticalPriceImpactPercentage, error, priceImpactPercentage, amountUsd, }) {
6859
6878
  var _a, _b;
6860
- return (jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-[480px] tw-overflow-hidden tw-border-t tw-border-t-material-light-thin 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 : emptyAddressLabel }), 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 }) }), isFetching && (jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-l tw-z-10 tw-overflow-hidden", children: jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsx(NumericInput, { token: {
6879
+ return (jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-card tw-overflow-hidden tw-border-t tw-border-t-material-light-thin 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 : emptyAddressLabel }), 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 }) }), isFetching && (jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-l tw-z-10 tw-overflow-hidden", children: jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsx(NumericInput, { token: {
6861
6880
  decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
6862
6881
  symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : '',
6863
6882
  price: tokenPrice,
@@ -6876,9 +6895,10 @@ function SwapProgressViewHeader({ title, description, }) {
6876
6895
  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 })] }));
6877
6896
  }
6878
6897
 
6898
+ const STEPS_LIST_HEIGHT = 400;
6879
6899
  const SwapStepsCollapsed = forwardRef((props, ref) => {
6880
6900
  const { steps, currentStepIndex: _newStepIndex, onOpen, onClose, footerButton, } = props;
6881
- const newStepIndex = Math.round(_newStepIndex);
6901
+ const newStepIndex = Math.round(_newStepIndex < 0 ? 0 : _newStepIndex);
6882
6902
  useImperativeHandle(ref, () => ({
6883
6903
  handleToggleRouteSteps,
6884
6904
  }));
@@ -6898,6 +6918,16 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
6898
6918
  clearTimeout(timeoutId);
6899
6919
  };
6900
6920
  }, [isShowRouteAnimationRunning]);
6921
+ useEffect(() => {
6922
+ var _a;
6923
+ if (!isRouteVisible)
6924
+ return;
6925
+ // scroll in the steps list so the current step is visible at the middle
6926
+ (_a = routeStepsListRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
6927
+ top: -((newStepIndex - 1) * STEP_ITEM_HEIGHT) + STEPS_LIST_HEIGHT / 2,
6928
+ behavior: 'smooth',
6929
+ });
6930
+ }, [newStepIndex]);
6901
6931
  const routeStepsListRef = useRef(null);
6902
6932
  const handleToggleRouteSteps = () => {
6903
6933
  if (isRouteVisible) {
@@ -6928,9 +6958,13 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
6928
6958
  }, onClick: handleToggleRouteSteps, className: "tw-absolute tw-inset-0 tw-h-[60px] tw-cursor-pointer tw-rounded-squid-l tw-border tw-border-material-light-thin" }), jsx("div", { onClick: isShowRouteAnimationRunning ? undefined : handleToggleRouteSteps, style: {
6929
6959
  [CSS_VARS.COLLAPSE_ROUTE_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE}ms`,
6930
6960
  [CSS_VARS.EXPAND_ROUTE_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE}ms`,
6931
- }, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
6932
- ? 'tw-animate-expand-route'
6933
- : 'tw-animate-collapse-route'), children: jsxs("div", { className: "tw-flex tw-max-h-[535px] tw-grow-0 tw-flex-col tw-gap-squid-xxs tw-pt-[52px]", style: {
6961
+ }, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isRouteVisible &&
6962
+ (isShowRouteAnimationRunning
6963
+ ? 'tw-animate-expand-route'
6964
+ : 'tw-animate-collapse-route')), children: jsxs("div", { className: cn('tw-flex tw-flex-col tw-gap-squid-xxs', isRouteVisible || isShowRouteAnimationRunning
6965
+ ? 'tw-max-h-[535px]'
6966
+ : ''), style: {
6967
+ paddingTop: `${STEP_ITEM_HEIGHT}px`,
6934
6968
  transition: isShowRouteAnimationRunning
6935
6969
  ? `transform ${ANIMATION_DURATIONS.SHOW_ROUTE}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`
6936
6970
  : isRouteVisible
@@ -6938,13 +6972,16 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
6938
6972
  : `transform ${ANIMATION_DURATIONS.CHANGE_SWAP_STEP}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`,
6939
6973
  transform: isShowRouteAnimationRunning
6940
6974
  ? 'translateY(0)'
6941
- : `translateY(calc(-100% + 85px + ${(newStepIndex + 1) * 50}px))`,
6942
- }, children: [jsx("div", { className: cn('tw-absolute tw-top-0 tw-z-10 tw-flex tw-h-[52px] tw-w-full tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-transparent tw-p-squid-xs'), children: jsx("button", { onClick: handleToggleRouteSteps, 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", { ref: routeStepsListRef, style: {
6975
+ : `translateY(calc(-100% + 69px + ${(newStepIndex + 1) * STEP_ITEM_HEIGHT}px))`,
6976
+ }, children: [jsx("div", { style: {
6977
+ display: isRouteVisible ? 'flex' : 'none',
6978
+ height: `${STEP_ITEM_HEIGHT}px`,
6979
+ }, className: cn('tw-absolute tw-top-0 tw-z-10 tw-flex tw-w-full tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-grey-800 tw-p-squid-xs'), children: jsx("button", { onClick: handleToggleRouteSteps, 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", { ref: routeStepsListRef, style: {
6943
6980
  zIndex: isRouteVisible ? 0 : -10,
6944
6981
  scrollbarWidth: 'none',
6945
- }, className: "tw-relative tw-flex tw-max-h-[413px] tw-w-[400px] tw-flex-1 tw-grow-0 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs tw-py-[15px]", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks,
6982
+ }, className: "tw-relative tw-flex tw-w-[400px] tw-flex-1 tw-grow-0 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs tw-pb-squid-xxs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks,
6946
6983
  // show separator for all steps except the first one
6947
- showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsx("footer", { className: "tw-flex tw-w-full tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsx(Button, { size: "md", variant: "secondary", onClick: footerButton === null || footerButton === void 0 ? void 0 : footerButton.onClick, link: footerButton === null || footerButton === void 0 ? void 0 : footerButton.link, label: footerButton === null || footerButton === void 0 ? void 0 : footerButton.label, className: "tw-w-full" }) })] }) })] }) }) }));
6984
+ showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsx("footer", { className: "tw-flex tw-max-h-[55px] tw-min-h-[55px] tw-w-full tw-justify-center tw-gap-squid-xs tw-self-stretch tw-px-squid-s tw-pb-squid-s", children: jsx(Button, { size: "md", variant: "secondary", onClick: footerButton === null || footerButton === void 0 ? void 0 : footerButton.onClick, link: footerButton === null || footerButton === void 0 ? void 0 : footerButton.link, label: footerButton === null || footerButton === void 0 ? void 0 : footerButton.label, className: "tw-w-full" }) })] }) })] }) }) }));
6948
6985
  });
6949
6986
 
6950
6987
  function TokenPair({ firstToken, secondToken }) {
@@ -42341,6 +42378,13 @@ const TrackTransactionView = forwardRef((props, ref) => {
42341
42378
  currentStepIndex: rawSteps.length - 1,
42342
42379
  };
42343
42380
  }
42381
+ if (swapState === SwapState.ERROR) {
42382
+ const firstErrorStepIndex = rawSteps.findIndex((s) => s.status === 'error');
42383
+ return {
42384
+ steps: rawSteps,
42385
+ currentStepIndex: firstErrorStepIndex,
42386
+ };
42387
+ }
42344
42388
  return {
42345
42389
  steps: rawSteps,
42346
42390
  currentStepIndex: 0,
@@ -42359,8 +42403,8 @@ const lightTheme = {
42359
42403
  // content
42360
42404
  'content-100': '#17191C',
42361
42405
  'content-200': '#292C32',
42362
- 'content-300': '#4C515D',
42363
- 'content-400': '#626784',
42406
+ 'content-300': '#292C32',
42407
+ 'content-400': '#676B7E',
42364
42408
  'content-500': '#8A8FA8',
42365
42409
  'content-600': '#A7ABBE',
42366
42410
  'content-700': '#D1D6E0',
@@ -42370,7 +42414,7 @@ const lightTheme = {
42370
42414
  'accent-400': '#9E79D2',
42371
42415
  'accent-500': '#B893EC',
42372
42416
  // status
42373
- 'status-positive': '#11D421',
42417
+ 'status-positive': '#17CF26',
42374
42418
  'status-negative': '#FF5B4D',
42375
42419
  'status-warning': '#EC9213',
42376
42420
  };
@@ -42540,4 +42584,4 @@ function SquidConfigProvider({ theme = lightTheme, children, themeType = 'light'
42540
42584
  return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-font-geist", children: children }));
42541
42585
  }
42542
42586
 
42543
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
42587
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, STEP_ITEM_HEIGHT, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
@@ -1,3 +1,4 @@
1
+ type AssetsButtonVariant = 'primary' | 'accent';
1
2
  interface AssetsButtonProps {
2
3
  tokenImageUrl?: string;
3
4
  chainImageUrl?: string;
@@ -6,6 +7,7 @@ interface AssetsButtonProps {
6
7
  tokenBgColor?: string;
7
8
  tokenTextColor?: string;
8
9
  onClick?: () => void;
10
+ variant?: AssetsButtonVariant;
9
11
  }
10
- export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor, tokenBgColor, tokenTextColor, onClick, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DropdownMenuItemProps } from './DropdownMenuItem';
3
- type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
3
+ import { HistoryItemStatus } from '../../types/components';
4
4
  interface HistoryItemProps {
5
5
  firstImageUrl: string;
6
6
  secondImageUrl: string;
@@ -4,6 +4,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
4
4
  mainImageUrl?: string;
5
5
  secondaryImageUrl?: string;
6
6
  subtitle?: string;
7
+ subtitleOnHover?: React.ReactNode;
7
8
  detail?: string;
8
9
  icon?: React.ReactNode;
9
10
  size?: ListItemSize;
@@ -20,5 +21,5 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
20
21
  containerProps?: React.HTMLAttributes<HTMLLIElement>;
21
22
  }
22
23
  type ListItemSize = 'small' | 'large';
23
- export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
24
25
  export {};
@@ -5,5 +5,6 @@ interface SwapStepItemProps {
5
5
  link?: string;
6
6
  status?: SwapStepItemStatus;
7
7
  }
8
+ export declare const STEP_ITEM_HEIGHT = 52;
8
9
  export declare function SwapStepItem({ descriptionBlocks, showStepSeparator, link, status, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -3,7 +3,8 @@ import { AssetsButton } from '../../components/buttons/AssetsButton';
3
3
  declare const meta: Meta<typeof AssetsButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
- export declare const Empty: Story;
6
+ export declare const PrimaryVariantEmpty: Story;
7
+ export declare const AccentVariantEmpty: Story;
7
8
  export declare const ChainOnly: Story;
8
9
  export declare const ChainAndTokenLightText: Story;
9
10
  export declare const ChainAndTokenDarkText: Story;
@@ -10,3 +10,4 @@ export declare const ShortRoute: Story;
10
10
  export declare const LongRoute: Story;
11
11
  export declare const Error: Story;
12
12
  export declare const Warning: Story;
13
+ export declare const LongDescriptionSteps: Story;
@@ -9,6 +9,8 @@ export declare const LargeWithLongTitle: Story;
9
9
  export declare const LargeWithLongTitleAndSubtitle: Story;
10
10
  export declare const LargeRoundedFull: Story;
11
11
  export declare const LargeWithSubtitle: Story;
12
+ export declare const SubtitleOnHover: Story;
13
+ export declare const SubtitleOnHoverTokenBalance: Story;
12
14
  export declare const LargeWithDetail: Story;
13
15
  export declare const LargeWithIcon: Story;
14
16
  export declare const LargeWithDetailAndIconInteractive: Story;
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Executed: Story;
7
7
  export declare const ExecutedWithSeparator: Story;
8
+ export declare const ExecutedWithSeparatorAndLink: Story;
8
9
  export declare const Success: Story;
9
10
  export declare const SuccessWithSeparator: Story;
10
11
  export declare const Pending: Story;
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const WithControls: Story;
7
7
  export declare const ShortRoute: Story;
8
+ export declare const LongDescriptionSteps: Story;
8
9
  export declare const LongRoute: Story;
9
10
  export declare const Completed: Story;
10
11
  export declare const Error: Story;
@@ -4,6 +4,7 @@ export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
4
4
  export type ButtonSize = 'md' | 'lg';
5
5
  export type SwapDirection = 'from' | 'to';
6
6
  export type BoostMode = 'normal' | 'boost';
7
+ export type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
7
8
  export type SwapStepDescriptionBlock = {
8
9
  type: 'string';
9
10
  value: string;
@@ -1,2 +1,2 @@
1
1
  export type { SquidTheme } from './config';
2
- export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, } from './components';
2
+ export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, HistoryItemStatus, } from './components';
package/dist/index.css CHANGED
@@ -741,6 +741,10 @@ video {
741
741
  top: 11px;
742
742
  }
743
743
 
744
+ .tw-top-full {
745
+ top: 100%;
746
+ }
747
+
744
748
  .tw-top-squid-xxs {
745
749
  top: 0.3125rem;
746
750
  }
@@ -820,6 +824,14 @@ video {
820
824
  margin-right: 1px;
821
825
  }
822
826
 
827
+ .tw-mt-0 {
828
+ margin-top: 0px;
829
+ }
830
+
831
+ .tw-mt-0\.5 {
832
+ margin-top: 0.125rem;
833
+ }
834
+
823
835
  .tw-mt-1 {
824
836
  margin-top: 0.25rem;
825
837
  }
@@ -960,10 +972,6 @@ video {
960
972
  height: 640px;
961
973
  }
962
974
 
963
- .tw-h-\[660px\] {
964
- height: 660px;
965
- }
966
-
967
975
  .tw-h-\[94px\] {
968
976
  height: 94px;
969
977
  }
@@ -977,7 +985,7 @@ video {
977
985
  }
978
986
 
979
987
  .tw-h-card {
980
- height: 680px;
988
+ height: 660px;
981
989
  }
982
990
 
983
991
  .tw-h-full {
@@ -1020,10 +1028,6 @@ video {
1020
1028
  max-height: 205px;
1021
1029
  }
1022
1030
 
1023
- .tw-max-h-\[413px\] {
1024
- max-height: 413px;
1025
- }
1026
-
1027
1031
  .tw-max-h-\[535px\] {
1028
1032
  max-height: 535px;
1029
1033
  }
@@ -1032,6 +1036,10 @@ video {
1032
1036
  max-height: 540px;
1033
1037
  }
1034
1038
 
1039
+ .tw-max-h-\[55px\] {
1040
+ max-height: 55px;
1041
+ }
1042
+
1035
1043
  .tw-max-h-\[600px\] {
1036
1044
  max-height: 600px;
1037
1045
  }
@@ -1064,12 +1072,16 @@ video {
1064
1072
  min-height: 30px;
1065
1073
  }
1066
1074
 
1075
+ .tw-min-h-\[55px\] {
1076
+ min-height: 55px;
1077
+ }
1078
+
1067
1079
  .tw-min-h-button {
1068
1080
  min-height: 3.75rem;
1069
1081
  }
1070
1082
 
1071
1083
  .tw-min-h-card {
1072
- min-height: 680px;
1084
+ min-height: 660px;
1073
1085
  }
1074
1086
 
1075
1087
  .tw-min-h-squid-l {
@@ -1189,10 +1201,6 @@ video {
1189
1201
  width: 470px;
1190
1202
  }
1191
1203
 
1192
- .tw-w-\[480px\] {
1193
- width: 480px;
1194
- }
1195
-
1196
1204
  .tw-w-\[500px\] {
1197
1205
  width: 500px;
1198
1206
  }
@@ -1242,7 +1250,7 @@ video {
1242
1250
  }
1243
1251
 
1244
1252
  .tw-w-card {
1245
- width: 500px;
1253
+ width: 480px;
1246
1254
  }
1247
1255
 
1248
1256
  .tw-w-fit {
@@ -1738,10 +1746,6 @@ video {
1738
1746
  border-radius: 0.9375rem;
1739
1747
  }
1740
1748
 
1741
- .tw-rounded-squid-xl {
1742
- border-radius: 2.5rem;
1743
- }
1744
-
1745
1749
  .tw-rounded-squid-xs {
1746
1750
  border-radius: 0.625rem;
1747
1751
  }
@@ -1834,10 +1838,6 @@ video {
1834
1838
  border-color: var(--squid-theme-grey-900);
1835
1839
  }
1836
1840
 
1837
- .tw-border-material-light-thick {
1838
- border-color: var(--squid-theme-material-light-thick);
1839
- }
1840
-
1841
1841
  .tw-border-material-light-thin {
1842
1842
  border-color: var(--squid-theme-material-light-thin);
1843
1843
  }
@@ -1911,10 +1911,6 @@ video {
1911
1911
  background-color: var(--squid-theme-material-dark-thin);
1912
1912
  }
1913
1913
 
1914
- .tw-bg-material-light-thick {
1915
- background-color: var(--squid-theme-material-light-thick);
1916
- }
1917
-
1918
1914
  .tw-bg-material-light-thin {
1919
1915
  background-color: var(--squid-theme-material-light-thin);
1920
1916
  }
@@ -2033,10 +2029,6 @@ video {
2033
2029
  padding: 1.875rem;
2034
2030
  }
2035
2031
 
2036
- .tw-p-squid-s {
2037
- padding: 0.9375rem;
2038
- }
2039
-
2040
2032
  .tw-p-squid-xs {
2041
2033
  padding: 0.625rem;
2042
2034
  }
@@ -2105,6 +2097,11 @@ video {
2105
2097
  padding-right: 1.25rem;
2106
2098
  }
2107
2099
 
2100
+ .tw-px-squid-s {
2101
+ padding-left: 0.9375rem;
2102
+ padding-right: 0.9375rem;
2103
+ }
2104
+
2108
2105
  .tw-px-squid-xs {
2109
2106
  padding-left: 0.625rem;
2110
2107
  padding-right: 0.625rem;
@@ -2135,11 +2132,6 @@ video {
2135
2132
  padding-bottom: 0.5rem;
2136
2133
  }
2137
2134
 
2138
- .tw-py-\[15px\] {
2139
- padding-top: 15px;
2140
- padding-bottom: 15px;
2141
- }
2142
-
2143
2135
  .tw-py-squid-s {
2144
2136
  padding-top: 0.9375rem;
2145
2137
  padding-bottom: 0.9375rem;
@@ -2256,10 +2248,6 @@ video {
2256
2248
  padding-right: 0.625rem;
2257
2249
  }
2258
2250
 
2259
- .tw-pt-\[52px\] {
2260
- padding-top: 52px;
2261
- }
2262
-
2263
2251
  .tw-pt-\[5px\] {
2264
2252
  padding-top: 5px;
2265
2253
  }
@@ -2818,6 +2806,10 @@ input[type='number'] {
2818
2806
  display: block;
2819
2807
  }
2820
2808
 
2809
+ .tw-group\/list-item:hover .group-hover\/list-item\:tw-block {
2810
+ display: block;
2811
+ }
2812
+
2821
2813
  .tw-group\/history-item:hover .group-hover\/history-item\:tw-hidden {
2822
2814
  display: none;
2823
2815
  }
@@ -2980,12 +2972,24 @@ input[type='number'] {
2980
2972
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
2981
2973
  }
2982
2974
 
2975
+ .tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-shadow-elevation-dark-3 {
2976
+ --tw-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.20), 0px 5px 50px -1px rgba(0, 0, 0, 0.33);
2977
+ --tw-shadow-colored: 0px 2px 4px 0px var(--tw-shadow-color), 0px 5px 50px -1px var(--tw-shadow-color);
2978
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
2979
+ }
2980
+
2983
2981
  .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-shadow-elevation-light-2 {
2984
2982
  --tw-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.10), 0px 5px 20px -1px rgba(0, 0, 0, 0.10);
2985
2983
  --tw-shadow-colored: 0px 2px 5px 1px var(--tw-shadow-color), 0px 5px 20px -1px var(--tw-shadow-color);
2986
2984
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
2987
2985
  }
2988
2986
 
2987
+ .tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-shadow-elevation-light-3 {
2988
+ --tw-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.10), 0px 5px 50px -1px rgba(0, 0, 0, 0.20);
2989
+ --tw-shadow-colored: 0px 2px 4px 0px var(--tw-shadow-color), 0px 5px 50px -1px var(--tw-shadow-color);
2990
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
2991
+ }
2992
+
2989
2993
  .tw-peer[data-boost-mode=boost] ~ .peer-data-\[boost-mode\=boost\]\:tw-bg-status-positive {
2990
2994
  background-color: var(--squid-theme-status-positive);
2991
2995
  }
package/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ interface ArrowButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
37
37
  }
38
38
  declare function ArrowButton({ label, disabled, ...props }: ArrowButtonProps): react_jsx_runtime.JSX.Element;
39
39
 
40
+ type AssetsButtonVariant = 'primary' | 'accent';
40
41
  interface AssetsButtonProps {
41
42
  tokenImageUrl?: string;
42
43
  chainImageUrl?: string;
@@ -45,8 +46,9 @@ interface AssetsButtonProps {
45
46
  tokenBgColor?: string;
46
47
  tokenTextColor?: string;
47
48
  onClick?: () => void;
49
+ variant?: AssetsButtonVariant;
48
50
  }
49
- declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor, tokenBgColor, tokenTextColor, onClick, }: AssetsButtonProps): react_jsx_runtime.JSX.Element;
51
+ declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant, }: AssetsButtonProps): react_jsx_runtime.JSX.Element;
50
52
 
51
53
  type TextSize = 'small' | 'medium' | 'large';
52
54
  type SwitchSize = 'small' | 'large';
@@ -54,6 +56,7 @@ type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
54
56
  type ButtonSize = 'md' | 'lg';
55
57
  type SwapDirection = 'from' | 'to';
56
58
  type BoostMode = 'normal' | 'boost';
59
+ type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
57
60
  type SwapStepDescriptionBlock = {
58
61
  type: 'string';
59
62
  value: string;
@@ -236,7 +239,6 @@ interface DropdownMenuItemProps {
236
239
  }
237
240
  declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
238
241
 
239
- type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
240
242
  interface HistoryItemProps {
241
243
  firstImageUrl: string;
242
244
  secondImageUrl: string;
@@ -258,6 +260,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
258
260
  mainImageUrl?: string;
259
261
  secondaryImageUrl?: string;
260
262
  subtitle?: string;
263
+ subtitleOnHover?: React.ReactNode;
261
264
  detail?: string;
262
265
  icon?: React.ReactNode;
263
266
  size?: ListItemSize;
@@ -274,7 +277,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
274
277
  containerProps?: React.HTMLAttributes<HTMLLIElement>;
275
278
  }
276
279
  type ListItemSize = 'small' | 'large';
277
- declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
280
+ declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
278
281
 
279
282
  interface MenuItemProps {
280
283
  label: string;
@@ -346,6 +349,7 @@ interface SwapStepItemProps {
346
349
  link?: string;
347
350
  status?: SwapStepItemStatus;
348
351
  }
352
+ declare const STEP_ITEM_HEIGHT = 52;
349
353
  declare function SwapStepItem({ descriptionBlocks, showStepSeparator, link, status, }: SwapStepItemProps): react_jsx_runtime.JSX.Element;
350
354
 
351
355
  interface DropdownMenuProps {
@@ -573,4 +577,4 @@ declare function useDropdownMenu(props?: {
573
577
  openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
574
578
  };
575
579
 
576
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapState, type SwapStep, SwapStepItem, type SwapStepItemStatus, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, Switch, type ThemeType, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
580
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, type HistoryItemStatus, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, STEP_ITEM_HEIGHT, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapState, type SwapStep, SwapStepItem, type SwapStepItemStatus, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, Switch, type ThemeType, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
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.15.4",
8
+ "version": "0.15.6",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "resolutions": {