@0xsquid/ui 0.19.4 → 0.20.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 +382 -321
- package/dist/cjs/types/components/buttons/AssetsButton.d.ts +3 -1
- package/dist/cjs/types/components/buttons/BoostButton.d.ts +1 -3
- package/dist/cjs/types/components/buttons/FeeButton.d.ts +3 -1
- package/dist/cjs/types/components/controls/NumericInput.d.ts +10 -2
- package/dist/cjs/types/components/controls/Tooltip.d.ts +1 -1
- package/dist/cjs/types/components/icons/Loader.d.ts +2 -1
- package/dist/cjs/types/components/layout/Boost.d.ts +3 -3
- package/dist/cjs/types/components/layout/DetailsToolbar.d.ts +18 -14
- package/dist/cjs/types/components/layout/NavigationBar.d.ts +2 -0
- package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +21 -7
- package/dist/cjs/types/components/lists/HistoryItem.d.ts +1 -1
- package/dist/cjs/types/stories/buttons/AssetsButton.stories.d.ts +1 -0
- package/dist/cjs/types/stories/buttons/FeeButton.stories.d.ts +1 -0
- package/dist/cjs/types/stories/layout/Boost.stories.d.ts +1 -0
- package/dist/cjs/types/stories/layout/DetailsToolbar.stories.d.ts +4 -1
- package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +1 -0
- package/dist/esm/index.js +382 -321
- package/dist/esm/types/components/buttons/AssetsButton.d.ts +3 -1
- package/dist/esm/types/components/buttons/BoostButton.d.ts +1 -3
- package/dist/esm/types/components/buttons/FeeButton.d.ts +3 -1
- package/dist/esm/types/components/controls/NumericInput.d.ts +10 -2
- package/dist/esm/types/components/controls/Tooltip.d.ts +1 -1
- package/dist/esm/types/components/icons/Loader.d.ts +2 -1
- package/dist/esm/types/components/layout/Boost.d.ts +3 -3
- package/dist/esm/types/components/layout/DetailsToolbar.d.ts +18 -14
- package/dist/esm/types/components/layout/NavigationBar.d.ts +2 -0
- package/dist/esm/types/components/layout/SwapConfiguration.d.ts +21 -7
- package/dist/esm/types/components/lists/HistoryItem.d.ts +1 -1
- package/dist/esm/types/stories/buttons/AssetsButton.stories.d.ts +1 -0
- package/dist/esm/types/stories/buttons/FeeButton.stories.d.ts +1 -0
- package/dist/esm/types/stories/layout/Boost.stories.d.ts +1 -0
- package/dist/esm/types/stories/layout/DetailsToolbar.stories.d.ts +4 -1
- package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +125 -102
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -130,69 +130,6 @@ interface ArrowButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
130
130
|
}
|
|
131
131
|
declare function ArrowButton({ label, disabled, ...props }: ArrowButtonProps): react_jsx_runtime.JSX.Element;
|
|
132
132
|
|
|
133
|
-
interface AssetsButtonProps {
|
|
134
|
-
token?: {
|
|
135
|
-
iconUrl: string;
|
|
136
|
-
symbol: string;
|
|
137
|
-
bgColor: string;
|
|
138
|
-
textColor: string;
|
|
139
|
-
};
|
|
140
|
-
chain?: {
|
|
141
|
-
iconUrl: string;
|
|
142
|
-
bgColor: string;
|
|
143
|
-
};
|
|
144
|
-
onClick?: () => void;
|
|
145
|
-
variant?: AssetsButtonVariant;
|
|
146
|
-
isLoading?: boolean;
|
|
147
|
-
}
|
|
148
|
-
declare function AssetsButton({ chain, token, onClick, variant, isLoading, }: AssetsButtonProps): react_jsx_runtime.JSX.Element;
|
|
149
|
-
|
|
150
|
-
interface BoostButtonProps {
|
|
151
|
-
boostMode: BoostMode;
|
|
152
|
-
canToggleBoostMode?: boolean;
|
|
153
|
-
boostDisabledMessage?: string;
|
|
154
|
-
tooltipDisplayDelayMs?: number;
|
|
155
|
-
boostIndicatorRef: React.RefObject<HTMLDivElement>;
|
|
156
|
-
}
|
|
157
|
-
declare function BoostButton({ boostMode, canToggleBoostMode, boostDisabledMessage, tooltipDisplayDelayMs, boostIndicatorRef, }: BoostButtonProps): react_jsx_runtime.JSX.Element;
|
|
158
|
-
|
|
159
|
-
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
160
|
-
label?: string;
|
|
161
|
-
icon?: React.ReactNode;
|
|
162
|
-
variant: ButtonVariant;
|
|
163
|
-
size: ButtonSize;
|
|
164
|
-
disabled?: boolean;
|
|
165
|
-
link?: string;
|
|
166
|
-
isLoading?: boolean;
|
|
167
|
-
}
|
|
168
|
-
declare function Button({ label, disabled, size, variant, icon, link, isLoading, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
169
|
-
|
|
170
|
-
interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
171
|
-
label?: string;
|
|
172
|
-
icon?: React.ReactNode;
|
|
173
|
-
}
|
|
174
|
-
declare function Chip({ label, icon, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
175
|
-
|
|
176
|
-
interface FeeButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
177
|
-
feeInUsd?: string;
|
|
178
|
-
chipLabel?: string;
|
|
179
|
-
}
|
|
180
|
-
declare function FeeButton({ feeInUsd, chipLabel, className, ...props }: FeeButtonProps): react_jsx_runtime.JSX.Element;
|
|
181
|
-
|
|
182
|
-
interface FilterButtonProps {
|
|
183
|
-
selected: boolean;
|
|
184
|
-
numApplied?: number;
|
|
185
|
-
onClick?: () => void;
|
|
186
|
-
}
|
|
187
|
-
declare function FilterButton({ selected, numApplied, onClick, }: FilterButtonProps): react_jsx_runtime.JSX.Element;
|
|
188
|
-
|
|
189
|
-
interface SettingsButtonProps {
|
|
190
|
-
label: string;
|
|
191
|
-
isSelected?: boolean;
|
|
192
|
-
onClick?: () => void;
|
|
193
|
-
}
|
|
194
|
-
declare function SettingsButton({ label, isSelected, onClick, }: SettingsButtonProps): react_jsx_runtime.JSX.Element;
|
|
195
|
-
|
|
196
133
|
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
197
134
|
placeholder?: string;
|
|
198
135
|
showIcon?: boolean;
|
|
@@ -209,6 +146,21 @@ type InputActionButtonProps = {
|
|
|
209
146
|
label?: string;
|
|
210
147
|
};
|
|
211
148
|
|
|
149
|
+
type TooltipWidth = 'max' | 'container';
|
|
150
|
+
type TooltipThreshold = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
|
151
|
+
interface TooltipProps {
|
|
152
|
+
children: react__default.ReactNode;
|
|
153
|
+
tooltipContent?: react__default.ReactNode;
|
|
154
|
+
threshold?: TooltipThreshold;
|
|
155
|
+
tooltipWidth?: TooltipWidth;
|
|
156
|
+
containerClassName?: string;
|
|
157
|
+
childrenClassName?: string;
|
|
158
|
+
tooltipClassName?: string;
|
|
159
|
+
displayDelayMs?: number;
|
|
160
|
+
containerRef?: react__default.RefObject<HTMLElement>;
|
|
161
|
+
}
|
|
162
|
+
declare function Tooltip({ children, tooltipContent, tooltipWidth, threshold, containerClassName, childrenClassName, tooltipClassName, displayDelayMs, containerRef: containerRefProp, }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
163
|
+
|
|
212
164
|
interface Token$1 {
|
|
213
165
|
price: number;
|
|
214
166
|
symbol: string;
|
|
@@ -231,11 +183,18 @@ interface NumericInputProps {
|
|
|
231
183
|
priceImpactPercentage?: string;
|
|
232
184
|
criticalPriceImpactPercentage?: number;
|
|
233
185
|
direction?: SwapDirection;
|
|
234
|
-
|
|
186
|
+
inputModeButton?: {
|
|
187
|
+
usdModeTooltip?: Omit<TooltipProps, 'children'>;
|
|
188
|
+
tokenModeTooltip?: Omit<TooltipProps, 'children'>;
|
|
189
|
+
amountUsd?: string;
|
|
190
|
+
};
|
|
235
191
|
maxUsdDecimals?: number;
|
|
236
192
|
isInteractive?: boolean;
|
|
193
|
+
balanceButton?: {
|
|
194
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
195
|
+
};
|
|
237
196
|
}
|
|
238
|
-
declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, showDetails, isLoading, direction,
|
|
197
|
+
declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, showDetails, isLoading, direction, inputModeButton, isInteractive, balanceButton, }: NumericInputProps): react_jsx_runtime.JSX.Element;
|
|
239
198
|
|
|
240
199
|
interface SettingsSliderProps {
|
|
241
200
|
value: number | undefined;
|
|
@@ -256,20 +215,68 @@ interface SwitchProps {
|
|
|
256
215
|
}
|
|
257
216
|
declare function Switch({ checked, onChange, size, disabled, }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
258
217
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
218
|
+
interface AssetsButtonProps {
|
|
219
|
+
token?: {
|
|
220
|
+
iconUrl: string;
|
|
221
|
+
symbol: string;
|
|
222
|
+
bgColor: string;
|
|
223
|
+
textColor: string;
|
|
224
|
+
};
|
|
225
|
+
chain?: {
|
|
226
|
+
iconUrl: string;
|
|
227
|
+
bgColor: string;
|
|
228
|
+
};
|
|
229
|
+
onClick?: () => void;
|
|
230
|
+
variant?: AssetsButtonVariant;
|
|
231
|
+
isLoading?: boolean;
|
|
232
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
271
233
|
}
|
|
272
|
-
declare function
|
|
234
|
+
declare function AssetsButton({ chain, token, onClick, variant, isLoading, tooltip, }: AssetsButtonProps): react_jsx_runtime.JSX.Element;
|
|
235
|
+
|
|
236
|
+
interface BoostButtonProps {
|
|
237
|
+
boostMode: BoostMode;
|
|
238
|
+
canToggleBoostMode?: boolean;
|
|
239
|
+
boostIndicatorRef: React.RefObject<HTMLDivElement>;
|
|
240
|
+
}
|
|
241
|
+
declare function BoostButton({ boostMode, canToggleBoostMode, boostIndicatorRef, }: BoostButtonProps): react_jsx_runtime.JSX.Element;
|
|
242
|
+
|
|
243
|
+
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
244
|
+
label?: string;
|
|
245
|
+
icon?: React.ReactNode;
|
|
246
|
+
variant: ButtonVariant;
|
|
247
|
+
size: ButtonSize;
|
|
248
|
+
disabled?: boolean;
|
|
249
|
+
link?: string;
|
|
250
|
+
isLoading?: boolean;
|
|
251
|
+
}
|
|
252
|
+
declare function Button({ label, disabled, size, variant, icon, link, isLoading, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
253
|
+
|
|
254
|
+
interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
255
|
+
label?: string;
|
|
256
|
+
icon?: React.ReactNode;
|
|
257
|
+
}
|
|
258
|
+
declare function Chip({ label, icon, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
259
|
+
|
|
260
|
+
interface FeeButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
261
|
+
feeInUsd?: string;
|
|
262
|
+
chipLabel?: string;
|
|
263
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
264
|
+
}
|
|
265
|
+
declare function FeeButton({ feeInUsd, chipLabel, className, tooltip, ...props }: FeeButtonProps): react_jsx_runtime.JSX.Element;
|
|
266
|
+
|
|
267
|
+
interface FilterButtonProps {
|
|
268
|
+
selected: boolean;
|
|
269
|
+
numApplied?: number;
|
|
270
|
+
onClick?: () => void;
|
|
271
|
+
}
|
|
272
|
+
declare function FilterButton({ selected, numApplied, onClick, }: FilterButtonProps): react_jsx_runtime.JSX.Element;
|
|
273
|
+
|
|
274
|
+
interface SettingsButtonProps {
|
|
275
|
+
label: string;
|
|
276
|
+
isSelected?: boolean;
|
|
277
|
+
onClick?: () => void;
|
|
278
|
+
}
|
|
279
|
+
declare function SettingsButton({ label, isSelected, onClick, }: SettingsButtonProps): react_jsx_runtime.JSX.Element;
|
|
273
280
|
|
|
274
281
|
interface Props {
|
|
275
282
|
lottieJsonFile: object;
|
|
@@ -813,11 +820,10 @@ interface BoostProps {
|
|
|
813
820
|
boostMode: BoostMode;
|
|
814
821
|
}) => void;
|
|
815
822
|
estimatedTime: string;
|
|
816
|
-
boostDisabledMessage?: string;
|
|
817
823
|
canToggleBoostMode?: boolean;
|
|
818
|
-
|
|
824
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
819
825
|
}
|
|
820
|
-
declare function Boost({ boostMode, onToggleBoostMode, estimatedTime,
|
|
826
|
+
declare function Boost({ boostMode, onToggleBoostMode, estimatedTime, canToggleBoostMode, tooltip, }: BoostProps): react_jsx_runtime.JSX.Element;
|
|
821
827
|
|
|
822
828
|
declare function Breadcrumb({ children, className, }: {
|
|
823
829
|
children: ReactNode;
|
|
@@ -842,30 +848,33 @@ declare function Inline({ className, children, ...props }: ComponentProps<'div'>
|
|
|
842
848
|
|
|
843
849
|
interface DetailsToolbarProps {
|
|
844
850
|
errorMessage?: string;
|
|
845
|
-
boostMode?: BoostMode;
|
|
846
|
-
onToggleBoostMode?: ({ boostMode }: {
|
|
847
|
-
boostMode: BoostMode;
|
|
848
|
-
}) => void;
|
|
849
|
-
onInvertSwapButtonClick?: () => void;
|
|
850
|
-
onFeeButtonClick?: () => void;
|
|
851
851
|
flipButton?: {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
852
|
+
onClick?: () => void;
|
|
853
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
854
|
+
isDisabled?: boolean;
|
|
855
|
+
};
|
|
856
|
+
feeButton?: {
|
|
857
|
+
feeInUsd: string;
|
|
858
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
859
|
+
onClick: () => void;
|
|
855
860
|
};
|
|
856
|
-
feeInUsd?: string;
|
|
857
861
|
estimatedTime?: string;
|
|
858
|
-
canToggleBoostMode?: boolean;
|
|
859
|
-
boostDisabledMessage?: string;
|
|
860
862
|
isLoading?: boolean;
|
|
861
863
|
isEmpty?: boolean;
|
|
862
864
|
helpButton?: {
|
|
863
865
|
label: string;
|
|
864
866
|
onClick: () => void;
|
|
865
867
|
};
|
|
866
|
-
|
|
868
|
+
boostButton?: {
|
|
869
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
870
|
+
onClick?: ({ boostMode }: {
|
|
871
|
+
boostMode: BoostMode;
|
|
872
|
+
}) => void;
|
|
873
|
+
canToggleBoostMode?: boolean;
|
|
874
|
+
boostMode?: BoostMode;
|
|
875
|
+
};
|
|
867
876
|
}
|
|
868
|
-
declare function DetailsToolbar({ errorMessage,
|
|
877
|
+
declare function DetailsToolbar({ errorMessage, estimatedTime, helpButton, isLoading, isEmpty, flipButton, feeButton, boostButton, }: DetailsToolbarProps): react_jsx_runtime.JSX.Element;
|
|
869
878
|
|
|
870
879
|
interface DropdownMenuItemProps {
|
|
871
880
|
label: string;
|
|
@@ -1364,6 +1373,7 @@ type ActionButton = {
|
|
|
1364
1373
|
labelOrIcon: string | React.ReactNode;
|
|
1365
1374
|
onClick?: () => void;
|
|
1366
1375
|
id: React.Key;
|
|
1376
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
1367
1377
|
};
|
|
1368
1378
|
interface NavigationBarProps {
|
|
1369
1379
|
title?: string;
|
|
@@ -1392,7 +1402,6 @@ interface SwapConfigurationProps {
|
|
|
1392
1402
|
priceImpactPercentage?: string;
|
|
1393
1403
|
amount?: string;
|
|
1394
1404
|
forcedAmount?: string;
|
|
1395
|
-
amountUsd?: string;
|
|
1396
1405
|
tokenPrice?: number;
|
|
1397
1406
|
balance?: string;
|
|
1398
1407
|
isFetching?: boolean;
|
|
@@ -1407,21 +1416,35 @@ interface SwapConfigurationProps {
|
|
|
1407
1416
|
textColor: string;
|
|
1408
1417
|
decimals: number;
|
|
1409
1418
|
};
|
|
1410
|
-
address?: string;
|
|
1411
1419
|
onAmountChange?: (amount: string) => void;
|
|
1412
|
-
onWalletButtonClick?: () => void;
|
|
1413
|
-
onAssetsButtonClick?: () => void;
|
|
1414
1420
|
error?: {
|
|
1415
1421
|
message: string;
|
|
1416
1422
|
};
|
|
1417
1423
|
criticalPriceImpactPercentage?: number;
|
|
1418
|
-
emptyAddressLabel?: string;
|
|
1419
|
-
assetsButtonVariant?: AssetsButtonVariant;
|
|
1420
1424
|
maxUsdDecimals?: number;
|
|
1421
1425
|
isInputInteractive?: boolean;
|
|
1422
1426
|
isLoading?: boolean;
|
|
1427
|
+
inputModeButton?: {
|
|
1428
|
+
usdModeTooltip?: Omit<TooltipProps, 'children'>;
|
|
1429
|
+
tokenModeTooltip?: Omit<TooltipProps, 'children'>;
|
|
1430
|
+
amountUsd?: string;
|
|
1431
|
+
};
|
|
1432
|
+
balanceButton?: {
|
|
1433
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
1434
|
+
};
|
|
1435
|
+
assetsButton?: {
|
|
1436
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
1437
|
+
onClick?: () => void;
|
|
1438
|
+
variant?: AssetsButtonVariant;
|
|
1439
|
+
};
|
|
1440
|
+
walletButton?: {
|
|
1441
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
1442
|
+
onClick?: () => void;
|
|
1443
|
+
address?: string;
|
|
1444
|
+
emptyAddressLabel?: string;
|
|
1445
|
+
};
|
|
1423
1446
|
}
|
|
1424
|
-
declare function SwapConfiguration({ amount, tokenPrice, isFetching: isFetchingProp, chain, token, direction, onAmountChange,
|
|
1447
|
+
declare function SwapConfiguration({ amount, tokenPrice, isFetching: isFetchingProp, chain, token, direction, onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive, isLoading, inputModeButton, balanceButton, assetsButton, walletButton, }: SwapConfigurationProps): react_jsx_runtime.JSX.Element;
|
|
1425
1448
|
|
|
1426
1449
|
interface SwapProgressViewHeaderProps {
|
|
1427
1450
|
title: string;
|