@0xsquid/ui 0.15.5 → 0.15.6
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 +26 -12
- package/dist/cjs/types/components/buttons/AssetsButton.d.ts +3 -1
- package/dist/cjs/types/components/lists/HistoryItem.d.ts +1 -1
- package/dist/cjs/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
- package/dist/cjs/types/types/components.d.ts +1 -0
- package/dist/cjs/types/types/index.d.ts +1 -1
- package/dist/esm/index.js +26 -12
- package/dist/esm/types/components/buttons/AssetsButton.d.ts +3 -1
- package/dist/esm/types/components/lists/HistoryItem.d.ts +1 -1
- package/dist/esm/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
- package/dist/esm/types/types/components.d.ts +1 -0
- package/dist/esm/types/types/index.d.ts +1 -1
- package/dist/index.css +15 -23
- package/dist/index.d.ts +5 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2588,7 +2588,7 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
|
|
|
2588
2588
|
setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { badgeLoaded: true })));
|
|
2589
2589
|
}, className: cn(badgeImageClassName,
|
|
2590
2590
|
// hide badge image while it is loading, and display it when it is loaded
|
|
2591
|
-
imagesLoadState.
|
|
2591
|
+
imagesLoadState.badgeLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
|
|
2592
2592
|
}
|
|
2593
2593
|
|
|
2594
2594
|
function LoadingSkeleton({ className, height = '20', }) {
|
|
@@ -2845,8 +2845,22 @@ function PlusIcon() {
|
|
|
2845
2845
|
}
|
|
2846
2846
|
|
|
2847
2847
|
const imageClass = 'tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center';
|
|
2848
|
-
const
|
|
2849
|
-
|
|
2848
|
+
const themeKeyVariantMap = {
|
|
2849
|
+
primary: 'grey-800',
|
|
2850
|
+
accent: 'royal-500',
|
|
2851
|
+
};
|
|
2852
|
+
const buttonTextClassNameMap = {
|
|
2853
|
+
primary: 'tw-text-grey-300',
|
|
2854
|
+
accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
|
|
2855
|
+
};
|
|
2856
|
+
const emptyChainIconTextClassNameMap = {
|
|
2857
|
+
primary: 'tw-text-grey-100',
|
|
2858
|
+
accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
|
|
2859
|
+
};
|
|
2860
|
+
function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant = 'primary', }) {
|
|
2861
|
+
const defaultBgColor = `var(${themeTypesKeys[themeKeyVariantMap[variant]].cssVariable})`;
|
|
2862
|
+
const chainBgColor = _chainBgColor !== null && _chainBgColor !== void 0 ? _chainBgColor : defaultBgColor;
|
|
2863
|
+
const tokenBgColor = _tokenBgColor !== null && _tokenBgColor !== void 0 ? _tokenBgColor : defaultBgColor;
|
|
2850
2864
|
const bgGradient = React.useMemo(() => {
|
|
2851
2865
|
if (!chainImageUrl) {
|
|
2852
2866
|
return `linear-gradient(to right, ${defaultBgColor}, ${defaultBgColor})`;
|
|
@@ -2856,9 +2870,9 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
|
|
|
2856
2870
|
}
|
|
2857
2871
|
return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
|
|
2858
2872
|
}, [chainBgColor, tokenBgColor]);
|
|
2859
|
-
return (jsxRuntime.jsxs("button", { onClick: onClick, className:
|
|
2873
|
+
return (jsxRuntime.jsxs("button", { onClick: onClick, className: cn('tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center focus:tw-outline-none', buttonTextClassNameMap[variant]), children: [jsxRuntime.jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-cursor-pointer tw-text-material-light-thin", viewBox: "0 0 72 40", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: jsxRuntime.jsx("path", { d: "m57.86 5.86c-.53.53-1.05 1.06-1.56 1.59-3.29 3.38-6.37 6.55-10.3 6.55s-7.01-3.17-10.3-6.55c-.51-.53-1.03-1.06-1.56-1.59-3.9-3.91-9.02-5.86-14.14-5.86s-10.24 1.95-14.14 5.86c-3.91 3.9-5.86 9.02-5.86 14.14s1.95 10.24 5.86 14.14c3.91 3.91 9.02 5.86 14.14 5.86s10.24-1.95 14.14-5.86c.52-.53 1.04-1.06 1.55-1.58 3.29-3.39 6.37-6.56 10.31-6.56s7.02 3.17 10.31 6.56c.51.53 1.03 1.06 1.55 1.58 3.91 3.91 9.02 5.86 14.14 5.86v-40c-5.12 0-10.24 1.95-14.14 5.86zm14.14 33.14c-5.07 0-9.85-1.98-13.43-5.56-.52-.52-1.02-1.04-1.54-1.57-3.43-3.53-6.67-6.86-11.02-6.86s-7.6 3.33-11.04 6.88c-.5.52-1.01 1.04-1.53 1.56-3.59 3.59-8.36 5.57-13.44 5.57s-9.85-1.98-13.43-5.57c-3.59-3.59-5.56-8.36-5.56-13.43s1.98-9.85 5.56-13.44c3.58-3.6 8.35-5.58 13.43-5.58s9.85 1.98 13.44 5.57c.52.52 1.04 1.05 1.55 1.58 3.43 3.53 6.66 6.86 11.02 6.86s7.59-3.33 11.02-6.86c.51-.52 1.02-1.05 1.55-1.58 3.59-3.59 8.36-5.56 13.43-5.56v38z" }) }), jsxRuntime.jsx("div", { className: cn('tw-assets-button-mask tw-flex tw-h-squid-xl tw-w-[92px] tw-cursor-pointer tw-items-center tw-justify-between', tokenImageUrl ? 'tw-w-[90px]' : 'tw-w-full tw-max-w-[72px]'), style: {
|
|
2860
2874
|
backgroundImage: bgGradient,
|
|
2861
|
-
}, children: jsxRuntime.jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsxRuntime.jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsxRuntime.jsx(
|
|
2875
|
+
}, children: jsxRuntime.jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsxRuntime.jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsxRuntime.jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsxRuntime.jsx(PlusIcon, {}) })) }) }), tokenImageUrl && chainImageUrl ? (jsxRuntime.jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-overflow-hidden'), children: [jsxRuntime.jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
|
|
2862
2876
|
backgroundColor: tokenBgColor,
|
|
2863
2877
|
} }), jsxRuntime.jsx("img", { src: tokenImageUrl, alt: tokenSymbol, className: "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full" }), jsxRuntime.jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px] tw-border-b\n tw-border-t tw-border-material-light-thin" })] })) : null, jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-xl tw-w-fit tw-min-w-squid-xl tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-br-full tw-rounded-tr-full tw-border-b tw-border-r tw-border-t tw-border-material-light-thin tw-py-squid-xs tw-pr-squid-xs', tokenImageUrl && 'tw-pl-[7px]'), style: {
|
|
2864
2878
|
backgroundColor: tokenBgColor,
|
|
@@ -6502,7 +6516,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
|
|
|
6502
6516
|
return 'full';
|
|
6503
6517
|
}, [errorMessage, isLoading, isEmpty]);
|
|
6504
6518
|
const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
|
|
6505
|
-
return (jsxRuntime.jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-
|
|
6519
|
+
return (jsxRuntime.jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-card tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500', state === 'error' ? 'tw-px-squid-l' : 'tw-px-squid-m'), children: state === 'error' && errorMessage ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsxRuntime.jsx(Button, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsxRuntime.jsx(Loader, { size: "32" })) : (jsxRuntime.jsx(Tooltip, { tooltipContent: isFlipButtonDisabled ? flipButtonDisabledMessage : undefined, tooltipWidth: "max", children: jsxRuntime.jsx("button", { disabled: isFlipButtonDisabled, onClick: onInvertSwapButtonClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsxRuntime.jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !isFlipButtonDisabled &&
|
|
6506
6520
|
'group-hover/flip-button:tw-rotate-180') }) }) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
|
|
6507
6521
|
}
|
|
6508
6522
|
|
|
@@ -6670,7 +6684,7 @@ function ListItem(_a) {
|
|
|
6670
6684
|
return (jsxRuntime.jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsxRuntime.jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
|
|
6671
6685
|
// 'large' variant has extra padding
|
|
6672
6686
|
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
6673
|
-
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsxRuntime.jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxRuntime.jsxs(CaptionText, { className: subtitleClassName, children: [jsxRuntime.jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover }), subtitle] })) : null)] }), showDetail && (jsxRuntime.jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
|
|
6687
|
+
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsxRuntime.jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxRuntime.jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsxRuntime.jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxRuntime.jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
|
|
6674
6688
|
? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
|
|
6675
6689
|
: 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsxRuntime.jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsxRuntime.jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
|
|
6676
6690
|
}
|
|
@@ -6858,7 +6872,7 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
|
|
|
6858
6872
|
}
|
|
6859
6873
|
|
|
6860
6874
|
function ProductCard({ children }) {
|
|
6861
|
-
return (jsxRuntime.jsx("div", { className: "
|
|
6875
|
+
return (jsxRuntime.jsx("div", { className: "group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-3 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-3 tw-relative tw-flex tw-h-card tw-min-h-card tw-w-card tw-flex-col tw-overflow-hidden tw-rounded-squid-l tw-bg-grey-900 tw-text-grey-300 tw-outline tw-outline-1 tw-outline-material-light-thin", children: children }));
|
|
6862
6876
|
}
|
|
6863
6877
|
function BorderedContainer({ children, className, }) {
|
|
6864
6878
|
return (jsxRuntime.jsx("section", { className: cn('tw-border-t tw-border-t-material-light-thin', className), children: children }));
|
|
@@ -6882,7 +6896,7 @@ function LogoContainer({ children }) {
|
|
|
6882
6896
|
|
|
6883
6897
|
function SwapConfiguration({ amount, tokenPrice = 0, isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, emptyAddressLabel = 'Connect wallet', balance, criticalPriceImpactPercentage, error, priceImpactPercentage, amountUsd, }) {
|
|
6884
6898
|
var _a, _b;
|
|
6885
|
-
return (jsxRuntime.jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-
|
|
6899
|
+
return (jsxRuntime.jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-card tw-overflow-hidden tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-pb-squid-m", children: [jsxRuntime.jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxRuntime.jsxs("button", { onClick: onWalletButtonClick, className: "-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs tw-text-grey-600 hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), jsxRuntime.jsx(BodyText, { size: "small", children: ":" }), jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsxRuntime.jsx(BodyText, { size: "small", className: address ? 'tw-text-grey-300' : 'tw-text-royal-400', children: address ? address : emptyAddressLabel }), jsxRuntime.jsx(ChevronArrowIcon, { className: address ? 'tw-text-grey-600' : 'tw-text-royal-400' })] })] }) }), jsxRuntime.jsx("div", { className: "tw-px-squid-l", children: jsxRuntime.jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), isFetching && (jsxRuntime.jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-l tw-z-10 tw-overflow-hidden", children: jsxRuntime.jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsxRuntime.jsx(NumericInput, { token: {
|
|
6886
6900
|
decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
|
|
6887
6901
|
symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : '',
|
|
6888
6902
|
price: tokenPrice,
|
|
@@ -42409,8 +42423,8 @@ const lightTheme = {
|
|
|
42409
42423
|
// content
|
|
42410
42424
|
'content-100': '#17191C',
|
|
42411
42425
|
'content-200': '#292C32',
|
|
42412
|
-
'content-300': '#
|
|
42413
|
-
'content-400': '#
|
|
42426
|
+
'content-300': '#292C32',
|
|
42427
|
+
'content-400': '#676B7E',
|
|
42414
42428
|
'content-500': '#8A8FA8',
|
|
42415
42429
|
'content-600': '#A7ABBE',
|
|
42416
42430
|
'content-700': '#D1D6E0',
|
|
@@ -42420,7 +42434,7 @@ const lightTheme = {
|
|
|
42420
42434
|
'accent-400': '#9E79D2',
|
|
42421
42435
|
'accent-500': '#B893EC',
|
|
42422
42436
|
// status
|
|
42423
|
-
'status-positive': '#
|
|
42437
|
+
'status-positive': '#17CF26',
|
|
42424
42438
|
'status-negative': '#FF5B4D',
|
|
42425
42439
|
'status-warning': '#EC9213',
|
|
42426
42440
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
type AssetsButtonVariant = 'primary' | 'accent';
|
|
1
2
|
interface AssetsButtonProps {
|
|
2
3
|
tokenImageUrl?: string;
|
|
3
4
|
chainImageUrl?: string;
|
|
@@ -6,6 +7,7 @@ interface AssetsButtonProps {
|
|
|
6
7
|
tokenBgColor?: string;
|
|
7
8
|
tokenTextColor?: string;
|
|
8
9
|
onClick?: () => void;
|
|
10
|
+
variant?: AssetsButtonVariant;
|
|
9
11
|
}
|
|
10
|
-
export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor, tokenBgColor, tokenTextColor, onClick, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DropdownMenuItemProps } from './DropdownMenuItem';
|
|
3
|
-
|
|
3
|
+
import { HistoryItemStatus } from '../../types/components';
|
|
4
4
|
interface HistoryItemProps {
|
|
5
5
|
firstImageUrl: string;
|
|
6
6
|
secondImageUrl: string;
|
|
@@ -3,7 +3,8 @@ import { AssetsButton } from '../../components/buttons/AssetsButton';
|
|
|
3
3
|
declare const meta: Meta<typeof AssetsButton>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const PrimaryVariantEmpty: Story;
|
|
7
|
+
export declare const AccentVariantEmpty: Story;
|
|
7
8
|
export declare const ChainOnly: Story;
|
|
8
9
|
export declare const ChainAndTokenLightText: Story;
|
|
9
10
|
export declare const ChainAndTokenDarkText: Story;
|
|
@@ -4,6 +4,7 @@ export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
|
4
4
|
export type ButtonSize = 'md' | 'lg';
|
|
5
5
|
export type SwapDirection = 'from' | 'to';
|
|
6
6
|
export type BoostMode = 'normal' | 'boost';
|
|
7
|
+
export type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
|
|
7
8
|
export type SwapStepDescriptionBlock = {
|
|
8
9
|
type: 'string';
|
|
9
10
|
value: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { SquidTheme } from './config';
|
|
2
|
-
export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, } from './components';
|
|
2
|
+
export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, HistoryItemStatus, } from './components';
|
package/dist/esm/index.js
CHANGED
|
@@ -2568,7 +2568,7 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
|
|
|
2568
2568
|
setImageLoadState((prevState) => (Object.assign(Object.assign({}, prevState), { badgeLoaded: true })));
|
|
2569
2569
|
}, className: cn(badgeImageClassName,
|
|
2570
2570
|
// hide badge image while it is loading, and display it when it is loaded
|
|
2571
|
-
imagesLoadState.
|
|
2571
|
+
imagesLoadState.badgeLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
|
|
2572
2572
|
}
|
|
2573
2573
|
|
|
2574
2574
|
function LoadingSkeleton({ className, height = '20', }) {
|
|
@@ -2825,8 +2825,22 @@ function PlusIcon() {
|
|
|
2825
2825
|
}
|
|
2826
2826
|
|
|
2827
2827
|
const imageClass = 'tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center';
|
|
2828
|
-
const
|
|
2829
|
-
|
|
2828
|
+
const themeKeyVariantMap = {
|
|
2829
|
+
primary: 'grey-800',
|
|
2830
|
+
accent: 'royal-500',
|
|
2831
|
+
};
|
|
2832
|
+
const buttonTextClassNameMap = {
|
|
2833
|
+
primary: 'tw-text-grey-300',
|
|
2834
|
+
accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
|
|
2835
|
+
};
|
|
2836
|
+
const emptyChainIconTextClassNameMap = {
|
|
2837
|
+
primary: 'tw-text-grey-100',
|
|
2838
|
+
accent: 'group-data-[squid-theme-type=dark]:tw-text-grey-100 group-data-[squid-theme-type=light]:tw-text-grey-900',
|
|
2839
|
+
};
|
|
2840
|
+
function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant = 'primary', }) {
|
|
2841
|
+
const defaultBgColor = `var(${themeTypesKeys[themeKeyVariantMap[variant]].cssVariable})`;
|
|
2842
|
+
const chainBgColor = _chainBgColor !== null && _chainBgColor !== void 0 ? _chainBgColor : defaultBgColor;
|
|
2843
|
+
const tokenBgColor = _tokenBgColor !== null && _tokenBgColor !== void 0 ? _tokenBgColor : defaultBgColor;
|
|
2830
2844
|
const bgGradient = useMemo(() => {
|
|
2831
2845
|
if (!chainImageUrl) {
|
|
2832
2846
|
return `linear-gradient(to right, ${defaultBgColor}, ${defaultBgColor})`;
|
|
@@ -2836,9 +2850,9 @@ function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor
|
|
|
2836
2850
|
}
|
|
2837
2851
|
return `linear-gradient(to right, ${chainBgColor} 43.5%, ${tokenBgColor} 56.55%)`;
|
|
2838
2852
|
}, [chainBgColor, tokenBgColor]);
|
|
2839
|
-
return (jsxs("button", { onClick: onClick, className:
|
|
2853
|
+
return (jsxs("button", { onClick: onClick, className: cn('tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-items-center focus:tw-outline-none', buttonTextClassNameMap[variant]), children: [jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-cursor-pointer tw-text-material-light-thin", viewBox: "0 0 72 40", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: jsx("path", { d: "m57.86 5.86c-.53.53-1.05 1.06-1.56 1.59-3.29 3.38-6.37 6.55-10.3 6.55s-7.01-3.17-10.3-6.55c-.51-.53-1.03-1.06-1.56-1.59-3.9-3.91-9.02-5.86-14.14-5.86s-10.24 1.95-14.14 5.86c-3.91 3.9-5.86 9.02-5.86 14.14s1.95 10.24 5.86 14.14c3.91 3.91 9.02 5.86 14.14 5.86s10.24-1.95 14.14-5.86c.52-.53 1.04-1.06 1.55-1.58 3.29-3.39 6.37-6.56 10.31-6.56s7.02 3.17 10.31 6.56c.51.53 1.03 1.06 1.55 1.58 3.91 3.91 9.02 5.86 14.14 5.86v-40c-5.12 0-10.24 1.95-14.14 5.86zm14.14 33.14c-5.07 0-9.85-1.98-13.43-5.56-.52-.52-1.02-1.04-1.54-1.57-3.43-3.53-6.67-6.86-11.02-6.86s-7.6 3.33-11.04 6.88c-.5.52-1.01 1.04-1.53 1.56-3.59 3.59-8.36 5.57-13.44 5.57s-9.85-1.98-13.43-5.57c-3.59-3.59-5.56-8.36-5.56-13.43s1.98-9.85 5.56-13.44c3.58-3.6 8.35-5.58 13.43-5.58s9.85 1.98 13.44 5.57c.52.52 1.04 1.05 1.55 1.58 3.43 3.53 6.66 6.86 11.02 6.86s7.59-3.33 11.02-6.86c.51-.52 1.02-1.05 1.55-1.58 3.59-3.59 8.36-5.56 13.43-5.56v38z" }) }), jsx("div", { className: cn('tw-assets-button-mask tw-flex tw-h-squid-xl tw-w-[92px] tw-cursor-pointer tw-items-center tw-justify-between', tokenImageUrl ? 'tw-w-[90px]' : 'tw-w-full tw-max-w-[72px]'), style: {
|
|
2840
2854
|
backgroundImage: bgGradient,
|
|
2841
|
-
}, children: jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsx(
|
|
2855
|
+
}, children: jsx("div", { className: clsx(imageClass), children: chainImageUrl ? (jsx("img", { src: chainImageUrl, alt: "", className: "tw-rounded-full" })) : (jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsx(PlusIcon, {}) })) }) }), tokenImageUrl && chainImageUrl ? (jsxs("div", { className: clsx(imageClass, 'tw-absolute tw-left-[54px] tw-h-squid-xl tw-cursor-pointer tw-overflow-hidden'), children: [jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
|
|
2842
2856
|
backgroundColor: tokenBgColor,
|
|
2843
2857
|
} }), jsx("img", { src: tokenImageUrl, alt: tokenSymbol, className: "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full" }), jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px] tw-border-b\n tw-border-t tw-border-material-light-thin" })] })) : null, jsxs("div", { className: cn('tw-flex tw-h-squid-xl tw-w-fit tw-min-w-squid-xl tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-br-full tw-rounded-tr-full tw-border-b tw-border-r tw-border-t tw-border-material-light-thin tw-py-squid-xs tw-pr-squid-xs', tokenImageUrl && 'tw-pl-[7px]'), style: {
|
|
2844
2858
|
backgroundColor: tokenBgColor,
|
|
@@ -6482,7 +6496,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
|
|
|
6482
6496
|
return 'full';
|
|
6483
6497
|
}, [errorMessage, isLoading, isEmpty]);
|
|
6484
6498
|
const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
|
|
6485
|
-
return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-
|
|
6499
|
+
return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-card tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500', state === 'error' ? 'tw-px-squid-l' : 'tw-px-squid-m'), children: state === 'error' && errorMessage ? (jsxs(Fragment, { children: [jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsx(Button, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsx(Loader, { size: "32" })) : (jsx(Tooltip, { tooltipContent: isFlipButtonDisabled ? flipButtonDisabledMessage : undefined, tooltipWidth: "max", children: jsx("button", { disabled: isFlipButtonDisabled, onClick: onInvertSwapButtonClick, className: "tw-group/flip-button tw-flex tw-h-squid-xl tw-min-w-[60px] tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-transparent tw-px-squid-xs tw-py-squid-xxs tw-text-grey-300 hover:tw-bg-material-light-thin disabled:tw-cursor-not-allowed", children: jsx(ChevronLargeDownIcon, { className: cn('tw-transition-transform tw-duration-150', !isFlipButtonDisabled &&
|
|
6486
6500
|
'group-hover/flip-button:tw-rotate-180') }) }) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
|
|
6487
6501
|
}
|
|
6488
6502
|
|
|
@@ -6650,7 +6664,7 @@ function ListItem(_a) {
|
|
|
6650
6664
|
return (jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
|
|
6651
6665
|
// 'large' variant has extra padding
|
|
6652
6666
|
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
6653
|
-
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover }), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
|
|
6667
|
+
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
|
|
6654
6668
|
? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
|
|
6655
6669
|
: 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
|
|
6656
6670
|
}
|
|
@@ -6838,7 +6852,7 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
|
|
|
6838
6852
|
}
|
|
6839
6853
|
|
|
6840
6854
|
function ProductCard({ children }) {
|
|
6841
|
-
return (jsx("div", { className: "
|
|
6855
|
+
return (jsx("div", { className: "group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-3 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-3 tw-relative tw-flex tw-h-card tw-min-h-card tw-w-card tw-flex-col tw-overflow-hidden tw-rounded-squid-l tw-bg-grey-900 tw-text-grey-300 tw-outline tw-outline-1 tw-outline-material-light-thin", children: children }));
|
|
6842
6856
|
}
|
|
6843
6857
|
function BorderedContainer({ children, className, }) {
|
|
6844
6858
|
return (jsx("section", { className: cn('tw-border-t tw-border-t-material-light-thin', className), children: children }));
|
|
@@ -6862,7 +6876,7 @@ function LogoContainer({ children }) {
|
|
|
6862
6876
|
|
|
6863
6877
|
function SwapConfiguration({ amount, tokenPrice = 0, isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, emptyAddressLabel = 'Connect wallet', balance, criticalPriceImpactPercentage, error, priceImpactPercentage, amountUsd, }) {
|
|
6864
6878
|
var _a, _b;
|
|
6865
|
-
return (jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-
|
|
6879
|
+
return (jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-card tw-overflow-hidden tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-pb-squid-m", children: [jsx("header", { className: "tw-flex tw-items-center tw-gap-1 tw-px-squid-l tw-py-squid-xs tw-leading-5 tw-text-grey-300", children: jsxs("button", { onClick: onWalletButtonClick, className: "-tw-ml-squid-xs tw-flex tw-h-squid-l tw-items-center tw-gap-squid-xxs tw-rounded-squid-s tw-px-squid-xs tw-text-grey-600 hover:tw-bg-material-light-thin", children: [jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }), jsx(BodyText, { size: "small", children: ":" }), jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [jsx(BodyText, { size: "small", className: address ? 'tw-text-grey-300' : 'tw-text-royal-400', children: address ? address : emptyAddressLabel }), jsx(ChevronArrowIcon, { className: address ? 'tw-text-grey-600' : 'tw-text-royal-400' })] })] }) }), jsx("div", { className: "tw-px-squid-l", children: jsx(AssetsButton, { onClick: onAssetsButtonClick, chainImageUrl: chain === null || chain === void 0 ? void 0 : chain.iconUrl, tokenImageUrl: token === null || token === void 0 ? void 0 : token.iconUrl, tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol, chainBgColor: chain === null || chain === void 0 ? void 0 : chain.bgColor, tokenBgColor: token === null || token === void 0 ? void 0 : token.bgColor, tokenTextColor: token === null || token === void 0 ? void 0 : token.textColor }) }), isFetching && (jsx("div", { className: "tw-absolute tw-bottom-4 tw-left-squid-l tw-z-10 tw-overflow-hidden", children: jsx("div", { className: "tw-h-[94px] tw-w-[1260px] tw-animate-move-loading-cover-to-right tw-bg-dark-cover" }) })), jsx(NumericInput, { token: {
|
|
6866
6880
|
decimals: (_a = token === null || token === void 0 ? void 0 : token.decimals) !== null && _a !== void 0 ? _a : 18,
|
|
6867
6881
|
symbol: (_b = token === null || token === void 0 ? void 0 : token.symbol) !== null && _b !== void 0 ? _b : '',
|
|
6868
6882
|
price: tokenPrice,
|
|
@@ -42389,8 +42403,8 @@ const lightTheme = {
|
|
|
42389
42403
|
// content
|
|
42390
42404
|
'content-100': '#17191C',
|
|
42391
42405
|
'content-200': '#292C32',
|
|
42392
|
-
'content-300': '#
|
|
42393
|
-
'content-400': '#
|
|
42406
|
+
'content-300': '#292C32',
|
|
42407
|
+
'content-400': '#676B7E',
|
|
42394
42408
|
'content-500': '#8A8FA8',
|
|
42395
42409
|
'content-600': '#A7ABBE',
|
|
42396
42410
|
'content-700': '#D1D6E0',
|
|
@@ -42400,7 +42414,7 @@ const lightTheme = {
|
|
|
42400
42414
|
'accent-400': '#9E79D2',
|
|
42401
42415
|
'accent-500': '#B893EC',
|
|
42402
42416
|
// status
|
|
42403
|
-
'status-positive': '#
|
|
42417
|
+
'status-positive': '#17CF26',
|
|
42404
42418
|
'status-negative': '#FF5B4D',
|
|
42405
42419
|
'status-warning': '#EC9213',
|
|
42406
42420
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
type AssetsButtonVariant = 'primary' | 'accent';
|
|
1
2
|
interface AssetsButtonProps {
|
|
2
3
|
tokenImageUrl?: string;
|
|
3
4
|
chainImageUrl?: string;
|
|
@@ -6,6 +7,7 @@ interface AssetsButtonProps {
|
|
|
6
7
|
tokenBgColor?: string;
|
|
7
8
|
tokenTextColor?: string;
|
|
8
9
|
onClick?: () => void;
|
|
10
|
+
variant?: AssetsButtonVariant;
|
|
9
11
|
}
|
|
10
|
-
export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor, tokenBgColor, tokenTextColor, onClick, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant, }: AssetsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DropdownMenuItemProps } from './DropdownMenuItem';
|
|
3
|
-
|
|
3
|
+
import { HistoryItemStatus } from '../../types/components';
|
|
4
4
|
interface HistoryItemProps {
|
|
5
5
|
firstImageUrl: string;
|
|
6
6
|
secondImageUrl: string;
|
|
@@ -3,7 +3,8 @@ import { AssetsButton } from '../../components/buttons/AssetsButton';
|
|
|
3
3
|
declare const meta: Meta<typeof AssetsButton>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const PrimaryVariantEmpty: Story;
|
|
7
|
+
export declare const AccentVariantEmpty: Story;
|
|
7
8
|
export declare const ChainOnly: Story;
|
|
8
9
|
export declare const ChainAndTokenLightText: Story;
|
|
9
10
|
export declare const ChainAndTokenDarkText: Story;
|
|
@@ -4,6 +4,7 @@ export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
|
4
4
|
export type ButtonSize = 'md' | 'lg';
|
|
5
5
|
export type SwapDirection = 'from' | 'to';
|
|
6
6
|
export type BoostMode = 'normal' | 'boost';
|
|
7
|
+
export type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
|
|
7
8
|
export type SwapStepDescriptionBlock = {
|
|
8
9
|
type: 'string';
|
|
9
10
|
value: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { SquidTheme } from './config';
|
|
2
|
-
export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, } from './components';
|
|
2
|
+
export type { SwapState, ThemeType, SwapStep, SwapStepItemStatus, HistoryItemStatus, } from './components';
|
package/dist/index.css
CHANGED
|
@@ -972,10 +972,6 @@ video {
|
|
|
972
972
|
height: 640px;
|
|
973
973
|
}
|
|
974
974
|
|
|
975
|
-
.tw-h-\[660px\] {
|
|
976
|
-
height: 660px;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
975
|
.tw-h-\[94px\] {
|
|
980
976
|
height: 94px;
|
|
981
977
|
}
|
|
@@ -989,7 +985,7 @@ video {
|
|
|
989
985
|
}
|
|
990
986
|
|
|
991
987
|
.tw-h-card {
|
|
992
|
-
height:
|
|
988
|
+
height: 660px;
|
|
993
989
|
}
|
|
994
990
|
|
|
995
991
|
.tw-h-full {
|
|
@@ -1085,7 +1081,7 @@ video {
|
|
|
1085
1081
|
}
|
|
1086
1082
|
|
|
1087
1083
|
.tw-min-h-card {
|
|
1088
|
-
min-height:
|
|
1084
|
+
min-height: 660px;
|
|
1089
1085
|
}
|
|
1090
1086
|
|
|
1091
1087
|
.tw-min-h-squid-l {
|
|
@@ -1205,10 +1201,6 @@ video {
|
|
|
1205
1201
|
width: 470px;
|
|
1206
1202
|
}
|
|
1207
1203
|
|
|
1208
|
-
.tw-w-\[480px\] {
|
|
1209
|
-
width: 480px;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
1204
|
.tw-w-\[500px\] {
|
|
1213
1205
|
width: 500px;
|
|
1214
1206
|
}
|
|
@@ -1258,7 +1250,7 @@ video {
|
|
|
1258
1250
|
}
|
|
1259
1251
|
|
|
1260
1252
|
.tw-w-card {
|
|
1261
|
-
width:
|
|
1253
|
+
width: 480px;
|
|
1262
1254
|
}
|
|
1263
1255
|
|
|
1264
1256
|
.tw-w-fit {
|
|
@@ -1754,10 +1746,6 @@ video {
|
|
|
1754
1746
|
border-radius: 0.9375rem;
|
|
1755
1747
|
}
|
|
1756
1748
|
|
|
1757
|
-
.tw-rounded-squid-xl {
|
|
1758
|
-
border-radius: 2.5rem;
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
1749
|
.tw-rounded-squid-xs {
|
|
1762
1750
|
border-radius: 0.625rem;
|
|
1763
1751
|
}
|
|
@@ -1850,10 +1838,6 @@ video {
|
|
|
1850
1838
|
border-color: var(--squid-theme-grey-900);
|
|
1851
1839
|
}
|
|
1852
1840
|
|
|
1853
|
-
.tw-border-material-light-thick {
|
|
1854
|
-
border-color: var(--squid-theme-material-light-thick);
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
1841
|
.tw-border-material-light-thin {
|
|
1858
1842
|
border-color: var(--squid-theme-material-light-thin);
|
|
1859
1843
|
}
|
|
@@ -1927,10 +1911,6 @@ video {
|
|
|
1927
1911
|
background-color: var(--squid-theme-material-dark-thin);
|
|
1928
1912
|
}
|
|
1929
1913
|
|
|
1930
|
-
.tw-bg-material-light-thick {
|
|
1931
|
-
background-color: var(--squid-theme-material-light-thick);
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
1914
|
.tw-bg-material-light-thin {
|
|
1935
1915
|
background-color: var(--squid-theme-material-light-thin);
|
|
1936
1916
|
}
|
|
@@ -2992,12 +2972,24 @@ input[type='number'] {
|
|
|
2992
2972
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
2993
2973
|
}
|
|
2994
2974
|
|
|
2975
|
+
.tw-group[data-squid-theme-type=dark] .group-data-\[squid-theme-type\=dark\]\:tw-shadow-elevation-dark-3 {
|
|
2976
|
+
--tw-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.20), 0px 5px 50px -1px rgba(0, 0, 0, 0.33);
|
|
2977
|
+
--tw-shadow-colored: 0px 2px 4px 0px var(--tw-shadow-color), 0px 5px 50px -1px var(--tw-shadow-color);
|
|
2978
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2995
2981
|
.tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-shadow-elevation-light-2 {
|
|
2996
2982
|
--tw-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.10), 0px 5px 20px -1px rgba(0, 0, 0, 0.10);
|
|
2997
2983
|
--tw-shadow-colored: 0px 2px 5px 1px var(--tw-shadow-color), 0px 5px 20px -1px var(--tw-shadow-color);
|
|
2998
2984
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
2999
2985
|
}
|
|
3000
2986
|
|
|
2987
|
+
.tw-group[data-squid-theme-type=light] .group-data-\[squid-theme-type\=light\]\:tw-shadow-elevation-light-3 {
|
|
2988
|
+
--tw-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.10), 0px 5px 50px -1px rgba(0, 0, 0, 0.20);
|
|
2989
|
+
--tw-shadow-colored: 0px 2px 4px 0px var(--tw-shadow-color), 0px 5px 50px -1px var(--tw-shadow-color);
|
|
2990
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
2991
|
+
}
|
|
2992
|
+
|
|
3001
2993
|
.tw-peer[data-boost-mode=boost] ~ .peer-data-\[boost-mode\=boost\]\:tw-bg-status-positive {
|
|
3002
2994
|
background-color: var(--squid-theme-status-positive);
|
|
3003
2995
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface ArrowButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
37
37
|
}
|
|
38
38
|
declare function ArrowButton({ label, disabled, ...props }: ArrowButtonProps): react_jsx_runtime.JSX.Element;
|
|
39
39
|
|
|
40
|
+
type AssetsButtonVariant = 'primary' | 'accent';
|
|
40
41
|
interface AssetsButtonProps {
|
|
41
42
|
tokenImageUrl?: string;
|
|
42
43
|
chainImageUrl?: string;
|
|
@@ -45,8 +46,9 @@ interface AssetsButtonProps {
|
|
|
45
46
|
tokenBgColor?: string;
|
|
46
47
|
tokenTextColor?: string;
|
|
47
48
|
onClick?: () => void;
|
|
49
|
+
variant?: AssetsButtonVariant;
|
|
48
50
|
}
|
|
49
|
-
declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor, tokenBgColor, tokenTextColor, onClick, }: AssetsButtonProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare function AssetsButton({ chainImageUrl, tokenImageUrl, tokenSymbol, chainBgColor: _chainBgColor, tokenBgColor: _tokenBgColor, tokenTextColor, onClick, variant, }: AssetsButtonProps): react_jsx_runtime.JSX.Element;
|
|
50
52
|
|
|
51
53
|
type TextSize = 'small' | 'medium' | 'large';
|
|
52
54
|
type SwitchSize = 'small' | 'large';
|
|
@@ -54,6 +56,7 @@ type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
|
54
56
|
type ButtonSize = 'md' | 'lg';
|
|
55
57
|
type SwapDirection = 'from' | 'to';
|
|
56
58
|
type BoostMode = 'normal' | 'boost';
|
|
59
|
+
type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
|
|
57
60
|
type SwapStepDescriptionBlock = {
|
|
58
61
|
type: 'string';
|
|
59
62
|
value: string;
|
|
@@ -236,7 +239,6 @@ interface DropdownMenuItemProps {
|
|
|
236
239
|
}
|
|
237
240
|
declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
238
241
|
|
|
239
|
-
type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
|
|
240
242
|
interface HistoryItemProps {
|
|
241
243
|
firstImageUrl: string;
|
|
242
244
|
secondImageUrl: string;
|
|
@@ -575,4 +577,4 @@ declare function useDropdownMenu(props?: {
|
|
|
575
577
|
openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
|
|
576
578
|
};
|
|
577
579
|
|
|
578
|
-
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, STEP_ITEM_HEIGHT, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapState, type SwapStep, SwapStepItem, type SwapStepItemStatus, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, Switch, type ThemeType, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
|
|
580
|
+
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, type HistoryItemStatus, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, STEP_ITEM_HEIGHT, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapState, type SwapStep, SwapStepItem, type SwapStepItemStatus, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, Switch, type ThemeType, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
|