@0xsquid/ui 0.13.1 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +35245 -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 +34 -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 +35201 -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 +34 -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 +82 -23
- package/dist/index.d.ts +53 -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,36 @@
|
|
|
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, currentStepIndex, isOpen, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }: {
|
|
13
|
+
steps: SwapStep[];
|
|
14
|
+
currentStepIndex: number;
|
|
15
|
+
handleClose?: () => void;
|
|
16
|
+
isOpen?: boolean;
|
|
17
|
+
socialLink?: string;
|
|
18
|
+
supportLink?: string;
|
|
19
|
+
fromToken: Token;
|
|
20
|
+
toToken: Token;
|
|
21
|
+
fromAmount: string;
|
|
22
|
+
toAmount: string;
|
|
23
|
+
fromChain: ChainData;
|
|
24
|
+
toChain: ChainData;
|
|
25
|
+
fromAddressFormatted: string;
|
|
26
|
+
toAddressFormatted: string;
|
|
27
|
+
txStatus: TransactionStatus;
|
|
4
28
|
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
interface Props {
|
|
30
|
+
rawSteps: SwapStep[];
|
|
31
|
+
txStatus?: TransactionStatus;
|
|
32
|
+
onOpen?: () => void;
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const TrackTransactionView: ({ txStatus, rawSteps, onOpen, onClose, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
36
|
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
|
+
SLIDE_TO_BOTTOM_DURATION: string;
|
|
5
|
+
SLIDE_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
|
}
|
|
@@ -1429,7 +1443,7 @@ video {
|
|
|
1429
1443
|
}
|
|
1430
1444
|
|
|
1431
1445
|
.tw-animate-fade-in {
|
|
1432
|
-
animation: tw-fade-in
|
|
1446
|
+
animation: tw-fade-in var(--squid-animation-fade-in-duration, 0s) ease-out both;
|
|
1433
1447
|
}
|
|
1434
1448
|
|
|
1435
1449
|
@keyframes tw-fade-out {
|
|
@@ -1443,7 +1457,7 @@ video {
|
|
|
1443
1457
|
}
|
|
1444
1458
|
|
|
1445
1459
|
.tw-animate-fade-out {
|
|
1446
|
-
animation: tw-fade-out
|
|
1460
|
+
animation: tw-fade-out var(--squid-animation-fade-out-duration, 0s) ease-out both;
|
|
1447
1461
|
}
|
|
1448
1462
|
|
|
1449
1463
|
@keyframes tw-hide {
|
|
@@ -1494,36 +1508,68 @@ video {
|
|
|
1494
1508
|
animation: tw-move-loading-cover-to-right 1.4s linear infinite;
|
|
1495
1509
|
}
|
|
1496
1510
|
|
|
1511
|
+
@keyframes tw-scale-and-fade-down {
|
|
1512
|
+
0% {
|
|
1513
|
+
transform: scale(1);
|
|
1514
|
+
opacity: 1;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
100% {
|
|
1518
|
+
transform: scale(0.8);
|
|
1519
|
+
opacity: 0;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
.tw-animate-scale-and-fade-down {
|
|
1524
|
+
animation: tw-scale-and-fade-down var(--squid-animation-scale-and-fade-down-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
@keyframes tw-scale-and-fade-up {
|
|
1528
|
+
0% {
|
|
1529
|
+
transform: scale(0.8);
|
|
1530
|
+
opacity: 0;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
100% {
|
|
1534
|
+
transform: scale(1);
|
|
1535
|
+
opacity: 1;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.tw-animate-scale-and-fade-up {
|
|
1540
|
+
animation: tw-scale-and-fade-up var(--squid-animation-scale-and-fade-up-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1497
1543
|
@keyframes tw-slide-to-bottom {
|
|
1498
1544
|
0% {
|
|
1499
|
-
|
|
1545
|
+
height: 100%;
|
|
1500
1546
|
opacity: 1;
|
|
1501
1547
|
}
|
|
1502
1548
|
|
|
1503
1549
|
100% {
|
|
1504
|
-
|
|
1550
|
+
height: 60px;
|
|
1505
1551
|
opacity: 0;
|
|
1506
1552
|
}
|
|
1507
1553
|
}
|
|
1508
1554
|
|
|
1509
1555
|
.tw-animate-slide-to-bottom {
|
|
1510
|
-
animation: tw-slide-to-bottom
|
|
1556
|
+
animation: tw-slide-to-bottom var(--squid-animation-slide-to-bottom-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1511
1557
|
}
|
|
1512
1558
|
|
|
1513
1559
|
@keyframes tw-slide-to-top {
|
|
1514
1560
|
0% {
|
|
1515
|
-
|
|
1561
|
+
height: 60px;
|
|
1516
1562
|
opacity: 0;
|
|
1517
1563
|
}
|
|
1518
1564
|
|
|
1519
1565
|
100% {
|
|
1520
|
-
|
|
1566
|
+
height: 100%;
|
|
1521
1567
|
opacity: 1;
|
|
1522
1568
|
}
|
|
1523
1569
|
}
|
|
1524
1570
|
|
|
1525
1571
|
.tw-animate-slide-to-top {
|
|
1526
|
-
animation: tw-slide-to-top
|
|
1572
|
+
animation: tw-slide-to-top var(--squid-animation-slide-to-top-duration, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1527
1573
|
}
|
|
1528
1574
|
|
|
1529
1575
|
@keyframes tw-translate-to-bottom {
|
|
@@ -1532,12 +1578,12 @@ video {
|
|
|
1532
1578
|
}
|
|
1533
1579
|
|
|
1534
1580
|
100% {
|
|
1535
|
-
transform: translateY(
|
|
1581
|
+
transform: translateY(100%);
|
|
1536
1582
|
}
|
|
1537
1583
|
}
|
|
1538
1584
|
|
|
1539
1585
|
.tw-animate-translate-to-bottom {
|
|
1540
|
-
animation: tw-translate-to-bottom
|
|
1586
|
+
animation: tw-translate-to-bottom var(--squid-animation-translate-top-or-bottom, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1541
1587
|
}
|
|
1542
1588
|
|
|
1543
1589
|
@keyframes tw-translate-to-top {
|
|
@@ -1546,12 +1592,12 @@ video {
|
|
|
1546
1592
|
}
|
|
1547
1593
|
|
|
1548
1594
|
100% {
|
|
1549
|
-
transform: translateY(-
|
|
1595
|
+
transform: translateY(-100%);
|
|
1550
1596
|
}
|
|
1551
1597
|
}
|
|
1552
1598
|
|
|
1553
1599
|
.tw-animate-translate-to-top {
|
|
1554
|
-
animation: tw-translate-to-top
|
|
1600
|
+
animation: tw-translate-to-top var(--squid-animation-translate-top-or-bottom, 0s) cubic-bezier(.165,.84,.44,1) both;
|
|
1555
1601
|
}
|
|
1556
1602
|
|
|
1557
1603
|
.tw-cursor-help {
|
|
@@ -1847,11 +1893,6 @@ video {
|
|
|
1847
1893
|
background-color: var(--squid-theme-royal-400) !important;
|
|
1848
1894
|
}
|
|
1849
1895
|
|
|
1850
|
-
.tw-bg-blue-950 {
|
|
1851
|
-
--tw-bg-opacity: 1;
|
|
1852
|
-
background-color: rgb(23 37 84 / var(--tw-bg-opacity));
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1855
1896
|
.tw-bg-grey-100 {
|
|
1856
1897
|
background-color: var(--squid-theme-grey-100);
|
|
1857
1898
|
}
|
|
@@ -2428,6 +2469,10 @@ video {
|
|
|
2428
2469
|
color: var(--squid-theme-grey-300);
|
|
2429
2470
|
}
|
|
2430
2471
|
|
|
2472
|
+
.tw-text-grey-400 {
|
|
2473
|
+
color: var(--squid-theme-grey-400);
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2431
2476
|
.tw-text-grey-500 {
|
|
2432
2477
|
color: var(--squid-theme-grey-500);
|
|
2433
2478
|
}
|
|
@@ -2485,6 +2530,10 @@ video {
|
|
|
2485
2530
|
opacity: 0;
|
|
2486
2531
|
}
|
|
2487
2532
|
|
|
2533
|
+
.tw-opacity-100 {
|
|
2534
|
+
opacity: 1;
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2488
2537
|
.tw-opacity-33 {
|
|
2489
2538
|
opacity: 0.33;
|
|
2490
2539
|
}
|
|
@@ -2673,6 +2722,20 @@ input[type='number'] {
|
|
|
2673
2722
|
outline-color: var(--squid-theme-status-negative);
|
|
2674
2723
|
}
|
|
2675
2724
|
|
|
2725
|
+
/* Change animation stroke color based on theme type */
|
|
2726
|
+
|
|
2727
|
+
.tw-group[data-squid-theme-type='dark'] #squid-lottie-animation #keystroke {
|
|
2728
|
+
stroke: var(--squid-theme-grey-100) !important;
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
.tw-group[data-squid-theme-type='light'] #squid-lottie-animation #keystroke {
|
|
2732
|
+
stroke: var(--squid-theme-grey-900) !important;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
#squid-lottie-animation #keyfill {
|
|
2736
|
+
fill: var(--squid-theme-royal-500) !important;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2676
2739
|
.placeholder\:tw-text-grey-600::-moz-placeholder {
|
|
2677
2740
|
color: var(--squid-theme-grey-600);
|
|
2678
2741
|
}
|
|
@@ -2740,10 +2803,6 @@ input[type='number'] {
|
|
|
2740
2803
|
outline-offset: 2px;
|
|
2741
2804
|
}
|
|
2742
2805
|
|
|
2743
|
-
.disabled\:tw-opacity-60:disabled {
|
|
2744
|
-
opacity: 0.6;
|
|
2745
|
-
}
|
|
2746
|
-
|
|
2747
2806
|
.tw-group\/base-button:hover .group-hover\/base-button\:tw-block {
|
|
2748
2807
|
display: block;
|
|
2749
2808
|
}
|
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,34 @@ 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, currentStepIndex, isOpen, handleClose, socialLink, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, txStatus, }: {
|
|
497
|
+
steps: SwapStep[];
|
|
498
|
+
currentStepIndex: number;
|
|
499
|
+
handleClose?: () => void;
|
|
500
|
+
isOpen?: boolean;
|
|
501
|
+
socialLink?: string;
|
|
502
|
+
supportLink?: string;
|
|
503
|
+
fromToken: Token;
|
|
504
|
+
toToken: Token;
|
|
505
|
+
fromAmount: string;
|
|
506
|
+
toAmount: string;
|
|
507
|
+
fromChain: ChainData;
|
|
508
|
+
toChain: ChainData;
|
|
509
|
+
fromAddressFormatted: string;
|
|
510
|
+
toAddressFormatted: string;
|
|
511
|
+
txStatus: TransactionStatus;
|
|
512
|
+
}): react_jsx_runtime.JSX.Element;
|
|
513
|
+
|
|
467
514
|
type SquidTheme = {
|
|
468
515
|
'content-100': string;
|
|
469
516
|
'content-200': string;
|
|
@@ -503,4 +550,4 @@ declare function useDropdownMenu(props?: {
|
|
|
503
550
|
openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
|
|
504
551
|
};
|
|
505
552
|
|
|
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 };
|
|
553
|
+
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.3",
|
|
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",
|