@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/cjs/index.js
CHANGED
|
@@ -2564,7 +2564,7 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
|
|
|
2564
2564
|
}
|
|
2565
2565
|
|
|
2566
2566
|
function LoadingSkeleton({ className, height = '20', }) {
|
|
2567
|
-
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsxRuntime.
|
|
2567
|
+
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_1246_29063)", children: jsxRuntime.jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxRuntime.jsxs("defs", { children: [jsxRuntime.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: [jsxRuntime.jsx("stop", { "stop-color": "currentColor" }), jsxRuntime.jsx("stop", { offset: "0.395881", "stop-color": "currentColor" }), jsxRuntime.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" }), jsxRuntime.jsx("stop", { offset: "0.697004", "stop-color": "currentColor" })] }), jsxRuntime.jsx("clipPath", { id: "clip0_1246_29063", children: jsxRuntime.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" }) })] }), ' '] }));
|
|
2568
2568
|
}
|
|
2569
2569
|
|
|
2570
2570
|
/******************************************************************************
|
|
@@ -2627,10 +2627,31 @@ function BodyText(_a) {
|
|
|
2627
2627
|
return (jsxRuntime.jsx("span", Object.assign({}, props, { className: cn(textClassMap$1[size], fontWeightClass, props.className), children: children })));
|
|
2628
2628
|
}
|
|
2629
2629
|
|
|
2630
|
-
function Loader({ size = '24' }) {
|
|
2631
|
-
return (
|
|
2632
|
-
|
|
2633
|
-
|
|
2630
|
+
function Loader({ size = '24', strokeWidth = '1' }) {
|
|
2631
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("style", { children: `
|
|
2632
|
+
.squid-animated-loader-dash {
|
|
2633
|
+
animation: squid-animated-loader-dash-grow 0.5s infinite alternate;
|
|
2634
|
+
}
|
|
2635
|
+
@keyframes squid-animated-loader-dash-grow {
|
|
2636
|
+
0% {
|
|
2637
|
+
stroke-dasharray: 10, 5;
|
|
2638
|
+
}
|
|
2639
|
+
100% {
|
|
2640
|
+
stroke-dasharray: 5, 20;
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
@keyframes squid-animated-loader-rotate {
|
|
2644
|
+
from {
|
|
2645
|
+
transform: rotate(0deg);
|
|
2646
|
+
}
|
|
2647
|
+
to {
|
|
2648
|
+
transform: rotate(-360deg);
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
.squid-animated-loader {
|
|
2652
|
+
animation: squid-animated-loader-rotate 1s linear infinite;
|
|
2653
|
+
transform-origin: center;
|
|
2654
|
+
}` }), jsxRuntime.jsxs("g", { "clip-path": "url(#clip0_1387_2296)", children: [jsxRuntime.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 }), jsxRuntime.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" })] }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_1387_2296", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white" }) }) })] }));
|
|
2634
2655
|
}
|
|
2635
2656
|
|
|
2636
2657
|
function AddressButton(_a) {
|
|
@@ -2924,12 +2945,12 @@ function HeadingText({ children, bold, size }) {
|
|
|
2924
2945
|
return (jsxRuntime.jsx("h6", { className: clsx(textClassMap[size], fontWeightClass), children: children }));
|
|
2925
2946
|
}
|
|
2926
2947
|
|
|
2927
|
-
function SettingsSlider({ value, type, onChange }) {
|
|
2928
|
-
return (jsxRuntime.jsxs("div", { className: "tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.jsx("input", { min: 0, max: 99, placeholder: "0", type: "number", onChange: (e) => {
|
|
2929
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
2948
|
+
function SettingsSlider({ value, type, onChange, hasDecimals, max, min, }) {
|
|
2949
|
+
return (jsxRuntime.jsxs("div", { className: "tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.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) => {
|
|
2950
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Number(e.target.value));
|
|
2930
2951
|
}, 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'
|
|
2931
|
-
? 'tw-w-[
|
|
2932
|
-
: 'tw-w-[
|
|
2952
|
+
? 'tw-w-[84px] tw-pr-[52px] tw-text-right'
|
|
2953
|
+
: 'tw-w-[80px] tw-pl-[20px] tw-pr-[32px] tw-text-left'), value: value }), type === 'percentage' && jsxRuntime.jsx(PercentageDecorator, {}), type === 'amount' && jsxRuntime.jsx(AmountDecorator, {})] }));
|
|
2933
2954
|
}
|
|
2934
2955
|
function PercentageDecorator() {
|
|
2935
2956
|
return (jsxRuntime.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: [jsxRuntime.jsx(CaptionText, { className: "tw-translate-y-[0.5px] !tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: "%" }), jsxRuntime.jsx(Chip, { icon: jsxRuntime.jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) })] }));
|
|
@@ -2942,10 +2963,20 @@ const switchSizeClassMap = {
|
|
|
2942
2963
|
small: 'tw-w-[36px] tw-h-squid-m tw-p-0.5',
|
|
2943
2964
|
large: 'tw-w-[54px] tw-h-squid-l tw-p-[3px]',
|
|
2944
2965
|
};
|
|
2945
|
-
const
|
|
2966
|
+
const switchKnobSizeClassMap = {
|
|
2946
2967
|
small: 'tw-w-4 tw-h-4',
|
|
2947
2968
|
large: 'tw-w-6 tw-h-6',
|
|
2948
2969
|
};
|
|
2970
|
+
const switchKnobCheckedClassMap = {
|
|
2971
|
+
large: {
|
|
2972
|
+
checked: 'tw-left-[26px]',
|
|
2973
|
+
unchecked: 'tw-left-[2px]',
|
|
2974
|
+
},
|
|
2975
|
+
small: {
|
|
2976
|
+
checked: 'tw-left-[17px]',
|
|
2977
|
+
unchecked: 'tw-left-[1px]',
|
|
2978
|
+
},
|
|
2979
|
+
};
|
|
2949
2980
|
function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
2950
2981
|
return (
|
|
2951
2982
|
// Switch container
|
|
@@ -2959,11 +2990,11 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
|
2959
2990
|
filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
|
|
2960
2991
|
}, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
|
|
2961
2992
|
// size styles
|
|
2962
|
-
|
|
2963
|
-
//
|
|
2964
|
-
checked
|
|
2965
|
-
? 'tw-
|
|
2966
|
-
: '
|
|
2993
|
+
switchKnobSizeClassMap[size],
|
|
2994
|
+
// checked styles
|
|
2995
|
+
switchKnobCheckedClassMap[size][checked ? 'checked' : 'unchecked'], checked
|
|
2996
|
+
? 'group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900'
|
|
2997
|
+
: 'tw-bg-grey-500') })] }));
|
|
2967
2998
|
}
|
|
2968
2999
|
|
|
2969
3000
|
const borderRadiusClassMap = {
|
|
@@ -3081,8 +3112,8 @@ function FeeButton(_a) {
|
|
|
3081
3112
|
return (jsxRuntime.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: [jsxRuntime.jsx(Chip, { label: chipLabel }), jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsxRuntime.jsx(Chip, { icon: jsxRuntime.jsx(EthereumIcon, {}) }), jsxRuntime.jsx(UsdAmount, { usdAmount: feeInUsd })] })] })));
|
|
3082
3113
|
}
|
|
3083
3114
|
|
|
3084
|
-
function SettingsButton({ label, isSelected = false, }) {
|
|
3085
|
-
return (jsxRuntime.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: jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
|
|
3115
|
+
function SettingsButton({ label, isSelected = false, onClick, }) {
|
|
3116
|
+
return (jsxRuntime.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: jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
|
|
3086
3117
|
}
|
|
3087
3118
|
|
|
3088
3119
|
function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, boostTooltipDisplayDelayMs = 0, }) {
|
|
@@ -3091,8 +3122,8 @@ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessa
|
|
|
3091
3122
|
: 'tw-bg-status-positive') })] }));
|
|
3092
3123
|
}
|
|
3093
3124
|
|
|
3094
|
-
function EmojiSadIcon() {
|
|
3095
|
-
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: jsxRuntime.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" }) }));
|
|
3125
|
+
function EmojiSadIcon({ className }) {
|
|
3126
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.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" }) }));
|
|
3096
3127
|
}
|
|
3097
3128
|
|
|
3098
3129
|
function ErrorMessage({ message, showIcon = true }) {
|
|
@@ -3116,7 +3147,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
|
|
|
3116
3147
|
return 'full';
|
|
3117
3148
|
}, [errorMessage, isLoading, isEmpty]);
|
|
3118
3149
|
const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
|
|
3119
|
-
return (jsxRuntime.jsx("aside", { className: cn('tw-h-
|
|
3150
|
+
return (jsxRuntime.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 ? (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(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, {}) })) }), 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 }) })] })) }));
|
|
3120
3151
|
}
|
|
3121
3152
|
|
|
3122
3153
|
function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }) {
|
|
@@ -3166,11 +3197,46 @@ const dropdownPositionClassMap = {
|
|
|
3166
3197
|
bottom: 'tw-right-[calc(100%-10px)] tw-top-7',
|
|
3167
3198
|
center: 'tw-right-[40px] -tw-top-[55px]',
|
|
3168
3199
|
};
|
|
3169
|
-
|
|
3200
|
+
const statusBadge = {
|
|
3201
|
+
completed: {},
|
|
3202
|
+
pending: {
|
|
3203
|
+
badge: jsxRuntime.jsx(Loader, { size: "16", strokeWidth: "2" }),
|
|
3204
|
+
containerClassName: 'tw-bg-royal-400',
|
|
3205
|
+
},
|
|
3206
|
+
failed: {
|
|
3207
|
+
badge: (jsxRuntime.jsx("span", { className: "group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900", children: jsxRuntime.jsx(EmojiSadIcon, { className: "tw-text-status-negative" }) })),
|
|
3208
|
+
containerClassName: 'tw-bg-status-negative',
|
|
3209
|
+
},
|
|
3210
|
+
};
|
|
3211
|
+
function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }) {
|
|
3170
3212
|
const { isDropdownOpen, dropdownRef, openDropdownButtonRef, openDropdown } = useDropdownMenu();
|
|
3171
3213
|
const [dropdownPosition, setDropdownPosition] = react.useState(null);
|
|
3172
3214
|
const itemRef = react.useRef(null);
|
|
3173
3215
|
const menuRef = react.useRef(null);
|
|
3216
|
+
const statusInfo = react.useMemo(() => {
|
|
3217
|
+
switch (status) {
|
|
3218
|
+
case 'completed':
|
|
3219
|
+
return {
|
|
3220
|
+
label: dateCompleted,
|
|
3221
|
+
className: '',
|
|
3222
|
+
};
|
|
3223
|
+
case 'pending':
|
|
3224
|
+
return {
|
|
3225
|
+
label: 'Pending',
|
|
3226
|
+
className: 'tw-text-royal-400',
|
|
3227
|
+
};
|
|
3228
|
+
case 'failed':
|
|
3229
|
+
return {
|
|
3230
|
+
label: 'Failed',
|
|
3231
|
+
className: 'tw-text-status-negative',
|
|
3232
|
+
};
|
|
3233
|
+
default:
|
|
3234
|
+
return {
|
|
3235
|
+
label: '',
|
|
3236
|
+
className: '',
|
|
3237
|
+
};
|
|
3238
|
+
}
|
|
3239
|
+
}, [status, dateCompleted]);
|
|
3174
3240
|
// Effect to find the best position for the dropdown menu, so it's always visible for the user
|
|
3175
3241
|
react.useEffect(() => {
|
|
3176
3242
|
var _a;
|
|
@@ -3215,8 +3281,8 @@ function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted,
|
|
|
3215
3281
|
setDropdownPosition('top');
|
|
3216
3282
|
}
|
|
3217
3283
|
}, [isDropdownOpen, menuRef, dropdownPosition, itemRef]);
|
|
3218
|
-
return (jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [
|
|
3219
|
-
'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:
|
|
3284
|
+
return (jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsxRuntime.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 })), jsxRuntime.jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsxRuntime.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" })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(CaptionText, { children: fromLabel }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronRightSmallIcon, {}) }), jsxRuntime.jsx(CaptionText, { children: toLabel })] }), !!dropdownMenuItems && (jsxRuntime.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: jsxRuntime.jsx(DotGrid1x3HorizontalIcon, { size: "24" }) })), jsxRuntime.jsx("div", { className: cn(!!dropdownMenuItems &&
|
|
3285
|
+
'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 && (jsxRuntime.jsx(CaptionText, { className: statusInfo.className, children: statusInfo.label })) })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx(BodyText, { size: "small", children: fromAmount }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), jsxRuntime.jsx(BodyText, { size: "small", children: toAmount })] })] }), isDropdownOpen && !!dropdownMenuItems ? (jsxRuntime.jsx(DropdownMenu, { menuRef: menuRef,
|
|
3220
3286
|
// only show dropdown menu if there is a position defined for it
|
|
3221
3287
|
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] }) }));
|
|
3222
3288
|
}
|
|
@@ -3226,10 +3292,10 @@ const listItemSizeMap = {
|
|
|
3226
3292
|
large: 'tw-max-w-list-item-large tw-h-list-item-large tw-px-squid-xs',
|
|
3227
3293
|
};
|
|
3228
3294
|
function ListItem(_a) {
|
|
3229
|
-
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"]);
|
|
3295
|
+
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"]);
|
|
3230
3296
|
// 'small' variant does not have detail
|
|
3231
3297
|
const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
|
|
3232
|
-
return (jsxRuntime.jsx("li", { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.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' ? (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-xs',
|
|
3298
|
+
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("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' ? (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-xs',
|
|
3233
3299
|
// 'large' variant has extra padding
|
|
3234
3300
|
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: "tw-max-w-full tw-truncate !tw-leading-[17px]", children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
3235
3301
|
((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.jsx(CaptionText, { className: "tw-h-squid-xs tw-max-w-full tw-truncate !tw-leading-[11px] tw-text-grey-500", children: subtitle })) : null)] }), showDetail && (jsxRuntime.jsxs("button", { onClick: (event) => {
|
|
@@ -3238,22 +3304,23 @@ function ListItem(_a) {
|
|
|
3238
3304
|
onDetailClick === null || onDetailClick === void 0 ? void 0 : onDetailClick();
|
|
3239
3305
|
}, 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
|
|
3240
3306
|
? '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'
|
|
3241
|
-
: 'tw-flex', 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] }))] })) }));
|
|
3307
|
+
: 'tw-flex', 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] }))] })) })));
|
|
3242
3308
|
}
|
|
3243
3309
|
|
|
3244
3310
|
function MenuItem({ label, imageUrl, icon }) {
|
|
3245
3311
|
return (jsxRuntime.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: [jsxRuntime.jsx("div", { className: "tw-h-squid-m tw-w-squid-m", children: imageUrl ? (jsxRuntime.jsx("img", { className: "tw-h-full tw-w-full tw-rounded-squid-xxs", src: imageUrl, alt: "" })) : icon ? (icon) : null }), jsxRuntime.jsx(CaptionText, { children: label })] }));
|
|
3246
3312
|
}
|
|
3247
3313
|
|
|
3248
|
-
function SectionTitle(
|
|
3249
|
-
|
|
3314
|
+
function SectionTitle(_a) {
|
|
3315
|
+
var { title, icon, accessory, actionIcon, className } = _a, props = __rest(_a, ["title", "icon", "accessory", "actionIcon", "className"]);
|
|
3316
|
+
return (jsxRuntime.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, jsxRuntime.jsx(CaptionText, { children: title }), accessory ? (jsxRuntime.jsx(CaptionText, { className: "tw-flex-1 tw-text-right tw-text-grey-500", children: accessory })) : actionIcon ? (jsxRuntime.jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end", children: actionIcon })) : null] })));
|
|
3250
3317
|
}
|
|
3251
3318
|
|
|
3252
3319
|
function HelpIcon({ size = '20', className, }) {
|
|
3253
3320
|
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_457_36778)", children: jsxRuntime.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" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_457_36778", children: jsxRuntime.jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] }));
|
|
3254
3321
|
}
|
|
3255
3322
|
|
|
3256
|
-
function SettingsItem({ icon, label,
|
|
3323
|
+
function SettingsItem({ icon, label, control, link, transparent = false, helpTooltip, }) {
|
|
3257
3324
|
const ContentTag = link ? 'a' : 'div';
|
|
3258
3325
|
const contentTagProps = link
|
|
3259
3326
|
? {
|
|
@@ -3262,25 +3329,10 @@ function SettingsItem({ icon, label, controls = [], link, transparent = false, h
|
|
|
3262
3329
|
}
|
|
3263
3330
|
: {};
|
|
3264
3331
|
const helpIcon = !!helpTooltip && (jsxRuntime.jsx(HelpIcon, { className: cn('tw-text-grey-600', 'tw-cursor-help tw-transition-colors tw-duration-200 hover:tw-text-grey-400') }));
|
|
3265
|
-
const showDetailsBorder =
|
|
3266
|
-
!link &&
|
|
3267
|
-
!controls.some((control) => control.type === 'switch');
|
|
3332
|
+
const showDetailsBorder = !!control && !link && !(control.type === 'switch');
|
|
3268
3333
|
return (jsxRuntime.jsx("li", { className: cn('tw-h-[50px] tw-self-stretch tw-px-squid-xs', transparent ? 'tw-bg-transparent' : 'tw-bg-grey-800'), children: jsxRuntime.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, jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: [jsxRuntime.jsx(BodyText, { size: "small", children: label }), helpTooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, helpTooltip, { children: helpIcon }))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: helpIcon }))] }), jsxRuntime.jsx("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-rounded-squid-xs', showDetailsBorder &&
|
|
3269
|
-
'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsxRuntime.jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (
|
|
3270
|
-
|
|
3271
|
-
const switchControl = (jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }, index));
|
|
3272
|
-
if (control.tooltip) {
|
|
3273
|
-
return jsxRuntime.jsx(Tooltip, Object.assign({}, control.tooltip, { children: switchControl }));
|
|
3274
|
-
}
|
|
3275
|
-
return switchControl;
|
|
3276
|
-
}
|
|
3277
|
-
if (control.type === 'percentage') {
|
|
3278
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.isSelected }), jsxRuntime.jsx(SettingsSlider, { value: control.value, type: "percentage" })] }));
|
|
3279
|
-
}
|
|
3280
|
-
if (control.type === 'amount') {
|
|
3281
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.isSelected }), control.options.map(({ value, isSelected }, index, _controls) => (jsxRuntime.jsx(SettingsButton, { label: '$' + value, isSelected: isSelected }, index))), jsxRuntime.jsx(SettingsSlider, { type: control.type, value: 0 })] }));
|
|
3282
|
-
}
|
|
3283
|
-
})) })] })) }));
|
|
3334
|
+
'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsxRuntime.jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (!!control && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [control.type === 'amount' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { onClick: () => control.onChange(control.resetValueControl.value), label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value }), control.options.map(({ value }, index, _controls) => (jsxRuntime.jsx(SettingsButton, { label: '$' + value, isSelected: control.value === value, onClick: () => control.onChange(value) }, index))), jsxRuntime.jsx(SettingsSlider, { type: control.type, value: control.value, onChange: control.onChange, hasDecimals: false, max: 999 })] })), control.type === 'switch' &&
|
|
3335
|
+
(control.tooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsxRuntime.jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", hasDecimals: control.hasDecimals, max: control.max, min: control.min })] }))] }))) })] })) }));
|
|
3284
3336
|
}
|
|
3285
3337
|
|
|
3286
3338
|
function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
|
|
@@ -3379,7 +3431,10 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
|
|
|
3379
3431
|
}
|
|
3380
3432
|
|
|
3381
3433
|
function ProductCard({ children }) {
|
|
3382
|
-
return (jsxRuntime.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: jsxRuntime.jsx("div", { className: "tw-relative tw-flex tw-h-
|
|
3434
|
+
return (jsxRuntime.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: jsxRuntime.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 }) }));
|
|
3435
|
+
}
|
|
3436
|
+
function BorderedContainer({ children, className, }) {
|
|
3437
|
+
return (jsxRuntime.jsx("section", { className: cn('tw-border-t tw-border-t-material-light-thin', className), children: children }));
|
|
3383
3438
|
}
|
|
3384
3439
|
|
|
3385
3440
|
function SquidLogo() {
|
|
@@ -3416,7 +3471,7 @@ function SwapConfiguration({ priceImpactPercentage, amount, forcedAmount, swapAm
|
|
|
3416
3471
|
const BalanceChipTag = isBalanceChipInteractive ? 'button' : 'div';
|
|
3417
3472
|
const isSwapAmountChipInteractive = !!onSwapAmountButtonClick;
|
|
3418
3473
|
const SwapAmountChipTag = isSwapAmountChipInteractive ? 'button' : 'div';
|
|
3419
|
-
return (jsxRuntime.jsxs("section", { className: "tw-h-[205px] tw-max-h-[205px] 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 }) }), direction === 'from' ? (jsxRuntime.jsx(NumericInput, { forcedUpdateValue: forcedAmount, initialValue: amount, onParsedValueChanged: (value) => onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value) })) : (jsxRuntime.jsx("div", { className:
|
|
3474
|
+
return (jsxRuntime.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: [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-animate-move-loading-cover-to-right tw-bg-dark-cover tw-h-[94px] tw-w-[1260px]" }) })), direction === 'from' ? (jsxRuntime.jsx(NumericInput, { forcedUpdateValue: forcedAmount, initialValue: amount, onParsedValueChanged: (value) => onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(value) })) : (jsxRuntime.jsx("div", { className: cn('tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]', isFetching && 'tw-opacity-50'), children: jsxRuntime.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: jsxRuntime.jsx("span", { children: amount }) }) })), !(token === null || token === void 0 ? void 0 : token.iconUrl) ? null : (jsxRuntime.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 ? (jsxRuntime.jsx("div", { className: "tw-px-squid-xs", children: jsxRuntime.jsx(ErrorMessage, { message: error.message }) })) : (jsxRuntime.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: [jsxRuntime.jsx(SwapInputsIcon, {}), jsxRuntime.jsx(UsdAmount, { usdAmount: swapAmountUsd }), priceImpactPercentage && direction === 'to' ? (jsxRuntime.jsxs("span", { className: clsx('tw-flex tw-items-center', priceImpactClass), children: [jsxRuntime.jsx(ArrowTriangle, {}), jsxRuntime.jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] })), jsxRuntime.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: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balance }), jsxRuntime.jsx(MaxIcon, {})] })] }))] }));
|
|
3420
3475
|
}
|
|
3421
3476
|
|
|
3422
3477
|
function SwapProgressViewHeader({ title, description, }) {
|
|
@@ -3612,6 +3667,7 @@ exports.BadgeImage = BadgeImage;
|
|
|
3612
3667
|
exports.BodyText = BodyText;
|
|
3613
3668
|
exports.Boost = Boost;
|
|
3614
3669
|
exports.BoostButton = BoostButton;
|
|
3670
|
+
exports.BorderedContainer = BorderedContainer;
|
|
3615
3671
|
exports.Button = Button;
|
|
3616
3672
|
exports.CaptionText = CaptionText;
|
|
3617
3673
|
exports.Chip = Chip;
|
|
@@ -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;
|