@0xsquid/ui 2.6.1 → 2.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 (27) hide show
  1. package/dist/cjs/index.js +75 -37
  2. package/dist/cjs/types/components/icons/Arrow.d.ts +2 -1
  3. package/dist/cjs/types/components/icons/Generic.d.ts +3 -2
  4. package/dist/cjs/types/components/icons/Social.d.ts +9 -1
  5. package/dist/cjs/types/components/icons/index.d.ts +0 -1
  6. package/dist/cjs/types/components/layout/DropdownMenu.d.ts +2 -1
  7. package/dist/cjs/types/components/views/SwapProgressView.d.ts +3 -2
  8. package/dist/cjs/types/hooks/useDropdownMenu.d.ts +5 -5
  9. package/dist/cjs/types/stories/layout/AppContainer.stories.d.ts +1 -1
  10. package/dist/cjs/types/stories/views/MainView.stories.d.ts +1 -1
  11. package/dist/cjs/types/stories/views/SwapDetailsView.stories.d.ts +1 -1
  12. package/dist/esm/index.js +72 -35
  13. package/dist/esm/types/components/icons/Arrow.d.ts +2 -1
  14. package/dist/esm/types/components/icons/Generic.d.ts +3 -2
  15. package/dist/esm/types/components/icons/Social.d.ts +9 -1
  16. package/dist/esm/types/components/icons/index.d.ts +0 -1
  17. package/dist/esm/types/components/layout/DropdownMenu.d.ts +2 -1
  18. package/dist/esm/types/components/views/SwapProgressView.d.ts +3 -2
  19. package/dist/esm/types/hooks/useDropdownMenu.d.ts +5 -5
  20. package/dist/esm/types/stories/layout/AppContainer.stories.d.ts +1 -1
  21. package/dist/esm/types/stories/views/MainView.stories.d.ts +1 -1
  22. package/dist/esm/types/stories/views/SwapDetailsView.stories.d.ts +1 -1
  23. package/dist/index.css +1 -1
  24. package/dist/index.d.ts +23 -17
  25. package/package.json +1 -1
  26. package/dist/cjs/types/components/icons/Copy.d.ts +0 -5
  27. package/dist/esm/types/components/icons/Copy.d.ts +0 -5
package/dist/cjs/index.js CHANGED
@@ -3760,8 +3760,8 @@ function ArrowUpIcon() {
3760
3760
  function ArrowCornerDownRightIcon({ size = "24", className, }) {
3761
3761
  return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 4C4.55228 4 5 4.44772 5 5V13C5 13.5523 5.44772 14 6 14H17.5858L15.2929 11.7071C14.9024 11.3166 14.9024 10.6834 15.2929 10.2929C15.6834 9.90237 16.3166 9.90237 16.7071 10.2929L20.7071 14.2929C21.0976 14.6834 21.0976 15.3166 20.7071 15.7071L16.7071 19.7071C16.3166 20.0976 15.6834 20.0976 15.2929 19.7071C14.9024 19.3166 14.9024 18.6834 15.2929 18.2929L17.5858 16H6C4.34315 16 3 14.6569 3 13V5C3 4.44772 3.44772 4 4 4Z", fill: "currentColor" }) }));
3762
3762
  }
3763
- function ChevronDownSmallIcon({ size = "16", className, }) {
3764
- return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M5.33325 6.66666L7.52851 8.86192C7.78886 9.12227 8.21097 9.12227 8.47132 8.86192L10.6666 6.66666", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
3763
+ function ChevronDownSmallIcon({ size = "16", strokeWidth = "2", className, }) {
3764
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M5.33325 6.66666L7.52851 8.86192C7.78886 9.12227 8.21097 9.12227 8.47132 8.86192L10.6666 6.66666", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }) }));
3765
3765
  }
3766
3766
  function ArrowDownIcon({ size = "24", className, }) {
3767
3767
  return (jsxRuntime.jsx("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 25", fill: "none", children: jsxRuntime.jsx("path", { d: "M18 14.5L12 20.5L6 14.5M12 19.5V4.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
@@ -3869,11 +3869,6 @@ function PowerIcon({ size = "24", className, }) {
3869
3869
  return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M7.02331 4.5C4.59826 6.11238 3 8.86954 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 8.86954 19.4017 6.11238 16.9767 4.5M12 2V7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
3870
3870
  }
3871
3871
 
3872
- function Copy(_a) {
3873
- var { size = "24", strokeWidth = "2" } = _a, props = __rest$1(_a, ["size", "strokeWidth"]);
3874
- return (jsxRuntime.jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24" }, props, { children: jsxRuntime.jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: strokeWidth, vectorEffect: "non-scaling-stroke", d: "M9 9V5.25A2.25 2.25 0 0111.25 3h7.5A2.25 2.25 0 0121 5.25v7.5A2.25 2.25 0 0118.75 15H15m-2.25-6h-7.5A2.25 2.25 0 003 11.25v7.5A2.25 2.25 0 005.25 21h7.5A2.25 2.25 0 0015 18.75v-7.5A2.25 2.25 0 0012.75 9z" }) })));
3875
- }
3876
-
3877
3872
  function CrossAnimatedIcon({ size = 24, isOpen, transitionDuration, className, }) {
3878
3873
  const rotateDegrees = isOpen ? 45 : 0;
3879
3874
  return (jsxRuntime.jsxs("div", { style: {
@@ -3998,11 +3993,11 @@ function PhoneIcon({ size = "24", className, }) {
3998
3993
  function LaptopIcon({ size = "24", className, }) {
3999
3994
  return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: [jsxRuntime.jsx("path", { d: "M4.5 6C4.5 4.89543 5.39543 4 6.5 4H18.5C19.6046 4 20.5 4.89543 20.5 6V15C20.5 15.5523 20.0523 16 19.5 16H5.5C4.94772 16 4.5 15.5523 4.5 15V6Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M2.5 16H22.5V18C22.5 19.1046 21.6046 20 20.5 20H4.5C3.39543 20 2.5 19.1046 2.5 18V16Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" })] }));
4000
3995
  }
4001
- function CopyOutlinedIcon({ size = "24", className, }) {
4002
- return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M9 9V5.25C9 4.00736 10.0074 3 11.25 3H18.75C19.9926 3 21 4.00736 21 5.25V12.75C21 13.9926 19.9926 15 18.75 15H15M12.75 9H5.25C4.00736 9 3 10.0074 3 11.25V18.75C3 19.9926 4.00736 21 5.25 21H12.75C13.9926 21 15 19.9926 15 18.75V11.25C15 10.0074 13.9926 9 12.75 9Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
3996
+ function CopyOutlinedIcon({ size = "24", strokeWidth = "2", className, }) {
3997
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M9 9V5.25C9 4.00736 10.0074 3 11.25 3H18.75C19.9926 3 21 4.00736 21 5.25V12.75C21 13.9926 19.9926 15 18.75 15H15M12.75 9H5.25C4.00736 9 3 10.0074 3 11.25V18.75C3 19.9926 4.00736 21 5.25 21H12.75C13.9926 21 15 19.9926 15 18.75V11.25C15 10.0074 13.9926 9 12.75 9Z", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }) }));
4003
3998
  }
4004
- function CopyIcon({ size = "20", className, }) {
4005
- return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.16663 6.66666V3.54166C7.16663 2.50612 8.00609 1.66666 9.04163 1.66666H16.9583C17.9938 1.66666 18.8333 2.50612 18.8333 3.54166V11.4583C18.8333 12.4939 17.9938 13.3333 16.9583 13.3333H13.8333V16.4583C13.8333 17.4939 12.9938 18.3333 11.9583 18.3333H4.04163C3.00609 18.3333 2.16663 17.4939 2.16663 16.4583V8.54166C2.16663 7.50612 3.00609 6.66666 4.04163 6.66666H7.16663ZM9.04163 13.3333C8.00609 13.3333 7.16663 12.4939 7.16663 11.4583V8.33332H4.04163C3.92657 8.33332 3.83329 8.4266 3.83329 8.54166V16.4583C3.83329 16.5734 3.92657 16.6667 4.04163 16.6667H11.9583C12.0734 16.6667 12.1666 16.5734 12.1666 16.4583V13.3333H9.04163Z", fill: "currentColor" }) }));
3999
+ function Copy2Icon({ size = "20", className, }) {
4000
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.3327 4.37496C18.3327 2.87919 17.1201 1.66663 15.6243 1.66663H9.37435C7.87858 1.66663 6.66602 2.87919 6.66602 4.37496V6.66663H4.37435C2.87858 6.66663 1.66602 7.87919 1.66602 9.37496V15.625C1.66602 17.1207 2.87858 18.3333 4.37435 18.3333H10.6243C12.1201 18.3333 13.3327 17.1207 13.3327 15.625V13.3333H15.6243C17.1201 13.3333 18.3327 12.1207 18.3327 10.625V4.37496ZM13.3327 11.6666H15.6243C16.1996 11.6666 16.666 11.2003 16.666 10.625V4.37496C16.666 3.79966 16.1996 3.33329 15.6243 3.33329H9.37435C8.79905 3.33329 8.33268 3.79966 8.33268 4.37496V6.66663H10.6243C12.1201 6.66663 13.3327 7.87919 13.3327 9.37496V11.6666Z", fill: "currentColor" }) }));
4006
4001
  }
4007
4002
  function FileDownloadIcon({ size = "20", className, }) {
4008
4003
  return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", className: className, children: [jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.33337 1.66666H10.5V5.83332C10.5 7.21404 11.6193 8.33332 13 8.33332H17.1667V15.8333C17.1667 17.214 16.0474 18.3333 14.6667 18.3333H6.33337C4.95266 18.3333 3.83337 17.214 3.83337 15.8333V4.16666C3.83337 2.78594 4.95266 1.66666 6.33337 1.66666ZM13.1726 14.3392L11.0893 16.4226C10.7639 16.748 10.2362 16.748 9.91079 16.4226L7.82745 14.3392C7.50201 14.0138 7.50201 13.4862 7.82745 13.1607C8.15289 12.8353 8.68053 12.8353 9.00596 13.1607L9.66671 13.8215V10.8333C9.66671 10.3731 10.0398 9.99999 10.5 9.99999C10.9603 9.99999 11.3334 10.3731 11.3334 10.8333V13.8215L11.9941 13.1607C12.3196 12.8353 12.8472 12.8353 13.1726 13.1607C13.4981 13.4862 13.4981 14.0138 13.1726 14.3392Z", fill: "currentColor" }), jsxRuntime.jsx("path", { d: "M12.1667 2.15481L16.6786 6.66666H13C12.5398 6.66666 12.1667 6.29356 12.1667 5.83332V2.15481Z", fill: "currentColor" })] }));
@@ -4142,7 +4137,7 @@ function SearchIcon({ className, size = "24", }) {
4142
4137
  return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, 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" }) }));
4143
4138
  }
4144
4139
 
4145
- function XSocial({ className, size = "24", }) {
4140
+ function XSocialIcon({ className, size = "24", }) {
4146
4141
  return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M17.4033 3.5H20.2852L13.989 10.701L21.396 20.5H15.5964L11.054 14.557L5.85637 20.5H2.97269L9.70709 12.7977L2.60156 3.5H8.54839L12.6544 8.93215L17.4033 3.5ZM16.3918 18.7738H17.9887L7.68067 5.13549H5.96702L16.3918 18.7738Z", fill: "currentColor" }) }));
4147
4142
  }
4148
4143
  function GithubIcon({ size = "24", className, }) {
@@ -4154,6 +4149,12 @@ function DiscordIcon({ size = "24", className, }) {
4154
4149
  function MirrorIcon({ size = "24", className, }) {
4155
4150
  return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.jsx("path", { d: "M6 9C6 5.68629 8.68629 3 12 3C15.3137 3 18 5.68629 18 9V20C18 20.5523 17.5523 21 17 21H7C6.44771 21 6 20.5523 6 20V9Z", stroke: "currentColor", strokeWidth: "2" }) }));
4156
4151
  }
4152
+ function FarcasterIcon({ size = "20", className, }) {
4153
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.8884 2H4.77734V4.28529L15.8884 4.28571V2ZM18.1115 16.2853V16.8567H13.667V16.2853C13.667 15.9696 13.9156 15.7139 14.2225 15.7139L14.2221 11.0971C14.2221 8.88795 12.481 7.0971 10.3332 7.0971C8.20241 7.0971 6.47187 8.85978 6.44466 11.0448V15.7139C6.75155 15.7139 7.00011 15.9696 7.00011 16.2853V16.8567H2.55566V16.2853C2.55566 15.9696 2.80428 15.7139 3.11122 15.7139L3.11133 6.57185H2.55556L2 4.28613H18.6667L18.1111 6.57185H17.556V15.7139C17.8629 15.7139 18.1115 15.9696 18.1115 16.2853ZM18.6669 17.4289C18.6669 17.1132 18.4185 16.8567 18.1115 16.8567H13.667C13.36 16.8567 13.1113 17.1132 13.1113 17.4289V18.0003H18.6669V17.4289ZM7.00011 16.8567C7.30706 16.8567 7.55555 17.1132 7.55555 17.4289V18.0003H2V17.4289C2 17.1132 2.24871 16.8567 2.55566 16.8567H7.00011Z", fill: "currentColor" }) }));
4154
+ }
4155
+ function TelegramIcon({ className, size = "20", }) {
4156
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M1.31748 8.8995C6.46345 6.66525 9.89405 5.19215 11.6094 4.48047C16.5127 2.44826 17.5302 2.09531 18.1949 2.08349C18.341 2.08102 18.6664 2.11703 18.8788 2.28828C19.0553 2.43259 19.105 2.62776 19.1298 2.76465C19.1518 2.90154 19.1822 3.21354 19.1574 3.45708C18.8926 6.2389 17.7427 12.9895 17.158 16.1053C16.9126 17.4237 16.4244 17.8657 15.9528 17.9089C14.927 18.0029 14.1492 17.2337 13.1564 16.5852C11.6038 15.5701 10.7269 14.9384 9.21842 13.948C7.47552 12.8034 8.60617 12.1742 9.59896 11.1461C9.85819 10.877 14.3754 6.78262 14.4608 6.41126C14.4719 6.3648 14.483 6.19162 14.3782 6.10036C14.2761 6.00883 14.1244 6.04016 14.0141 6.0649C13.8569 6.10009 11.3776 7.73509 6.56812 10.9696C5.8649 11.4518 5.22787 11.6868 4.65426 11.6744C4.02549 11.661 2.81216 11.3193 1.91037 11.0274C0.807272 10.6692 -0.0724949 10.4798 0.0047222 9.87149C0.0433308 9.55482 0.481884 9.23074 1.31748 8.8995Z", fill: "currentColor" }) }));
4157
+ }
4157
4158
 
4158
4159
  function SortIcon() {
4159
4160
  return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: jsxRuntime.jsx("path", { d: "M3 5H21M9 19H15M6 12H18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
@@ -4363,9 +4364,9 @@ function UsdAmount({ usdAmount }) {
4363
4364
  }
4364
4365
 
4365
4366
  function HashLink({ showTx = false, hash, showCopyButton = false, url, children, className, formattedHash, copyIconSize = "16", }) {
4366
- return (jsxRuntime.jsxs("div", { className: cn("tw-flex tw-items-center", className), children: [showTx && jsxRuntime.jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children : formattedHash, url && (jsxRuntime.jsx("a", { href: url, target: "_blank", className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", rel: "noreferrer", children: jsxRuntime.jsx(SquareArrowTopRight2Icon, { strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-text-royal-500" }) })), showCopyButton && (jsxRuntime.jsx("span", { className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(Copy, { size: copyIconSize, strokeWidth: "2", className: "tw-cursor-pointer tw-text-royal-500", onClick: () => {
4367
- navigator.clipboard.writeText(hash).catch(() => { });
4368
- } }) }))] }));
4367
+ return (jsxRuntime.jsxs("div", { className: cn("tw-flex tw-items-center", className), children: [showTx && jsxRuntime.jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children : formattedHash, url && (jsxRuntime.jsx("a", { href: url, target: "_blank", className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", rel: "noreferrer", children: jsxRuntime.jsx(SquareArrowTopRight2Icon, { strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-text-royal-500" }) })), showCopyButton && (jsxRuntime.jsx("span", { onClick: () => {
4368
+ navigator.clipboard.writeText(hash).catch(() => { });
4369
+ }, className: "tw-cursor-pointer tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(CopyOutlinedIcon, { size: copyIconSize, strokeWidth: "2.5", className: "tw-text-royal-500" }) }))] }));
4369
4370
  }
4370
4371
 
4371
4372
  function WalletLink({ imageURI, address }) {
@@ -4449,15 +4450,20 @@ function Button$1(_a) {
4449
4450
  disabled && buttonDisabledClass, isLoading && "tw-cursor-not-allowed",
4450
4451
  // custom classes from props
4451
4452
  props.className);
4452
- const ButtonWrapper = ({ children }) => (jsxRuntime.jsx("div", { className: cn("tw-relative", buttonWidthClassnameMap[size], roundedClassMap[size][variant], containerClassName), children: children }));
4453
+ const buttonWrapperProps = {
4454
+ className: containerClassName,
4455
+ size,
4456
+ variant,
4457
+ };
4453
4458
  if (link != null) {
4454
- return (jsxRuntime.jsxs(ButtonWrapper, { children: [jsxRuntime.jsx("a", { ref: anchorRef, "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, rel: "noreferrer", children: children }), chipElement] }));
4459
+ return (jsxRuntime.jsxs(ButtonWrapper, Object.assign({}, buttonWrapperProps, { children: [jsxRuntime.jsx("a", { ref: anchorRef, "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, rel: "noreferrer", children: children }), chipElement] })));
4455
4460
  }
4456
- return (jsxRuntime.jsxs(ButtonWrapper, { children: [jsxRuntime.jsx("button", Object.assign({}, props, { type: "button", ref: buttonRef, "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] }));
4461
+ return (jsxRuntime.jsxs(ButtonWrapper, Object.assign({}, buttonWrapperProps, { children: [jsxRuntime.jsx("button", Object.assign({}, props, { type: "button", ref: buttonRef, "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] })));
4457
4462
  }
4458
4463
  const ButtonHoverOverlay = ({ className }) => {
4459
4464
  return (jsxRuntime.jsx("span", { className: cn("tw-absolute tw-inset-0 tw-z-0 tw-hidden tw-h-full tw-w-full tw-bg-material-light-thin group-hover/base-button:tw-block", className) }));
4460
4465
  };
4466
+ const ButtonWrapper = ({ children, size, variant, className, }) => (jsxRuntime.jsx("div", { className: cn("tw-relative", buttonWidthClassnameMap[size], roundedClassMap[size][variant], className), children: children }));
4461
4467
 
4462
4468
  function AccountsButton(_a) {
4463
4469
  var { imageUrls } = _a, props = __rest$1(_a, ["imageUrls"]);
@@ -18869,8 +18875,8 @@ function DetailsToolbar({ errorMessage, helpButton, isLoading, isEmpty, flipButt
18869
18875
  "group-hover/flip-button:tw-rotate-180") }) }) }))) }), jsxRuntime.jsx("div", { className: cn(detailClassName, "tw-justify-end"), children: !!stopsButton && jsxRuntime.jsx(StopsButton, Object.assign({}, stopsButton)) })] })) }));
18870
18876
  }
18871
18877
 
18872
- function DropdownMenu({ dropdownRef, className, menuRef, isHidden = false, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, }) {
18873
- return (jsxRuntime.jsx("div", { ref: dropdownRef, className: cn("tw-relative", containerClassName), children: jsxRuntime.jsx(Menu, { menuRef: menuRef, rounded: "sm", containerClassName: cn("tw-absolute tw-right-0 tw-z-30", className), contentClassName: cn("!tw-p-0", menuContentClassName), contentWrapperProps: contentWrapperProps, children: !isHidden && (jsxRuntime.jsx("ul", { className: cn("tw-flex tw-max-w-full tw-flex-col tw-gap-squid-xxs tw-px-0 tw-py-squid-xxs", listClassName), children: children })) }) }));
18878
+ function DropdownMenu({ dropdownRef, className, menuRef, isHidden = false, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, trigger, }) {
18879
+ return (jsxRuntime.jsxs("div", { ref: dropdownRef, className: cn("tw-relative", containerClassName), children: [trigger, jsxRuntime.jsx(Menu, { menuRef: menuRef, rounded: "sm", containerClassName: cn("tw-absolute tw-right-0 tw-z-30", className), contentClassName: cn("!tw-p-0", menuContentClassName), contentWrapperProps: contentWrapperProps, children: !isHidden && (jsxRuntime.jsx("ul", { className: cn("tw-flex tw-max-w-full tw-flex-col tw-gap-squid-xxs tw-px-0 tw-py-squid-xxs", listClassName), children: children })) })] }));
18874
18880
  }
18875
18881
 
18876
18882
  function InfoBox({ title, description, icon }) {
@@ -19031,19 +19037,20 @@ function AccountListItem({ isConnected, imageUrls = [], imageUrl, badgeUrl, acti
19031
19037
 
19032
19038
  const SPACING = 10;
19033
19039
  function useDropdownMenu(props) {
19034
- const { initialIsModalOpen, itemsContainerRef } = props !== null && props !== void 0 ? props : {};
19035
- const [isDropdownOpen, setIsModalOpen] = React$1.useState(Boolean(initialIsModalOpen));
19040
+ const { initialIsDropdownOpen, itemsContainerRef } = props !== null && props !== void 0 ? props : {};
19041
+ const [isDropdownOpen, setIsDropdownOpen] = React$1.useState(Boolean(initialIsDropdownOpen));
19036
19042
  const dropdownRef = React$1.useRef(null);
19037
19043
  const openDropdownButtonRef = React$1.useRef(null);
19038
19044
  React$1.useEffect(() => {
19039
19045
  const handleClickOutside = (event) => {
19040
- // close modal if the user clicked outside of it
19046
+ // close dropdown if the user clicked outside of it
19041
19047
  var _a;
19042
- if (dropdownRef.current &&
19048
+ const hasClickedOutside = dropdownRef.current &&
19043
19049
  event.target !== openDropdownButtonRef.current &&
19044
19050
  !dropdownRef.current.contains(event.target) &&
19045
- !((_a = openDropdownButtonRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
19046
- setIsModalOpen(false);
19051
+ !((_a = openDropdownButtonRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target));
19052
+ if (hasClickedOutside) {
19053
+ setIsDropdownOpen(false);
19047
19054
  }
19048
19055
  };
19049
19056
  if (isDropdownOpen) {
@@ -19054,10 +19061,10 @@ function useDropdownMenu(props) {
19054
19061
  };
19055
19062
  }, [dropdownRef, isDropdownOpen]);
19056
19063
  const openDropdown = React$1.useCallback(() => {
19057
- setIsModalOpen((prev) => !prev);
19064
+ setIsDropdownOpen((prev) => !prev);
19058
19065
  }, []);
19059
19066
  const closeDropdown = React$1.useCallback(() => {
19060
- setIsModalOpen(false);
19067
+ setIsDropdownOpen(false);
19061
19068
  }, []);
19062
19069
  const [dropdownStyles, setDropdownStyles] = React$1.useState(null);
19063
19070
  const itemRef = React$1.useRef(null);
@@ -19097,10 +19104,11 @@ function useDropdownMenu(props) {
19097
19104
  // if the dropdown is not visible at top or bottom of the item
19098
19105
  // we just center it
19099
19106
  if (!isDropdownVisibleAtItemTopOrBottom) {
19100
- return setDropdownStyles({
19107
+ setDropdownStyles({
19101
19108
  position: "center",
19102
19109
  maxHeight,
19103
19110
  });
19111
+ return;
19104
19112
  }
19105
19113
  // finally, if the dropdown fits, position it where it has more space
19106
19114
  if (distanceBetweenItemBottomAndContainerBottomEdge >=
@@ -69218,7 +69226,7 @@ const swapProgressButtonTexts = {
69218
69226
  [SwapState.PARTIAL_SUCCESS]: "Cancel",
69219
69227
  [SwapState.NEEDS_GAS]: "Go to Axelarscan",
69220
69228
  };
69221
- function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, addGasLink, }) {
69229
+ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, addGasLink, shareSwapDropdownContent, }) {
69222
69230
  const [showSwapInfoSection, setShowSwapInfoSection] = React$1.useState(true);
69223
69231
  const isFirstRenderRef = React$1.useRef(true);
69224
69232
  const { timer, stopTimer, startTimer } = useTimer({
@@ -69277,7 +69285,7 @@ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, s
69277
69285
  height: "100%",
69278
69286
  maxHeight: "100%",
69279
69287
  width: "auto",
69280
- }, autoplay: true, loop: true, src: swapProgressAnimations[swapState] }) }), jsxRuntime.jsx("div", { className: "tw-relative tw-flex tw-h-squid-m tw-w-full tw-items-end tw-justify-between tw-self-stretch tw-px-squid-m", children: swapState === SwapState.COMPLETED ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "-tw-mb-1 -tw-ml-1", children: jsxRuntime.jsx(SwapSuccessIcon, {}) }), jsxRuntime.jsx(Button$1, { size: "md", variant: "secondary", icon: jsxRuntime.jsx(XSocial, {}), label: "Share", link: socialLink, title: "Share on X" })] })) : swapState === SwapState.ERROR ? (jsxRuntime.jsx(SwapErrorTopMenu, { supportLink: supportLink, type: "error" })) : swapState === SwapState.PARTIAL_SUCCESS ? (jsxRuntime.jsx(SwapErrorTopMenu, { supportLink: supportLink, type: "warning" })) : (jsxRuntime.jsx(TokenPair, { firstToken: {
69288
+ }, autoplay: true, loop: true, src: swapProgressAnimations[swapState] }) }), jsxRuntime.jsx("div", { className: "tw-relative tw-flex tw-h-squid-m tw-w-full tw-items-end tw-justify-between tw-self-stretch tw-px-squid-m", children: swapState === SwapState.COMPLETED ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "-tw-mb-1 -tw-ml-1", children: jsxRuntime.jsx(SwapSuccessIcon, {}) }), jsxRuntime.jsx(ShareSwapButton, { dropdownContent: shareSwapDropdownContent })] })) : swapState === SwapState.ERROR ? (jsxRuntime.jsx(SwapErrorTopMenu, { supportLink: supportLink, type: "error" })) : swapState === SwapState.PARTIAL_SUCCESS ? (jsxRuntime.jsx(SwapErrorTopMenu, { supportLink: supportLink, type: "warning" })) : (jsxRuntime.jsx(TokenPair, { firstToken: {
69281
69289
  bgColor: fromToken.bgColor,
69282
69290
  logoURI: fromToken.logoUrl,
69283
69291
  }, secondToken: {
@@ -69301,9 +69309,6 @@ const TrackTransactionView = React$1.forwardRef((props, ref) => {
69301
69309
  currentStepIndex: rawSteps.length - 1,
69302
69310
  };
69303
69311
  }
69304
- // TODO: Fix this
69305
- // Vercel build throws an error for findLastIndex, probably related to the Node version being used
69306
- // @ts-expect-error
69307
69312
  const lastSuccessfulStepIndex = rawSteps.findLastIndex((s) => s.status === "executed" || s.status === "success");
69308
69313
  if (swapState === SwapState.PROGRESS) {
69309
69314
  onTxStart();
@@ -69340,6 +69345,29 @@ const TrackTransactionView = React$1.forwardRef((props, ref) => {
69340
69345
  currentStepIndex: firstWarningStepIndex,
69341
69346
  };
69342
69347
  }
69348
+ if (swapState === SwapState.PARTIAL_SUCCESS) {
69349
+ const lastWarningStepIndex = rawSteps.findLastIndex((s) => s.status === "warning");
69350
+ if (lastWarningStepIndex !== -1) {
69351
+ return {
69352
+ currentStepIndex: lastWarningStepIndex,
69353
+ steps: rawSteps,
69354
+ };
69355
+ }
69356
+ const lastSuccessfulStep = rawSteps[lastSuccessfulStepIndex];
69357
+ if (!lastSuccessfulStep) {
69358
+ return {
69359
+ currentStepIndex: 0,
69360
+ steps: rawSteps,
69361
+ };
69362
+ }
69363
+ // If swap state is partial success and there is no warning step
69364
+ // override last successful step with warning status
69365
+ const stepsWithRefunded = rawSteps.with(lastSuccessfulStepIndex, Object.assign(Object.assign({}, lastSuccessfulStep), { status: "warning" }));
69366
+ return {
69367
+ currentStepIndex: lastSuccessfulStepIndex,
69368
+ steps: stepsWithRefunded,
69369
+ };
69370
+ }
69343
69371
  return {
69344
69372
  steps: rawSteps,
69345
69373
  currentStepIndex: 0,
@@ -69351,6 +69379,15 @@ const SwapErrorTopMenu = ({ supportLink, type, }) => {
69351
69379
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "-tw-mb-1 -tw-ml-1", children: type === "error" ? jsxRuntime.jsx(SwapErrorIcon, {}) : jsxRuntime.jsx(SwapWarningIcon, {}) }), jsxRuntime.jsx(Button$1, { size: "md", variant: "secondary", label: "Get help", link: supportLink, title: "Contact support" })] }));
69352
69380
  };
69353
69381
  TrackTransactionView.displayName = "TrackTransactionView";
69382
+ function ShareSwapButton({ dropdownContent, }) {
69383
+ const containerRef = useContainerStore((state) => state.containerRef);
69384
+ const { dropdownRef, isDropdownOpen, openDropdown, menuRef } = useDropdownMenu({
69385
+ itemsContainerRef: containerRef,
69386
+ });
69387
+ return (jsxRuntime.jsx(DropdownMenu, { dropdownRef: dropdownRef, menuRef: menuRef, className: "-tw-bottom-[calc(100%+5px)] tw-left-1/2 tw-right-[unset] tw-top-[calc(100%+5px)] -tw-translate-x-1/2", isHidden: !isDropdownOpen, trigger: jsxRuntime.jsx(Button$1, { size: "md", variant: "secondary", onClick: () => {
69388
+ openDropdown();
69389
+ }, children: jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(BodyText, { size: "small", className: "tw-px-squid-xxs", children: "Share" }), jsxRuntime.jsx(ChevronDownSmallIcon, { size: "24", strokeWidth: "1.5" })] }) }), children: dropdownContent }));
69390
+ }
69354
69391
 
69355
69392
  function TransactionViewLayout(_a) {
69356
69393
  var { isLoading, header, properties, actions, fees } = _a, props = __rest$1(_a, ["isLoading", "header", "properties", "actions", "fees"]);
@@ -69827,8 +69864,7 @@ exports.CommandIcon = CommandIcon;
69827
69864
  exports.CompassRoundOutlinedIcon = CompassRoundOutlinedIcon;
69828
69865
  exports.CompassRoundSolidIcon = CompassRoundSolidIcon;
69829
69866
  exports.ConsoleIcon = ConsoleIcon;
69830
- exports.Copy = Copy;
69831
- exports.CopyIcon = CopyIcon;
69867
+ exports.Copy2Icon = Copy2Icon;
69832
69868
  exports.CopyOutlinedIcon = CopyOutlinedIcon;
69833
69869
  exports.CrossAnimatedIcon = CrossAnimatedIcon;
69834
69870
  exports.CrossedOutSunSolidIcon = CrossedOutSunSolidIcon;
@@ -69857,6 +69893,7 @@ exports.ErrorMessage = ErrorMessage;
69857
69893
  exports.EthereumIcon = EthereumIcon;
69858
69894
  exports.ExplosionIcon = ExplosionIcon;
69859
69895
  exports.EyeOpenIcon = EyeOpenIcon;
69896
+ exports.FarcasterIcon = FarcasterIcon;
69860
69897
  exports.FavouriteFilterIcon = FavouriteFilterIcon;
69861
69898
  exports.FeeButton = FeeButton;
69862
69899
  exports.FeesAction = FeesAction;
@@ -69994,6 +70031,7 @@ exports.Tab = Tab;
69994
70031
  exports.Tabs = Tabs;
69995
70032
  exports.TagIcon = TagIcon;
69996
70033
  exports.TagIconFilled = TagIconFilled;
70034
+ exports.TelegramIcon = TelegramIcon;
69997
70035
  exports.TextSkeleton = TextSkeleton;
69998
70036
  exports.ThemeProvider = ThemeProvider;
69999
70037
  exports.ThumbsUp = ThumbsUp;
@@ -70028,7 +70066,7 @@ exports.WalletFilledIcon = WalletFilledIcon;
70028
70066
  exports.WalletIcon = WalletIcon;
70029
70067
  exports.WalletLink = WalletLink;
70030
70068
  exports.WrapAction = WrapAction;
70031
- exports.XSocial = XSocial;
70069
+ exports.XSocialIcon = XSocialIcon;
70032
70070
  exports.adjustColorForContrast = adjustColorForContrast;
70033
70071
  exports.baseTailwindConfig = baseTailwindConfig;
70034
70072
  exports.blendColors = blendColors;
@@ -75,8 +75,9 @@ export declare function ArrowCornerDownRightIcon({ size, className, }: {
75
75
  size?: string;
76
76
  className?: string;
77
77
  }): import("react/jsx-runtime").JSX.Element;
78
- export declare function ChevronDownSmallIcon({ size, className, }: {
78
+ export declare function ChevronDownSmallIcon({ size, strokeWidth, className, }: {
79
79
  size?: string;
80
+ strokeWidth?: string;
80
81
  className?: string;
81
82
  }): import("react/jsx-runtime").JSX.Element;
82
83
  export declare function ArrowDownIcon({ size, className, }: {
@@ -62,11 +62,12 @@ export declare function LaptopIcon({ size, className, }: {
62
62
  size?: string;
63
63
  className?: string;
64
64
  }): import("react/jsx-runtime").JSX.Element;
65
- export declare function CopyOutlinedIcon({ size, className, }: {
65
+ export declare function CopyOutlinedIcon({ size, strokeWidth, className, }: {
66
66
  size?: string;
67
67
  className?: string;
68
+ strokeWidth?: string;
68
69
  }): import("react/jsx-runtime").JSX.Element;
69
- export declare function CopyIcon({ size, className, }: {
70
+ export declare function Copy2Icon({ size, className, }: {
70
71
  size?: string;
71
72
  className?: string;
72
73
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- export declare function XSocial({ className, size, }: {
1
+ export declare function XSocialIcon({ className, size, }: {
2
2
  size?: string;
3
3
  className?: string;
4
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -14,3 +14,11 @@ export declare function MirrorIcon({ size, className, }: {
14
14
  size?: string;
15
15
  className?: string;
16
16
  }): import("react/jsx-runtime").JSX.Element;
17
+ export declare function FarcasterIcon({ size, className, }: {
18
+ size?: string;
19
+ className?: string;
20
+ }): import("react/jsx-runtime").JSX.Element;
21
+ export declare function TelegramIcon({ className, size, }: {
22
+ className?: string;
23
+ size?: string;
24
+ }): import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,6 @@ export * from "./Clock";
12
12
  export * from "./Coins";
13
13
  export * from "./Collection";
14
14
  export * from "./CompassRound";
15
- export * from "./Copy";
16
15
  export * from "./CrossAnimatedIcon";
17
16
  export * from "./DashboardFast";
18
17
  export * from "./DockIcons";
@@ -10,6 +10,7 @@ interface DropdownMenuProps {
10
10
  children?: React.ReactNode;
11
11
  contentWrapperProps?: React.ComponentProps<"div">;
12
12
  menuContentClassName?: string;
13
+ trigger?: React.ReactNode;
13
14
  }
14
- export declare function DropdownMenu({ dropdownRef, className, menuRef, isHidden, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function DropdownMenu({ dropdownRef, className, menuRef, isHidden, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, trigger, }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SwapState, type SwapStep } from "../../types/components";
2
3
  import { type SwapStepsCollapsedFooterButton } from "../layout/SwapStepsCollapsed";
3
4
  interface ChainData {
@@ -9,12 +10,12 @@ interface Token {
9
10
  logoUrl: string;
10
11
  bgColor: string;
11
12
  }
12
- export declare function SwapProgressView({ steps, isOpen, handleClose, handleComplete, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, addGasLink, }: {
13
+ export declare function SwapProgressView({ steps, isOpen, handleClose, handleComplete, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, addGasLink, shareSwapDropdownContent, }: {
13
14
  steps: SwapStep[];
14
15
  handleClose?: (swapState: SwapState) => void;
15
16
  handleComplete?: () => void;
16
17
  isOpen?: boolean;
17
- socialLink?: string;
18
+ shareSwapDropdownContent?: React.ReactNode;
18
19
  supportLink?: string;
19
20
  fromToken: Token;
20
21
  toToken: Token;
@@ -1,11 +1,11 @@
1
- import React from "react";
2
- export type DropdownPosition = "top" | "bottom" | "center";
3
- export type DropdownStyles = {
1
+ import type React from "react";
2
+ import { type DropdownPosition } from "../types/components";
3
+ export interface DropdownStyles {
4
4
  position: DropdownPosition;
5
5
  maxHeight: number | null;
6
- };
6
+ }
7
7
  interface UseDropdownMenuParams {
8
- initialIsModalOpen?: boolean;
8
+ initialIsDropdownOpen?: boolean;
9
9
  itemsContainerRef?: React.RefObject<HTMLElement>;
10
10
  }
11
11
  export declare function useDropdownMenu(props?: UseDropdownMenuParams): {
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from "@storybook/react/*";
1
+ import { type Meta, type StoryObj } from "@storybook/react/*";
2
2
  declare const meta: Meta<typeof SwitchingAppContainer>;
3
3
  export default meta;
4
4
  type Story = StoryObj<typeof meta>;
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from "@storybook/react";
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
2
  import { MainView } from "../../components/views/MainView";
3
3
  declare const meta: Meta<typeof MainView>;
4
4
  export default meta;
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from "@storybook/react";
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
2
  import { SwapDetailsView } from "../../components/views/SwapDetailsView";
3
3
  declare const meta: Meta<typeof SwapDetailsView>;
4
4
  export default meta;