@0xsquid/ui 0.13.2 → 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 +35253 -45
- package/dist/cjs/types/assets/animations/index.d.ts +11 -0
- package/dist/cjs/types/components/controls/Input.d.ts +2 -1
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/cjs/types/components/layout/AnimationWrapper.d.ts +8 -0
- package/dist/cjs/types/components/layout/ModalContent.d.ts +4 -2
- package/dist/cjs/types/components/layout/SwapStepsCollapsed.d.ts +6 -2
- package/dist/cjs/types/components/storybook/SwapStepsControls.d.ts +4 -0
- package/dist/cjs/types/components/views/SwapProgressView.d.ts +33 -3
- package/dist/cjs/types/components/views/index.d.ts +1 -0
- package/dist/cjs/types/core/constants.d.ts +12 -0
- package/dist/cjs/types/hooks/useTimer.d.ts +7 -0
- package/dist/cjs/types/stories/views/SwapProgressView.stories.d.ts +1 -7
- package/dist/cjs/types/types/components.d.ts +14 -0
- package/dist/esm/index.js +35209 -20
- package/dist/esm/types/assets/animations/index.d.ts +11 -0
- package/dist/esm/types/components/controls/Input.d.ts +2 -1
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/esm/types/components/layout/AnimationWrapper.d.ts +8 -0
- package/dist/esm/types/components/layout/ModalContent.d.ts +4 -2
- package/dist/esm/types/components/layout/SwapStepsCollapsed.d.ts +6 -2
- package/dist/esm/types/components/storybook/SwapStepsControls.d.ts +4 -0
- package/dist/esm/types/components/views/SwapProgressView.d.ts +33 -3
- package/dist/esm/types/components/views/index.d.ts +1 -0
- package/dist/esm/types/core/constants.d.ts +12 -0
- package/dist/esm/types/hooks/useTimer.d.ts +7 -0
- package/dist/esm/types/stories/views/SwapProgressView.stories.d.ts +1 -7
- package/dist/esm/types/types/components.d.ts +14 -0
- package/dist/index.css +108 -17
- package/dist/index.d.ts +52 -6
- package/package.json +6 -1
- package/dist/cjs/types/components/icons/Animations.d.ts +0 -2
- package/dist/esm/types/components/icons/Animations.d.ts +0 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const checkMarkInfo: any;
|
|
2
|
+
export declare const checkMarkSuccess: any;
|
|
3
|
+
export declare const checkMarkError: any;
|
|
4
|
+
export declare const loadingDots: any;
|
|
5
|
+
export declare const transactionPendingAnimation: any;
|
|
6
|
+
export declare const transactionProcessinganimation: any;
|
|
7
|
+
export declare const transactionFailureAnimation: any;
|
|
8
|
+
export declare const transactionSuccessAnimation: any;
|
|
9
|
+
export declare const transactionHalfSuccessAnimation: any;
|
|
10
|
+
export declare const transactionErrorPauseAnimation: any;
|
|
11
|
+
export declare const transactionRejectedAnimation: any;
|
|
@@ -6,6 +6,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
isError?: boolean;
|
|
8
8
|
onPasteButtonClick?: () => void;
|
|
9
|
+
containerClassName?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare function Input({ placeholder, showIcon, showPasteButton, className, icon, isError, onPasteButtonClick, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function Input({ placeholder, showIcon, showPasteButton, className, icon, isError, onPasteButtonClick, containerClassName, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
lottieJsonFile: object;
|
|
4
|
+
animReplacement?: JSX.Element;
|
|
5
|
+
hideAnimations?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const AnimationWrapper: ({ lottieJsonFile, animReplacement, hideAnimations, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type ModalContentBorderType = 'border' | 'outline';
|
|
3
|
-
|
|
3
|
+
interface ModalContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
addGap?: boolean;
|
|
6
6
|
paddingY?: boolean;
|
|
7
7
|
borderType?: ModalContentBorderType;
|
|
8
|
-
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ModalContent({ children, addGap, paddingY, borderType, className, ...props }: ModalContentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export declare function ModalContentDivider(): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { SwapStep } from '../../types/components';
|
|
2
|
-
|
|
2
|
+
interface SwapStepsCollapsedProps {
|
|
3
3
|
steps: SwapStep[];
|
|
4
4
|
currentStepIndex: number;
|
|
5
|
-
|
|
5
|
+
onOpen?: () => void;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, onOpen, onClose, }: SwapStepsCollapsedProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { SwapStep, TransactionStatus } from '../../types/components';
|
|
2
|
+
type ChainData = {
|
|
3
|
+
networkName: string;
|
|
4
|
+
logoUrl: string;
|
|
5
|
+
bgColor: string;
|
|
6
|
+
};
|
|
7
|
+
type Token = {
|
|
8
|
+
symbol: string;
|
|
9
|
+
logoUrl: string;
|
|
10
|
+
bgColor: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function SwapProgressView({ steps, isOpen, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }: {
|
|
13
|
+
steps: SwapStep[];
|
|
14
|
+
handleClose?: () => void;
|
|
15
|
+
isOpen?: boolean;
|
|
16
|
+
socialLink?: string;
|
|
17
|
+
supportLink?: string;
|
|
18
|
+
fromToken: Token;
|
|
19
|
+
toToken: Token;
|
|
20
|
+
fromAmount: string;
|
|
21
|
+
toAmount: string;
|
|
22
|
+
fromChain: ChainData;
|
|
23
|
+
toChain: ChainData;
|
|
24
|
+
fromAddressFormatted: string;
|
|
25
|
+
toAddressFormatted: string;
|
|
26
|
+
txStatus: TransactionStatus;
|
|
4
27
|
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
interface Props {
|
|
29
|
+
rawSteps: SwapStep[];
|
|
30
|
+
txStatus?: TransactionStatus;
|
|
31
|
+
onOpen?: () => void;
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const TrackTransactionView: ({ txStatus, rawSteps, onOpen, onClose, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
35
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SwapProgressView } from './SwapProgressView';
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export declare const CSS_VARS: {
|
|
2
2
|
MOVE_WITH_SPRING_BOUNCE_DURATION: string;
|
|
3
3
|
DISPLAY_DELAYED_DURATION: string;
|
|
4
|
+
COLLAPSE_TO_BOTTOM_DURATION: string;
|
|
5
|
+
EXPAND_TO_TOP_DURATION: string;
|
|
6
|
+
FADE_IN_DURATION: string;
|
|
7
|
+
FADE_OUT_DURATION: string;
|
|
8
|
+
SCALE_AND_FADE_UP_DURATION: string;
|
|
9
|
+
SCALE_AND_FADE_DOWN_DURATION: string;
|
|
10
|
+
TRANSLATE_TOP_OR_BOTTOM: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const ANIMATION_DURATIONS: {
|
|
13
|
+
SHOW_ROUTE_STEPS: number;
|
|
14
|
+
HIDE_ROUTE_STEPS: number;
|
|
15
|
+
CHANGE_SWAP_STEP: number;
|
|
4
16
|
};
|
|
@@ -3,10 +3,4 @@ import { SwapProgressView } from '../../components/views/SwapProgressView';
|
|
|
3
3
|
declare const meta: Meta<typeof SwapProgressView>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const Progress: Story;
|
|
8
|
-
export declare const Completed: Story;
|
|
9
|
-
export declare const Failed: Story;
|
|
10
|
-
export declare const ConfirmationTooLong: Story;
|
|
11
|
-
export declare const ConfirmationRejected: Story;
|
|
12
|
-
export declare const PartialSuccess: Story;
|
|
6
|
+
export declare const Default: Story;
|
|
@@ -13,7 +13,21 @@ export type SwapStep = {
|
|
|
13
13
|
descriptionBlocks: SwapStepDescriptionBlock[];
|
|
14
14
|
chipContent: React.ReactNode;
|
|
15
15
|
link?: string;
|
|
16
|
+
status: TransactionStatus;
|
|
16
17
|
};
|
|
18
|
+
export type SwapProgressState = 'confirm' | 'progress' | 'completed' | 'error' | 'partialSuccess' | 'confirmationTooLong' | 'confirmationRejected' | 'needsGas';
|
|
17
19
|
export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
|
|
18
20
|
export type ThemeType = 'light' | 'dark';
|
|
19
21
|
export type SwapStepItemStatus = 'executed' | 'progress' | 'pending';
|
|
22
|
+
export declare enum TransactionStatus {
|
|
23
|
+
SUCCESS = "success",
|
|
24
|
+
NEEDS_GAS = "needs_gas",
|
|
25
|
+
ONGOING = "ongoing",
|
|
26
|
+
PARTIAL_SUCCESS = "partial_success",
|
|
27
|
+
NOT_FOUND = "not_found",
|
|
28
|
+
INITIAL_LOADING = "initialLoading",
|
|
29
|
+
ERROR = "error",
|
|
30
|
+
WARNING = "warning",
|
|
31
|
+
PENDING = "pending",
|
|
32
|
+
REJECTED = "rejected"
|
|
33
|
+
}
|
package/dist/index.css
CHANGED
|
@@ -984,6 +984,11 @@ video {
|
|
|
984
984
|
height: 680px;
|
|
985
985
|
}
|
|
986
986
|
|
|
987
|
+
.tw-h-fit {
|
|
988
|
+
height: -moz-fit-content;
|
|
989
|
+
height: fit-content;
|
|
990
|
+
}
|
|
991
|
+
|
|
987
992
|
.tw-h-full {
|
|
988
993
|
height: 100%;
|
|
989
994
|
}
|
|
@@ -1012,6 +1017,10 @@ video {
|
|
|
1012
1017
|
height: 3.75rem;
|
|
1013
1018
|
}
|
|
1014
1019
|
|
|
1020
|
+
.\!tw-max-h-\[470px\] {
|
|
1021
|
+
max-height: 470px !important;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1015
1024
|
.tw-max-h-\[120px\] {
|
|
1016
1025
|
max-height: 120px;
|
|
1017
1026
|
}
|
|
@@ -1044,8 +1053,9 @@ video {
|
|
|
1044
1053
|
max-height: 80px;
|
|
1045
1054
|
}
|
|
1046
1055
|
|
|
1047
|
-
.tw-max-h-
|
|
1048
|
-
max-height:
|
|
1056
|
+
.tw-max-h-fit {
|
|
1057
|
+
max-height: -moz-fit-content;
|
|
1058
|
+
max-height: fit-content;
|
|
1049
1059
|
}
|
|
1050
1060
|
|
|
1051
1061
|
.tw-max-h-list-item-small {
|
|
@@ -1145,6 +1155,10 @@ video {
|
|
|
1145
1155
|
width: 144px;
|
|
1146
1156
|
}
|
|
1147
1157
|
|
|
1158
|
+
.tw-w-\[150px\] {
|
|
1159
|
+
width: 150px;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1148
1162
|
.tw-w-\[180px\] {
|
|
1149
1163
|
width: 180px;
|
|
1150
1164
|
}
|
|
@@ -1418,6 +1432,38 @@ video {
|
|
|
1418
1432
|
animation: tw-blur-out 0.2s ease-out both;
|
|
1419
1433
|
}
|
|
1420
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
|
+
|
|
1421
1467
|
@keyframes tw-fade-in {
|
|
1422
1468
|
0% {
|
|
1423
1469
|
opacity: 0;
|
|
@@ -1429,7 +1475,7 @@ video {
|
|
|
1429
1475
|
}
|
|
1430
1476
|
|
|
1431
1477
|
.tw-animate-fade-in {
|
|
1432
|
-
animation: tw-fade-in
|
|
1478
|
+
animation: tw-fade-in var(--squid-animation-fade-in-duration, 0s) ease-out both;
|
|
1433
1479
|
}
|
|
1434
1480
|
|
|
1435
1481
|
@keyframes tw-fade-out {
|
|
@@ -1443,7 +1489,7 @@ video {
|
|
|
1443
1489
|
}
|
|
1444
1490
|
|
|
1445
1491
|
.tw-animate-fade-out {
|
|
1446
|
-
animation: tw-fade-out
|
|
1492
|
+
animation: tw-fade-out var(--squid-animation-fade-out-duration, 0s) ease-out both;
|
|
1447
1493
|
}
|
|
1448
1494
|
|
|
1449
1495
|
@keyframes tw-hide {
|
|
@@ -1494,6 +1540,38 @@ video {
|
|
|
1494
1540
|
animation: tw-move-loading-cover-to-right 1.4s linear infinite;
|
|
1495
1541
|
}
|
|
1496
1542
|
|
|
1543
|
+
@keyframes tw-scale-and-fade-down {
|
|
1544
|
+
0% {
|
|
1545
|
+
transform: scale(1);
|
|
1546
|
+
opacity: 1;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
100% {
|
|
1550
|
+
transform: scale(0.8);
|
|
1551
|
+
opacity: 0;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
.tw-animate-scale-and-fade-down {
|
|
1556
|
+
animation: tw-scale-and-fade-down var(--squid-animation-scale-and-fade-down-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
@keyframes tw-scale-and-fade-up {
|
|
1560
|
+
0% {
|
|
1561
|
+
transform: scale(0.8);
|
|
1562
|
+
opacity: 0;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
100% {
|
|
1566
|
+
transform: scale(1);
|
|
1567
|
+
opacity: 1;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
.tw-animate-scale-and-fade-up {
|
|
1572
|
+
animation: tw-scale-and-fade-up var(--squid-animation-scale-and-fade-up-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1497
1575
|
@keyframes tw-slide-to-bottom {
|
|
1498
1576
|
0% {
|
|
1499
1577
|
transform: translateY(0);
|
|
@@ -1532,12 +1610,12 @@ video {
|
|
|
1532
1610
|
}
|
|
1533
1611
|
|
|
1534
1612
|
100% {
|
|
1535
|
-
transform: translateY(
|
|
1613
|
+
transform: translateY(100%);
|
|
1536
1614
|
}
|
|
1537
1615
|
}
|
|
1538
1616
|
|
|
1539
1617
|
.tw-animate-translate-to-bottom {
|
|
1540
|
-
animation: tw-translate-to-bottom
|
|
1618
|
+
animation: tw-translate-to-bottom var(--squid-animation-translate-top-or-bottom, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1541
1619
|
}
|
|
1542
1620
|
|
|
1543
1621
|
@keyframes tw-translate-to-top {
|
|
@@ -1546,12 +1624,12 @@ video {
|
|
|
1546
1624
|
}
|
|
1547
1625
|
|
|
1548
1626
|
100% {
|
|
1549
|
-
transform: translateY(-
|
|
1627
|
+
transform: translateY(-100%);
|
|
1550
1628
|
}
|
|
1551
1629
|
}
|
|
1552
1630
|
|
|
1553
1631
|
.tw-animate-translate-to-top {
|
|
1554
|
-
animation: tw-translate-to-top
|
|
1632
|
+
animation: tw-translate-to-top var(--squid-animation-translate-top-or-bottom, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1555
1633
|
}
|
|
1556
1634
|
|
|
1557
1635
|
.tw-cursor-help {
|
|
@@ -1847,11 +1925,6 @@ video {
|
|
|
1847
1925
|
background-color: var(--squid-theme-royal-400) !important;
|
|
1848
1926
|
}
|
|
1849
1927
|
|
|
1850
|
-
.tw-bg-blue-950 {
|
|
1851
|
-
--tw-bg-opacity: 1;
|
|
1852
|
-
background-color: rgb(23 37 84 / var(--tw-bg-opacity));
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1855
1928
|
.tw-bg-grey-100 {
|
|
1856
1929
|
background-color: var(--squid-theme-grey-100);
|
|
1857
1930
|
}
|
|
@@ -2428,6 +2501,10 @@ video {
|
|
|
2428
2501
|
color: var(--squid-theme-grey-300);
|
|
2429
2502
|
}
|
|
2430
2503
|
|
|
2504
|
+
.tw-text-grey-400 {
|
|
2505
|
+
color: var(--squid-theme-grey-400);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2431
2508
|
.tw-text-grey-500 {
|
|
2432
2509
|
color: var(--squid-theme-grey-500);
|
|
2433
2510
|
}
|
|
@@ -2485,6 +2562,10 @@ video {
|
|
|
2485
2562
|
opacity: 0;
|
|
2486
2563
|
}
|
|
2487
2564
|
|
|
2565
|
+
.tw-opacity-100 {
|
|
2566
|
+
opacity: 1;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2488
2569
|
.tw-opacity-33 {
|
|
2489
2570
|
opacity: 0.33;
|
|
2490
2571
|
}
|
|
@@ -2673,6 +2754,20 @@ input[type='number'] {
|
|
|
2673
2754
|
outline-color: var(--squid-theme-status-negative);
|
|
2674
2755
|
}
|
|
2675
2756
|
|
|
2757
|
+
/* Change animation stroke color based on theme type */
|
|
2758
|
+
|
|
2759
|
+
.tw-group[data-squid-theme-type='dark'] #squid-lottie-animation #keystroke {
|
|
2760
|
+
stroke: var(--squid-theme-grey-100) !important;
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
.tw-group[data-squid-theme-type='light'] #squid-lottie-animation #keystroke {
|
|
2764
|
+
stroke: var(--squid-theme-grey-900) !important;
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
#squid-lottie-animation #keyfill {
|
|
2768
|
+
fill: var(--squid-theme-royal-500) !important;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2676
2771
|
.placeholder\:tw-text-grey-600::-moz-placeholder {
|
|
2677
2772
|
color: var(--squid-theme-grey-600);
|
|
2678
2773
|
}
|
|
@@ -2740,10 +2835,6 @@ input[type='number'] {
|
|
|
2740
2835
|
outline-offset: 2px;
|
|
2741
2836
|
}
|
|
2742
2837
|
|
|
2743
|
-
.disabled\:tw-opacity-60:disabled {
|
|
2744
|
-
opacity: 0.6;
|
|
2745
|
-
}
|
|
2746
|
-
|
|
2747
2838
|
.tw-group\/base-button:hover .group-hover\/base-button\:tw-block {
|
|
2748
2839
|
display: block;
|
|
2749
2840
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -61,9 +61,22 @@ type SwapStep = {
|
|
|
61
61
|
descriptionBlocks: SwapStepDescriptionBlock[];
|
|
62
62
|
chipContent: React.ReactNode;
|
|
63
63
|
link?: string;
|
|
64
|
+
status: TransactionStatus;
|
|
64
65
|
};
|
|
65
66
|
type ThemeType = 'light' | 'dark';
|
|
66
67
|
type SwapStepItemStatus = 'executed' | 'progress' | 'pending';
|
|
68
|
+
declare enum TransactionStatus {
|
|
69
|
+
SUCCESS = "success",
|
|
70
|
+
NEEDS_GAS = "needs_gas",
|
|
71
|
+
ONGOING = "ongoing",
|
|
72
|
+
PARTIAL_SUCCESS = "partial_success",
|
|
73
|
+
NOT_FOUND = "not_found",
|
|
74
|
+
INITIAL_LOADING = "initialLoading",
|
|
75
|
+
ERROR = "error",
|
|
76
|
+
WARNING = "warning",
|
|
77
|
+
PENDING = "pending",
|
|
78
|
+
REJECTED = "rejected"
|
|
79
|
+
}
|
|
67
80
|
|
|
68
81
|
interface BoostButtonProps {
|
|
69
82
|
boostMode: BoostMode;
|
|
@@ -112,8 +125,9 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
112
125
|
icon?: React.ReactNode;
|
|
113
126
|
isError?: boolean;
|
|
114
127
|
onPasteButtonClick?: () => void;
|
|
128
|
+
containerClassName?: string;
|
|
115
129
|
}
|
|
116
|
-
declare function Input({ placeholder, showIcon, showPasteButton, className, icon, isError, onPasteButtonClick, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
130
|
+
declare function Input({ placeholder, showIcon, showPasteButton, className, icon, isError, onPasteButtonClick, containerClassName, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
117
131
|
|
|
118
132
|
interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
119
133
|
onParsedValueChanged: (value: string) => void;
|
|
@@ -357,12 +371,14 @@ interface ModalProps {
|
|
|
357
371
|
declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, }: ModalProps): false | react_jsx_runtime.JSX.Element;
|
|
358
372
|
|
|
359
373
|
type ModalContentBorderType = 'border' | 'outline';
|
|
360
|
-
|
|
374
|
+
interface ModalContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
361
375
|
children?: React.ReactNode;
|
|
362
376
|
addGap?: boolean;
|
|
363
377
|
paddingY?: boolean;
|
|
364
378
|
borderType?: ModalContentBorderType;
|
|
365
|
-
|
|
379
|
+
className?: string;
|
|
380
|
+
}
|
|
381
|
+
declare function ModalContent({ children, addGap, paddingY, borderType, className, ...props }: ModalContentProps): react_jsx_runtime.JSX.Element;
|
|
366
382
|
declare function ModalContentDivider(): react_jsx_runtime.JSX.Element;
|
|
367
383
|
|
|
368
384
|
type ActionButton = {
|
|
@@ -428,10 +444,13 @@ interface SwapProgressViewHeaderProps {
|
|
|
428
444
|
}
|
|
429
445
|
declare function SwapProgressViewHeader({ title, description, }: SwapProgressViewHeaderProps): react_jsx_runtime.JSX.Element;
|
|
430
446
|
|
|
431
|
-
|
|
447
|
+
interface SwapStepsCollapsedProps {
|
|
432
448
|
steps: SwapStep[];
|
|
433
449
|
currentStepIndex: number;
|
|
434
|
-
|
|
450
|
+
onOpen?: () => void;
|
|
451
|
+
onClose?: () => void;
|
|
452
|
+
}
|
|
453
|
+
declare function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, onOpen, onClose, }: SwapStepsCollapsedProps): react_jsx_runtime.JSX.Element;
|
|
435
454
|
|
|
436
455
|
interface TokenPairProps {
|
|
437
456
|
firstToken: {
|
|
@@ -464,6 +483,33 @@ interface HeadingTextProps {
|
|
|
464
483
|
}
|
|
465
484
|
declare function HeadingText({ children, bold, size }: HeadingTextProps): react_jsx_runtime.JSX.Element;
|
|
466
485
|
|
|
486
|
+
type ChainData = {
|
|
487
|
+
networkName: string;
|
|
488
|
+
logoUrl: string;
|
|
489
|
+
bgColor: string;
|
|
490
|
+
};
|
|
491
|
+
type Token = {
|
|
492
|
+
symbol: string;
|
|
493
|
+
logoUrl: string;
|
|
494
|
+
bgColor: string;
|
|
495
|
+
};
|
|
496
|
+
declare function SwapProgressView({ steps, isOpen, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }: {
|
|
497
|
+
steps: SwapStep[];
|
|
498
|
+
handleClose?: () => void;
|
|
499
|
+
isOpen?: boolean;
|
|
500
|
+
socialLink?: string;
|
|
501
|
+
supportLink?: string;
|
|
502
|
+
fromToken: Token;
|
|
503
|
+
toToken: Token;
|
|
504
|
+
fromAmount: string;
|
|
505
|
+
toAmount: string;
|
|
506
|
+
fromChain: ChainData;
|
|
507
|
+
toChain: ChainData;
|
|
508
|
+
fromAddressFormatted: string;
|
|
509
|
+
toAddressFormatted: string;
|
|
510
|
+
txStatus: TransactionStatus;
|
|
511
|
+
}): react_jsx_runtime.JSX.Element;
|
|
512
|
+
|
|
467
513
|
type SquidTheme = {
|
|
468
514
|
'content-100': string;
|
|
469
515
|
'content-200': string;
|
|
@@ -503,4 +549,4 @@ declare function useDropdownMenu(props?: {
|
|
|
503
549
|
openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
|
|
504
550
|
};
|
|
505
551
|
|
|
506
|
-
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
|
|
552
|
+
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
|
package/package.json
CHANGED
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
"url": "git+https://github.com/0xsquid/squid-ui.git"
|
|
6
6
|
},
|
|
7
7
|
"description": "Squid's UI components",
|
|
8
|
-
"version": "0.13.
|
|
8
|
+
"version": "0.13.4",
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"resolutions": {
|
|
12
|
+
"string-width": "4.2.3"
|
|
13
|
+
},
|
|
11
14
|
"scripts": {
|
|
12
15
|
"storybook": "concurrently 'yarn:watch:*'",
|
|
13
16
|
"watch:storybook": "storybook dev -p 6006",
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
"copy-fonts": "cp -r src/styles/fonts dist/fonts"
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
30
|
+
"@lottiefiles/react-lottie-player": "3.5.0",
|
|
27
31
|
"clsx": "2.1.0",
|
|
28
32
|
"color": "4.2.3",
|
|
29
33
|
"tailwind-merge": "2.3.0"
|
|
@@ -42,6 +46,7 @@
|
|
|
42
46
|
"@chromatic-com/storybook": "^1.2.22",
|
|
43
47
|
"@release-it/conventional-changelog": "github:release-it/conventional-changelog",
|
|
44
48
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
49
|
+
"@rollup/plugin-json": "6.1.0",
|
|
45
50
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
46
51
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
47
52
|
"@storybook/addon-essentials": "^8.0.1",
|