@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
|
+
}
|