@0xsquid/ui 0.9.4 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/index.js +156 -111
  2. package/dist/cjs/types/components/buttons/BoostButton.d.ts +2 -1
  3. package/dist/cjs/types/components/buttons/Button.d.ts +2 -1
  4. package/dist/cjs/types/components/controls/Tooltip.d.ts +2 -1
  5. package/dist/cjs/types/components/icons/Social.d.ts +4 -0
  6. package/dist/cjs/types/components/layout/Boost.d.ts +2 -1
  7. package/dist/cjs/types/components/layout/DetailsToolbar.d.ts +2 -1
  8. package/dist/cjs/types/components/lists/ListItem.d.ts +1 -1
  9. package/dist/cjs/types/core/constants.d.ts +4 -0
  10. package/dist/cjs/types/core/themes.d.ts +1 -0
  11. package/dist/cjs/types/providers/SquidConfigProvider.d.ts +2 -2
  12. package/dist/cjs/types/services/internal/colorService.d.ts +16 -1
  13. package/dist/cjs/types/stories/buttons/BoostButton.stories.d.ts +1 -0
  14. package/dist/cjs/types/stories/buttons/Button.stories.d.ts +2 -0
  15. package/dist/cjs/types/stories/layout/Boost.stories.d.ts +1 -0
  16. package/dist/cjs/types/stories/layout/DetailsToolbar.stories.d.ts +1 -0
  17. package/dist/cjs/types/stories/lists/ListItem.stories.d.ts +1 -0
  18. package/dist/cjs/types/types/config.d.ts +23 -16
  19. package/dist/esm/index.js +156 -111
  20. package/dist/esm/types/components/buttons/BoostButton.d.ts +2 -1
  21. package/dist/esm/types/components/buttons/Button.d.ts +2 -1
  22. package/dist/esm/types/components/controls/Tooltip.d.ts +2 -1
  23. package/dist/esm/types/components/icons/Social.d.ts +4 -0
  24. package/dist/esm/types/components/layout/Boost.d.ts +2 -1
  25. package/dist/esm/types/components/layout/DetailsToolbar.d.ts +2 -1
  26. package/dist/esm/types/components/lists/ListItem.d.ts +1 -1
  27. package/dist/esm/types/core/constants.d.ts +4 -0
  28. package/dist/esm/types/core/themes.d.ts +1 -0
  29. package/dist/esm/types/providers/SquidConfigProvider.d.ts +2 -2
  30. package/dist/esm/types/services/internal/colorService.d.ts +16 -1
  31. package/dist/esm/types/stories/buttons/BoostButton.stories.d.ts +1 -0
  32. package/dist/esm/types/stories/buttons/Button.stories.d.ts +2 -0
  33. package/dist/esm/types/stories/layout/Boost.stories.d.ts +1 -0
  34. package/dist/esm/types/stories/layout/DetailsToolbar.stories.d.ts +1 -0
  35. package/dist/esm/types/stories/lists/ListItem.stories.d.ts +1 -0
  36. package/dist/esm/types/types/config.d.ts +23 -16
  37. package/dist/index.css +84 -40
  38. package/dist/index.d.ts +31 -40
  39. package/package.json +1 -1
  40. package/dist/cjs/types/components/views/ProfileView.d.ts +0 -1
  41. package/dist/cjs/types/stories/views/ProfileView.stories.d.ts +0 -6
  42. package/dist/esm/types/components/views/ProfileView.d.ts +0 -1
  43. package/dist/esm/types/stories/views/ProfileView.stories.d.ts +0 -6
package/dist/cjs/index.js CHANGED
@@ -2680,12 +2680,6 @@ const SQUID_THEME_CSS_VARIABLE_PREFIX = '--squid-theme-';
2680
2680
  * Mapping between readable variables name and css variables used TailwindCSS config
2681
2681
  */
2682
2682
  const themeTypesKeys = {
2683
- 'accent-gold': {
2684
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}accent-gold`,
2685
- },
2686
- 'accent-salmon': {
2687
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}accent-salmon`,
2688
- },
2689
2683
  'grey-100': {
2690
2684
  cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}grey-100`,
2691
2685
  },
@@ -2731,54 +2725,18 @@ const themeTypesKeys = {
2731
2725
  'material-light-thin': {
2732
2726
  cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}material-light-thin`,
2733
2727
  },
2734
- 'royal-100': {
2735
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-100`,
2736
- },
2737
- 'royal-200': {
2738
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-200`,
2739
- },
2740
- 'royal-300': {
2741
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-300`,
2742
- },
2743
2728
  'royal-400': {
2744
2729
  cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-400`,
2745
2730
  },
2746
2731
  'royal-500': {
2747
2732
  cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-500`,
2748
2733
  },
2749
- 'royal-600': {
2750
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-600`,
2751
- },
2752
- 'royal-700': {
2753
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-700`,
2754
- },
2755
- 'royal-800': {
2756
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}royal-800`,
2757
- },
2758
2734
  'status-negative': {
2759
2735
  cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}status-negative`,
2760
2736
  },
2761
2737
  'status-positive': {
2762
2738
  cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}status-positive`,
2763
2739
  },
2764
- 'volt-300': {
2765
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}volt-300`,
2766
- },
2767
- 'volt-400': {
2768
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}volt-400`,
2769
- },
2770
- 'volt-600': {
2771
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}volt-600`,
2772
- },
2773
- 'volt-700': {
2774
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}volt-700`,
2775
- },
2776
- 'volt-800': {
2777
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}volt-800`,
2778
- },
2779
- 'volt-900': {
2780
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}volt-900`,
2781
- },
2782
2740
  };
2783
2741
 
2784
2742
  function PlusIcon() {
@@ -2807,6 +2765,11 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
2807
2765
  }, children: [jsxRuntime.jsx(BodyText, { size: "small", className: "tw-leading-[13px]", children: tokenImageUrl ? tokenSymbol : 'Select token' }), jsxRuntime.jsx(ChevronLargeRightIcon, { className: "tw-opacity-66" })] })] }));
2808
2766
  }
2809
2767
 
2768
+ const CSS_VARS = {
2769
+ MOVE_WITH_SPRING_BOUNCE_DURATION: '--squid-animation-move-with-spring-bounce-duration',
2770
+ DISPLAY_DELAYED_DURATION: '--squid-animation-display-delayed-duration',
2771
+ };
2772
+
2810
2773
  function SearchIcon() {
2811
2774
  return (jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M20 20L16.05 16.05M18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
2812
2775
  }
@@ -3009,7 +2972,7 @@ const borderRadiusClassMap = {
3009
2972
  };
3010
2973
  function Menu(_a) {
3011
2974
  var { children, containerClassName, contentClassName, title, displayControls, rounded = 'lg', menuRef } = _a, props = __rest(_a, ["children", "containerClassName", "contentClassName", "title", "displayControls", "rounded", "menuRef"]);
3012
- return (jsxRuntime.jsx("div", Object.assign({}, props, { className: cn('tw-max-w-[320px]', containerClassName), ref: menuRef, children: jsxRuntime.jsxs("div", { className: cn('tw-relative tw-inline-flex tw-max-w-full tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-m tw-bg-material-dark-thick tw-p-squid-s tw-text-center tw-text-material-light-thick tw-backdrop-blur/20 tw-backdrop-saturate-150 group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-2 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-2', borderRadiusClassMap[rounded], contentClassName), children: [title ? (jsxRuntime.jsx("div", { className: "tw-z-20 tw-flex tw-flex-col tw-items-center tw-justify-center tw-self-stretch tw-py-squid-xxs tw-text-grey-100", children: jsxRuntime.jsx(BodyText, { size: "small", className: "tw-self-stretch !tw-leading-[10px]", children: title }) })) : null, typeof children === 'string' ? (jsxRuntime.jsx(CaptionText, { className: "tw-z-20 tw-self-stretch", children: children })) : (jsxRuntime.jsx("div", { className: "tw-z-20 tw-max-w-full", children: children })), displayControls ? (jsxRuntime.jsx("div", { className: "tw-z-20 tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xs", children: jsxRuntime.jsx(Button, { size: "md", variant: "tertiary", label: "Learn more", className: "tw-self-stretch" }) })) : null, jsxRuntime.jsx("div", { className: cn('tw-absolute tw-z-10 tw-h-full tw-w-full tw-border tw-border-material-light-thin tw-bg-material-light-thin', borderRadiusClassMap[rounded]) })] }) })));
2975
+ return (jsxRuntime.jsx("div", Object.assign({}, props, { className: cn('tw-max-w-[320px]', containerClassName), ref: menuRef, children: jsxRuntime.jsxs("div", { className: cn('tw-relative tw-inline-flex tw-max-w-full tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-m tw-bg-material-dark-thick tw-p-squid-s tw-text-center tw-text-material-light-thick tw-backdrop-blur/20 tw-backdrop-saturate-150 group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-2 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-2', borderRadiusClassMap[rounded], contentClassName), children: [title ? (jsxRuntime.jsx("div", { className: "tw-z-20 tw-flex tw-flex-col tw-items-center tw-justify-center tw-self-stretch tw-py-squid-xxs tw-text-grey-100", children: jsxRuntime.jsx(BodyText, { size: "small", className: "tw-self-stretch !tw-leading-[10px]", children: title }) })) : null, typeof children === 'string' ? (jsxRuntime.jsx(CaptionText, { className: "tw-z-20 tw-self-stretch", children: children })) : (jsxRuntime.jsx("div", { className: "tw-z-20 tw-max-w-full tw-text-caption", children: children })), displayControls ? (jsxRuntime.jsx("div", { className: "tw-z-20 tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xs", children: jsxRuntime.jsx(Button, { size: "md", variant: "tertiary", label: "Learn more", className: "tw-self-stretch" }) })) : null, jsxRuntime.jsx("div", { className: cn('tw-absolute tw-z-10 tw-h-full tw-w-full tw-border tw-border-material-light-thin tw-bg-material-light-thin', borderRadiusClassMap[rounded]) })] }) })));
3013
2976
  }
3014
2977
 
3015
2978
  const tooltipWidthClassMap = {
@@ -3025,19 +2988,25 @@ const tooltipThresholdClassMap = {
3025
2988
  xl: 'tw-pb-squid-xl',
3026
2989
  xxl: 'tw-pb-squid-xxl',
3027
2990
  };
3028
- function Tooltip({ children, tooltipContent, tooltipWidth = 'container', threshold = 'xxs', containerClassName, childrenClassName, tooltipClassName, }) {
3029
- return (jsxRuntime.jsxs("div", { className: cn('tw-relative', containerClassName), children: [jsxRuntime.jsx("div", { className: cn('tw-peer', childrenClassName), children: children }), tooltipContent ? (jsxRuntime.jsx(Menu, { containerClassName: cn('tw-absolute tw-z-40 tw-hidden hover:tw-block peer-hover:tw-block', 'tw-bottom-full tw-left-1/2 -tw-translate-x-1/2', tooltipWidthClassMap[tooltipWidth], tooltipThresholdClassMap[threshold], tooltipClassName), children: tooltipContent })) : null] }));
2991
+ function Tooltip({ children, tooltipContent, tooltipWidth = 'container', threshold = 'xxs', containerClassName, childrenClassName, tooltipClassName, displayDelayMs = 0, }) {
2992
+ return (jsxRuntime.jsxs("div", { className: cn('tw-relative', containerClassName), children: [jsxRuntime.jsx("div", { className: cn('tw-peer', childrenClassName), children: children }), tooltipContent ? (jsxRuntime.jsx(Menu, { style: {
2993
+ [CSS_VARS.DISPLAY_DELAYED_DURATION]: `${displayDelayMs}ms`,
2994
+ }, containerClassName: cn(
2995
+ // general styles
2996
+ 'tw-absolute tw-z-40 tw-bottom-full tw-left-1/2 -tw-translate-x-1/2',
2997
+ // visibility styles. Display only on hover
2998
+ 'tw-opacity-0 hover:tw-animate-display-delayed peer-hover:tw-animate-display-delayed', tooltipWidthClassMap[tooltipWidth], tooltipThresholdClassMap[threshold], tooltipClassName), children: tooltipContent })) : null] }));
3030
2999
  }
3031
3000
 
3032
3001
  const animationDuration = '500ms';
3033
- function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode = true, boostDisabledMessage = 'Boost disabled', }) {
3002
+ function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode = true, boostDisabledMessage = 'Boost disabled', tooltipDisplayDelayMs = 0, }) {
3034
3003
  const boostIndicatorRef = react.useRef(null);
3035
3004
  function handleToggleBoostMode() {
3036
3005
  if (!boostIndicatorRef.current || !canToggleBoostMode)
3037
3006
  return;
3038
3007
  // we don't want to trigger the animation when the component is mounted
3039
3008
  // so we set the animation duration only when user clicks the button
3040
- boostIndicatorRef.current.style.setProperty('--boost-animation-duration', animationDuration);
3009
+ boostIndicatorRef.current.style.setProperty(CSS_VARS.MOVE_WITH_SPRING_BOUNCE_DURATION, animationDuration);
3041
3010
  if (boostIndicatorRef.current.dataset.boostMode === 'normal') {
3042
3011
  boostIndicatorRef.current.dataset.boostMode = 'boost';
3043
3012
  onToggleBoostMode === null || onToggleBoostMode === void 0 ? void 0 : onToggleBoostMode({ boostMode: 'boost' });
@@ -3047,7 +3016,7 @@ function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode = true,
3047
3016
  onToggleBoostMode === null || onToggleBoostMode === void 0 ? void 0 : onToggleBoostMode({ boostMode: 'normal' });
3048
3017
  }
3049
3018
  }
3050
- return (jsxRuntime.jsx(Tooltip, { tooltipWidth: "max", tooltipContent: canToggleBoostMode ? null : boostDisabledMessage, children: jsxRuntime.jsxs("button", { onClick: handleToggleBoostMode, disabled: !canToggleBoostMode, className: "tw-group tw-relative tw-flex tw-h-squid-xl tw-w-[140px] tw-flex-col tw-justify-between tw-overflow-hidden tw-bg-grey-900 tw-pb-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 tw-absolute tw-left-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-r tw-from-grey-900 tw-to-transparent" }), jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 tw-absolute tw-right-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-l tw-from-grey-900 tw-to-transparent" }), jsxRuntime.jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-flex tw-h-full tw-w-full tw-items-center tw-justify-between tw-transition-transform group-disabled:tw-grayscale data-[boost-mode=boost]:tw-animate-move-to-left-with-spring-bounce data-[boost-mode=normal]:tw-animate-move-to-right-with-spring-bounce", children: [jsxRuntime.jsx("div", { className: "tw-w-1/2 tw-text-center group-disabled:tw-grayscale", children: jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxRuntime.jsxs("div", { className: "tw-w-1/2 tw-text-center group-disabled:tw-grayscale", children: [jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-status-positive", children: "Boost" }), ' '] }), jsxRuntime.jsx("div", { className: "tw-absolute tw-bottom-0 tw-h-1.5 tw-w-[1.5px] tw-rounded-sm tw-bg-grey-500 tw-text-grey-500 group-data-[boost-mode=boost]:tw-left-[calc(50%-2px)] group-data-[boost-mode=normal]:tw-left-[calc(50%-6px)]", style: {
3019
+ return (jsxRuntime.jsx(Tooltip, { tooltipWidth: "max", displayDelayMs: tooltipDisplayDelayMs, tooltipContent: canToggleBoostMode ? null : boostDisabledMessage, children: jsxRuntime.jsxs("button", { onClick: handleToggleBoostMode, disabled: !canToggleBoostMode, className: "tw-group tw-relative tw-flex tw-h-squid-xl tw-w-[140px] tw-flex-col tw-justify-between tw-overflow-hidden tw-bg-grey-900 tw-pb-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 tw-absolute tw-left-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-r tw-from-grey-900 tw-to-transparent" }), jsxRuntime.jsx("span", { className: "tw-via-grey-900/70 tw-absolute tw-right-0 tw-top-0 tw-z-10 tw-h-full tw-w-8 tw-bg-gradient-to-l tw-from-grey-900 tw-to-transparent" }), jsxRuntime.jsxs("div", { ref: boostIndicatorRef, "data-boost-mode": boostMode, className: "tw-group tw-peer tw-flex tw-h-full tw-w-full tw-items-center tw-justify-between tw-transition-transform group-disabled:tw-grayscale data-[boost-mode=boost]:tw-animate-move-to-left-with-spring-bounce data-[boost-mode=normal]:tw-animate-move-to-right-with-spring-bounce", children: [jsxRuntime.jsx("div", { className: "tw-w-1/2 tw-text-center group-disabled:tw-grayscale", children: jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-grey-300", children: "Normal" }) }), jsxRuntime.jsxs("div", { className: "tw-w-1/2 tw-text-center group-disabled:tw-grayscale", children: [jsxRuntime.jsx(BodyText, { size: "small", className: "tw-text-status-positive", children: "Boost" }), ' '] }), jsxRuntime.jsx("div", { className: "tw-absolute tw-bottom-0 tw-h-1.5 tw-w-[1.5px] tw-rounded-sm tw-bg-grey-500 tw-text-grey-500 group-data-[boost-mode=boost]:tw-left-[calc(50%-2px)] group-data-[boost-mode=normal]:tw-left-[calc(50%-6px)]", style: {
3051
3020
  boxShadow: generateMarkerLines(40),
3052
3021
  } })] }), jsxRuntime.jsx("div", { className: cn('tw-absolute tw-bottom-0.5 tw-left-[calc(50%-1.5px)] tw-z-20 tw-h-[10px] tw-w-[3px] tw-rounded-sm tw-transition-colors group-disabled:tw-grayscale peer-data-[boost-mode=boost]:tw-bg-status-positive peer-data-[boost-mode=normal]:tw-bg-current'), style: {
3053
3022
  transitionDuration: animationDuration,
@@ -3066,30 +3035,35 @@ function generateMarkerLines(count) {
3066
3035
  }
3067
3036
 
3068
3037
  const buttonSizeClassMap = {
3069
- md: 'tw-px-squid-xs tw-py-squid-xxs tw-rounded-squid-m tw-border tw-flex tw-items-center tw-gap-squid-xxs tw-min-w-[60px] tw-h-squid-xl tw-justify-center',
3070
- lg: 'tw-border tw-rounded-squid-xxl tw-p-1 tw-h-button tw-w-full',
3038
+ md: 'tw-flex tw-px-squid-xs tw-py-squid-xxs tw-rounded-squid-m tw-border tw-flex tw-items-center tw-gap-squid-xxs tw-min-w-[60px] tw-h-squid-xl tw-justify-center',
3039
+ lg: 'tw-flex tw-border tw-rounded-squid-xxl tw-p-1 tw-h-button tw-w-full tw-flex tw-items-center',
3071
3040
  };
3072
3041
  const buttonVariantClassMap = {
3073
- primary: 'tw-bg-royal-500 tw-text-grey-100 tw-border-material-light-thin',
3042
+ primary: 'tw-bg-royal-500 group-data-[squid-theme-type=light]:tw-text-grey-900 group-data-[squid-theme-type=dark]:tw-text-grey-100 tw-border-material-light-thin',
3074
3043
  secondary: 'tw-bg-grey-100 tw-text-grey-800 tw-border-material-light-thin',
3075
3044
  tertiary: 'tw-bg-grey-800 tw-text-grey-300 tw-border-material-light-thin',
3076
3045
  };
3077
3046
  // right now all variants have the same disabled styles
3078
3047
  // in the future, we can add more disabled styles for different variants
3079
- const buttonDisabledClass = 'disabled:tw-bg-grey-800 disabled:tw-text-grey-600';
3048
+ const buttonDisabledClass = 'tw-bg-grey-800 tw-text-grey-600 tw-cursor-not-allowed';
3080
3049
  function Button(_a) {
3081
- var { label, disabled, size, variant, icon } = _a, props = __rest(_a, ["label", "disabled", "size", "variant", "icon"]);
3082
- return (jsxRuntime.jsx("button", Object.assign({}, props, { disabled: disabled, className: clsx(buttonSizeClassMap[size], buttonVariantClassMap[variant],
3083
- // disabled styles
3084
- buttonDisabledClass,
3085
- // custom classes from props
3086
- props.className), children: size === 'lg' ? (jsxRuntime.jsx("span", { className: "tw-px-squid-m", children: jsxRuntime.jsx(BodyText, { size: "medium", children: label }) })) : size === 'md' ? (label && !icon ? (
3050
+ var { label, disabled, size, variant, icon, link } = _a, props = __rest(_a, ["label", "disabled", "size", "variant", "icon", "link"]);
3051
+ const children = (jsxRuntime.jsx(jsxRuntime.Fragment, { children: size === 'lg' ? (jsxRuntime.jsx("span", { className: "tw-px-squid-m", children: jsxRuntime.jsx(BodyText, { size: "medium", children: label }) })) : size === 'md' ? (label && !icon ? (
3087
3052
  // label only
3088
3053
  jsxRuntime.jsx(BodyText, { size: "small", children: label })) : !label && icon ? (
3089
3054
  // icon only
3090
3055
  icon) : (
3091
3056
  // icon and label
3092
- jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [icon, jsxRuntime.jsx(BodyText, { className: "tw-pr-1", size: "small", children: label })] }))) : null })));
3057
+ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [icon, jsxRuntime.jsx(BodyText, { className: "tw-pr-1", size: "small", children: label })] }))) : null }));
3058
+ const className = cn(buttonSizeClassMap[size], buttonVariantClassMap[variant],
3059
+ // disabled styles
3060
+ disabled && buttonDisabledClass,
3061
+ // custom classes from props
3062
+ props.className);
3063
+ if (link) {
3064
+ return (jsxRuntime.jsx("a", { "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, children: children }));
3065
+ }
3066
+ return (jsxRuntime.jsx("button", Object.assign({}, props, { "aria-disabled": disabled, className: className, disabled: disabled, children: children })));
3093
3067
  }
3094
3068
 
3095
3069
  function Chip(_a) {
@@ -3110,8 +3084,8 @@ function SettingsButton({ label, isSelected = false, }) {
3110
3084
  return (jsxRuntime.jsx("button", { className: cn('tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', isSelected && 'tw-outline-royal-500'), children: jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
3111
3085
  }
3112
3086
 
3113
- function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, }) {
3114
- return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
3087
+ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, boostTooltipDisplayDelayMs = 0, }) {
3088
+ return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode, tooltipDisplayDelayMs: boostTooltipDisplayDelayMs }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
3115
3089
  ? 'tw-bg-grey-300'
3116
3090
  : 'tw-bg-status-positive') })] }));
3117
3091
  }
@@ -3130,7 +3104,7 @@ const detailStateClassMap = {
3130
3104
  error: 'tw-opacity-33 tw-pointer-events-none',
3131
3105
  full: '',
3132
3106
  };
3133
- function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, isLoading, isEmpty, }) {
3107
+ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, isLoading, isEmpty, boostTooltipDisplayDelayMs = 0, }) {
3134
3108
  const state = react.useMemo(() => {
3135
3109
  if (errorMessage)
3136
3110
  return 'error';
@@ -3141,11 +3115,11 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
3141
3115
  return 'full';
3142
3116
  }, [errorMessage, isLoading, isEmpty]);
3143
3117
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
3144
- return (jsxRuntime.jsx("aside", { className: cn('tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500', state === 'error' ? 'tw-px-squid-l' : 'tw-px-squid-m'), children: state === 'error' && errorMessage ? (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(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, {}) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
3118
+ return (jsxRuntime.jsx("aside", { className: cn('tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500', state === 'error' ? 'tw-px-squid-l' : 'tw-px-squid-m'), children: state === 'error' && errorMessage ? (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(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, {}) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
3145
3119
  }
3146
3120
 
3147
3121
  function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }) {
3148
- return (jsxRuntime.jsx("li", { className: "tw-max-h-squid-xl tw-w-full tw-px-squid-xxs", onClick: onClick, children: jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-l tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-squid-xs tw-px-squid-xxs hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-between tw-rounded-squid-xs", children: imageUrl ? (jsxRuntime.jsx("img", { src: imageUrl, className: "tw-h-full tw-w-full tw-rounded-squid-xxs" })) : (icon) }), jsxRuntime.jsx(CaptionText, { className: cn(labelClassName, 'tw-max-w-full tw-truncate !tw-leading-[18px]'), children: label })] }) }));
3122
+ return (jsxRuntime.jsx("li", { className: "tw-max-h-squid-xl tw-w-full tw-px-squid-xxs", children: jsxRuntime.jsxs("button", { onClick: onClick, className: "tw-flex tw-h-squid-l tw-w-full tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-squid-xs tw-px-squid-xxs hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-between tw-rounded-squid-xs", children: imageUrl ? (jsxRuntime.jsx("img", { src: imageUrl, className: "tw-h-full tw-w-full tw-rounded-squid-xxs" })) : (icon) }), jsxRuntime.jsx(CaptionText, { className: cn(labelClassName, 'tw-max-w-full tw-truncate !tw-leading-[18px]'), children: label })] }) }));
3149
3123
  }
3150
3124
 
3151
3125
  function useDropdownMenu(props) {
@@ -3252,16 +3226,18 @@ const listItemSizeMap = {
3252
3226
  };
3253
3227
  function ListItem(_a) {
3254
3228
  var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading"]);
3255
- return (jsxRuntime.jsx("li", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs("div", { className: cn('tw-flex tw-w-full tw-max-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && 'tw-bg-material-light-thin'), children: [size === 'large' ? (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-xs',
3229
+ // 'small' variant does not have detail
3230
+ const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
3231
+ return (jsxRuntime.jsx("li", { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs("button", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && 'tw-bg-material-light-thin'), children: [size === 'large' ? (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-xs',
3256
3232
  // 'large' variant has extra padding
3257
- size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: "tw-max-w-full tw-truncate !tw-leading-[18px]", children: itemTitle })) : (itemTitle), size === 'large' &&
3258
- ((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-squid-xs !tw-leading-[10px] tw-text-grey-500", children: subtitle })) : null)] }), jsxRuntime.jsxs("button", { onClick: (event) => {
3233
+ size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: "tw-max-w-full tw-truncate !tw-leading-[14px]", children: itemTitle })) : (itemTitle), size === 'large' &&
3234
+ ((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-squid-xs tw-max-w-full tw-truncate !tw-leading-[11px] tw-text-grey-500", children: subtitle })) : null)] }), showDetail && (jsxRuntime.jsxs("button", { onClick: (event) => {
3259
3235
  // prevent click event from bubbling up to parent
3260
3236
  event.stopPropagation();
3261
3237
  onDetailClick === null || onDetailClick === void 0 ? void 0 : onDetailClick();
3262
- }, className: cn('tw-cursor-pointer tw-items-center tw-justify-center tw-rounded-squid-xs hover:tw-bg-material-light-thin', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
3263
- ? 'tw-hidden group-hover/list-item:tw-flex'
3264
- : 'tw-flex', detailButtonClassName), children: [size === 'large' && detail ? (jsxRuntime.jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })) : null, icon ? (jsxRuntime.jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })] }) })));
3238
+ }, className: cn('tw-flex tw-w-fit tw-cursor-pointer tw-items-center tw-justify-center tw-rounded-squid-xs hover:tw-bg-material-light-thin', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
3239
+ ? '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'
3240
+ : 'tw-flex', 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] }))] })) }));
3265
3241
  }
3266
3242
 
3267
3243
  function MenuItem({ label, imageUrl, icon }) {
@@ -3329,8 +3305,9 @@ const separatorClassMap = {
3329
3305
  progress: 'tw-text-grey-600',
3330
3306
  pending: 'tw-text-grey-600',
3331
3307
  };
3308
+ const colorsTransitionClass = 'tw-transition-colors tw-duration-300';
3332
3309
  function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = false, link, status = 'pending', }) {
3333
- return (jsxRuntime.jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-bg-grey-800 tw-text-grey-300", children: [showStepSeparator && (jsxRuntime.jsx("span", { className: separatorClassMap[status], children: jsxRuntime.jsx(SwapStepSeparator, {}) })), jsxRuntime.jsxs("a", { href: link, target: "_blank", 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', statusTextClassMap[status]), 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, { className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: typeof chipContent === 'string' ? (jsxRuntime.jsx(CaptionText, { children: chipContent })) : (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(({ type, value }, index) => {
3310
+ return (jsxRuntime.jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-text-grey-300", children: [showStepSeparator && (jsxRuntime.jsx("span", { className: cn(separatorClassMap[status], colorsTransitionClass, 'tw-duration-100'), children: jsxRuntime.jsx(SwapStepSeparator, {}) })), jsxRuntime.jsxs("a", { href: link, target: "_blank", 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', statusTextClassMap[status], colorsTransitionClass), 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, { className: cn('tw-w-squid-xl', statusBgClassMap[status], colorsTransitionClass), icon: typeof chipContent === 'string' ? (jsxRuntime.jsx(CaptionText, { children: chipContent })) : (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(({ type, value }, index) => {
3334
3311
  if (type === 'string') {
3335
3312
  return (
3336
3313
  // Instead of displaying the string into a single <BodyText />
@@ -3476,12 +3453,11 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }) {
3476
3453
  };
3477
3454
  }, [isShowRouteAnimationRunning]);
3478
3455
  const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3479
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { className: "tw-relative tw-max-h-button tw-max-w-[400px] tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800", onClick: () => {
3480
- // mount route component and start animation
3481
- setIsRouteVisible(true);
3482
- setIsShowRouteAnimationRunning(true);
3483
- }, children: [newStepIndex > currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-absolute -tw-top-full tw-left-0 tw-w-full tw-animate-translate-to-bottom", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx(CurrentStep, { className: cn(newStepIndex > currentStepIndex &&
3484
- 'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-absolute tw-left-0 tw-top-full tw-w-full tw-animate-translate-to-top", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx("span", { className: "tw-absolute tw-left-0 tw-top-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-b tw-from-grey-800" }), jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-0 tw-left-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-t tw-from-grey-800" })] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3456
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("button", { className: "tw-group/swap-step-item-button tw-relative tw-max-h-button tw-max-w-[400px] tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800 tw-transition-colors tw-duration-[50ms] hover:tw-bg-grey-700", onClick: () => {
3457
+ // mount route component and start animation
3458
+ setIsRouteVisible(true);
3459
+ setIsShowRouteAnimationRunning(true);
3460
+ }, children: [newStepIndex > currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-absolute -tw-top-full tw-left-0 tw-w-full tw-animate-translate-to-bottom", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx(CurrentStep, { className: cn(newStepIndex > currentStepIndex && 'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-absolute tw-left-0 tw-top-full tw-w-full tw-animate-translate-to-top", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx("span", { className: "tw-absolute tw-left-0 tw-top-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-b tw-from-grey-800 tw-transition-colors group-hover/swap-step-item-button:tw-from-grey-700" }), jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-0 tw-left-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-t tw-from-grey-800 tw-transition-colors group-hover/swap-step-item-button:tw-from-grey-700" })] }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3485
3461
  ? 'tw-animate-fade-in'
3486
3462
  : 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
3487
3463
  ? 'tw-animate-slide-to-top'
@@ -3501,42 +3477,111 @@ function TokenPair({ firstToken, secondToken }) {
3501
3477
  }, children: [jsxRuntime.jsx("img", { className: "tw-ml-[1px] tw-aspect-square tw-w-10", src: firstToken.imageUrl }), jsxRuntime.jsx("img", { className: "tw-mr-[1px] tw-aspect-square tw-w-10", src: secondToken.imageUrl })] })] }));
3502
3478
  }
3503
3479
 
3480
+ const lightTheme = {
3481
+ // content
3482
+ 'content-100': '#17191C',
3483
+ 'content-200': '#292C32',
3484
+ 'content-300': '#4C515D',
3485
+ 'content-400': '#626784',
3486
+ 'content-500': '#8A8FA8',
3487
+ 'content-600': '#A7ABBE',
3488
+ 'content-700': '#D1D6E0',
3489
+ 'content-800': '#EDEEF3',
3490
+ 'content-900': '#FBFBFD',
3491
+ // accent
3492
+ 'accent-400': '#9E79D2',
3493
+ 'accent-500': '#B893EC',
3494
+ // status
3495
+ 'status-positive': '#11D421',
3496
+ 'status-negative': '#FF5B4D',
3497
+ // transparent
3498
+ 'transparent-light-thin': '#17191C1A', // 10% opacity
3499
+ 'transparent-light-average': '#17191C54', // 33% opacity
3500
+ 'transparent-light-thick': '#17191CA8', // 66% opacity
3501
+ 'transparent-dark-thin': '#FBFBFD1A', // 10% opacity
3502
+ 'transparent-dark-average': '#FBFCFD54', // 33% opacity
3503
+ 'transparent-dark-thick': '#FBFCFDA8', // 66% opacity
3504
+ };
3505
+
3506
+ const themeKeysToReplace = [
3507
+ {
3508
+ userKey: 'content',
3509
+ internalKey: 'grey',
3510
+ },
3511
+ {
3512
+ userKey: 'accent',
3513
+ internalKey: 'royal',
3514
+ },
3515
+ {
3516
+ userKey: 'transparent',
3517
+ internalKey: 'material',
3518
+ },
3519
+ ];
3504
3520
  /**
3505
3521
  * Parsing the user readable config to css variables
3522
+ * Also maps the public theme variables to the internal theme variables
3523
+ * example user theme:
3524
+ * {
3525
+ * 'content-100': '#000',
3526
+ * 'content-200': '#000',
3527
+ * 'accent-400': '#000',
3528
+ * 'transparent-light-thin': '#000'
3529
+ * }
3530
+ * Resulting in:
3531
+ * {
3532
+ * 'grey-100': '#000',
3533
+ * 'grey-200': '#000',
3534
+ * 'royal-400': '#000',
3535
+ * 'material-light-thin': '#000'
3536
+ * }
3506
3537
  * @param style
3507
3538
  */
3508
- const getParsedStyle = (style) => {
3509
- if (style) {
3510
- const styleKeys = Object.keys(themeTypesKeys);
3511
- const parsed = styleKeys.map((sk) => {
3512
- const themeItem = themeTypesKeys[sk];
3513
- let userValue = style[sk];
3514
- return {
3515
- [themeItem.cssVariable]: userValue,
3516
- };
3517
- });
3518
- // adds a variant with 0.05 opacity for each color
3519
- // will result in variables like this:
3520
- // var(--squid-theme-grey-100-005) --> grey-100 with 0.05 opacity
3521
- // styleKeys.forEach((sk) => {
3522
- // const themeItem = themeTypesKeys[sk]
3523
- // const valueWith005Opacity = getHexColorFromOpacityPercentage(
3524
- // style[sk], // i.e "#ffffff"
3525
- // 0.05,
3526
- // )
3527
- // // { "--squid-theme-grey-100-005": "#ffffff80" }
3528
- // parsed.push({
3529
- // [`${themeItem.cssVariable}-005`]: valueWith005Opacity,
3530
- // })
3531
- // })
3532
- parsed.push({
3533
- [`${themeTypesKeys['grey-100'].cssVariable}-005`]: getHexColorFromOpacityPercentage(style['grey-100'], 0.05),
3534
- });
3535
- return parsed.reduce((a, v) => {
3536
- const key = Object.keys(v)[0];
3537
- return Object.assign(Object.assign({}, a), { [key]: v[key] });
3538
- });
3539
- }
3539
+ const parseSquidTheme = (userTheme) => {
3540
+ if (!userTheme)
3541
+ return undefined;
3542
+ const squidTheme = Object.entries(userTheme).reduce((internalKeys, [userKey, userValue]) => {
3543
+ // content-* -> grey-*
3544
+ // accent-* -> royal-*
3545
+ // transparent-* -> material-*
3546
+ const keyToReplace = themeKeysToReplace.find((k) => userKey.includes(k.userKey));
3547
+ if (keyToReplace) {
3548
+ const newKey = userKey.replace(keyToReplace.userKey, keyToReplace.internalKey);
3549
+ internalKeys[newKey] = userValue;
3550
+ }
3551
+ else {
3552
+ internalKeys[userKey] = userValue;
3553
+ }
3554
+ return internalKeys;
3555
+ }, {});
3556
+ const styleKeys = Object.keys(themeTypesKeys);
3557
+ const parsed = styleKeys.map((sk) => {
3558
+ const themeItem = themeTypesKeys[sk];
3559
+ let userValue = squidTheme[sk];
3560
+ return {
3561
+ [themeItem.cssVariable]: userValue,
3562
+ };
3563
+ });
3564
+ // adds a variant with 0.05 opacity for each color
3565
+ // will result in variables like this:
3566
+ // var(--squid-theme-grey-100-005) --> grey-100 with 0.05 opacity
3567
+ // styleKeys.forEach((sk) => {
3568
+ // const themeItem = themeTypesKeys[sk]
3569
+ // const valueWith005Opacity = getHexColorFromOpacityPercentage(
3570
+ // style[sk], // i.e "#ffffff"
3571
+ // 0.05,
3572
+ // )
3573
+ // // { "--squid-theme-grey-100-005": "#ffffff80" }
3574
+ // parsed.push({
3575
+ // [`${themeItem.cssVariable}-005`]: valueWith005Opacity,
3576
+ // })
3577
+ // })
3578
+ parsed.push({
3579
+ [`${themeTypesKeys['grey-100'].cssVariable}-005`]: getHexColorFromOpacityPercentage(squidTheme['grey-100'], 0.05),
3580
+ });
3581
+ return parsed.reduce((a, v) => {
3582
+ const key = Object.keys(v)[0];
3583
+ return Object.assign(Object.assign({}, a), { [key]: v[key] });
3584
+ });
3540
3585
  };
3541
3586
  /**
3542
3587
  * Returns a hexadecimal color with opacity based on the given color and opacity percentage.
@@ -3554,8 +3599,8 @@ function getHexColorFromOpacityPercentage(color, opacity) {
3554
3599
  .padStart(2, '0')).toUpperCase();
3555
3600
  }
3556
3601
 
3557
- function SquidConfigProvider({ theme, children, themeType = 'light', }) {
3558
- const parsedStyle = getParsedStyle(theme);
3602
+ function SquidConfigProvider({ theme = lightTheme, children, themeType = 'light', }) {
3603
+ const parsedStyle = parseSquidTheme(theme);
3559
3604
  return (jsxRuntime.jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-font-geist", children: children }));
3560
3605
  }
3561
3606
 
@@ -6,6 +6,7 @@ interface BoostButtonProps {
6
6
  boostMode: BoostMode;
7
7
  }) => void;
8
8
  boostDisabledMessage?: string;
9
+ tooltipDisplayDelayMs?: number;
9
10
  }
10
- export declare function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode, boostDisabledMessage, }: BoostButtonProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode, boostDisabledMessage, tooltipDisplayDelayMs, }: BoostButtonProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -6,6 +6,7 @@ interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
6
6
  variant: ButtonVariant;
7
7
  size: ButtonSize;
8
8
  disabled?: boolean;
9
+ link?: string;
9
10
  }
10
- export declare function Button({ label, disabled, size, variant, icon, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Button({ label, disabled, size, variant, icon, link, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -9,5 +9,6 @@ export interface TooltipProps {
9
9
  containerClassName?: string;
10
10
  childrenClassName?: string;
11
11
  tooltipClassName?: string;
12
+ displayDelayMs?: number;
12
13
  }
13
- export declare function Tooltip({ children, tooltipContent, tooltipWidth, threshold, containerClassName, childrenClassName, tooltipClassName, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function Tooltip({ children, tooltipContent, tooltipWidth, threshold, containerClassName, childrenClassName, tooltipClassName, displayDelayMs, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function XSocial({ className, size, }: {
2
+ size?: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -7,6 +7,7 @@ interface BoostProps {
7
7
  estimatedTime: string;
8
8
  boostDisabledMessage?: string;
9
9
  canToggleBoostMode?: boolean;
10
+ boostTooltipDisplayDelayMs?: number;
10
11
  }
11
- export declare function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode, }: BoostProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode, boostTooltipDisplayDelayMs, }: BoostProps): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -17,6 +17,7 @@ interface DetailsToolbarProps {
17
17
  label: string;
18
18
  onClick: () => void;
19
19
  };
20
+ boostTooltipDisplayDelayMs?: number;
20
21
  }
21
- export declare function DetailsToolbar({ errorMessage, boostMode, onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, isLoading, isEmpty, }: DetailsToolbarProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function DetailsToolbar({ errorMessage, boostMode, onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, isLoading, isEmpty, boostTooltipDisplayDelayMs, }: DetailsToolbarProps): import("react/jsx-runtime").JSX.Element;
22
23
  export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
2
+ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
3
3
  itemTitle: string | React.ReactNode;
4
4
  mainImageUrl?: string;
5
5
  secondaryImageUrl?: string;
@@ -0,0 +1,4 @@
1
+ export declare const CSS_VARS: {
2
+ MOVE_WITH_SPRING_BOUNCE_DURATION: string;
3
+ DISPLAY_DELAYED_DURATION: string;
4
+ };
@@ -7,4 +7,5 @@ export type Theme = {
7
7
  theme: SquidTheme;
8
8
  type: ThemeType;
9
9
  };
10
+ export declare const lightTheme: SquidTheme;
10
11
  export declare const themes: Theme[];
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { SquidTheme } from '../types/config';
3
2
  import { ThemeType } from '../types/components';
3
+ import { SquidTheme } from '../types/config';
4
4
  export declare function SquidConfigProvider({ theme, children, themeType, }: {
5
- theme: SquidTheme;
5
+ theme?: SquidTheme;
6
6
  children?: React.ReactNode;
7
7
  themeType?: ThemeType;
8
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,24 @@
1
1
  import { SquidTheme } from '../../types/config';
2
2
  /**
3
3
  * Parsing the user readable config to css variables
4
+ * Also maps the public theme variables to the internal theme variables
5
+ * example user theme:
6
+ * {
7
+ * 'content-100': '#000',
8
+ * 'content-200': '#000',
9
+ * 'accent-400': '#000',
10
+ * 'transparent-light-thin': '#000'
11
+ * }
12
+ * Resulting in:
13
+ * {
14
+ * 'grey-100': '#000',
15
+ * 'grey-200': '#000',
16
+ * 'royal-400': '#000',
17
+ * 'material-light-thin': '#000'
18
+ * }
4
19
  * @param style
5
20
  */
6
- export declare const getParsedStyle: (style?: SquidTheme) => {
21
+ export declare const parseSquidTheme: (userTheme?: SquidTheme) => {
7
22
  [key: string]: string | undefined;
8
23
  } | undefined;
9
24
  export declare function getContrastColor({ r, g, b, }: {
@@ -6,3 +6,4 @@ type Story = StoryObj<typeof meta>;
6
6
  export declare const Normal: Story;
7
7
  export declare const Boost: Story;
8
8
  export declare const Disabled: Story;
9
+ export declare const DisabledWithDelayedTooltip: Story;
@@ -19,3 +19,5 @@ export declare const LargePrimary: Story;
19
19
  export declare const LargeSecondary: Story;
20
20
  export declare const LargeTertiary: Story;
21
21
  export declare const LargeDisabled: Story;
22
+ export declare const LargeAndLink: Story;
23
+ export declare const LargeAndLinkDisabled: Story;
@@ -6,3 +6,4 @@ type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const Boosted: Story;
8
8
  export declare const Disabled: Story;
9
+ export declare const DisabledWithDelayedTooltip: Story;
@@ -9,3 +9,4 @@ export declare const Empty: Story;
9
9
  export declare const Error: Story;
10
10
  export declare const ErrorHelpButton: Story;
11
11
  export declare const BoostDisabled: Story;
12
+ export declare const BoostDisabledWithDelayedTooltip: Story;
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Large: Story;
7
7
  export declare const LargeWithLongTitle: Story;
8
+ export declare const LargeWithLongTitleAndSubtitle: Story;
8
9
  export declare const LargeRoundedFull: Story;
9
10
  export declare const LargeWithSubtitle: Story;
10
11
  export declare const LargeWithDetail: Story;