@0xsquid/ui 0.13.3 → 0.13.4
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 +18 -10
- package/dist/cjs/types/components/views/SwapProgressView.d.ts +1 -2
- package/dist/cjs/types/core/constants.d.ts +2 -2
- package/dist/esm/index.js +18 -10
- package/dist/esm/types/components/views/SwapProgressView.d.ts +1 -2
- package/dist/esm/types/core/constants.d.ts +2 -2
- package/dist/index.css +38 -6
- package/dist/index.d.ts +1 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2852,8 +2852,8 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
|
|
|
2852
2852
|
const CSS_VARS = {
|
|
2853
2853
|
MOVE_WITH_SPRING_BOUNCE_DURATION: '--squid-animation-move-with-spring-bounce-duration',
|
|
2854
2854
|
DISPLAY_DELAYED_DURATION: '--squid-animation-display-delayed-duration',
|
|
2855
|
-
|
|
2856
|
-
|
|
2855
|
+
COLLAPSE_TO_BOTTOM_DURATION: '--squid-animation-collapse-to-bottom-duration',
|
|
2856
|
+
EXPAND_TO_TOP_DURATION: '--squid-animation-expand-to-top-duration',
|
|
2857
2857
|
FADE_IN_DURATION: '--squid-animation-fade-in-duration',
|
|
2858
2858
|
FADE_OUT_DURATION: '--squid-animation-fade-out-duration',
|
|
2859
2859
|
SCALE_AND_FADE_UP_DURATION: '--squid-animation-scale-and-fade-up-duration',
|
|
@@ -3591,11 +3591,11 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, onOpen, on
|
|
|
3591
3591
|
}, className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
|
|
3592
3592
|
? 'tw-animate-fade-in'
|
|
3593
3593
|
: 'tw-animate-fade-out'), onClick: handleCloseRouteSteps }), jsxRuntime.jsxs("div", { style: {
|
|
3594
|
-
[CSS_VARS.
|
|
3595
|
-
[CSS_VARS.
|
|
3594
|
+
[CSS_VARS.COLLAPSE_TO_BOTTOM_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE_STEPS}ms`,
|
|
3595
|
+
[CSS_VARS.EXPAND_TO_TOP_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE_STEPS}ms`,
|
|
3596
3596
|
}, className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
|
|
3597
|
-
? 'tw-animate-
|
|
3598
|
-
: 'tw-animate-
|
|
3597
|
+
? 'tw-animate-expand-to-top'
|
|
3598
|
+
: 'tw-animate-collapse-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: handleCloseRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsxRuntime.jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsxRuntime.jsx("ul", { className: "tw-flex tw-max-h-fit tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", style: {
|
|
3599
3599
|
scrollbarGutter: 'stable',
|
|
3600
3600
|
}, children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1), link: step.link, status: currentStepIndex < index
|
|
3601
3601
|
? 'pending'
|
|
@@ -38652,8 +38652,14 @@ const swapProgressButtonTexts = {
|
|
|
38652
38652
|
partialSuccess: 'Ok, done',
|
|
38653
38653
|
needsGas: 'Go to Axelarscan',
|
|
38654
38654
|
};
|
|
38655
|
-
function SwapProgressView({ steps,
|
|
38655
|
+
function SwapProgressView({ steps, isOpen = true, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }) {
|
|
38656
38656
|
const [showSwapInfoSection, setShowSwapInfoSection] = React.useState(true);
|
|
38657
|
+
const isFirstRenderRef = React.useRef(true);
|
|
38658
|
+
React.useEffect(() => {
|
|
38659
|
+
if (isFirstRenderRef.current) {
|
|
38660
|
+
isFirstRenderRef.current = false;
|
|
38661
|
+
}
|
|
38662
|
+
}, []);
|
|
38657
38663
|
const handleRouteStepsOpen = React.useCallback(() => {
|
|
38658
38664
|
setShowSwapInfoSection(false);
|
|
38659
38665
|
}, []);
|
|
@@ -38681,11 +38687,13 @@ function SwapProgressView({ steps, currentStepIndex, isOpen = true, handleClose,
|
|
|
38681
38687
|
default:
|
|
38682
38688
|
return 'confirm';
|
|
38683
38689
|
}
|
|
38684
|
-
}, [
|
|
38685
|
-
return (jsxRuntime.jsxs(Modal, {
|
|
38690
|
+
}, [txStatus]);
|
|
38691
|
+
return (jsxRuntime.jsxs(Modal, { isOpen: isOpen, onBackdropClick: handleClose, children: [jsxRuntime.jsxs(ModalContent, { style: {
|
|
38686
38692
|
[CSS_VARS.SCALE_AND_FADE_DOWN_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE_STEPS}ms`,
|
|
38687
38693
|
[CSS_VARS.SCALE_AND_FADE_UP_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE_STEPS}ms`,
|
|
38688
|
-
}, borderType: "outline", className: cn('!tw-max-h-[470px]',
|
|
38694
|
+
}, borderType: "outline", className: cn('!tw-max-h-[470px]',
|
|
38695
|
+
// do not show animation on first render
|
|
38696
|
+
isFirstRenderRef.current ? "" : showSwapInfoSection
|
|
38689
38697
|
? 'tw-animate-scale-and-fade-up'
|
|
38690
38698
|
: 'tw-animate-scale-and-fade-down'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[160px] tw-w-full tw-items-center tw-justify-center tw-rounded-tl-squid-l tw-rounded-tr-squid-l tw-bg-royal-500 tw-text-material-light-thin", style: {
|
|
38691
38699
|
// box shadow simulating bottom outline (we do not use css outline because cannot apply it to only one side)
|
|
@@ -9,9 +9,8 @@ type Token = {
|
|
|
9
9
|
logoUrl: string;
|
|
10
10
|
bgColor: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function SwapProgressView({ steps,
|
|
12
|
+
export declare function SwapProgressView({ steps, isOpen, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }: {
|
|
13
13
|
steps: SwapStep[];
|
|
14
|
-
currentStepIndex: number;
|
|
15
14
|
handleClose?: () => void;
|
|
16
15
|
isOpen?: boolean;
|
|
17
16
|
socialLink?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const CSS_VARS: {
|
|
2
2
|
MOVE_WITH_SPRING_BOUNCE_DURATION: string;
|
|
3
3
|
DISPLAY_DELAYED_DURATION: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
COLLAPSE_TO_BOTTOM_DURATION: string;
|
|
5
|
+
EXPAND_TO_TOP_DURATION: string;
|
|
6
6
|
FADE_IN_DURATION: string;
|
|
7
7
|
FADE_OUT_DURATION: string;
|
|
8
8
|
SCALE_AND_FADE_UP_DURATION: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -2832,8 +2832,8 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
|
|
|
2832
2832
|
const CSS_VARS = {
|
|
2833
2833
|
MOVE_WITH_SPRING_BOUNCE_DURATION: '--squid-animation-move-with-spring-bounce-duration',
|
|
2834
2834
|
DISPLAY_DELAYED_DURATION: '--squid-animation-display-delayed-duration',
|
|
2835
|
-
|
|
2836
|
-
|
|
2835
|
+
COLLAPSE_TO_BOTTOM_DURATION: '--squid-animation-collapse-to-bottom-duration',
|
|
2836
|
+
EXPAND_TO_TOP_DURATION: '--squid-animation-expand-to-top-duration',
|
|
2837
2837
|
FADE_IN_DURATION: '--squid-animation-fade-in-duration',
|
|
2838
2838
|
FADE_OUT_DURATION: '--squid-animation-fade-out-duration',
|
|
2839
2839
|
SCALE_AND_FADE_UP_DURATION: '--squid-animation-scale-and-fade-up-duration',
|
|
@@ -3571,11 +3571,11 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, onOpen, on
|
|
|
3571
3571
|
}, className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
|
|
3572
3572
|
? 'tw-animate-fade-in'
|
|
3573
3573
|
: 'tw-animate-fade-out'), onClick: handleCloseRouteSteps }), jsxs("div", { style: {
|
|
3574
|
-
[CSS_VARS.
|
|
3575
|
-
[CSS_VARS.
|
|
3574
|
+
[CSS_VARS.COLLAPSE_TO_BOTTOM_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE_STEPS}ms`,
|
|
3575
|
+
[CSS_VARS.EXPAND_TO_TOP_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE_STEPS}ms`,
|
|
3576
3576
|
}, className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
|
|
3577
|
-
? 'tw-animate-
|
|
3578
|
-
: 'tw-animate-
|
|
3577
|
+
? 'tw-animate-expand-to-top'
|
|
3578
|
+
: 'tw-animate-collapse-to-bottom'), children: [jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsx("button", { onClick: handleCloseRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsx("ul", { className: "tw-flex tw-max-h-fit tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", style: {
|
|
3579
3579
|
scrollbarGutter: 'stable',
|
|
3580
3580
|
}, children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1), link: step.link, status: currentStepIndex < index
|
|
3581
3581
|
? 'pending'
|
|
@@ -38632,8 +38632,14 @@ const swapProgressButtonTexts = {
|
|
|
38632
38632
|
partialSuccess: 'Ok, done',
|
|
38633
38633
|
needsGas: 'Go to Axelarscan',
|
|
38634
38634
|
};
|
|
38635
|
-
function SwapProgressView({ steps,
|
|
38635
|
+
function SwapProgressView({ steps, isOpen = true, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }) {
|
|
38636
38636
|
const [showSwapInfoSection, setShowSwapInfoSection] = useState(true);
|
|
38637
|
+
const isFirstRenderRef = useRef(true);
|
|
38638
|
+
useEffect(() => {
|
|
38639
|
+
if (isFirstRenderRef.current) {
|
|
38640
|
+
isFirstRenderRef.current = false;
|
|
38641
|
+
}
|
|
38642
|
+
}, []);
|
|
38637
38643
|
const handleRouteStepsOpen = useCallback(() => {
|
|
38638
38644
|
setShowSwapInfoSection(false);
|
|
38639
38645
|
}, []);
|
|
@@ -38661,11 +38667,13 @@ function SwapProgressView({ steps, currentStepIndex, isOpen = true, handleClose,
|
|
|
38661
38667
|
default:
|
|
38662
38668
|
return 'confirm';
|
|
38663
38669
|
}
|
|
38664
|
-
}, [
|
|
38665
|
-
return (jsxs(Modal, {
|
|
38670
|
+
}, [txStatus]);
|
|
38671
|
+
return (jsxs(Modal, { isOpen: isOpen, onBackdropClick: handleClose, children: [jsxs(ModalContent, { style: {
|
|
38666
38672
|
[CSS_VARS.SCALE_AND_FADE_DOWN_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE_STEPS}ms`,
|
|
38667
38673
|
[CSS_VARS.SCALE_AND_FADE_UP_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE_STEPS}ms`,
|
|
38668
|
-
}, borderType: "outline", className: cn('!tw-max-h-[470px]',
|
|
38674
|
+
}, borderType: "outline", className: cn('!tw-max-h-[470px]',
|
|
38675
|
+
// do not show animation on first render
|
|
38676
|
+
isFirstRenderRef.current ? "" : showSwapInfoSection
|
|
38669
38677
|
? 'tw-animate-scale-and-fade-up'
|
|
38670
38678
|
: 'tw-animate-scale-and-fade-down'), children: [jsx("div", { className: "tw-flex tw-h-[160px] tw-w-full tw-items-center tw-justify-center tw-rounded-tl-squid-l tw-rounded-tr-squid-l tw-bg-royal-500 tw-text-material-light-thin", style: {
|
|
38671
38679
|
// box shadow simulating bottom outline (we do not use css outline because cannot apply it to only one side)
|
|
@@ -9,9 +9,8 @@ type Token = {
|
|
|
9
9
|
logoUrl: string;
|
|
10
10
|
bgColor: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function SwapProgressView({ steps,
|
|
12
|
+
export declare function SwapProgressView({ steps, isOpen, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }: {
|
|
13
13
|
steps: SwapStep[];
|
|
14
|
-
currentStepIndex: number;
|
|
15
14
|
handleClose?: () => void;
|
|
16
15
|
isOpen?: boolean;
|
|
17
16
|
socialLink?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const CSS_VARS: {
|
|
2
2
|
MOVE_WITH_SPRING_BOUNCE_DURATION: string;
|
|
3
3
|
DISPLAY_DELAYED_DURATION: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
COLLAPSE_TO_BOTTOM_DURATION: string;
|
|
5
|
+
EXPAND_TO_TOP_DURATION: string;
|
|
6
6
|
FADE_IN_DURATION: string;
|
|
7
7
|
FADE_OUT_DURATION: string;
|
|
8
8
|
SCALE_AND_FADE_UP_DURATION: string;
|
package/dist/index.css
CHANGED
|
@@ -1432,6 +1432,38 @@ video {
|
|
|
1432
1432
|
animation: tw-blur-out 0.2s ease-out both;
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
|
+
@keyframes tw-collapse-to-bottom {
|
|
1436
|
+
0% {
|
|
1437
|
+
height: 100%;
|
|
1438
|
+
opacity: 1;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
100% {
|
|
1442
|
+
height: 60px;
|
|
1443
|
+
opacity: 0;
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
.tw-animate-collapse-to-bottom {
|
|
1448
|
+
animation: tw-collapse-to-bottom var(--squid-animation-collapse-to-bottom-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
@keyframes tw-expand-to-top {
|
|
1452
|
+
0% {
|
|
1453
|
+
height: 60px;
|
|
1454
|
+
opacity: 0;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
100% {
|
|
1458
|
+
height: 100%;
|
|
1459
|
+
opacity: 1;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
.tw-animate-expand-to-top {
|
|
1464
|
+
animation: tw-expand-to-top var(--squid-animation-expand-to-top-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1435
1467
|
@keyframes tw-fade-in {
|
|
1436
1468
|
0% {
|
|
1437
1469
|
opacity: 0;
|
|
@@ -1542,34 +1574,34 @@ video {
|
|
|
1542
1574
|
|
|
1543
1575
|
@keyframes tw-slide-to-bottom {
|
|
1544
1576
|
0% {
|
|
1545
|
-
|
|
1577
|
+
transform: translateY(0);
|
|
1546
1578
|
opacity: 1;
|
|
1547
1579
|
}
|
|
1548
1580
|
|
|
1549
1581
|
100% {
|
|
1550
|
-
|
|
1582
|
+
transform: translateY(120px);
|
|
1551
1583
|
opacity: 0;
|
|
1552
1584
|
}
|
|
1553
1585
|
}
|
|
1554
1586
|
|
|
1555
1587
|
.tw-animate-slide-to-bottom {
|
|
1556
|
-
animation: tw-slide-to-bottom
|
|
1588
|
+
animation: tw-slide-to-bottom 0.2s ease-out both;
|
|
1557
1589
|
}
|
|
1558
1590
|
|
|
1559
1591
|
@keyframes tw-slide-to-top {
|
|
1560
1592
|
0% {
|
|
1561
|
-
|
|
1593
|
+
transform: translateY(120px);
|
|
1562
1594
|
opacity: 0;
|
|
1563
1595
|
}
|
|
1564
1596
|
|
|
1565
1597
|
100% {
|
|
1566
|
-
|
|
1598
|
+
transform: translateY(0);
|
|
1567
1599
|
opacity: 1;
|
|
1568
1600
|
}
|
|
1569
1601
|
}
|
|
1570
1602
|
|
|
1571
1603
|
.tw-animate-slide-to-top {
|
|
1572
|
-
animation: tw-slide-to-top
|
|
1604
|
+
animation: tw-slide-to-top 0.35s ease-out both;
|
|
1573
1605
|
}
|
|
1574
1606
|
|
|
1575
1607
|
@keyframes tw-translate-to-bottom {
|
package/dist/index.d.ts
CHANGED
|
@@ -493,9 +493,8 @@ type Token = {
|
|
|
493
493
|
logoUrl: string;
|
|
494
494
|
bgColor: string;
|
|
495
495
|
};
|
|
496
|
-
declare function SwapProgressView({ steps,
|
|
496
|
+
declare function SwapProgressView({ steps, isOpen, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }: {
|
|
497
497
|
steps: SwapStep[];
|
|
498
|
-
currentStepIndex: number;
|
|
499
498
|
handleClose?: () => void;
|
|
500
499
|
isOpen?: boolean;
|
|
501
500
|
socialLink?: string;
|