@0xsquid/ui 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/cjs/index.js +28 -24
  2. package/dist/cjs/types/components/icons/Arrow.d.ts +4 -1
  3. package/dist/cjs/types/components/layout/Modal.d.ts +3 -1
  4. package/dist/cjs/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
  5. package/dist/cjs/types/components/layout/index.d.ts +0 -1
  6. package/dist/cjs/types/services/internal/colorService.d.ts +1 -18
  7. package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +2 -0
  8. package/dist/{esm/types/stories/layout/SwapProgressView.stories.d.ts → cjs/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
  9. package/dist/cjs/types/types/components.d.ts +0 -1
  10. package/dist/esm/index.js +29 -24
  11. package/dist/esm/types/components/icons/Arrow.d.ts +4 -1
  12. package/dist/esm/types/components/layout/Modal.d.ts +3 -1
  13. package/dist/esm/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
  14. package/dist/esm/types/components/layout/index.d.ts +0 -1
  15. package/dist/esm/types/services/internal/colorService.d.ts +1 -18
  16. package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +2 -0
  17. package/dist/{cjs/types/stories/layout/SwapProgressView.stories.d.ts → esm/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
  18. package/dist/esm/types/types/components.d.ts +0 -1
  19. package/dist/index.css +43 -5
  20. package/dist/index.d.ts +6 -11
  21. package/package.json +1 -1
  22. package/dist/cjs/types/components/layout/WalletAddress.d.ts +0 -6
  23. package/dist/cjs/types/services/internal/walletService.d.ts +0 -1
  24. package/dist/esm/types/components/layout/WalletAddress.d.ts +0 -6
  25. package/dist/esm/types/services/internal/walletService.d.ts +0 -1
package/dist/cjs/index.js CHANGED
@@ -2619,8 +2619,8 @@ function AddressButton(_a) {
2619
2619
  function ArrowRightIcon() {
2620
2620
  return (jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M14 6L20 12L14 18M19 12H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2621
2621
  }
2622
- function ChevronArrowIcon() {
2623
- return (jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2622
+ function ChevronArrowIcon({ size = '16', className, }) {
2623
+ return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2624
2624
  }
2625
2625
  function ArrowTriangle() {
2626
2626
  return (jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M2.87921 5.55701C2.21562 4.22933 3.18052 2.6665 4.66531 2.6665H11.3348C12.8196 2.6665 13.7845 4.22933 13.1209 5.55701L9.78615 12.229C9.05029 13.7012 6.94983 13.7012 6.21397 12.229L2.87921 5.55701Z", fill: "currentColor" }) }));
@@ -2946,8 +2946,8 @@ function SettingsButton({ label }) {
2946
2946
  return (jsxRuntime.jsx("button", { className: "tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs", children: jsxRuntime.jsx(CaptionText, { children: label }) }));
2947
2947
  }
2948
2948
 
2949
- function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode, }) {
2950
- return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || boostDisabledMessage
2949
+ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, }) {
2950
+ return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
2951
2951
  ? 'tw-bg-grey-300'
2952
2952
  : 'tw-bg-status-positive') })] }));
2953
2953
  }
@@ -2964,7 +2964,7 @@ const detailStateClassMap = {
2964
2964
  };
2965
2965
  function DetailsToolbar({ state = 'full', errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }) {
2966
2966
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
2967
- return (jsxRuntime.jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsxRuntime.jsx(ErrorMessage, { message: errorMessage })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsxRuntime.jsx(Loader, { size: "32" })) : (jsxRuntime.jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, {}) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2967
+ return (jsxRuntime.jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsxRuntime.jsx(ErrorMessage, { message: errorMessage })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsxRuntime.jsx(Loader, { size: "32" })) : (jsxRuntime.jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, {}) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2968
2968
  }
2969
2969
  const ErrorMessage = ({ message }) => {
2970
2970
  return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-status-negative", children: [jsxRuntime.jsx(EmojiSadIcon, {}), jsxRuntime.jsx(CaptionText, { children: message })] }));
@@ -3103,10 +3103,16 @@ function DropdownMenu({ dropdownRef, items, className, }) {
3103
3103
  return (jsxRuntime.jsx("div", { ref: dropdownRef, className: "tw-relative", children: jsxRuntime.jsx(Menu, { rounded: "sm", containerClassName: cn('tw-absolute tw-right-0 tw-z-20', className), contentClassName: "!tw-p-0", children: jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[144px] tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-px-0 tw-py-squid-xxs", children: items.map((item) => (jsxRuntime.jsx(DropdownMenuItem, Object.assign({}, item), item.label))) }) }) }));
3104
3104
  }
3105
3105
 
3106
- function Modal({ children }) {
3106
+ function Modal({ children, className, onBackdropClick }) {
3107
3107
  return (
3108
- // modal container
3109
- jsxRuntime.jsx("div", { className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-thick tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsxRuntime.jsx("div", { className: "tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end", children: children }) }));
3108
+ // modal container (backdrop)
3109
+ jsxRuntime.jsx("div", { onClick: onBackdropClick
3110
+ ? (event) => {
3111
+ if (event.target === event.currentTarget) {
3112
+ onBackdropClick();
3113
+ }
3114
+ }
3115
+ : undefined, className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsxRuntime.jsx("div", { className: cn('tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className), children: children }) }));
3110
3116
  }
3111
3117
 
3112
3118
  function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
@@ -3129,10 +3135,6 @@ function SwapInputsIcon() {
3129
3135
  return (jsxRuntime.jsxs("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_40_7936)", children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20 10.5C20 16.0228 15.5228 20.5 10 20.5C4.47715 20.5 0 16.0228 0 10.5C0 4.97715 4.47715 0.5 10 0.5C15.5228 0.5 20 4.97715 20 10.5ZM8.38268 4.57612C8.75636 4.7309 9 5.09554 9 5.5V15.5C9 16.0523 8.55228 16.5 8 16.5C7.44772 16.5 7 16.0523 7 15.5V7.91421L5.70711 9.20711C5.31658 9.59763 4.68342 9.59763 4.29289 9.20711C3.90237 8.81658 3.90237 8.18342 4.29289 7.79289L7.29289 4.79289C7.57889 4.5069 8.00901 4.42134 8.38268 4.57612ZM11 15.5C11 15.9045 11.2436 16.2691 11.6173 16.4239C11.991 16.5787 12.4211 16.4931 12.7071 16.2071L15.7071 13.2071C16.0976 12.8166 16.0976 12.1834 15.7071 11.7929C15.3166 11.4024 14.6834 11.4024 14.2929 11.7929L13 13.0858V5.5C13 4.94771 12.5523 4.5 12 4.5C11.4477 4.5 11 4.94771 11 5.5V15.5Z", fill: "currentColor" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_40_7936", children: jsxRuntime.jsx("rect", { width: "20", height: "20", fill: "white", transform: "translate(0 0.5)" }) }) })] }));
3130
3136
  }
3131
3137
 
3132
- function WalletAddress({ address, ens }) {
3133
- return (jsxRuntime.jsx("div", { className: "tw-flex tw-items-center tw-gap-1", children: ens || address ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BodyText, { size: "small", children: ens ? ens : (address === null || address === void 0 ? void 0 : address.slice(0, 6)) + '...' + (address === null || address === void 0 ? void 0 : address.slice(-4)) }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronArrowIcon, {}) })] })) : null }));
3134
- }
3135
-
3136
3138
  function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }) {
3137
3139
  var _a;
3138
3140
  const priceImpactClass = ((_a = Number(priceImpactPercentage)) !== null && _a !== void 0 ? _a : 0) > 5
@@ -3141,22 +3143,22 @@ function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0',
3141
3143
  const isInteractive = direction === 'from';
3142
3144
  // improve accessibility
3143
3145
  const BalanceButtonTag = isInteractive ? 'button' : 'div';
3144
- return (jsxRuntime.jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsxRuntime.jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxRuntime.jsxs("button", { onClick: onWalletButtonClick, className: "-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), address ? (jsxRuntime.jsx(BodyText, { className: "tw-text-grey-600", size: "small", children: ":" })) : null, jsxRuntime.jsx(WalletAddress, { ens: address })] }) }), jsxRuntime.jsx("div", { className: "tw-px-squid-l", children: jsxRuntime.jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsxRuntime.jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.jsx("input", { className: "tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-400 focus:tw-outline-none", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsxRuntime.jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.jsx("div", { className: "tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300", children: jsxRuntime.jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxRuntime.jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsxRuntime.jsx(SwapInputsIcon, {}), jsxRuntime.jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxRuntime.jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsxRuntime.jsx(ArrowTriangle, {}), jsxRuntime.jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxRuntime.jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balance }), jsxRuntime.jsx(MaxIcon, {})] })] }))] }));
3146
+ return (jsxRuntime.jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsxRuntime.jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxRuntime.jsxs("button", { onClick: onWalletButtonClick, className: "-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs tw-text-grey-600 hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), jsxRuntime.jsx(BodyText, { size: "small", children: ":" }), jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsxRuntime.jsx(BodyText, { size: "small", className: address ? 'tw-text-grey-300' : 'tw-text-royal-400', children: address ? address : 'Connect wallet' }), jsxRuntime.jsx(ChevronArrowIcon, { className: address ? 'tw-text-grey-600' : 'tw-text-royal-400' })] })] }) }), jsxRuntime.jsx("div", { className: "tw-px-squid-l", children: jsxRuntime.jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsxRuntime.jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.jsx("input", { className: "tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-400 focus:tw-outline-none", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsxRuntime.jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.jsx("div", { className: "tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300", children: jsxRuntime.jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxRuntime.jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsxRuntime.jsx(SwapInputsIcon, {}), jsxRuntime.jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxRuntime.jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsxRuntime.jsx(ArrowTriangle, {}), jsxRuntime.jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxRuntime.jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin', direction === 'to' && 'tw-pointer-events-none'), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balance }), jsxRuntime.jsx(MaxIcon, {})] })] }))] }));
3145
3147
  }
3146
3148
 
3147
3149
  function SwapProgressViewHeader({ title, description, }) {
3148
3150
  return (jsxRuntime.jsxs("header", { className: "tw-flex tw-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsxRuntime.jsx(BodyText, { size: "large", className: "tw-h-squid-m !tw-leading-[20px] tw-text-grey-300", children: title }), jsxRuntime.jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
3149
3151
  }
3150
3152
 
3151
- function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3153
+ function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3152
3154
  // handles if route component is mounted
3153
3155
  const [isRouteVisible, setIsRouteVisible] = react.useState(false);
3154
- const currentStepCount = Math.round(_currentStepCount);
3156
+ const currentStepIndex = Math.round(_currentStepIndex);
3155
3157
  // handles if route component is animating to show
3156
3158
  const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = react.useState(false);
3157
- const currentStep = steps[currentStepCount - 1];
3158
- const isLastStep = currentStepCount === steps.length;
3159
- const isFirstStep = currentStepCount === 1;
3159
+ const currentStep = steps[currentStepIndex];
3160
+ const isLastStep = currentStepIndex === steps.length - 1;
3161
+ const isFirstStep = currentStepIndex === 0;
3160
3162
  react.useEffect(() => {
3161
3163
  // we do not want to unmount the route component if the animation to show route is running
3162
3164
  if (isShowRouteAnimationRunning)
@@ -3164,18 +3166,21 @@ function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3164
3166
  // unmount route component when the animation of hiding is done
3165
3167
  const timeoutId = setTimeout(() => {
3166
3168
  setIsRouteVisible(false);
3167
- }, 350);
3169
+ }, 200);
3168
3170
  return () => {
3169
3171
  clearTimeout(timeoutId);
3170
3172
  };
3171
3173
  }, [isShowRouteAnimationRunning]);
3174
+ const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3172
3175
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full tw-rounded-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { onClick: () => {
3173
3176
  // mount route component and start animation
3174
3177
  setIsRouteVisible(true);
3175
3178
  setIsShowRouteAnimationRunning(true);
3176
- }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsxRuntime.jsx(SwapStepSeparator, {})] })), jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent }), !isFirstStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsxRuntime.jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: cn('tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800', isShowRouteAnimationRunning
3177
- ? 'tw-animate-slide-to-top'
3178
- : 'tw-animate-slide-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: () => setIsShowRouteAnimationRunning(false), className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsxRuntime.jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] }))] }));
3179
+ }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsxRuntime.jsx(SwapStepSeparator, {})] })), currentStep && (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent })), !isFirstStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsxRuntime.jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3180
+ ? 'tw-animate-fade-in'
3181
+ : 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
3182
+ ? 'tw-animate-slide-to-top'
3183
+ : 'tw-animate-slide-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: collapseRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsxRuntime.jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3179
3184
  }
3180
3185
 
3181
3186
  function TokenPair({ firstToken, secondToken }) {
@@ -3185,7 +3190,7 @@ function TokenPair({ firstToken, secondToken }) {
3185
3190
  }
3186
3191
 
3187
3192
  /**
3188
- * Parsing the user readable config to css variables with HSL values
3193
+ * Parsing the user readable config to css variables
3189
3194
  * @param style
3190
3195
  */
3191
3196
  const getParsedStyle = (style) => {
@@ -3279,5 +3284,4 @@ exports.Switch = Switch;
3279
3284
  exports.TokenPair = TokenPair;
3280
3285
  exports.Tooltip = Tooltip;
3281
3286
  exports.UsdAmount = UsdAmount;
3282
- exports.WalletAddress = WalletAddress;
3283
3287
  exports.useModal = useModal;
@@ -1,5 +1,8 @@
1
1
  export declare function ArrowRightIcon(): import("react/jsx-runtime").JSX.Element;
2
- export declare function ChevronArrowIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChevronArrowIcon({ size, className, }: {
3
+ size?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
3
6
  export declare function ArrowTriangle(): import("react/jsx-runtime").JSX.Element;
4
7
  export declare function ChevronTopSmallIcon(): import("react/jsx-runtime").JSX.Element;
5
8
  export declare function ChevronLargeDownIcon({ size }: {
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface ModalProps {
3
3
  children: React.ReactNode;
4
+ className?: string;
5
+ onBackdropClick?: () => void;
4
6
  }
5
- export declare function Modal({ children }: ModalProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Modal({ children, className, onBackdropClick }: ModalProps): import("react/jsx-runtime").JSX.Element;
6
8
  export {};
@@ -1,5 +1,5 @@
1
1
  import { SwapStep } from '../../types/components';
2
- export declare function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }: {
2
+ export declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
3
3
  steps: SwapStep[];
4
- currentStepCount: number;
4
+ currentStepIndex: number;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -9,4 +9,3 @@ export * from './SwapConfiguration';
9
9
  export * from './SwapProgressViewHeader';
10
10
  export * from './SwapStepsCollapsed';
11
11
  export * from './TokenPair';
12
- export * from './WalletAddress';
@@ -1,28 +1,11 @@
1
1
  import { ConfigTheme } from '../../types/config';
2
2
  /**
3
- * Converts Hex color to HSL
4
- * Because the current daisy theme only accepts HSL css variables
5
- * @param hex
6
- * @returns HSL string
7
- */
8
- export declare const toHSL: (hex: string) => string;
9
- export declare const generateForegroundColorFrom: (input: string, percentage?: number) => string;
10
- export declare const generateFocusColorFrom: (input: string) => string;
11
- /**
12
- * Parsing the user readable config to css variables with HSL values
3
+ * Parsing the user readable config to css variables
13
4
  * @param style
14
5
  */
15
6
  export declare const getParsedStyle: (style?: ConfigTheme) => {
16
7
  [key: string]: string | undefined;
17
8
  } | undefined;
18
- export declare const isColorDark: (colorHEX: string | undefined) => boolean;
19
- export declare const getListItemHoverClassName: ({ transparentWidget }: {
20
- transparentWidget?: boolean | undefined;
21
- }) => string;
22
- export declare function getDominantColor({ imageUrl, sampleSize, }: {
23
- imageUrl: string;
24
- sampleSize?: number;
25
- }): Promise<number[]>;
26
9
  export declare function getContrastColor({ r, g, b, }: {
27
10
  r: number;
28
11
  g: number;
@@ -14,3 +14,5 @@ export declare const HighPriceImpact: Story;
14
14
  export declare const IsFetching: Story;
15
15
  export declare const AllProps: Story;
16
16
  export declare const ToDirection: Story;
17
+ export declare const FromAddressEmpty: Story;
18
+ export declare const ToAddressEmpty: Story;
@@ -6,4 +6,5 @@ type Story = StoryObj<typeof meta>;
6
6
  export declare const FirstStep: Story;
7
7
  export declare const MiddleStep: Story;
8
8
  export declare const LastStep: Story;
9
- export declare const LongerRoute: Story;
9
+ export declare const ShortRoute: Story;
10
+ export declare const LongRoute: Story;
@@ -12,7 +12,6 @@ export type SwapStepDescriptionBlock = {
12
12
  export type SwapStep = {
13
13
  descriptionBlocks: SwapStepDescriptionBlock[];
14
14
  chipContent: React.ReactNode;
15
- routeStepOrder: number;
16
15
  };
17
16
  export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
18
17
  export type ThemeType = 'light' | 'dark';
package/dist/esm/index.js CHANGED
@@ -2617,8 +2617,8 @@ function AddressButton(_a) {
2617
2617
  function ArrowRightIcon() {
2618
2618
  return (jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M14 6L20 12L14 18M19 12H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2619
2619
  }
2620
- function ChevronArrowIcon() {
2621
- return (jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2620
+ function ChevronArrowIcon({ size = '16', className, }) {
2621
+ return (jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2622
2622
  }
2623
2623
  function ArrowTriangle() {
2624
2624
  return (jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M2.87921 5.55701C2.21562 4.22933 3.18052 2.6665 4.66531 2.6665H11.3348C12.8196 2.6665 13.7845 4.22933 13.1209 5.55701L9.78615 12.229C9.05029 13.7012 6.94983 13.7012 6.21397 12.229L2.87921 5.55701Z", fill: "currentColor" }) }));
@@ -2944,8 +2944,8 @@ function SettingsButton({ label }) {
2944
2944
  return (jsx("button", { className: "tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs", children: jsx(CaptionText, { children: label }) }));
2945
2945
  }
2946
2946
 
2947
- function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode, }) {
2948
- return (jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || boostDisabledMessage
2947
+ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, }) {
2948
+ return (jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
2949
2949
  ? 'tw-bg-grey-300'
2950
2950
  : 'tw-bg-status-positive') })] }));
2951
2951
  }
@@ -2962,7 +2962,7 @@ const detailStateClassMap = {
2962
2962
  };
2963
2963
  function DetailsToolbar({ state = 'full', errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }) {
2964
2964
  const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
2965
- return (jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsx(ErrorMessage, { message: errorMessage })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsx(Loader, { size: "32" })) : (jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsx(ChevronLargeDownIcon, {}) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2965
+ return (jsx("aside", { className: "tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around tw-bg-grey-900 tw-px-squid-m tw-py-squid-xxs tw-text-grey-500", children: state === 'error' ? (jsx(ErrorMessage, { message: errorMessage })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsx(Loader, { size: "32" })) : (jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsx(ChevronLargeDownIcon, {}) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage }) })] })) }));
2966
2966
  }
2967
2967
  const ErrorMessage = ({ message }) => {
2968
2968
  return (jsxs("div", { className: "tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-status-negative", children: [jsx(EmojiSadIcon, {}), jsx(CaptionText, { children: message })] }));
@@ -3101,10 +3101,16 @@ function DropdownMenu({ dropdownRef, items, className, }) {
3101
3101
  return (jsx("div", { ref: dropdownRef, className: "tw-relative", children: jsx(Menu, { rounded: "sm", containerClassName: cn('tw-absolute tw-right-0 tw-z-20', className), contentClassName: "!tw-p-0", children: jsx("ul", { className: "tw-flex tw-w-[144px] tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-px-0 tw-py-squid-xxs", children: items.map((item) => (jsx(DropdownMenuItem, Object.assign({}, item), item.label))) }) }) }));
3102
3102
  }
3103
3103
 
3104
- function Modal({ children }) {
3104
+ function Modal({ children, className, onBackdropClick }) {
3105
3105
  return (
3106
- // modal container
3107
- jsx("div", { className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-thick tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsx("div", { className: "tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end", children: children }) }));
3106
+ // modal container (backdrop)
3107
+ jsx("div", { onClick: onBackdropClick
3108
+ ? (event) => {
3109
+ if (event.target === event.currentTarget) {
3110
+ onBackdropClick();
3111
+ }
3112
+ }
3113
+ : undefined, className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsx("div", { className: cn('tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className), children: children }) }));
3108
3114
  }
3109
3115
 
3110
3116
  function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
@@ -3127,10 +3133,6 @@ function SwapInputsIcon() {
3127
3133
  return (jsxs("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("g", { "clip-path": "url(#clip0_40_7936)", children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20 10.5C20 16.0228 15.5228 20.5 10 20.5C4.47715 20.5 0 16.0228 0 10.5C0 4.97715 4.47715 0.5 10 0.5C15.5228 0.5 20 4.97715 20 10.5ZM8.38268 4.57612C8.75636 4.7309 9 5.09554 9 5.5V15.5C9 16.0523 8.55228 16.5 8 16.5C7.44772 16.5 7 16.0523 7 15.5V7.91421L5.70711 9.20711C5.31658 9.59763 4.68342 9.59763 4.29289 9.20711C3.90237 8.81658 3.90237 8.18342 4.29289 7.79289L7.29289 4.79289C7.57889 4.5069 8.00901 4.42134 8.38268 4.57612ZM11 15.5C11 15.9045 11.2436 16.2691 11.6173 16.4239C11.991 16.5787 12.4211 16.4931 12.7071 16.2071L15.7071 13.2071C16.0976 12.8166 16.0976 12.1834 15.7071 11.7929C15.3166 11.4024 14.6834 11.4024 14.2929 11.7929L13 13.0858V5.5C13 4.94771 12.5523 4.5 12 4.5C11.4477 4.5 11 4.94771 11 5.5V15.5Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: "clip0_40_7936", children: jsx("rect", { width: "20", height: "20", fill: "white", transform: "translate(0 0.5)" }) }) })] }));
3128
3134
  }
3129
3135
 
3130
- function WalletAddress({ address, ens }) {
3131
- return (jsx("div", { className: "tw-flex tw-items-center tw-gap-1", children: ens || address ? (jsxs(Fragment, { children: [jsx(BodyText, { size: "small", children: ens ? ens : (address === null || address === void 0 ? void 0 : address.slice(0, 6)) + '...' + (address === null || address === void 0 ? void 0 : address.slice(-4)) }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronArrowIcon, {}) })] })) : null }));
3132
- }
3133
-
3134
3136
  function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }) {
3135
3137
  var _a;
3136
3138
  const priceImpactClass = ((_a = Number(priceImpactPercentage)) !== null && _a !== void 0 ? _a : 0) > 5
@@ -3139,22 +3141,22 @@ function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0',
3139
3141
  const isInteractive = direction === 'from';
3140
3142
  // improve accessibility
3141
3143
  const BalanceButtonTag = isInteractive ? 'button' : 'div';
3142
- return (jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxs("button", { onClick: onWalletButtonClick, className: "-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs hover:tw-bg-material-light-thin", children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), address ? (jsx(BodyText, { className: "tw-text-grey-600", size: "small", children: ":" })) : null, jsx(WalletAddress, { ens: address })] }) }), jsx("div", { className: "tw-px-squid-l", children: jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsx("input", { className: "tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-400 focus:tw-outline-none", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsx("div", { className: "tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300", children: jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsx(SwapInputsIcon, {}), jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsx(ArrowTriangle, {}), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balance }), jsx(MaxIcon, {})] })] }))] }));
3144
+ return (jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] tw-bg-grey-900 tw-pb-squid-m", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxs("button", { onClick: onWalletButtonClick, className: "-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs tw-text-grey-600 hover:tw-bg-material-light-thin", children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), jsx(BodyText, { size: "small", children: ":" }), jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsx(BodyText, { size: "small", className: address ? 'tw-text-grey-300' : 'tw-text-royal-400', children: address ? address : 'Connect wallet' }), jsx(ChevronArrowIcon, { className: address ? 'tw-text-grey-600' : 'tw-text-royal-400' })] })] }) }), jsx("div", { className: "tw-px-squid-l", children: jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), direction === 'from' ? (jsx("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsx("input", { className: "tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-400 focus:tw-outline-none", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsx("div", { className: "tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300", children: jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) || isFetching ? null : (jsxs("footer", { className: "tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500", children: [jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsx(SwapInputsIcon, {}), jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsx(ArrowTriangle, {}), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] }), jsxs(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin', direction === 'to' && 'tw-pointer-events-none'), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balance }), jsx(MaxIcon, {})] })] }))] }));
3143
3145
  }
3144
3146
 
3145
3147
  function SwapProgressViewHeader({ title, description, }) {
3146
3148
  return (jsxs("header", { className: "tw-flex tw-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsx(BodyText, { size: "large", className: "tw-h-squid-m !tw-leading-[20px] tw-text-grey-300", children: title }), jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
3147
3149
  }
3148
3150
 
3149
- function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3151
+ function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3150
3152
  // handles if route component is mounted
3151
3153
  const [isRouteVisible, setIsRouteVisible] = useState(false);
3152
- const currentStepCount = Math.round(_currentStepCount);
3154
+ const currentStepIndex = Math.round(_currentStepIndex);
3153
3155
  // handles if route component is animating to show
3154
3156
  const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = useState(false);
3155
- const currentStep = steps[currentStepCount - 1];
3156
- const isLastStep = currentStepCount === steps.length;
3157
- const isFirstStep = currentStepCount === 1;
3157
+ const currentStep = steps[currentStepIndex];
3158
+ const isLastStep = currentStepIndex === steps.length - 1;
3159
+ const isFirstStep = currentStepIndex === 0;
3158
3160
  useEffect(() => {
3159
3161
  // we do not want to unmount the route component if the animation to show route is running
3160
3162
  if (isShowRouteAnimationRunning)
@@ -3162,18 +3164,21 @@ function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
3162
3164
  // unmount route component when the animation of hiding is done
3163
3165
  const timeoutId = setTimeout(() => {
3164
3166
  setIsRouteVisible(false);
3165
- }, 350);
3167
+ }, 200);
3166
3168
  return () => {
3167
3169
  clearTimeout(timeoutId);
3168
3170
  };
3169
3171
  }, [isShowRouteAnimationRunning]);
3172
+ const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3170
3173
  return (jsxs(Fragment, { children: [jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full tw-rounded-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxs("button", { onClick: () => {
3171
3174
  // mount route component and start animation
3172
3175
  setIsRouteVisible(true);
3173
3176
  setIsShowRouteAnimationRunning(true);
3174
- }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsx(SwapStepSeparator, {})] })), jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent }), !isFirstStep && (jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxs("div", { className: cn('tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800', isShowRouteAnimationRunning
3175
- ? 'tw-animate-slide-to-top'
3176
- : 'tw-animate-slide-to-bottom'), children: [jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsx("button", { onClick: () => setIsShowRouteAnimationRunning(false), className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] }))] }));
3177
+ }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsx(SwapStepSeparator, {})] })), currentStep && (jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent })), !isFirstStep && (jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3178
+ ? 'tw-animate-fade-in'
3179
+ : 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
3180
+ ? 'tw-animate-slide-to-top'
3181
+ : 'tw-animate-slide-to-bottom'), children: [jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsx("button", { onClick: collapseRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3177
3182
  }
3178
3183
 
3179
3184
  function TokenPair({ firstToken, secondToken }) {
@@ -3183,7 +3188,7 @@ function TokenPair({ firstToken, secondToken }) {
3183
3188
  }
3184
3189
 
3185
3190
  /**
3186
- * Parsing the user readable config to css variables with HSL values
3191
+ * Parsing the user readable config to css variables
3187
3192
  * @param style
3188
3193
  */
3189
3194
  const getParsedStyle = (style) => {
@@ -3240,4 +3245,4 @@ function SquidConfigProvider({ theme, children, themeType = 'light', }) {
3240
3245
  return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: clsx('tw-text-base-content tw-group tw-relative tw-font-geist'), children: children }));
3241
3246
  }
3242
3247
 
3243
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, WalletAddress, useModal };
3248
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useModal };
@@ -1,5 +1,8 @@
1
1
  export declare function ArrowRightIcon(): import("react/jsx-runtime").JSX.Element;
2
- export declare function ChevronArrowIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChevronArrowIcon({ size, className, }: {
3
+ size?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
3
6
  export declare function ArrowTriangle(): import("react/jsx-runtime").JSX.Element;
4
7
  export declare function ChevronTopSmallIcon(): import("react/jsx-runtime").JSX.Element;
5
8
  export declare function ChevronLargeDownIcon({ size }: {
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface ModalProps {
3
3
  children: React.ReactNode;
4
+ className?: string;
5
+ onBackdropClick?: () => void;
4
6
  }
5
- export declare function Modal({ children }: ModalProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Modal({ children, className, onBackdropClick }: ModalProps): import("react/jsx-runtime").JSX.Element;
6
8
  export {};
@@ -1,5 +1,5 @@
1
1
  import { SwapStep } from '../../types/components';
2
- export declare function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }: {
2
+ export declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
3
3
  steps: SwapStep[];
4
- currentStepCount: number;
4
+ currentStepIndex: number;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -9,4 +9,3 @@ export * from './SwapConfiguration';
9
9
  export * from './SwapProgressViewHeader';
10
10
  export * from './SwapStepsCollapsed';
11
11
  export * from './TokenPair';
12
- export * from './WalletAddress';
@@ -1,28 +1,11 @@
1
1
  import { ConfigTheme } from '../../types/config';
2
2
  /**
3
- * Converts Hex color to HSL
4
- * Because the current daisy theme only accepts HSL css variables
5
- * @param hex
6
- * @returns HSL string
7
- */
8
- export declare const toHSL: (hex: string) => string;
9
- export declare const generateForegroundColorFrom: (input: string, percentage?: number) => string;
10
- export declare const generateFocusColorFrom: (input: string) => string;
11
- /**
12
- * Parsing the user readable config to css variables with HSL values
3
+ * Parsing the user readable config to css variables
13
4
  * @param style
14
5
  */
15
6
  export declare const getParsedStyle: (style?: ConfigTheme) => {
16
7
  [key: string]: string | undefined;
17
8
  } | undefined;
18
- export declare const isColorDark: (colorHEX: string | undefined) => boolean;
19
- export declare const getListItemHoverClassName: ({ transparentWidget }: {
20
- transparentWidget?: boolean | undefined;
21
- }) => string;
22
- export declare function getDominantColor({ imageUrl, sampleSize, }: {
23
- imageUrl: string;
24
- sampleSize?: number;
25
- }): Promise<number[]>;
26
9
  export declare function getContrastColor({ r, g, b, }: {
27
10
  r: number;
28
11
  g: number;
@@ -14,3 +14,5 @@ export declare const HighPriceImpact: Story;
14
14
  export declare const IsFetching: Story;
15
15
  export declare const AllProps: Story;
16
16
  export declare const ToDirection: Story;
17
+ export declare const FromAddressEmpty: Story;
18
+ export declare const ToAddressEmpty: Story;
@@ -6,4 +6,5 @@ type Story = StoryObj<typeof meta>;
6
6
  export declare const FirstStep: Story;
7
7
  export declare const MiddleStep: Story;
8
8
  export declare const LastStep: Story;
9
- export declare const LongerRoute: Story;
9
+ export declare const ShortRoute: Story;
10
+ export declare const LongRoute: Story;
@@ -12,7 +12,6 @@ export type SwapStepDescriptionBlock = {
12
12
  export type SwapStep = {
13
13
  descriptionBlocks: SwapStepDescriptionBlock[];
14
14
  chipContent: React.ReactNode;
15
- routeStepOrder: number;
16
15
  };
17
16
  export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
18
17
  export type ThemeType = 'light' | 'dark';
package/dist/index.css CHANGED
@@ -983,6 +983,10 @@ video {
983
983
  max-height: 535px;
984
984
  }
985
985
 
986
+ .tw-max-h-\[536px\] {
987
+ max-height: 536px;
988
+ }
989
+
986
990
  .tw-max-h-\[540px\] {
987
991
  max-height: 540px;
988
992
  }
@@ -1312,6 +1316,34 @@ video {
1312
1316
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1313
1317
  }
1314
1318
 
1319
+ @keyframes tw-fade-in {
1320
+ 0% {
1321
+ opacity: 0;
1322
+ }
1323
+
1324
+ 100% {
1325
+ opacity: 1;
1326
+ }
1327
+ }
1328
+
1329
+ .tw-animate-fade-in {
1330
+ animation: tw-fade-in 0.2s ease-out both;
1331
+ }
1332
+
1333
+ @keyframes tw-fade-out {
1334
+ 0% {
1335
+ opacity: 1;
1336
+ }
1337
+
1338
+ 100% {
1339
+ opacity: 0;
1340
+ }
1341
+ }
1342
+
1343
+ .tw-animate-fade-out {
1344
+ animation: tw-fade-out 0.2s ease-out both;
1345
+ }
1346
+
1315
1347
  @keyframes tw-pulse {
1316
1348
  50% {
1317
1349
  opacity: .5;
@@ -1335,7 +1367,7 @@ video {
1335
1367
  }
1336
1368
 
1337
1369
  .tw-animate-slide-to-bottom {
1338
- animation: tw-slide-to-bottom 0.35s ease-out both;
1370
+ animation: tw-slide-to-bottom 0.2s ease-out both;
1339
1371
  }
1340
1372
 
1341
1373
  @keyframes tw-slide-to-top {
@@ -1684,6 +1716,10 @@ video {
1684
1716
  background-color: inherit;
1685
1717
  }
1686
1718
 
1719
+ .tw-bg-material-dark-average {
1720
+ background-color: var(--squid-theme-material-dark-average);
1721
+ }
1722
+
1687
1723
  .tw-bg-material-dark-thick {
1688
1724
  background-color: var(--squid-theme-material-dark-thick);
1689
1725
  }
@@ -1722,10 +1758,6 @@ video {
1722
1758
  background-color: transparent;
1723
1759
  }
1724
1760
 
1725
- .tw-bg-opacity-70 {
1726
- --tw-bg-opacity: 0.7;
1727
- }
1728
-
1729
1761
  .tw-bg-gradient-to-b {
1730
1762
  background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
1731
1763
  }
@@ -2289,6 +2321,12 @@ video {
2289
2321
  outline-color: var(--squid-theme-material-light-thin);
2290
2322
  }
2291
2323
 
2324
+ .tw-backdrop-blur-2xl {
2325
+ --tw-backdrop-blur: blur(40px);
2326
+ -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2327
+ backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2328
+ }
2329
+
2292
2330
  .tw-backdrop-blur\/10 {
2293
2331
  --tw-backdrop-blur: blur(10px);
2294
2332
  -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
package/dist/index.d.ts CHANGED
@@ -55,7 +55,6 @@ type SwapStepDescriptionBlock = {
55
55
  type SwapStep = {
56
56
  descriptionBlocks: SwapStepDescriptionBlock[];
57
57
  chipContent: React.ReactNode;
58
- routeStepOrder: number;
59
58
  };
60
59
  type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
61
60
  type ThemeType = 'light' | 'dark';
@@ -252,8 +251,10 @@ declare function Menu({ children, containerClassName, contentClassName, title, d
252
251
 
253
252
  interface ModalProps {
254
253
  children: React.ReactNode;
254
+ className?: string;
255
+ onBackdropClick?: () => void;
255
256
  }
256
- declare function Modal({ children }: ModalProps): react_jsx_runtime.JSX.Element;
257
+ declare function Modal({ children, className, onBackdropClick }: ModalProps): react_jsx_runtime.JSX.Element;
257
258
 
258
259
  interface NavigationBarProps {
259
260
  title?: string;
@@ -303,9 +304,9 @@ interface SwapProgressViewHeaderProps {
303
304
  }
304
305
  declare function SwapProgressViewHeader({ title, description, }: SwapProgressViewHeaderProps): react_jsx_runtime.JSX.Element;
305
306
 
306
- declare function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }: {
307
+ declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
307
308
  steps: SwapStep[];
308
- currentStepCount: number;
309
+ currentStepIndex: number;
309
310
  }): react_jsx_runtime.JSX.Element;
310
311
 
311
312
  interface TokenPairProps {
@@ -320,12 +321,6 @@ interface TokenPairProps {
320
321
  }
321
322
  declare function TokenPair({ firstToken, secondToken }: TokenPairProps): react_jsx_runtime.JSX.Element;
322
323
 
323
- interface WalletAddressProps {
324
- ens?: string;
325
- address?: string;
326
- }
327
- declare function WalletAddress({ address, ens }: WalletAddressProps): react_jsx_runtime.JSX.Element;
328
-
329
324
  interface BodyTextProps extends React.HTMLAttributes<HTMLSpanElement> {
330
325
  children: string | undefined;
331
326
  size: TextSize;
@@ -397,4 +392,4 @@ declare function useModal(props?: {
397
392
  openModalButtonRef: React.RefObject<HTMLButtonElement>;
398
393
  };
399
394
 
400
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipThreshold, type TooltipWidth, UsdAmount, WalletAddress, useModal };
395
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipThreshold, type TooltipWidth, UsdAmount, useModal };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/squid-ui.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.6.2",
8
+ "version": "0.6.3",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "scripts": {
@@ -1,6 +0,0 @@
1
- interface WalletAddressProps {
2
- ens?: string;
3
- address?: string;
4
- }
5
- export declare function WalletAddress({ address, ens }: WalletAddressProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1 +0,0 @@
1
- export declare const formatWalletAddress: (walletAddress: string | undefined, trimLength?: number) => string;
@@ -1,6 +0,0 @@
1
- interface WalletAddressProps {
2
- ens?: string;
3
- address?: string;
4
- }
5
- export declare function WalletAddress({ address, ens }: WalletAddressProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1 +0,0 @@
1
- export declare const formatWalletAddress: (walletAddress: string | undefined, trimLength?: number) => string;