@0xsquid/ui 3.3.3-beta-ssr.0 → 3.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +17 -26
- package/dist/cjs/types/components/views/TransactionView/BaseTransactionViewProps.d.ts +2 -0
- package/dist/cjs/types/components/views/TransactionView/BridgeTransactionView.d.ts +1 -1
- package/dist/cjs/types/components/views/TransactionView/Properties/RefundedProperty.d.ts +11 -0
- package/dist/cjs/types/components/views/TransactionView/SwapTransactionView.d.ts +1 -1
- package/dist/cjs/types/hooks/useMediaQuery.d.ts +2 -2
- package/dist/cjs/types/stories/views/TransactionView.stories.d.ts +52 -0
- package/dist/esm/index.js +17 -26
- package/dist/esm/types/components/views/TransactionView/BaseTransactionViewProps.d.ts +2 -0
- package/dist/esm/types/components/views/TransactionView/BridgeTransactionView.d.ts +1 -1
- package/dist/esm/types/components/views/TransactionView/Properties/RefundedProperty.d.ts +11 -0
- package/dist/esm/types/components/views/TransactionView/SwapTransactionView.d.ts +1 -1
- package/dist/esm/types/hooks/useMediaQuery.d.ts +2 -2
- package/dist/esm/types/stories/views/TransactionView.stories.d.ts +52 -0
- package/dist/index.d.ts +6 -4
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -5192,7 +5192,7 @@ function useConstant(init) {
|
|
|
5192
5192
|
|
|
5193
5193
|
const isBrowser$1 = typeof window !== "undefined";
|
|
5194
5194
|
|
|
5195
|
-
const useIsomorphicLayoutEffect$
|
|
5195
|
+
const useIsomorphicLayoutEffect$1 = isBrowser$1 ? require$$0.useLayoutEffect : require$$0.useEffect;
|
|
5196
5196
|
|
|
5197
5197
|
/**
|
|
5198
5198
|
* @public
|
|
@@ -5497,7 +5497,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
|
|
|
5497
5497
|
*/
|
|
5498
5498
|
const [diffedChildren, setDiffedChildren] = require$$0.useState(presentChildren);
|
|
5499
5499
|
const [renderedChildren, setRenderedChildren] = require$$0.useState(presentChildren);
|
|
5500
|
-
useIsomorphicLayoutEffect$
|
|
5500
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
5501
5501
|
isInitialRender.current = false;
|
|
5502
5502
|
pendingPresentChildren.current = presentChildren;
|
|
5503
5503
|
/**
|
|
@@ -5596,7 +5596,7 @@ const DeprecatedLayoutGroupContext = require$$0.createContext(null);
|
|
|
5596
5596
|
|
|
5597
5597
|
function useIsMounted() {
|
|
5598
5598
|
const isMounted = require$$0.useRef(false);
|
|
5599
|
-
useIsomorphicLayoutEffect$
|
|
5599
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
5600
5600
|
isMounted.current = true;
|
|
5601
5601
|
return () => {
|
|
5602
5602
|
isMounted.current = false;
|
|
@@ -6241,7 +6241,7 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
6241
6241
|
const wantsHandoff = require$$0.useRef(Boolean(optimisedAppearId) &&
|
|
6242
6242
|
!window.MotionHandoffIsComplete?.(optimisedAppearId) &&
|
|
6243
6243
|
window.MotionHasOptimisedAnimation?.(optimisedAppearId));
|
|
6244
|
-
useIsomorphicLayoutEffect$
|
|
6244
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
6245
6245
|
if (!visualElement)
|
|
6246
6246
|
return;
|
|
6247
6247
|
isMounted.current = true;
|
|
@@ -39395,11 +39395,10 @@ const Card = ({ variant = "transparent", className, children, }) => {
|
|
|
39395
39395
|
return (jsxRuntime.jsx("div", { className: cn("tw-rounded-squid-l tw-border tw-border-material-dark-average tw-bg-material-dark-average tw-backdrop-blur/10", className), children: children }));
|
|
39396
39396
|
};
|
|
39397
39397
|
|
|
39398
|
-
const useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? require$$0.useLayoutEffect : require$$0.useEffect;
|
|
39399
39398
|
function useOnResize(ref, callback) {
|
|
39400
39399
|
const callbackRef = require$$0.useRef(callback);
|
|
39401
39400
|
callbackRef.current = callback;
|
|
39402
|
-
|
|
39401
|
+
require$$0.useLayoutEffect(() => {
|
|
39403
39402
|
if (!ref.current)
|
|
39404
39403
|
return;
|
|
39405
39404
|
const observer = new ResizeObserver(([entry]) => {
|
|
@@ -39412,13 +39411,8 @@ function useOnResize(ref, callback) {
|
|
|
39412
39411
|
return () => observer.disconnect();
|
|
39413
39412
|
}, [ref.current]);
|
|
39414
39413
|
}
|
|
39415
|
-
const EMPTY_RECT = {
|
|
39416
|
-
x: 0, y: 0, width: 0, height: 0,
|
|
39417
|
-
top: 0, left: 0, right: 0, bottom: 0,
|
|
39418
|
-
toJSON: () => ({}),
|
|
39419
|
-
};
|
|
39420
39414
|
function useRect(ref) {
|
|
39421
|
-
const [rect, setRect] = require$$0.useState(
|
|
39415
|
+
const [rect, setRect] = require$$0.useState(() => new DOMRectReadOnly());
|
|
39422
39416
|
useOnResize(ref, setRect);
|
|
39423
39417
|
return rect;
|
|
39424
39418
|
}
|
|
@@ -40113,7 +40107,7 @@ const useIsomorphicLayoutEffect = IS_SERVER ? require$$0.useEffect : require$$0.
|
|
|
40113
40107
|
* // Use `isSmallScreen` to conditionally apply styles or logic based on the screen size.
|
|
40114
40108
|
* ```
|
|
40115
40109
|
*/
|
|
40116
|
-
function useMediaQuery(query, { defaultValue = false, initializeWithValue =
|
|
40110
|
+
function useMediaQuery(query, { defaultValue = false, initializeWithValue = true, } = {}) {
|
|
40117
40111
|
const getMatches = (query) => {
|
|
40118
40112
|
if (IS_SERVER) {
|
|
40119
40113
|
return defaultValue;
|
|
@@ -40201,8 +40195,6 @@ function useUserTheme() {
|
|
|
40201
40195
|
const [themePreference, setThemePreference] = require$$0.useState(getInitialTheme);
|
|
40202
40196
|
const [themeType, setThemeType] = require$$0.useState(getEffectiveTheme(themePreference));
|
|
40203
40197
|
require$$0.useEffect(() => {
|
|
40204
|
-
if (typeof window === "undefined")
|
|
40205
|
-
return;
|
|
40206
40198
|
const handleThemeChange = (e) => {
|
|
40207
40199
|
setThemePreference(e.detail);
|
|
40208
40200
|
};
|
|
@@ -40212,8 +40204,6 @@ function useUserTheme() {
|
|
|
40212
40204
|
};
|
|
40213
40205
|
}, []);
|
|
40214
40206
|
require$$0.useEffect(() => {
|
|
40215
|
-
if (typeof window === "undefined")
|
|
40216
|
-
return;
|
|
40217
40207
|
const mediaQuery = window.matchMedia(THEME_MEDIA_QUERY);
|
|
40218
40208
|
const handleChange = () => {
|
|
40219
40209
|
if (themePreference === exports.ThemePreference.SYSTEM) {
|
|
@@ -40231,8 +40221,6 @@ function useUserTheme() {
|
|
|
40231
40221
|
}, [themePreference]);
|
|
40232
40222
|
const setThemeManually = (theme) => {
|
|
40233
40223
|
setThemePreference(theme);
|
|
40234
|
-
if (typeof window === "undefined")
|
|
40235
|
-
return;
|
|
40236
40224
|
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
40237
40225
|
window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme }));
|
|
40238
40226
|
};
|
|
@@ -40254,8 +40242,6 @@ function getInitialTheme() {
|
|
|
40254
40242
|
function getEffectiveTheme(themeType) {
|
|
40255
40243
|
if (themeType !== exports.ThemePreference.SYSTEM)
|
|
40256
40244
|
return themeType;
|
|
40257
|
-
if (typeof window === "undefined")
|
|
40258
|
-
return "dark";
|
|
40259
40245
|
return window.matchMedia(THEME_MEDIA_QUERY).matches ? "light" : "dark";
|
|
40260
40246
|
}
|
|
40261
40247
|
|
|
@@ -41475,7 +41461,7 @@ function FilterSection({ title, children, collapsed = false, handleCollapse, han
|
|
|
41475
41461
|
maxHeight: 0,
|
|
41476
41462
|
},
|
|
41477
41463
|
expanded: {
|
|
41478
|
-
maxHeight: Math.min(height,
|
|
41464
|
+
maxHeight: Math.min(height, window.innerHeight - 40) + "px",
|
|
41479
41465
|
},
|
|
41480
41466
|
}), [height]);
|
|
41481
41467
|
return (jsxRuntime.jsxs("div", { className: "tw-flex tw-min-h-10 tw-flex-col", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-min-h-squid-xl tw-shrink-0 tw-cursor-pointer tw-items-center tw-justify-between tw-px-squid-m tw-text-grey-300", onClick: () => {
|
|
@@ -83730,6 +83716,11 @@ function LinkButton({ href, label }) {
|
|
|
83730
83716
|
return (jsxRuntime.jsxs("a", { href: href, target: "_blank", className: "tw-flex tw-items-center tw-gap-0.5", rel: "noreferrer", children: [label, jsxRuntime.jsx("div", { className: "tw-ml-0.5 tw-rounded-squid-xs tw-p-0.5 tw-text-royal-500 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(SquareArrowTopRightIcon, {}) })] }));
|
|
83731
83717
|
}
|
|
83732
83718
|
|
|
83719
|
+
const RefundedProperty = ({ token, amount, link, showGradientBg, }) => {
|
|
83720
|
+
const detail = (jsxRuntime.jsx(IconLabel, { src: token.logoURI, rounded: "full", children: jsxRuntime.jsx(BodyText, { size: "small", children: amount }) }));
|
|
83721
|
+
return (jsxRuntime.jsx(PropertyListItem, { variant: "large", showGradientBg: showGradientBg, label: `Refunded ${token.symbol}`, icon: jsxRuntime.jsx(SwapIcon, {}), detail: link ? jsxRuntime.jsx(LinkButton, { href: link, label: detail }) : detail }));
|
|
83722
|
+
};
|
|
83723
|
+
|
|
83733
83724
|
const TokenLink = ({ logoURI, amount, }) => {
|
|
83734
83725
|
return (jsxRuntime.jsx(IconLabel, { src: logoURI, rounded: "full", children: amount ? (jsxRuntime.jsx(BodyText, { size: "small", children: amount })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }));
|
|
83735
83726
|
};
|
|
@@ -83737,16 +83728,16 @@ const TokenProperty = ({ icon, label, token, link, amount, showGradientBg, }) =>
|
|
|
83737
83728
|
return (jsxRuntime.jsx(PropertyListItem, { variant: "large", icon: icon, label: label, showGradientBg: showGradientBg, detail: token ? (link ? (jsxRuntime.jsx(LinkButton, { href: link, label: jsxRuntime.jsx(TokenLink, { logoURI: token.logoURI, amount: amount }) })) : (jsxRuntime.jsx(TokenLink, { logoURI: token.logoURI, amount: amount }))) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }));
|
|
83738
83729
|
};
|
|
83739
83730
|
|
|
83740
|
-
function SwapTransactionView({ title = "Swap", hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, }) {
|
|
83731
|
+
function SwapTransactionView({ title = "Swap", hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, refundHash, refundLink, }) {
|
|
83741
83732
|
if (isLoading)
|
|
83742
83733
|
return jsxRuntime.jsx(TransactionViewLayout, { isLoading: isLoading });
|
|
83743
|
-
return (jsxRuntime.jsx(TransactionViewLayout, { header: jsxRuntime.jsx(TransactionHeaderLayout, { title: title, status: status, media: jsxRuntime.jsx(Drip, { direction: "horizontal", from: fromToken, to: toToken }), children: jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsxRuntime.jsx(Chip, { label: "TX" }), jsxRuntime.jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxRuntime.jsxs(PropertiesLayout, { children: [jsxRuntime.jsx(TokenProperty, { token: fromToken, link: fromLink, amount: fromAmount, icon: jsxRuntime.jsx(ArrowRightDownCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Swap ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsxRuntime.jsx(TokenProperty, { token: toToken, link: toLink, amount: toAmount, icon: jsxRuntime.jsx(ArrowRightDownCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsxRuntime.jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsxRuntime.jsx(Transfer, { from: fromChain ? (jsxRuntime.jsx(IconLabel, { src: fromChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: fromChain.name }) })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toChain ? (jsxRuntime.jsx(IconLabel, { src: toChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", icon: jsxRuntime.jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: fromAddress, label: jsxRuntime.jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: toAddress, label: jsxRuntime.jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsxRuntime.jsx(ArrowsSwapIcon, {}), label: "Exchange rate", detail: jsxRuntime.jsx(Transfer, { from: fromToken ? (jsxRuntime.jsxs(BodyText, { size: "small", children: ["1 ", fromToken.symbol] })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toToken && exchangeRate ? (jsxRuntime.jsxs(BodyText, { size: "small", children: [exchangeRate, " ", toToken.symbol] })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), jsxRuntime.jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete })] }), actions: actions, fees: fees }));
|
|
83734
|
+
return (jsxRuntime.jsx(TransactionViewLayout, { header: jsxRuntime.jsx(TransactionHeaderLayout, { title: title, status: status, media: jsxRuntime.jsx(Drip, { direction: "horizontal", from: fromToken, to: toToken }), children: jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsxRuntime.jsx(Chip, { label: "TX" }), jsxRuntime.jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxRuntime.jsxs(PropertiesLayout, { children: [jsxRuntime.jsx(TokenProperty, { token: fromToken, link: fromLink, amount: fromAmount, icon: jsxRuntime.jsx(ArrowRightDownCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Swap ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsxRuntime.jsx(TokenProperty, { token: toToken, link: toLink, amount: toAmount, icon: jsxRuntime.jsx(ArrowRightDownCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsxRuntime.jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsxRuntime.jsx(Transfer, { from: fromChain ? (jsxRuntime.jsx(IconLabel, { src: fromChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: fromChain.name }) })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toChain ? (jsxRuntime.jsx(IconLabel, { src: toChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", icon: jsxRuntime.jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: fromAddress, label: jsxRuntime.jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: toAddress, label: jsxRuntime.jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsxRuntime.jsx(ArrowsSwapIcon, {}), label: "Exchange rate", detail: jsxRuntime.jsx(Transfer, { from: fromToken ? (jsxRuntime.jsxs(BodyText, { size: "small", children: ["1 ", fromToken.symbol] })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toToken && exchangeRate ? (jsxRuntime.jsxs(BodyText, { size: "small", children: [exchangeRate, " ", toToken.symbol] })) : (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), refundHash && status === "refunded" ? (jsxRuntime.jsx(RefundedProperty, { token: fromToken, amount: fromAmount, link: refundLink })) : (jsxRuntime.jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete }))] }), actions: actions, fees: fees }));
|
|
83744
83735
|
}
|
|
83745
83736
|
|
|
83746
|
-
function BridgeTransactionView({ title = "Bridge", hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, }) {
|
|
83737
|
+
function BridgeTransactionView({ title = "Bridge", hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, refundHash, refundLink, }) {
|
|
83747
83738
|
if (isLoading)
|
|
83748
83739
|
return jsxRuntime.jsx(TransactionViewLayout, { isLoading: isLoading });
|
|
83749
|
-
return (jsxRuntime.jsx(TransactionViewLayout, { isLoading: isLoading, header: jsxRuntime.jsx(TransactionHeaderLayout, { title: title, status: status, media: jsxRuntime.jsxs("div", { className: "tw-relative", children: [jsxRuntime.jsx(Image$2, { src: fromChain.logoURI, size: "xlarge", rounded: "full" }), toChain ? (jsxRuntime.jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-rounded-md tw-border tw-border-white", children: jsxRuntime.jsx(Image$2, { src: toChain.logoURI, size: "medium" }) })) : (jsxRuntime.jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-w-squid-m tw-overflow-hidden tw-rounded-md", children: jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-600 tw-text-transparent" }) }))] }), children: jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsxRuntime.jsx(Chip, { label: "TX" }), jsxRuntime.jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxRuntime.jsxs(PropertiesLayout, { children: [jsxRuntime.jsx(TokenProperty, { token: fromToken, amount: fromAmount, link: fromLink, icon: jsxRuntime.jsx(ArrowRightUpCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Bridge ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsxRuntime.jsx(TokenProperty, { token: toToken, amount: toAmount, link: toLink, icon: jsxRuntime.jsx(ArrowRightDownCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsxRuntime.jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(IconLabel, { src: fromChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: fromChain.name }) }), to: toChain ? (jsxRuntime.jsx(IconLabel, { src: toChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsxRuntime.jsx(LoadingSkeleton, {})) }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", icon: jsxRuntime.jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: fromAddress, label: jsxRuntime.jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: toAddress, label: jsxRuntime.jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), jsxRuntime.jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete })] }), actions: actions, fees: fees }));
|
|
83740
|
+
return (jsxRuntime.jsx(TransactionViewLayout, { isLoading: isLoading, header: jsxRuntime.jsx(TransactionHeaderLayout, { title: title, status: status, media: jsxRuntime.jsxs("div", { className: "tw-relative", children: [jsxRuntime.jsx(Image$2, { src: fromChain.logoURI, size: "xlarge", rounded: "full" }), toChain ? (jsxRuntime.jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-rounded-md tw-border tw-border-white", children: jsxRuntime.jsx(Image$2, { src: toChain.logoURI, size: "medium" }) })) : (jsxRuntime.jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-w-squid-m tw-overflow-hidden tw-rounded-md", children: jsxRuntime.jsx(LoadingSkeleton, { className: "tw-bg-grey-600 tw-text-transparent" }) }))] }), children: jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsxRuntime.jsx(Chip, { label: "TX" }), jsxRuntime.jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxRuntime.jsxs(PropertiesLayout, { children: [jsxRuntime.jsx(TokenProperty, { token: fromToken, amount: fromAmount, link: fromLink, icon: jsxRuntime.jsx(ArrowRightUpCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Bridge ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsxRuntime.jsx(TokenProperty, { token: toToken, amount: toAmount, link: toLink, icon: jsxRuntime.jsx(ArrowRightDownCircleIcon, {}), label: jsxRuntime.jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsxRuntime.jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(IconLabel, { src: fromChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: fromChain.name }) }), to: toChain ? (jsxRuntime.jsx(IconLabel, { src: toChain.logoURI, children: jsxRuntime.jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsxRuntime.jsx(LoadingSkeleton, {})) }) }), jsxRuntime.jsx(PropertyListItem, { variant: "large", icon: jsxRuntime.jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsxRuntime.jsx(Transfer, { from: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: fromAddress, label: jsxRuntime.jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsxRuntime.jsx(BodyText, { size: "small", children: jsxRuntime.jsx(CopyButton, { copyText: toAddress, label: jsxRuntime.jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), refundHash && status === "refunded" ? (jsxRuntime.jsx(RefundedProperty, { token: fromToken, amount: fromAmount, link: refundLink })) : (jsxRuntime.jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete }))] }), actions: actions, fees: fees }));
|
|
83750
83741
|
}
|
|
83751
83742
|
|
|
83752
83743
|
function TransactionView({ type, isLoading, data, }) {
|
|
@@ -34,5 +34,5 @@ type BridgeTransactionViewProps = (BaseBridgeTransactionViewProps & {
|
|
|
34
34
|
}) | (Partial<Omit<BaseBridgeTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
|
|
35
35
|
isLoading: true;
|
|
36
36
|
});
|
|
37
|
-
export declare function BridgeTransactionView({ title, hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, }: BridgeTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function BridgeTransactionView({ title, hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, refundHash, refundLink, }: BridgeTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
token: {
|
|
3
|
+
logoURI: string;
|
|
4
|
+
symbol: string;
|
|
5
|
+
};
|
|
6
|
+
amount: string;
|
|
7
|
+
link?: string;
|
|
8
|
+
showGradientBg?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const RefundedProperty: ({ token, amount, link, showGradientBg, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -32,5 +32,5 @@ type SwapTransactionViewProps = (BaseSwapTransactionViewProps & {
|
|
|
32
32
|
}) | (Partial<Omit<BaseSwapTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
|
|
33
33
|
isLoading: true;
|
|
34
34
|
});
|
|
35
|
-
export declare function SwapTransactionView({ title, hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, }: SwapTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function SwapTransactionView({ title, hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, refundHash, refundLink, }: SwapTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
36
36
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type UseMediaQueryOptions = {
|
|
2
2
|
/**
|
|
3
3
|
* The default value to return if the hook is being run on the server.
|
|
4
4
|
* @default false
|
|
@@ -9,7 +9,7 @@ interface UseMediaQueryOptions {
|
|
|
9
9
|
* @default true
|
|
10
10
|
*/
|
|
11
11
|
initializeWithValue?: boolean;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
/**
|
|
14
14
|
* Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
|
|
15
15
|
* @param {string} query - The media query to track.
|
|
@@ -956,3 +956,55 @@ export declare const BridgeMissingToToken: {
|
|
|
956
956
|
};
|
|
957
957
|
};
|
|
958
958
|
};
|
|
959
|
+
export declare const BridgeRefunded: {
|
|
960
|
+
args: {
|
|
961
|
+
type: string;
|
|
962
|
+
data: {
|
|
963
|
+
title: string;
|
|
964
|
+
hash: string;
|
|
965
|
+
url: string;
|
|
966
|
+
status: string;
|
|
967
|
+
fromAmount: string;
|
|
968
|
+
toAmount: string;
|
|
969
|
+
fromToken: {
|
|
970
|
+
logoURI: string;
|
|
971
|
+
bgColor: string;
|
|
972
|
+
symbol: string;
|
|
973
|
+
};
|
|
974
|
+
toToken: {
|
|
975
|
+
logoURI: string;
|
|
976
|
+
bgColor: string;
|
|
977
|
+
symbol: string;
|
|
978
|
+
};
|
|
979
|
+
fromChain: {
|
|
980
|
+
logoURI: string;
|
|
981
|
+
name: string;
|
|
982
|
+
bgColor: string;
|
|
983
|
+
};
|
|
984
|
+
toChain: {
|
|
985
|
+
logoURI: string;
|
|
986
|
+
name: string;
|
|
987
|
+
bgColor: string;
|
|
988
|
+
};
|
|
989
|
+
fromAddress: string;
|
|
990
|
+
toAddress: string;
|
|
991
|
+
fromLink: string;
|
|
992
|
+
timeToComplete: string;
|
|
993
|
+
refundHash: string;
|
|
994
|
+
refundLink: string;
|
|
995
|
+
fees: {
|
|
996
|
+
status: string;
|
|
997
|
+
total: {
|
|
998
|
+
label: string;
|
|
999
|
+
usd: number;
|
|
1000
|
+
};
|
|
1001
|
+
lines: {
|
|
1002
|
+
label: string;
|
|
1003
|
+
usd: number;
|
|
1004
|
+
amount: string;
|
|
1005
|
+
symbol: string;
|
|
1006
|
+
}[];
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -5172,7 +5172,7 @@ function useConstant(init) {
|
|
|
5172
5172
|
|
|
5173
5173
|
const isBrowser$1 = typeof window !== "undefined";
|
|
5174
5174
|
|
|
5175
|
-
const useIsomorphicLayoutEffect$
|
|
5175
|
+
const useIsomorphicLayoutEffect$1 = isBrowser$1 ? useLayoutEffect : useEffect;
|
|
5176
5176
|
|
|
5177
5177
|
/**
|
|
5178
5178
|
* @public
|
|
@@ -5477,7 +5477,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
|
|
|
5477
5477
|
*/
|
|
5478
5478
|
const [diffedChildren, setDiffedChildren] = useState(presentChildren);
|
|
5479
5479
|
const [renderedChildren, setRenderedChildren] = useState(presentChildren);
|
|
5480
|
-
useIsomorphicLayoutEffect$
|
|
5480
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
5481
5481
|
isInitialRender.current = false;
|
|
5482
5482
|
pendingPresentChildren.current = presentChildren;
|
|
5483
5483
|
/**
|
|
@@ -5576,7 +5576,7 @@ const DeprecatedLayoutGroupContext = createContext(null);
|
|
|
5576
5576
|
|
|
5577
5577
|
function useIsMounted() {
|
|
5578
5578
|
const isMounted = useRef(false);
|
|
5579
|
-
useIsomorphicLayoutEffect$
|
|
5579
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
5580
5580
|
isMounted.current = true;
|
|
5581
5581
|
return () => {
|
|
5582
5582
|
isMounted.current = false;
|
|
@@ -6221,7 +6221,7 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
6221
6221
|
const wantsHandoff = useRef(Boolean(optimisedAppearId) &&
|
|
6222
6222
|
!window.MotionHandoffIsComplete?.(optimisedAppearId) &&
|
|
6223
6223
|
window.MotionHasOptimisedAnimation?.(optimisedAppearId));
|
|
6224
|
-
useIsomorphicLayoutEffect$
|
|
6224
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
6225
6225
|
if (!visualElement)
|
|
6226
6226
|
return;
|
|
6227
6227
|
isMounted.current = true;
|
|
@@ -39375,11 +39375,10 @@ const Card = ({ variant = "transparent", className, children, }) => {
|
|
|
39375
39375
|
return (jsx("div", { className: cn("tw-rounded-squid-l tw-border tw-border-material-dark-average tw-bg-material-dark-average tw-backdrop-blur/10", className), children: children }));
|
|
39376
39376
|
};
|
|
39377
39377
|
|
|
39378
|
-
const useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
39379
39378
|
function useOnResize(ref, callback) {
|
|
39380
39379
|
const callbackRef = useRef(callback);
|
|
39381
39380
|
callbackRef.current = callback;
|
|
39382
|
-
|
|
39381
|
+
useLayoutEffect(() => {
|
|
39383
39382
|
if (!ref.current)
|
|
39384
39383
|
return;
|
|
39385
39384
|
const observer = new ResizeObserver(([entry]) => {
|
|
@@ -39392,13 +39391,8 @@ function useOnResize(ref, callback) {
|
|
|
39392
39391
|
return () => observer.disconnect();
|
|
39393
39392
|
}, [ref.current]);
|
|
39394
39393
|
}
|
|
39395
|
-
const EMPTY_RECT = {
|
|
39396
|
-
x: 0, y: 0, width: 0, height: 0,
|
|
39397
|
-
top: 0, left: 0, right: 0, bottom: 0,
|
|
39398
|
-
toJSON: () => ({}),
|
|
39399
|
-
};
|
|
39400
39394
|
function useRect(ref) {
|
|
39401
|
-
const [rect, setRect] = useState(
|
|
39395
|
+
const [rect, setRect] = useState(() => new DOMRectReadOnly());
|
|
39402
39396
|
useOnResize(ref, setRect);
|
|
39403
39397
|
return rect;
|
|
39404
39398
|
}
|
|
@@ -40093,7 +40087,7 @@ const useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;
|
|
|
40093
40087
|
* // Use `isSmallScreen` to conditionally apply styles or logic based on the screen size.
|
|
40094
40088
|
* ```
|
|
40095
40089
|
*/
|
|
40096
|
-
function useMediaQuery(query, { defaultValue = false, initializeWithValue =
|
|
40090
|
+
function useMediaQuery(query, { defaultValue = false, initializeWithValue = true, } = {}) {
|
|
40097
40091
|
const getMatches = (query) => {
|
|
40098
40092
|
if (IS_SERVER) {
|
|
40099
40093
|
return defaultValue;
|
|
@@ -40181,8 +40175,6 @@ function useUserTheme() {
|
|
|
40181
40175
|
const [themePreference, setThemePreference] = useState(getInitialTheme);
|
|
40182
40176
|
const [themeType, setThemeType] = useState(getEffectiveTheme(themePreference));
|
|
40183
40177
|
useEffect(() => {
|
|
40184
|
-
if (typeof window === "undefined")
|
|
40185
|
-
return;
|
|
40186
40178
|
const handleThemeChange = (e) => {
|
|
40187
40179
|
setThemePreference(e.detail);
|
|
40188
40180
|
};
|
|
@@ -40192,8 +40184,6 @@ function useUserTheme() {
|
|
|
40192
40184
|
};
|
|
40193
40185
|
}, []);
|
|
40194
40186
|
useEffect(() => {
|
|
40195
|
-
if (typeof window === "undefined")
|
|
40196
|
-
return;
|
|
40197
40187
|
const mediaQuery = window.matchMedia(THEME_MEDIA_QUERY);
|
|
40198
40188
|
const handleChange = () => {
|
|
40199
40189
|
if (themePreference === ThemePreference.SYSTEM) {
|
|
@@ -40211,8 +40201,6 @@ function useUserTheme() {
|
|
|
40211
40201
|
}, [themePreference]);
|
|
40212
40202
|
const setThemeManually = (theme) => {
|
|
40213
40203
|
setThemePreference(theme);
|
|
40214
|
-
if (typeof window === "undefined")
|
|
40215
|
-
return;
|
|
40216
40204
|
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
40217
40205
|
window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme }));
|
|
40218
40206
|
};
|
|
@@ -40234,8 +40222,6 @@ function getInitialTheme() {
|
|
|
40234
40222
|
function getEffectiveTheme(themeType) {
|
|
40235
40223
|
if (themeType !== ThemePreference.SYSTEM)
|
|
40236
40224
|
return themeType;
|
|
40237
|
-
if (typeof window === "undefined")
|
|
40238
|
-
return "dark";
|
|
40239
40225
|
return window.matchMedia(THEME_MEDIA_QUERY).matches ? "light" : "dark";
|
|
40240
40226
|
}
|
|
40241
40227
|
|
|
@@ -41455,7 +41441,7 @@ function FilterSection({ title, children, collapsed = false, handleCollapse, han
|
|
|
41455
41441
|
maxHeight: 0,
|
|
41456
41442
|
},
|
|
41457
41443
|
expanded: {
|
|
41458
|
-
maxHeight: Math.min(height,
|
|
41444
|
+
maxHeight: Math.min(height, window.innerHeight - 40) + "px",
|
|
41459
41445
|
},
|
|
41460
41446
|
}), [height]);
|
|
41461
41447
|
return (jsxs("div", { className: "tw-flex tw-min-h-10 tw-flex-col", children: [jsxs("div", { className: "tw-flex tw-min-h-squid-xl tw-shrink-0 tw-cursor-pointer tw-items-center tw-justify-between tw-px-squid-m tw-text-grey-300", onClick: () => {
|
|
@@ -83710,6 +83696,11 @@ function LinkButton({ href, label }) {
|
|
|
83710
83696
|
return (jsxs("a", { href: href, target: "_blank", className: "tw-flex tw-items-center tw-gap-0.5", rel: "noreferrer", children: [label, jsx("div", { className: "tw-ml-0.5 tw-rounded-squid-xs tw-p-0.5 tw-text-royal-500 hover:tw-bg-material-light-thin", children: jsx(SquareArrowTopRightIcon, {}) })] }));
|
|
83711
83697
|
}
|
|
83712
83698
|
|
|
83699
|
+
const RefundedProperty = ({ token, amount, link, showGradientBg, }) => {
|
|
83700
|
+
const detail = (jsx(IconLabel, { src: token.logoURI, rounded: "full", children: jsx(BodyText, { size: "small", children: amount }) }));
|
|
83701
|
+
return (jsx(PropertyListItem, { variant: "large", showGradientBg: showGradientBg, label: `Refunded ${token.symbol}`, icon: jsx(SwapIcon, {}), detail: link ? jsx(LinkButton, { href: link, label: detail }) : detail }));
|
|
83702
|
+
};
|
|
83703
|
+
|
|
83713
83704
|
const TokenLink = ({ logoURI, amount, }) => {
|
|
83714
83705
|
return (jsx(IconLabel, { src: logoURI, rounded: "full", children: amount ? (jsx(BodyText, { size: "small", children: amount })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }));
|
|
83715
83706
|
};
|
|
@@ -83717,16 +83708,16 @@ const TokenProperty = ({ icon, label, token, link, amount, showGradientBg, }) =>
|
|
|
83717
83708
|
return (jsx(PropertyListItem, { variant: "large", icon: icon, label: label, showGradientBg: showGradientBg, detail: token ? (link ? (jsx(LinkButton, { href: link, label: jsx(TokenLink, { logoURI: token.logoURI, amount: amount }) })) : (jsx(TokenLink, { logoURI: token.logoURI, amount: amount }))) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }));
|
|
83718
83709
|
};
|
|
83719
83710
|
|
|
83720
|
-
function SwapTransactionView({ title = "Swap", hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, }) {
|
|
83711
|
+
function SwapTransactionView({ title = "Swap", hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, refundHash, refundLink, }) {
|
|
83721
83712
|
if (isLoading)
|
|
83722
83713
|
return jsx(TransactionViewLayout, { isLoading: isLoading });
|
|
83723
|
-
return (jsx(TransactionViewLayout, { header: jsx(TransactionHeaderLayout, { title: title, status: status, media: jsx(Drip, { direction: "horizontal", from: fromToken, to: toToken }), children: jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsx(Chip, { label: "TX" }), jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxs(PropertiesLayout, { children: [jsx(TokenProperty, { token: fromToken, link: fromLink, amount: fromAmount, icon: jsx(ArrowRightDownCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Swap ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsx(TokenProperty, { token: toToken, link: toLink, amount: toAmount, icon: jsx(ArrowRightDownCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsx(Transfer, { from: fromChain ? (jsx(IconLabel, { src: fromChain.logoURI, children: jsx(BodyText, { size: "small", children: fromChain.name }) })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toChain ? (jsx(IconLabel, { src: toChain.logoURI, children: jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), jsx(PropertyListItem, { variant: "large", icon: jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsx(Transfer, { from: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: fromAddress, label: jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: toAddress, label: jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsx(ArrowsSwapIcon, {}), label: "Exchange rate", detail: jsx(Transfer, { from: fromToken ? (jsxs(BodyText, { size: "small", children: ["1 ", fromToken.symbol] })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toToken && exchangeRate ? (jsxs(BodyText, { size: "small", children: [exchangeRate, " ", toToken.symbol] })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete })] }), actions: actions, fees: fees }));
|
|
83714
|
+
return (jsx(TransactionViewLayout, { header: jsx(TransactionHeaderLayout, { title: title, status: status, media: jsx(Drip, { direction: "horizontal", from: fromToken, to: toToken }), children: jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsx(Chip, { label: "TX" }), jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxs(PropertiesLayout, { children: [jsx(TokenProperty, { token: fromToken, link: fromLink, amount: fromAmount, icon: jsx(ArrowRightDownCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Swap ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsx(TokenProperty, { token: toToken, link: toLink, amount: toAmount, icon: jsx(ArrowRightDownCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsx(Transfer, { from: fromChain ? (jsx(IconLabel, { src: fromChain.logoURI, children: jsx(BodyText, { size: "small", children: fromChain.name }) })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toChain ? (jsx(IconLabel, { src: toChain.logoURI, children: jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), jsx(PropertyListItem, { variant: "large", icon: jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsx(Transfer, { from: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: fromAddress, label: jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: toAddress, label: jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsx(ArrowsSwapIcon, {}), label: "Exchange rate", detail: jsx(Transfer, { from: fromToken ? (jsxs(BodyText, { size: "small", children: ["1 ", fromToken.symbol] })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })), to: toToken && exchangeRate ? (jsxs(BodyText, { size: "small", children: [exchangeRate, " ", toToken.symbol] })) : (jsx(LoadingSkeleton, { className: "tw-bg-grey-700 tw-text-transparent" })) }) }), refundHash && status === "refunded" ? (jsx(RefundedProperty, { token: fromToken, amount: fromAmount, link: refundLink })) : (jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete }))] }), actions: actions, fees: fees }));
|
|
83724
83715
|
}
|
|
83725
83716
|
|
|
83726
|
-
function BridgeTransactionView({ title = "Bridge", hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, }) {
|
|
83717
|
+
function BridgeTransactionView({ title = "Bridge", hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, refundHash, refundLink, }) {
|
|
83727
83718
|
if (isLoading)
|
|
83728
83719
|
return jsx(TransactionViewLayout, { isLoading: isLoading });
|
|
83729
|
-
return (jsx(TransactionViewLayout, { isLoading: isLoading, header: jsx(TransactionHeaderLayout, { title: title, status: status, media: jsxs("div", { className: "tw-relative", children: [jsx(Image$2, { src: fromChain.logoURI, size: "xlarge", rounded: "full" }), toChain ? (jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-rounded-md tw-border tw-border-white", children: jsx(Image$2, { src: toChain.logoURI, size: "medium" }) })) : (jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-w-squid-m tw-overflow-hidden tw-rounded-md", children: jsx(LoadingSkeleton, { className: "tw-bg-grey-600 tw-text-transparent" }) }))] }), children: jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsx(Chip, { label: "TX" }), jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxs(PropertiesLayout, { children: [jsx(TokenProperty, { token: fromToken, amount: fromAmount, link: fromLink, icon: jsx(ArrowRightUpCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Bridge ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsx(TokenProperty, { token: toToken, amount: toAmount, link: toLink, icon: jsx(ArrowRightDownCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsx(Transfer, { from: jsx(IconLabel, { src: fromChain.logoURI, children: jsx(BodyText, { size: "small", children: fromChain.name }) }), to: toChain ? (jsx(IconLabel, { src: toChain.logoURI, children: jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsx(LoadingSkeleton, {})) }) }), jsx(PropertyListItem, { variant: "large", icon: jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsx(Transfer, { from: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: fromAddress, label: jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: toAddress, label: jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete })] }), actions: actions, fees: fees }));
|
|
83720
|
+
return (jsx(TransactionViewLayout, { isLoading: isLoading, header: jsx(TransactionHeaderLayout, { title: title, status: status, media: jsxs("div", { className: "tw-relative", children: [jsx(Image$2, { src: fromChain.logoURI, size: "xlarge", rounded: "full" }), toChain ? (jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-rounded-md tw-border tw-border-white", children: jsx(Image$2, { src: toChain.logoURI, size: "medium" }) })) : (jsx("div", { className: "tw-absolute -tw-bottom-[1px] -tw-right-[1px] tw-w-squid-m tw-overflow-hidden tw-rounded-md", children: jsx(LoadingSkeleton, { className: "tw-bg-grey-600 tw-text-transparent" }) }))] }), children: jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-text-grey-500", children: [jsx(Chip, { label: "TX" }), jsx(HashLink, { hash: hash, url: url, showCopyButton: true, formattedHash: formatHash(hash) })] }) }), properties: jsxs(PropertiesLayout, { children: [jsx(TokenProperty, { token: fromToken, amount: fromAmount, link: fromLink, icon: jsx(ArrowRightUpCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Bridge ", fromToken === null || fromToken === void 0 ? void 0 : fromToken.symbol] }), showGradientBg: false }), jsx(TokenProperty, { token: toToken, amount: toAmount, link: toLink, icon: jsx(ArrowRightDownCircleIcon, {}), label: jsxs(BodyText, { size: "small", children: ["Receive ", toToken === null || toToken === void 0 ? void 0 : toToken.symbol] }) }), jsx(PropertyListItem, { variant: "large", showGradientBg: false, icon: jsx(ChainLink, { size: "24" }), label: "Chain", detail: jsx(Transfer, { from: jsx(IconLabel, { src: fromChain.logoURI, children: jsx(BodyText, { size: "small", children: fromChain.name }) }), to: toChain ? (jsx(IconLabel, { src: toChain.logoURI, children: jsx(BodyText, { size: "small", children: toChain.name }) })) : (jsx(LoadingSkeleton, {})) }) }), jsx(PropertyListItem, { variant: "large", icon: jsx(WalletFilledIcon, {}), label: "Wallet", detail: jsx(Transfer, { from: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: fromAddress, label: jsx(HashLink, { hash: fromAddress, formattedHash: formatHash(fromAddress) }) }) }), to: jsx(BodyText, { size: "small", children: jsx(CopyButton, { copyText: toAddress, label: jsx(HashLink, { hash: toAddress, formattedHash: formatHash(toAddress) }) }) }) }) }), refundHash && status === "refunded" ? (jsx(RefundedProperty, { token: fromToken, amount: fromAmount, link: refundLink })) : (jsx(TimeToCompleteProperty, { timeToComplete: timeToComplete }))] }), actions: actions, fees: fees }));
|
|
83730
83721
|
}
|
|
83731
83722
|
|
|
83732
83723
|
function TransactionView({ type, isLoading, data, }) {
|
|
@@ -34,5 +34,5 @@ type BridgeTransactionViewProps = (BaseBridgeTransactionViewProps & {
|
|
|
34
34
|
}) | (Partial<Omit<BaseBridgeTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
|
|
35
35
|
isLoading: true;
|
|
36
36
|
});
|
|
37
|
-
export declare function BridgeTransactionView({ title, hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, }: BridgeTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function BridgeTransactionView({ title, hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, refundHash, refundLink, }: BridgeTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
token: {
|
|
3
|
+
logoURI: string;
|
|
4
|
+
symbol: string;
|
|
5
|
+
};
|
|
6
|
+
amount: string;
|
|
7
|
+
link?: string;
|
|
8
|
+
showGradientBg?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const RefundedProperty: ({ token, amount, link, showGradientBg, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -32,5 +32,5 @@ type SwapTransactionViewProps = (BaseSwapTransactionViewProps & {
|
|
|
32
32
|
}) | (Partial<Omit<BaseSwapTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
|
|
33
33
|
isLoading: true;
|
|
34
34
|
});
|
|
35
|
-
export declare function SwapTransactionView({ title, hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, }: SwapTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function SwapTransactionView({ title, hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, refundHash, refundLink, }: SwapTransactionViewProps): import("react/jsx-runtime").JSX.Element;
|
|
36
36
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type UseMediaQueryOptions = {
|
|
2
2
|
/**
|
|
3
3
|
* The default value to return if the hook is being run on the server.
|
|
4
4
|
* @default false
|
|
@@ -9,7 +9,7 @@ interface UseMediaQueryOptions {
|
|
|
9
9
|
* @default true
|
|
10
10
|
*/
|
|
11
11
|
initializeWithValue?: boolean;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
/**
|
|
14
14
|
* Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
|
|
15
15
|
* @param {string} query - The media query to track.
|
|
@@ -956,3 +956,55 @@ export declare const BridgeMissingToToken: {
|
|
|
956
956
|
};
|
|
957
957
|
};
|
|
958
958
|
};
|
|
959
|
+
export declare const BridgeRefunded: {
|
|
960
|
+
args: {
|
|
961
|
+
type: string;
|
|
962
|
+
data: {
|
|
963
|
+
title: string;
|
|
964
|
+
hash: string;
|
|
965
|
+
url: string;
|
|
966
|
+
status: string;
|
|
967
|
+
fromAmount: string;
|
|
968
|
+
toAmount: string;
|
|
969
|
+
fromToken: {
|
|
970
|
+
logoURI: string;
|
|
971
|
+
bgColor: string;
|
|
972
|
+
symbol: string;
|
|
973
|
+
};
|
|
974
|
+
toToken: {
|
|
975
|
+
logoURI: string;
|
|
976
|
+
bgColor: string;
|
|
977
|
+
symbol: string;
|
|
978
|
+
};
|
|
979
|
+
fromChain: {
|
|
980
|
+
logoURI: string;
|
|
981
|
+
name: string;
|
|
982
|
+
bgColor: string;
|
|
983
|
+
};
|
|
984
|
+
toChain: {
|
|
985
|
+
logoURI: string;
|
|
986
|
+
name: string;
|
|
987
|
+
bgColor: string;
|
|
988
|
+
};
|
|
989
|
+
fromAddress: string;
|
|
990
|
+
toAddress: string;
|
|
991
|
+
fromLink: string;
|
|
992
|
+
timeToComplete: string;
|
|
993
|
+
refundHash: string;
|
|
994
|
+
refundLink: string;
|
|
995
|
+
fees: {
|
|
996
|
+
status: string;
|
|
997
|
+
total: {
|
|
998
|
+
label: string;
|
|
999
|
+
usd: number;
|
|
1000
|
+
};
|
|
1001
|
+
lines: {
|
|
1002
|
+
label: string;
|
|
1003
|
+
usd: number;
|
|
1004
|
+
amount: string;
|
|
1005
|
+
symbol: string;
|
|
1006
|
+
}[];
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -2296,6 +2296,8 @@ interface BaseTransactionViewProps {
|
|
|
2296
2296
|
fees: FeesActionProps;
|
|
2297
2297
|
timeToComplete: string;
|
|
2298
2298
|
timestamp: number;
|
|
2299
|
+
refundHash?: string;
|
|
2300
|
+
refundLink?: string;
|
|
2299
2301
|
}
|
|
2300
2302
|
|
|
2301
2303
|
interface BaseBuyNFTTransactionViewProps extends BaseTransactionViewProps {
|
|
@@ -2379,7 +2381,7 @@ type SwapTransactionViewProps = (BaseSwapTransactionViewProps & {
|
|
|
2379
2381
|
}) | (Partial<Omit<BaseSwapTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
|
|
2380
2382
|
isLoading: true;
|
|
2381
2383
|
});
|
|
2382
|
-
declare function SwapTransactionView({ title, hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, }: SwapTransactionViewProps): react_jsx_runtime.JSX.Element;
|
|
2384
|
+
declare function SwapTransactionView({ title, hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, timeToComplete, timestamp, actions, fees, isLoading, refundHash, refundLink, }: SwapTransactionViewProps): react_jsx_runtime.JSX.Element;
|
|
2383
2385
|
|
|
2384
2386
|
interface BaseBridgeTransactionViewProps extends BaseTransactionViewProps {
|
|
2385
2387
|
fromToken: {
|
|
@@ -2416,7 +2418,7 @@ type BridgeTransactionViewProps = (BaseBridgeTransactionViewProps & {
|
|
|
2416
2418
|
}) | (Partial<Omit<BaseBridgeTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
|
|
2417
2419
|
isLoading: true;
|
|
2418
2420
|
});
|
|
2419
|
-
declare function BridgeTransactionView({ title, hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, }: BridgeTransactionViewProps): react_jsx_runtime.JSX.Element;
|
|
2421
|
+
declare function BridgeTransactionView({ title, hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, fromAddress, toAddress, actions, fees, timeToComplete, timestamp, isLoading, refundHash, refundLink, }: BridgeTransactionViewProps): react_jsx_runtime.JSX.Element;
|
|
2420
2422
|
|
|
2421
2423
|
declare const componentMap: {
|
|
2422
2424
|
readonly swap: typeof SwapTransactionView;
|
|
@@ -2482,7 +2484,7 @@ declare function useDropdownMenu(props?: UseDropdownMenuParams): {
|
|
|
2482
2484
|
menuRef: react__default.RefObject<HTMLDivElement>;
|
|
2483
2485
|
};
|
|
2484
2486
|
|
|
2485
|
-
|
|
2487
|
+
type UseMediaQueryOptions = {
|
|
2486
2488
|
/**
|
|
2487
2489
|
* The default value to return if the hook is being run on the server.
|
|
2488
2490
|
* @default false
|
|
@@ -2493,7 +2495,7 @@ interface UseMediaQueryOptions {
|
|
|
2493
2495
|
* @default true
|
|
2494
2496
|
*/
|
|
2495
2497
|
initializeWithValue?: boolean;
|
|
2496
|
-
}
|
|
2498
|
+
};
|
|
2497
2499
|
/**
|
|
2498
2500
|
* Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
|
|
2499
2501
|
* @param {string} query - The media query to track.
|