@0xsquid/ui 0.10.2 → 0.11.1
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 +106 -50
- package/dist/cjs/types/components/buttons/SettingsButton.d.ts +2 -1
- package/dist/cjs/types/components/controls/SettingsSlider.d.ts +5 -2
- package/dist/cjs/types/components/icons/EmojiSad.d.ts +3 -1
- package/dist/cjs/types/components/icons/Loader.d.ts +2 -1
- package/dist/cjs/types/components/layout/ProductCard.d.ts +4 -0
- package/dist/cjs/types/components/lists/HistoryItem.d.ts +3 -3
- package/dist/cjs/types/components/lists/ListItem.d.ts +2 -1
- package/dist/cjs/types/components/lists/SectionTitle.d.ts +2 -2
- package/dist/cjs/types/components/lists/SettingsItem.d.ts +9 -7
- package/dist/cjs/types/components/views/MainView.d.ts +0 -4
- package/dist/cjs/types/stories/badges/BadgeImage.stories.d.ts +11 -0
- package/dist/cjs/types/stories/badges/LoadingSkeleton.stories.d.ts +6 -0
- package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +2 -2
- package/dist/cjs/types/stories/lists/HistoryItem.stories.d.ts +2 -1
- package/dist/esm/index.js +106 -51
- package/dist/esm/types/components/buttons/SettingsButton.d.ts +2 -1
- package/dist/esm/types/components/controls/SettingsSlider.d.ts +5 -2
- package/dist/esm/types/components/icons/EmojiSad.d.ts +3 -1
- package/dist/esm/types/components/icons/Loader.d.ts +2 -1
- package/dist/esm/types/components/layout/ProductCard.d.ts +4 -0
- package/dist/esm/types/components/lists/HistoryItem.d.ts +3 -3
- package/dist/esm/types/components/lists/ListItem.d.ts +2 -1
- package/dist/esm/types/components/lists/SectionTitle.d.ts +2 -2
- package/dist/esm/types/components/lists/SettingsItem.d.ts +9 -7
- package/dist/esm/types/components/views/MainView.d.ts +0 -4
- package/dist/esm/types/stories/badges/BadgeImage.stories.d.ts +11 -0
- package/dist/esm/types/stories/badges/LoadingSkeleton.stories.d.ts +6 -0
- package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +2 -2
- package/dist/esm/types/stories/lists/HistoryItem.stories.d.ts +2 -1
- package/dist/index.css +102 -27
- package/dist/index.d.ts +28 -17
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2562,7 +2562,7 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
|
|
|
2562
2562
|
}
|
|
2563
2563
|
|
|
2564
2564
|
function LoadingSkeleton({ className, height = '20', }) {
|
|
2565
|
-
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [
|
|
2565
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsx("g", { "clip-path": "url(#clip0_1246_29063)", children: jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_1246_29063", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient tw-text-material-light-thin", children: [jsx("stop", { "stop-color": "currentColor" }), jsx("stop", { offset: "0.395881", "stop-color": "currentColor" }), jsx("stop", { offset: "0.597867", "stop-color": "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-average group-data-[squid-theme-type=light]:tw-text-transparent" }), jsx("stop", { offset: "0.697004", "stop-color": "currentColor" })] }), jsx("clipPath", { id: "clip0_1246_29063", children: jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] }), ' '] }));
|
|
2566
2566
|
}
|
|
2567
2567
|
|
|
2568
2568
|
/******************************************************************************
|
|
@@ -2625,10 +2625,31 @@ function BodyText(_a) {
|
|
|
2625
2625
|
return (jsx("span", Object.assign({}, props, { className: cn(textClassMap$1[size], fontWeightClass, props.className), children: children })));
|
|
2626
2626
|
}
|
|
2627
2627
|
|
|
2628
|
-
function Loader({ size = '24' }) {
|
|
2629
|
-
return (
|
|
2630
|
-
|
|
2631
|
-
|
|
2628
|
+
function Loader({ size = '24', strokeWidth = '1' }) {
|
|
2629
|
+
return (jsxs("svg", { className: "squid-animated-loader", xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: [jsx("style", { children: `
|
|
2630
|
+
.squid-animated-loader-dash {
|
|
2631
|
+
animation: squid-animated-loader-dash-grow 0.5s infinite alternate;
|
|
2632
|
+
}
|
|
2633
|
+
@keyframes squid-animated-loader-dash-grow {
|
|
2634
|
+
0% {
|
|
2635
|
+
stroke-dasharray: 10, 5;
|
|
2636
|
+
}
|
|
2637
|
+
100% {
|
|
2638
|
+
stroke-dasharray: 5, 20;
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
@keyframes squid-animated-loader-rotate {
|
|
2642
|
+
from {
|
|
2643
|
+
transform: rotate(0deg);
|
|
2644
|
+
}
|
|
2645
|
+
to {
|
|
2646
|
+
transform: rotate(-360deg);
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
.squid-animated-loader {
|
|
2650
|
+
animation: squid-animated-loader-rotate 1s linear infinite;
|
|
2651
|
+
transform-origin: center;
|
|
2652
|
+
}` }), jsxs("g", { "clip-path": "url(#clip0_1387_2296)", children: [jsx("circle", { cx: "7.99967", cy: "8.00004", r: "6.66667", stroke: "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-thin group-data-[squid-theme-type=light]:tw-text-material-dark-thin", "stroke-width": strokeWidth }), jsx("path", { className: "squid-animated-loader-dash group-data-[squid-theme-type=dark]:tw-text-material-light-thick group-data-[squid-theme-type=light]:tw-text-material-dark-thick", d: "M14.6663 8.00004C14.6663 7.12456 14.4939 6.25766 14.1589 5.44882C13.8238 4.63998 13.3328 3.90505 12.7137 3.286C12.0947 2.66694 11.3597 2.17588 10.5509 1.84084C9.74206 1.50581 8.87515 1.33337 7.99967 1.33337", stroke: "currentColor", "stroke-width": strokeWidth, "stroke-linecap": "round" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_1387_2296", children: jsx("rect", { width: "16", height: "16", fill: "white" }) }) })] }));
|
|
2632
2653
|
}
|
|
2633
2654
|
|
|
2634
2655
|
function AddressButton(_a) {
|
|
@@ -2922,12 +2943,12 @@ function HeadingText({ children, bold, size }) {
|
|
|
2922
2943
|
return (jsx("h6", { className: clsx(textClassMap[size], fontWeightClass), children: children }));
|
|
2923
2944
|
}
|
|
2924
2945
|
|
|
2925
|
-
function SettingsSlider({ value, type, onChange }) {
|
|
2926
|
-
return (jsxs("div", { className: "tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsx("input", { min: 0, max: 99, placeholder: "0", type: "number", onChange: (e) => {
|
|
2927
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
2946
|
+
function SettingsSlider({ value, type, onChange, hasDecimals, max, min, }) {
|
|
2947
|
+
return (jsxs("div", { className: "tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsx("input", { min: min !== null && min !== void 0 ? min : 0, max: max !== null && max !== void 0 ? max : 99, step: hasDecimals ? 0.1 : 1, placeholder: "0", type: "number", onChange: (e) => {
|
|
2948
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Number(e.target.value));
|
|
2928
2949
|
}, className: cn('tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-bg-transparent tw-p-squid-xs tw-text-caption !tw-font-medium tw-leading-[10px] tw-text-grey-300 placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', type === 'percentage'
|
|
2929
|
-
? 'tw-w-[
|
|
2930
|
-
: 'tw-w-[
|
|
2950
|
+
? 'tw-w-[84px] tw-pr-[52px] tw-text-right'
|
|
2951
|
+
: 'tw-w-[80px] tw-pl-[20px] tw-pr-[32px] tw-text-left'), value: value }), type === 'percentage' && jsx(PercentageDecorator, {}), type === 'amount' && jsx(AmountDecorator, {})] }));
|
|
2931
2952
|
}
|
|
2932
2953
|
function PercentageDecorator() {
|
|
2933
2954
|
return (jsxs("div", { className: "tw-absolute tw-right-squid-xs tw-flex tw-items-center tw-justify-center tw-gap-squid-xs !tw-font-medium tw-leading-[10px]", children: [jsx(CaptionText, { className: "tw-translate-y-[0.5px] !tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: "%" }), jsx(Chip, { icon: jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) })] }));
|
|
@@ -2940,10 +2961,20 @@ const switchSizeClassMap = {
|
|
|
2940
2961
|
small: 'tw-w-[36px] tw-h-squid-m tw-p-0.5',
|
|
2941
2962
|
large: 'tw-w-[54px] tw-h-squid-l tw-p-[3px]',
|
|
2942
2963
|
};
|
|
2943
|
-
const
|
|
2964
|
+
const switchKnobSizeClassMap = {
|
|
2944
2965
|
small: 'tw-w-4 tw-h-4',
|
|
2945
2966
|
large: 'tw-w-6 tw-h-6',
|
|
2946
2967
|
};
|
|
2968
|
+
const switchKnobCheckedClassMap = {
|
|
2969
|
+
large: {
|
|
2970
|
+
checked: 'tw-left-[26px]',
|
|
2971
|
+
unchecked: 'tw-left-[2px]',
|
|
2972
|
+
},
|
|
2973
|
+
small: {
|
|
2974
|
+
checked: 'tw-left-[17px]',
|
|
2975
|
+
unchecked: 'tw-left-[1px]',
|
|
2976
|
+
},
|
|
2977
|
+
};
|
|
2947
2978
|
function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
2948
2979
|
return (
|
|
2949
2980
|
// Switch container
|
|
@@ -2957,11 +2988,11 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
|
2957
2988
|
filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
|
|
2958
2989
|
}, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
|
|
2959
2990
|
// size styles
|
|
2960
|
-
|
|
2961
|
-
//
|
|
2962
|
-
checked
|
|
2963
|
-
? 'tw-
|
|
2964
|
-
: '
|
|
2991
|
+
switchKnobSizeClassMap[size],
|
|
2992
|
+
// checked styles
|
|
2993
|
+
switchKnobCheckedClassMap[size][checked ? 'checked' : 'unchecked'], checked
|
|
2994
|
+
? 'group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900'
|
|
2995
|
+
: 'tw-bg-grey-500') })] }));
|
|
2965
2996
|
}
|
|
2966
2997
|
|
|
2967
2998
|
const borderRadiusClassMap = {
|
|
@@ -3079,8 +3110,8 @@ function FeeButton(_a) {
|
|
|
3079
3110
|
return (jsxs("button", Object.assign({}, props, { className: cn('tw-flex tw-h-squid-xl tw-w-full tw-items-center tw-gap-x-squid-xs tw-rounded-squid-m tw-px-squid-xs hover:tw-bg-material-light-thin', className), children: [jsx(Chip, { label: chipLabel }), jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(Chip, { icon: jsx(EthereumIcon, {}) }), jsx(UsdAmount, { usdAmount: feeInUsd })] })] })));
|
|
3080
3111
|
}
|
|
3081
3112
|
|
|
3082
|
-
function SettingsButton({ label, isSelected = false, }) {
|
|
3083
|
-
return (jsx("button", { className: cn('tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', isSelected && 'tw-outline-royal-500'), children: jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
|
|
3113
|
+
function SettingsButton({ label, isSelected = false, onClick, }) {
|
|
3114
|
+
return (jsx("button", { onClick: onClick, className: cn('tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', isSelected && 'tw-outline-royal-500'), children: jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
|
|
3084
3115
|
}
|
|
3085
3116
|
|
|
3086
3117
|
function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, boostTooltipDisplayDelayMs = 0, }) {
|
|
@@ -3089,8 +3120,8 @@ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessa
|
|
|
3089
3120
|
: 'tw-bg-status-positive') })] }));
|
|
3090
3121
|
}
|
|
3091
3122
|
|
|
3092
|
-
function EmojiSadIcon() {
|
|
3093
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20ZM13.5341 12.4645C11.5815 10.5118 8.41568 10.5118 6.46306 12.4645C6.07254 12.855 6.07254 13.4882 6.46306 13.8787C6.85358 14.2692 7.48675 14.2692 7.87727 13.8787C9.04885 12.7071 10.9483 12.7071 12.1199 13.8787C12.5104 14.2692 13.1436 14.2692 13.5341 13.8787C13.9247 13.4882 13.9247 12.855 13.5341 12.4645ZM8.5 7.5C8.5 8.32843 7.94036 9 7.25 9C6.55964 9 6 8.32843 6 7.5C6 6.67157 6.55964 6 7.25 6C7.94036 6 8.5 6.67157 8.5 7.5ZM12.75 9C13.4404 9 14 8.32843 14 7.5C14 6.67157 13.4404 6 12.75 6C12.0596 6 11.5 6.67157 11.5 7.5C11.5 8.32843 12.0596 9 12.75 9Z", fill: "currentColor" }) }));
|
|
3123
|
+
function EmojiSadIcon({ className }) {
|
|
3124
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", className: className, children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20ZM13.5341 12.4645C11.5815 10.5118 8.41568 10.5118 6.46306 12.4645C6.07254 12.855 6.07254 13.4882 6.46306 13.8787C6.85358 14.2692 7.48675 14.2692 7.87727 13.8787C9.04885 12.7071 10.9483 12.7071 12.1199 13.8787C12.5104 14.2692 13.1436 14.2692 13.5341 13.8787C13.9247 13.4882 13.9247 12.855 13.5341 12.4645ZM8.5 7.5C8.5 8.32843 7.94036 9 7.25 9C6.55964 9 6 8.32843 6 7.5C6 6.67157 6.55964 6 7.25 6C7.94036 6 8.5 6.67157 8.5 7.5ZM12.75 9C13.4404 9 14 8.32843 14 7.5C14 6.67157 13.4404 6 12.75 6C12.0596 6 11.5 6.67157 11.5 7.5C11.5 8.32843 12.0596 9 12.75 9Z", fill: "currentColor" }) }));
|
|
3094
3125
|
}
|
|
3095
3126
|
|
|
3096
3127
|
function ErrorMessage({ message, showIcon = true }) {
|
|
@@ -3114,7 +3145,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
|
|
|
3114
3145
|
return 'full';
|
|
3115
3146
|
}, [errorMessage, isLoading, isEmpty]);
|
|
3116
3147
|
const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
|
|
3117
|
-
return (jsx("aside", { className: cn('tw-h-
|
|
3148
|
+
return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-[480px] 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(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsx(ChevronLargeDownIcon, {}) })) }), 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 }) })] })) }));
|
|
3118
3149
|
}
|
|
3119
3150
|
|
|
3120
3151
|
function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }) {
|
|
@@ -3164,11 +3195,46 @@ const dropdownPositionClassMap = {
|
|
|
3164
3195
|
bottom: 'tw-right-[calc(100%-10px)] tw-top-7',
|
|
3165
3196
|
center: 'tw-right-[40px] -tw-top-[55px]',
|
|
3166
3197
|
};
|
|
3167
|
-
|
|
3198
|
+
const statusBadge = {
|
|
3199
|
+
completed: {},
|
|
3200
|
+
pending: {
|
|
3201
|
+
badge: jsx(Loader, { size: "16", strokeWidth: "2" }),
|
|
3202
|
+
containerClassName: 'tw-bg-royal-400',
|
|
3203
|
+
},
|
|
3204
|
+
failed: {
|
|
3205
|
+
badge: (jsx("span", { className: "group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900", children: jsx(EmojiSadIcon, { className: "tw-text-status-negative" }) })),
|
|
3206
|
+
containerClassName: 'tw-bg-status-negative',
|
|
3207
|
+
},
|
|
3208
|
+
};
|
|
3209
|
+
function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }) {
|
|
3168
3210
|
const { isDropdownOpen, dropdownRef, openDropdownButtonRef, openDropdown } = useDropdownMenu();
|
|
3169
3211
|
const [dropdownPosition, setDropdownPosition] = useState(null);
|
|
3170
3212
|
const itemRef = useRef(null);
|
|
3171
3213
|
const menuRef = useRef(null);
|
|
3214
|
+
const statusInfo = useMemo(() => {
|
|
3215
|
+
switch (status) {
|
|
3216
|
+
case 'completed':
|
|
3217
|
+
return {
|
|
3218
|
+
label: dateCompleted,
|
|
3219
|
+
className: '',
|
|
3220
|
+
};
|
|
3221
|
+
case 'pending':
|
|
3222
|
+
return {
|
|
3223
|
+
label: 'Pending',
|
|
3224
|
+
className: 'tw-text-royal-400',
|
|
3225
|
+
};
|
|
3226
|
+
case 'failed':
|
|
3227
|
+
return {
|
|
3228
|
+
label: 'Failed',
|
|
3229
|
+
className: 'tw-text-status-negative',
|
|
3230
|
+
};
|
|
3231
|
+
default:
|
|
3232
|
+
return {
|
|
3233
|
+
label: '',
|
|
3234
|
+
className: '',
|
|
3235
|
+
};
|
|
3236
|
+
}
|
|
3237
|
+
}, [status, dateCompleted]);
|
|
3172
3238
|
// Effect to find the best position for the dropdown menu, so it's always visible for the user
|
|
3173
3239
|
useEffect(() => {
|
|
3174
3240
|
var _a;
|
|
@@ -3213,8 +3279,8 @@ function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted,
|
|
|
3213
3279
|
setDropdownPosition('top');
|
|
3214
3280
|
}
|
|
3215
3281
|
}, [isDropdownOpen, menuRef, dropdownPosition, itemRef]);
|
|
3216
|
-
return (jsx("li", { ref: itemRef, className: "tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", children: jsxs("div", { className: "tw-group/history-item tw-relative tw-flex tw-flex-shrink-0 tw-cursor-pointer tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin", children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [
|
|
3217
|
-
'tw-transition-opacity group-hover/history-item:tw-hidden group-hover/history-item:tw-opacity-0 peer-focus:tw-hidden peer-focus:tw-opacity-0'), children:
|
|
3282
|
+
return (jsx("li", { ref: itemRef, className: "tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", children: jsxs("div", { className: "tw-group/history-item tw-relative tw-flex tw-flex-shrink-0 tw-cursor-pointer tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin", children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsx("span", { className: cn('tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5', statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), !!dropdownMenuItems && (jsx("button", { className: "tw-peer tw-absolute tw-right-squid-xxs tw-top-squid-xxs tw-flex tw-h-squid-xl tw-w-squid-xl tw-items-center tw-justify-center tw-rounded-squid-xs tw-bg-material-light-thin tw-p-2 tw-text-grey-300 tw-opacity-0 tw-transition-opacity focus:tw-opacity-100 group-hover/history-item:tw-opacity-100", onClick: openDropdown, ref: openDropdownButtonRef, children: jsx(DotGrid1x3HorizontalIcon, { size: "24" }) })), jsx("div", { className: cn(!!dropdownMenuItems &&
|
|
3283
|
+
'tw-transition-opacity group-hover/history-item:tw-hidden group-hover/history-item:tw-opacity-0 peer-focus:tw-hidden peer-focus:tw-opacity-0'), children: statusInfo.label && (jsx(CaptionText, { className: statusInfo.className, children: statusInfo.label })) })] }), jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsx(BodyText, { size: "small", children: fromAmount }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronLargeRightIcon, {}) }), jsx(BodyText, { size: "small", children: toAmount })] })] }), isDropdownOpen && !!dropdownMenuItems ? (jsx(DropdownMenu, { menuRef: menuRef,
|
|
3218
3284
|
// only show dropdown menu if there is a position defined for it
|
|
3219
3285
|
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] }) }));
|
|
3220
3286
|
}
|
|
@@ -3224,10 +3290,10 @@ const listItemSizeMap = {
|
|
|
3224
3290
|
large: 'tw-max-w-list-item-large tw-h-list-item-large tw-px-squid-xs',
|
|
3225
3291
|
};
|
|
3226
3292
|
function ListItem(_a) {
|
|
3227
|
-
var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading"]);
|
|
3293
|
+
var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
|
|
3228
3294
|
// 'small' variant does not have detail
|
|
3229
3295
|
const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
|
|
3230
|
-
return (jsx("li", { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs("button", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && '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-xs',
|
|
3296
|
+
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("button", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && '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-xs',
|
|
3231
3297
|
// 'large' variant has extra padding
|
|
3232
3298
|
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: "tw-max-w-full tw-truncate !tw-leading-[17px]", children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
3233
3299
|
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsx(CaptionText, { className: "tw-h-squid-xs tw-max-w-full tw-truncate !tw-leading-[11px] tw-text-grey-500", children: subtitle })) : null)] }), showDetail && (jsxs("button", { onClick: (event) => {
|
|
@@ -3236,22 +3302,23 @@ function ListItem(_a) {
|
|
|
3236
3302
|
onDetailClick === null || onDetailClick === void 0 ? void 0 : onDetailClick();
|
|
3237
3303
|
}, className: cn('tw-flex tw-w-fit tw-cursor-pointer tw-items-center tw-justify-center tw-rounded-squid-xs hover:tw-bg-material-light-thin', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
|
|
3238
3304
|
? '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'
|
|
3239
|
-
: 'tw-flex', 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] }))] })) }));
|
|
3305
|
+
: 'tw-flex', 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] }))] })) })));
|
|
3240
3306
|
}
|
|
3241
3307
|
|
|
3242
3308
|
function MenuItem({ label, imageUrl, icon }) {
|
|
3243
3309
|
return (jsxs("li", { className: "tw-mx-squid-xxs tw-inline-flex tw-max-h-list-item-small tw-items-center tw-justify-start tw-gap-squid-xxs tw-rounded-squid-xs tw-bg-grey-900 tw-py-squid-xxs tw-pl-squid-xxs tw-pr-squid-xl tw-text-grey-300", children: [jsx("div", { className: "tw-h-squid-m tw-w-squid-m", children: imageUrl ? (jsx("img", { className: "tw-h-full tw-w-full tw-rounded-squid-xxs", src: imageUrl, alt: "" })) : icon ? (icon) : null }), jsx(CaptionText, { children: label })] }));
|
|
3244
3310
|
}
|
|
3245
3311
|
|
|
3246
|
-
function SectionTitle(
|
|
3247
|
-
|
|
3312
|
+
function SectionTitle(_a) {
|
|
3313
|
+
var { title, icon, accessory, actionIcon, className } = _a, props = __rest(_a, ["title", "icon", "accessory", "actionIcon", "className"]);
|
|
3314
|
+
return (jsxs("header", Object.assign({}, props, { className: cn('tw-flex tw-h-[46px] tw-w-full tw-items-center tw-gap-squid-xxs tw-bg-grey-900 tw-px-squid-m tw-pb-squid-xs tw-pt-squid-m tw-text-royal-400', className), children: [icon, jsx(CaptionText, { children: title }), accessory ? (jsx(CaptionText, { className: "tw-flex-1 tw-text-right tw-text-grey-500", children: accessory })) : actionIcon ? (jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end", children: actionIcon })) : null] })));
|
|
3248
3315
|
}
|
|
3249
3316
|
|
|
3250
3317
|
function HelpIcon({ size = '20', className, }) {
|
|
3251
3318
|
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsx("g", { "clip-path": "url(#clip0_457_36778)", children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10ZM6 7C6 4.46214 8.03736 3 10 3C12.1193 3 14 4.66531 14 7C14 7.93746 13.7596 8.6603 13.368 9.2586C13.0353 9.76679 12.6034 10.1601 12.2697 10.4639L12.1757 10.5497C11.8041 10.8904 11.534 11.1593 11.337 11.504C11.1513 11.8288 11 12.2794 11 13C11 13.5523 10.5523 14 10 14C9.44772 14 9 13.5523 9 13C9 11.9706 9.22366 11.1712 9.60051 10.5117C9.96604 9.87199 10.4459 9.42214 10.8243 9.07535L10.8834 9.02116L10.8834 9.02116L10.8834 9.02115C11.2572 8.67885 11.5066 8.45039 11.6945 8.16328C11.8654 7.9022 12 7.56254 12 7C12 5.83469 11.0807 5 10 5C8.96264 5 8 5.73786 8 7C8 7.55228 7.55228 8 7 8C6.44772 8 6 7.55228 6 7ZM10 15C9.44771 15 9 15.4477 9 16C9 16.5523 9.44771 17 10 17C10.5523 17 11 16.5523 11 16C11 15.4477 10.5523 15 10 15Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: "clip0_457_36778", children: jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] }));
|
|
3252
3319
|
}
|
|
3253
3320
|
|
|
3254
|
-
function SettingsItem({ icon, label,
|
|
3321
|
+
function SettingsItem({ icon, label, control, link, transparent = false, helpTooltip, }) {
|
|
3255
3322
|
const ContentTag = link ? 'a' : 'div';
|
|
3256
3323
|
const contentTagProps = link
|
|
3257
3324
|
? {
|
|
@@ -3260,25 +3327,10 @@ function SettingsItem({ icon, label, controls = [], link, transparent = false, h
|
|
|
3260
3327
|
}
|
|
3261
3328
|
: {};
|
|
3262
3329
|
const helpIcon = !!helpTooltip && (jsx(HelpIcon, { className: cn('tw-text-grey-600', 'tw-cursor-help tw-transition-colors tw-duration-200 hover:tw-text-grey-400') }));
|
|
3263
|
-
const showDetailsBorder =
|
|
3264
|
-
!link &&
|
|
3265
|
-
!controls.some((control) => control.type === 'switch');
|
|
3330
|
+
const showDetailsBorder = !!control && !link && !(control.type === 'switch');
|
|
3266
3331
|
return (jsx("li", { className: cn('tw-h-[50px] tw-self-stretch tw-px-squid-xs', transparent ? 'tw-bg-transparent' : 'tw-bg-grey-800'), children: jsxs(ContentTag, Object.assign({ className: cn('tw-flex tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xs tw-text-grey-300', link && 'hover:tw-bg-material-light-thin') }, contentTagProps, { children: [icon, jsxs("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: [jsx(BodyText, { size: "small", children: label }), helpTooltip ? (jsx(Tooltip, Object.assign({}, helpTooltip, { children: helpIcon }))) : (jsx(Fragment, { children: helpIcon }))] }), jsx("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-rounded-squid-xs', showDetailsBorder &&
|
|
3267
|
-
'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (
|
|
3268
|
-
|
|
3269
|
-
const switchControl = (jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }, index));
|
|
3270
|
-
if (control.tooltip) {
|
|
3271
|
-
return jsx(Tooltip, Object.assign({}, control.tooltip, { children: switchControl }));
|
|
3272
|
-
}
|
|
3273
|
-
return switchControl;
|
|
3274
|
-
}
|
|
3275
|
-
if (control.type === 'percentage') {
|
|
3276
|
-
return (jsxs(Fragment, { children: [jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.isSelected }), jsx(SettingsSlider, { value: control.value, type: "percentage" })] }));
|
|
3277
|
-
}
|
|
3278
|
-
if (control.type === 'amount') {
|
|
3279
|
-
return (jsxs(Fragment, { children: [jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.isSelected }), control.options.map(({ value, isSelected }, index, _controls) => (jsx(SettingsButton, { label: '$' + value, isSelected: isSelected }, index))), jsx(SettingsSlider, { type: control.type, value: 0 })] }));
|
|
3280
|
-
}
|
|
3281
|
-
})) })] })) }));
|
|
3332
|
+
'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (!!control && (jsxs(Fragment, { children: [control.type === 'amount' && (jsxs(Fragment, { children: [jsx(SettingsButton, { onClick: () => control.onChange(control.resetValueControl.value), label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value }), control.options.map(({ value }, index, _controls) => (jsx(SettingsButton, { label: '$' + value, isSelected: control.value === value, onClick: () => control.onChange(value) }, index))), jsx(SettingsSlider, { type: control.type, value: control.value, onChange: control.onChange, hasDecimals: false, max: 999 })] })), control.type === 'switch' &&
|
|
3333
|
+
(control.tooltip ? (jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxs(Fragment, { children: [jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", hasDecimals: control.hasDecimals, max: control.max, min: control.min })] }))] }))) })] })) }));
|
|
3282
3334
|
}
|
|
3283
3335
|
|
|
3284
3336
|
function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
|
|
@@ -3377,7 +3429,10 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
|
|
|
3377
3429
|
}
|
|
3378
3430
|
|
|
3379
3431
|
function ProductCard({ children }) {
|
|
3380
|
-
return (jsx("div", { className: "tw-h-card tw-min-h-card tw-w-card tw-rounded-squid-xl tw-border-[1px] tw-border-solid tw-border-material-light-thick tw-bg-material-light-thick tw-p-squid-xs tw-backdrop-blur/10 tw-backdrop-saturate-150", children: jsx("div", { className: "tw-relative tw-flex tw-h-
|
|
3432
|
+
return (jsx("div", { className: "tw-h-card tw-min-h-card tw-w-card tw-rounded-squid-xl tw-border-[1px] tw-border-solid tw-border-material-light-thick tw-bg-material-light-thick tw-p-squid-xs tw-backdrop-blur/10 tw-backdrop-saturate-150", children: jsx("div", { className: "tw-relative tw-flex tw-h-[660px] tw-w-full tw-flex-col tw-overflow-hidden tw-rounded-squid-l tw-bg-grey-900 tw-text-grey-300", children: children }) }));
|
|
3433
|
+
}
|
|
3434
|
+
function BorderedContainer({ children, className, }) {
|
|
3435
|
+
return (jsx("section", { className: cn('tw-border-t tw-border-t-material-light-thin', className), children: children }));
|
|
3381
3436
|
}
|
|
3382
3437
|
|
|
3383
3438
|
function SquidLogo() {
|
|
@@ -3414,7 +3469,7 @@ function SwapConfiguration({ priceImpactPercentage, amount, forcedAmount, swapAm
|
|
|
3414
3469
|
const BalanceChipTag = isBalanceChipInteractive ? 'button' : 'div';
|
|
3415
3470
|
const isSwapAmountChipInteractive = !!onSwapAmountButtonClick;
|
|
3416
3471
|
const SwapAmountChipTag = isSwapAmountChipInteractive ? 'button' : 'div';
|
|
3417
|
-
return (jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] 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 }) }), direction === 'from' ? (jsx(NumericInput, { forcedUpdateValue: forcedAmount, initialValue: amount, onParsedValueChanged: (value) => onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value) })) : (jsx("div", { className:
|
|
3472
|
+
return (jsxs("section", { className: "tw-relative tw-h-[205px] tw-max-h-[205px] tw-w-[480px] 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-animate-move-loading-cover-to-right tw-bg-dark-cover tw-h-[94px] tw-w-[1260px]" }) })), direction === 'from' ? (jsx(NumericInput, { forcedUpdateValue: forcedAmount, initialValue: amount, onParsedValueChanged: (value) => onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value) })) : (jsx("div", { className: cn('tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]', isFetching && 'tw-opacity-50'), children: jsx("div", { className: "tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300", children: jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) ? null : (jsxs("footer", { className: cn('tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-m tw-text-grey-500', isFetching && 'tw-opacity-50'), children: [error ? (jsx("div", { className: "tw-px-squid-xs", children: jsx(ErrorMessage, { message: error.message }) })) : (jsxs(SwapAmountChipTag, { onClick: onSwapAmountButtonClick, className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isSwapAmountChipInteractive && interactiveChipClassName), children: [jsx(SwapInputsIcon, {}), jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsx(ArrowTriangle, {}), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] })), jsxs(BalanceChipTag, { onClick: onBalanceButtonClick, className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isBalanceChipInteractive && interactiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balance }), jsx(MaxIcon, {})] })] }))] }));
|
|
3418
3473
|
}
|
|
3419
3474
|
|
|
3420
3475
|
function SwapProgressViewHeader({ title, description, }) {
|
|
@@ -3603,4 +3658,4 @@ function SquidConfigProvider({ theme = lightTheme, children, themeType = 'light'
|
|
|
3603
3658
|
return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-font-geist", children: children }));
|
|
3604
3659
|
}
|
|
3605
3660
|
|
|
3606
|
-
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
|
|
3661
|
+
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface SettingsButtonProps {
|
|
2
2
|
label: string;
|
|
3
3
|
isSelected?: boolean;
|
|
4
|
+
onClick?: () => void;
|
|
4
5
|
}
|
|
5
|
-
export declare function SettingsButton({ label, isSelected, }: SettingsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function SettingsButton({ label, isSelected, onClick, }: SettingsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export interface SettingsSliderProps {
|
|
2
2
|
value: number;
|
|
3
3
|
type: 'percentage' | 'amount';
|
|
4
|
-
onChange?: (value:
|
|
4
|
+
onChange?: (value: number) => void;
|
|
5
|
+
hasDecimals?: boolean;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
5
8
|
}
|
|
6
|
-
export declare function SettingsSlider({ value, type, onChange }: SettingsSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function SettingsSlider({ value, type, onChange, hasDecimals, max, min, }: SettingsSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface LoaderProps {
|
|
2
2
|
size?: string;
|
|
3
|
+
strokeWidth?: string;
|
|
3
4
|
}
|
|
4
|
-
export declare function Loader({ size }: LoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function Loader({ size, strokeWidth }: LoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export {};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare function ProductCard({ children }: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function BorderedContainer({ children, className, }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DropdownMenuItemProps } from './DropdownMenuItem';
|
|
3
|
+
type HistoryItemStatus = 'completed' | 'pending' | 'failed';
|
|
3
4
|
interface HistoryItemProps {
|
|
4
5
|
firstImageUrl: string;
|
|
5
6
|
secondImageUrl: string;
|
|
6
|
-
|
|
7
|
+
status: HistoryItemStatus;
|
|
7
8
|
fromLabel: string;
|
|
8
9
|
toLabel: string;
|
|
9
|
-
pendingLabel?: string;
|
|
10
10
|
dateCompleted: string;
|
|
11
11
|
fromAmount: string;
|
|
12
12
|
toAmount: string;
|
|
13
13
|
dropdownMenuItems?: DropdownMenuItemProps[];
|
|
14
14
|
itemsContainerRef?: React.RefObject<HTMLElement>;
|
|
15
15
|
}
|
|
16
|
-
export declare function HistoryItem({ firstImageUrl, secondImageUrl,
|
|
16
|
+
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -17,7 +17,8 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
17
17
|
loading?: {
|
|
18
18
|
subtitle?: boolean;
|
|
19
19
|
};
|
|
20
|
+
containerProps?: React.HTMLAttributes<HTMLLIElement>;
|
|
20
21
|
}
|
|
21
22
|
type ListItemSize = 'small' | 'large';
|
|
22
|
-
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
interface SectionTitleProps {
|
|
2
|
+
interface SectionTitleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
title: string;
|
|
4
4
|
icon?: React.ReactNode;
|
|
5
5
|
accessory?: string | null;
|
|
6
6
|
actionIcon?: React.ReactNode;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function SectionTitle({ title, icon, accessory, actionIcon, className, }: SectionTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function SectionTitle({ title, icon, accessory, actionIcon, className, ...props }: SectionTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -4,22 +4,24 @@ export type SettingsControl = {
|
|
|
4
4
|
type: 'percentage';
|
|
5
5
|
value: number;
|
|
6
6
|
onChange: (value: number) => void;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
hasDecimals?: boolean;
|
|
7
10
|
resetValueControl: {
|
|
8
11
|
label: string;
|
|
9
12
|
onSelect: () => void;
|
|
10
|
-
|
|
13
|
+
value: number;
|
|
11
14
|
};
|
|
12
15
|
} | {
|
|
13
16
|
type: 'amount';
|
|
17
|
+
value: number;
|
|
18
|
+
onChange: (value: number) => void;
|
|
14
19
|
options: {
|
|
15
20
|
value: number;
|
|
16
|
-
isSelected?: boolean;
|
|
17
|
-
onSelect?: () => void;
|
|
18
21
|
}[];
|
|
19
22
|
resetValueControl: {
|
|
20
23
|
label: string;
|
|
21
|
-
|
|
22
|
-
isSelected?: boolean;
|
|
24
|
+
value: number;
|
|
23
25
|
};
|
|
24
26
|
} | {
|
|
25
27
|
type: 'switch';
|
|
@@ -31,9 +33,9 @@ export type SettingsControl = {
|
|
|
31
33
|
export interface SettingsItemProps {
|
|
32
34
|
icon: React.ReactNode;
|
|
33
35
|
label: string;
|
|
34
|
-
|
|
36
|
+
control?: SettingsControl;
|
|
35
37
|
link?: string;
|
|
36
38
|
transparent?: boolean;
|
|
37
39
|
helpTooltip?: Omit<TooltipProps, 'children'>;
|
|
38
40
|
}
|
|
39
|
-
export declare function SettingsItem({ icon, label,
|
|
41
|
+
export declare function SettingsItem({ icon, label, control, link, transparent, helpTooltip, }: SettingsItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { BadgeImage } from '../../components/badges/BadgeImage';
|
|
3
|
+
declare const meta: Meta<typeof BadgeImage>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const ImageOnly: Story;
|
|
7
|
+
export declare const BadgeAndImage: Story;
|
|
8
|
+
export declare const ExtraMarginForBadge: Story;
|
|
9
|
+
export declare const Rounded: Story;
|
|
10
|
+
export declare const SizeMedium: Story;
|
|
11
|
+
export declare const SizeSmall: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { LoadingSkeleton } from '../../components/badges/LoadingSkeleton';
|
|
3
|
+
declare const meta: Meta<typeof LoadingSkeleton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
@@ -3,11 +3,11 @@ import { SwapConfiguration } from '../../components/layout/SwapConfiguration';
|
|
|
3
3
|
declare const meta: Meta<typeof SwapConfiguration>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Empty: Story;
|
|
7
7
|
export declare const ChainOnly: Story;
|
|
8
8
|
export declare const ChainAndToken: Story;
|
|
9
|
-
export declare const WithAmount: Story;
|
|
10
9
|
export declare const WithSwapAmountUsd: Story;
|
|
10
|
+
export declare const Address: Story;
|
|
11
11
|
export declare const WithBalance: Story;
|
|
12
12
|
export declare const LowPriceImpact: Story;
|
|
13
13
|
export declare const HighPriceImpact: Story;
|
|
@@ -3,6 +3,7 @@ import { HistoryItem } from '../../components/lists/HistoryItem';
|
|
|
3
3
|
declare const meta: Meta<typeof HistoryItem>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Completed: Story;
|
|
7
7
|
export declare const Pending: Story;
|
|
8
|
+
export declare const Failed: Story;
|
|
8
9
|
export declare const WithActions: Story;
|