@0xsquid/ui 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +49 -41
- package/dist/cjs/types/components/buttons/BoostButton.d.ts +1 -1
- package/dist/cjs/types/components/controls/Switch.d.ts +2 -1
- package/dist/cjs/types/components/icons/Arrow.d.ts +4 -1
- package/dist/cjs/types/components/icons/Heart.d.ts +9 -3
- package/dist/cjs/types/components/layout/DetailsToolbar.d.ts +6 -2
- package/dist/cjs/types/components/layout/ErrorMessage.d.ts +3 -0
- package/dist/cjs/types/components/layout/Modal.d.ts +3 -1
- package/dist/cjs/types/components/layout/ProductCard.d.ts +1 -5
- package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +4 -1
- package/dist/cjs/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
- package/dist/cjs/types/components/layout/index.d.ts +1 -1
- package/dist/cjs/types/components/lists/ListItem.d.ts +3 -1
- package/dist/cjs/types/components/views/AssetsView.d.ts +2 -6
- package/dist/cjs/types/services/internal/colorService.d.ts +1 -18
- package/dist/cjs/types/stories/controls/Switch.stories.d.ts +2 -0
- package/dist/cjs/types/stories/layout/DetailsToolbar.stories.d.ts +1 -0
- package/dist/cjs/types/stories/layout/ErrorMessage.stories.d.ts +6 -0
- package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +3 -0
- package/dist/{esm/types/stories/layout/SwapProgressView.stories.d.ts → cjs/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
- package/dist/cjs/types/stories/lists/ListItem.stories.d.ts +3 -0
- package/dist/cjs/types/types/components.d.ts +0 -1
- package/dist/esm/index.js +49 -41
- package/dist/esm/types/components/buttons/BoostButton.d.ts +1 -1
- package/dist/esm/types/components/controls/Switch.d.ts +2 -1
- package/dist/esm/types/components/icons/Arrow.d.ts +4 -1
- package/dist/esm/types/components/icons/Heart.d.ts +9 -3
- package/dist/esm/types/components/layout/DetailsToolbar.d.ts +6 -2
- package/dist/esm/types/components/layout/ErrorMessage.d.ts +3 -0
- package/dist/esm/types/components/layout/Modal.d.ts +3 -1
- package/dist/esm/types/components/layout/ProductCard.d.ts +1 -5
- package/dist/esm/types/components/layout/SwapConfiguration.d.ts +4 -1
- package/dist/esm/types/components/layout/SwapStepsCollapsed.d.ts +2 -2
- package/dist/esm/types/components/layout/index.d.ts +1 -1
- package/dist/esm/types/components/lists/ListItem.d.ts +3 -1
- package/dist/esm/types/components/views/AssetsView.d.ts +2 -6
- package/dist/esm/types/services/internal/colorService.d.ts +1 -18
- package/dist/esm/types/stories/controls/Switch.stories.d.ts +2 -0
- package/dist/esm/types/stories/layout/DetailsToolbar.stories.d.ts +1 -0
- package/dist/esm/types/stories/layout/ErrorMessage.stories.d.ts +6 -0
- package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +3 -0
- package/dist/{cjs/types/stories/layout/SwapProgressView.stories.d.ts → esm/types/stories/layout/SwapStepsCollapsed.stories.d.ts} +2 -1
- package/dist/esm/types/stories/lists/ListItem.stories.d.ts +3 -0
- package/dist/esm/types/types/components.d.ts +0 -1
- package/dist/index.css +73 -39
- package/dist/index.d.ts +27 -21
- package/package.json +1 -1
- package/dist/cjs/types/components/layout/WalletAddress.d.ts +0 -6
- package/dist/cjs/types/services/internal/walletService.d.ts +0 -1
- package/dist/esm/types/components/layout/WalletAddress.d.ts +0 -6
- package/dist/esm/types/services/internal/walletService.d.ts +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2619,8 +2619,8 @@ function AddressButton(_a) {
|
|
|
2619
2619
|
function ArrowRightIcon() {
|
|
2620
2620
|
return (jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M14 6L20 12L14 18M19 12H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
2621
2621
|
}
|
|
2622
|
-
function ChevronArrowIcon() {
|
|
2623
|
-
return (jsxRuntime.jsx("svg", { width:
|
|
2622
|
+
function ChevronArrowIcon({ size = '16', className, }) {
|
|
2623
|
+
return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.jsx("path", { d: "M6.66663 14L9.64022 8.64754C9.86394 8.24484 9.86394 7.75519 9.64022 7.35249L6.66663 2", stroke: "currentColor", strokeOpacity: "0.66", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
2624
2624
|
}
|
|
2625
2625
|
function ArrowTriangle() {
|
|
2626
2626
|
return (jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M2.87921 5.55701C2.21562 4.22933 3.18052 2.6665 4.66531 2.6665H11.3348C12.8196 2.6665 13.7845 4.22933 13.1209 5.55701L9.78615 12.229C9.05029 13.7012 6.94983 13.7012 6.21397 12.229L2.87921 5.55701Z", fill: "currentColor" }) }));
|
|
@@ -2819,14 +2819,16 @@ const switchCircleSizeClassMap = {
|
|
|
2819
2819
|
small: 'tw-w-4 tw-h-4',
|
|
2820
2820
|
large: 'tw-w-6 tw-h-6',
|
|
2821
2821
|
};
|
|
2822
|
-
function Switch({ checked = false, onChange, size }) {
|
|
2822
|
+
function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
2823
2823
|
return (
|
|
2824
2824
|
// Switch container
|
|
2825
|
-
jsxRuntime.jsxs("label", { className: clsx('tw-relative tw-inline-flex tw-
|
|
2825
|
+
jsxRuntime.jsxs("label", { className: clsx('tw-relative tw-inline-flex tw-items-center tw-justify-end tw-overflow-hidden tw-rounded-squid-m tw-border tw-border-material-light-thin tw-transition-colors',
|
|
2826
2826
|
// size styles
|
|
2827
2827
|
switchSizeClassMap[size],
|
|
2828
2828
|
// checked styles
|
|
2829
|
-
checked ? 'tw-bg-status-positive' : 'tw-bg-grey-800'
|
|
2829
|
+
checked ? 'tw-bg-status-positive' : 'tw-bg-grey-800',
|
|
2830
|
+
// disabled styles
|
|
2831
|
+
disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'), children: [jsxRuntime.jsx("input", { disabled: disabled, checked: checked, onChange: disabled ? undefined : (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked), type: "checkbox", className: "tw-peer tw-sr-only" }), jsxRuntime.jsx("span", { style: {
|
|
2830
2832
|
filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
|
|
2831
2833
|
}, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
|
|
2832
2834
|
// size styles
|
|
@@ -2864,10 +2866,8 @@ function Tooltip({ children, tooltipContent, tooltipWidth = 'container', thresho
|
|
|
2864
2866
|
}
|
|
2865
2867
|
|
|
2866
2868
|
const animationDuration = '500ms';
|
|
2867
|
-
function BoostButton({ boostMode
|
|
2869
|
+
function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode = true, boostDisabledMessage = 'Boost disabled', }) {
|
|
2868
2870
|
const boostIndicatorRef = react.useRef(null);
|
|
2869
|
-
// force normal mode if canToggleBoostMode is false
|
|
2870
|
-
const boostMode = canToggleBoostMode ? _boostMode : 'normal';
|
|
2871
2871
|
function handleToggleBoostMode() {
|
|
2872
2872
|
if (!boostIndicatorRef.current || !canToggleBoostMode)
|
|
2873
2873
|
return;
|
|
@@ -2946,8 +2946,8 @@ function SettingsButton({ label }) {
|
|
|
2946
2946
|
return (jsxRuntime.jsx("button", { className: "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", children: jsxRuntime.jsx(CaptionText, { children: label }) }));
|
|
2947
2947
|
}
|
|
2948
2948
|
|
|
2949
|
-
function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode, }) {
|
|
2950
|
-
return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' ||
|
|
2949
|
+
function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessage, canToggleBoostMode = true, }) {
|
|
2950
|
+
return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-items-center tw-gap-x-squid-xxs tw-bg-grey-900 tw-pr-squid-xxs", children: [jsxRuntime.jsx(BoostButton, { boostMode: boostMode, boostDisabledMessage: boostDisabledMessage, canToggleBoostMode: canToggleBoostMode, onToggleBoostMode: onToggleBoostMode }), jsxRuntime.jsx(Chip, { label: estimatedTime, className: cn('tw-text-grey-900 tw-transition-colors', boostMode === 'normal' || !canToggleBoostMode
|
|
2951
2951
|
? 'tw-bg-grey-300'
|
|
2952
2952
|
: 'tw-bg-status-positive') })] }));
|
|
2953
2953
|
}
|
|
@@ -2956,19 +2956,20 @@ function EmojiSadIcon() {
|
|
|
2956
2956
|
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" }) }));
|
|
2957
2957
|
}
|
|
2958
2958
|
|
|
2959
|
+
function ErrorMessage({ message }) {
|
|
2960
|
+
return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-status-negative", children: [jsxRuntime.jsx(EmojiSadIcon, {}), jsxRuntime.jsx(CaptionText, { children: message })] }));
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2959
2963
|
const detailStateClassMap = {
|
|
2960
2964
|
loading: 'tw-opacity-33 tw-pointer-events-none',
|
|
2961
2965
|
empty: 'tw-pointer-events-none tw-hidden',
|
|
2962
2966
|
error: 'tw-opacity-33 tw-pointer-events-none',
|
|
2963
2967
|
full: '',
|
|
2964
2968
|
};
|
|
2965
|
-
function DetailsToolbar({ state = 'full', errorMessage, boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }) {
|
|
2969
|
+
function DetailsToolbar({ state = 'full', errorMessage = 'Something went wrong', boostMode = 'normal', onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, }) {
|
|
2966
2970
|
const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
|
|
2967
|
-
return (jsxRuntime.jsx("aside", { className:
|
|
2971
|
+
return (jsxRuntime.jsx("aside", { className: cn('tw-h-squid-[50px] tw-flex tw-w-[480px] tw-items-center tw-justify-around 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 }) })] })) }));
|
|
2968
2972
|
}
|
|
2969
|
-
const ErrorMessage = ({ message }) => {
|
|
2970
|
-
return (jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-status-negative", children: [jsxRuntime.jsx(EmojiSadIcon, {}), jsxRuntime.jsx(CaptionText, { children: message })] }));
|
|
2971
|
-
};
|
|
2972
2973
|
|
|
2973
2974
|
function DropdownMenuItem({ label, imageUrl, icon, labelClassName, }) {
|
|
2974
2975
|
return (jsxRuntime.jsx("li", { className: "tw-max-h-squid-xl tw-w-full tw-px-squid-xxs", children: jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-l tw-cursor-pointer tw-items-center tw-gap-squid-xxs tw-rounded-squid-xs tw-pl-squid-xxs hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-between tw-rounded-squid-xs", children: imageUrl ? (jsxRuntime.jsx("img", { src: imageUrl, className: "tw-h-full tw-w-full tw-rounded-squid-xxs" })) : (icon) }), jsxRuntime.jsx(CaptionText, { className: labelClassName, children: label })] }) }));
|
|
@@ -3047,10 +3048,12 @@ const listItemSizeMap = {
|
|
|
3047
3048
|
large: 'tw-max-w-list-item-large tw-h-list-item-large tw-px-squid-xs',
|
|
3048
3049
|
};
|
|
3049
3050
|
function ListItem(_a) {
|
|
3050
|
-
var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected"]);
|
|
3051
|
-
return (jsxRuntime.jsx("li", Object.assign({}, props, { className: cn('tw-flex tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs("div", { className: cn('tw-flex tw-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: false })) })) : (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-w-full tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xs',
|
|
3051
|
+
var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly"]);
|
|
3052
|
+
return (jsxRuntime.jsx("li", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs("div", { className: cn('tw-flex tw-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: false })) })) : (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-w-full tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xs',
|
|
3052
3053
|
// 'large' variant has extra padding
|
|
3053
|
-
size === 'large' && 'tw-px-squid-xxs'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: "tw-truncate !tw-leading-[18px]", children: itemTitle })) : (itemTitle), size === 'large' && subtitle ? (jsxRuntime.jsx(CaptionText, { className: "tw-h-squid-xs !tw-leading-[10px] tw-text-grey-500", children: subtitle })) : null] }), jsxRuntime.jsxs("
|
|
3054
|
+
size === 'large' && 'tw-px-squid-xxs'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: "tw-truncate !tw-leading-[18px]", children: itemTitle })) : (itemTitle), size === 'large' && subtitle ? (jsxRuntime.jsx(CaptionText, { className: "tw-h-squid-xs !tw-leading-[10px] tw-text-grey-500", children: subtitle })) : null] }), jsxRuntime.jsxs("button", { onClick: onDetailClick, className: cn('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
|
|
3055
|
+
? 'tw-hidden group-hover/list-item:tw-flex'
|
|
3056
|
+
: 'tw-flex'), children: [size === 'large' && detail ? (jsxRuntime.jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })) : null, icon ? (jsxRuntime.jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })] }) })));
|
|
3054
3057
|
}
|
|
3055
3058
|
|
|
3056
3059
|
function MenuItem({ label, imageUrl, icon }) {
|
|
@@ -3070,10 +3073,10 @@ function SettingsItem({ icon, label, controls, transparentControls = false, show
|
|
|
3070
3073
|
}
|
|
3071
3074
|
|
|
3072
3075
|
function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
|
|
3073
|
-
return (jsxRuntime.jsx("li", { className: "tw-swap-detail-list-item-gradient tw-h-squid-l tw-w-full tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-l tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs tw-px-squid-xs", children: [jsxRuntime.jsx("div", { className: "tw-h-6 tw-w-6 tw-text-grey-500", children: icon }), jsxRuntime.jsx(CaptionText, { className: "tw-flex-1 tw-text-grey-500", children: label }), isLoading ? (jsxRuntime.jsx(LoadingSkeleton, {})) : typeof detail === 'string' ? (jsxRuntime.jsx(CaptionText, { children: detail })) : (detail)] }) }));
|
|
3076
|
+
return (jsxRuntime.jsx("li", { className: "tw-swap-detail-list-item-gradient tw-h-squid-l tw-w-full tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: jsxRuntime.jsxs("div", { className: "tw-flex tw-h-squid-l tw-items-center tw-justify-between tw-gap-squid-xs tw-rounded-squid-xs tw-px-squid-xs", children: [jsxRuntime.jsx("div", { className: "tw-h-6 tw-w-6 tw-text-grey-500", children: icon }), jsxRuntime.jsx(CaptionText, { className: "tw-flex-1 tw-text-grey-500", children: label }), isLoading ? (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-text-grey-500" })) : typeof detail === 'string' ? (jsxRuntime.jsx(CaptionText, { children: detail })) : (detail)] }) }));
|
|
3074
3077
|
}
|
|
3075
|
-
function LoadingSkeleton() {
|
|
3076
|
-
return (jsxRuntime.jsx("
|
|
3078
|
+
function LoadingSkeleton({ className }) {
|
|
3079
|
+
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: "20", viewBox: "0 0 100 20", fill: "none", className: className, children: [jsxRuntime.jsxs("g", { "clip-path": "url(#clip0_1083_18992)", children: [jsxRuntime.jsx("mask", { id: "mask0_1083_18992", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "100", height: "20", children: jsxRuntime.jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1083_18992)" }) }), jsxRuntime.jsx("g", { mask: "url(#mask0_1083_18992)", children: jsxRuntime.jsx("rect", { width: "100", height: "20", fill: "currentColor" }) })] }), jsxRuntime.jsxs("defs", { children: [jsxRuntime.jsxs("linearGradient", { id: "paint0_linear_1083_18992", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient", children: [jsxRuntime.jsx("stop", { "stop-color": "#D9D9D9", "stop-opacity": "0.33" }), jsxRuntime.jsx("stop", { offset: "0.395881", "stop-color": "#737373", "stop-opacity": "0.33" }), jsxRuntime.jsx("stop", { offset: "0.597867", "stop-color": "#737373", "stop-opacity": "0.66" }), jsxRuntime.jsx("stop", { offset: "0.697004", "stop-color": "#737373", "stop-opacity": "0.33" })] }), jsxRuntime.jsx("clipPath", { id: "clip0_1083_18992", 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" }) })] })] }));
|
|
3077
3080
|
}
|
|
3078
3081
|
|
|
3079
3082
|
function SwapStepSeparator() {
|
|
@@ -3103,10 +3106,16 @@ function DropdownMenu({ dropdownRef, items, className, }) {
|
|
|
3103
3106
|
return (jsxRuntime.jsx("div", { ref: dropdownRef, className: "tw-relative", children: jsxRuntime.jsx(Menu, { rounded: "sm", containerClassName: cn('tw-absolute tw-right-0 tw-z-20', className), contentClassName: "!tw-p-0", children: jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[144px] tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-px-0 tw-py-squid-xxs", children: items.map((item) => (jsxRuntime.jsx(DropdownMenuItem, Object.assign({}, item), item.label))) }) }) }));
|
|
3104
3107
|
}
|
|
3105
3108
|
|
|
3106
|
-
function Modal({ children }) {
|
|
3109
|
+
function Modal({ children, className, onBackdropClick }) {
|
|
3107
3110
|
return (
|
|
3108
|
-
// modal container
|
|
3109
|
-
jsxRuntime.jsx("div", {
|
|
3111
|
+
// modal container (backdrop)
|
|
3112
|
+
jsxRuntime.jsx("div", { onClick: onBackdropClick
|
|
3113
|
+
? (event) => {
|
|
3114
|
+
if (event.target === event.currentTarget) {
|
|
3115
|
+
onBackdropClick();
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
: undefined, className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsxRuntime.jsx("div", { className: cn('tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className), children: children }) }));
|
|
3110
3119
|
}
|
|
3111
3120
|
|
|
3112
3121
|
function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
|
|
@@ -3129,11 +3138,7 @@ function SwapInputsIcon() {
|
|
|
3129
3138
|
return (jsxRuntime.jsxs("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_40_7936)", children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20 10.5C20 16.0228 15.5228 20.5 10 20.5C4.47715 20.5 0 16.0228 0 10.5C0 4.97715 4.47715 0.5 10 0.5C15.5228 0.5 20 4.97715 20 10.5ZM8.38268 4.57612C8.75636 4.7309 9 5.09554 9 5.5V15.5C9 16.0523 8.55228 16.5 8 16.5C7.44772 16.5 7 16.0523 7 15.5V7.91421L5.70711 9.20711C5.31658 9.59763 4.68342 9.59763 4.29289 9.20711C3.90237 8.81658 3.90237 8.18342 4.29289 7.79289L7.29289 4.79289C7.57889 4.5069 8.00901 4.42134 8.38268 4.57612ZM11 15.5C11 15.9045 11.2436 16.2691 11.6173 16.4239C11.991 16.5787 12.4211 16.4931 12.7071 16.2071L15.7071 13.2071C16.0976 12.8166 16.0976 12.1834 15.7071 11.7929C15.3166 11.4024 14.6834 11.4024 14.2929 11.7929L13 13.0858V5.5C13 4.94771 12.5523 4.5 12 4.5C11.4477 4.5 11 4.94771 11 5.5V15.5Z", fill: "currentColor" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_40_7936", children: jsxRuntime.jsx("rect", { width: "20", height: "20", fill: "white", transform: "translate(0 0.5)" }) }) })] }));
|
|
3130
3139
|
}
|
|
3131
3140
|
|
|
3132
|
-
function
|
|
3133
|
-
return (jsxRuntime.jsx("div", { className: "tw-flex tw-items-center tw-gap-1", children: ens || address ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BodyText, { size: "small", children: ens ? ens : (address === null || address === void 0 ? void 0 : address.slice(0, 6)) + '...' + (address === null || address === void 0 ? void 0 : address.slice(-4)) }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronArrowIcon, {}) })] })) : null }));
|
|
3134
|
-
}
|
|
3135
|
-
|
|
3136
|
-
function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }) {
|
|
3141
|
+
function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0', balance = '0', isFetching = false, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, error, }) {
|
|
3137
3142
|
var _a;
|
|
3138
3143
|
const priceImpactClass = ((_a = Number(priceImpactPercentage)) !== null && _a !== void 0 ? _a : 0) > 5
|
|
3139
3144
|
? 'tw-text-status-negative'
|
|
@@ -3141,22 +3146,22 @@ function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd = '0',
|
|
|
3141
3146
|
const isInteractive = direction === 'from';
|
|
3142
3147
|
// improve accessibility
|
|
3143
3148
|
const BalanceButtonTag = isInteractive ? 'button' : 'div';
|
|
3144
|
-
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 hover:tw-bg-material-light-thin", children: [jsxRuntime.jsx(BodyText, { className: "tw-text-grey-500", size: "small", children: direction === 'from' ? 'Pay' : 'Receive' }),
|
|
3149
|
+
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 : 'Connect wallet' }), 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("div", { className: "tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", children: jsxRuntime.jsx("input", { className: "tw-h-[55px] tw-w-full 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 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-400 focus:tw-outline-none", placeholder: "0", value: amount, onChange: onAmountChange }) })) : (jsxRuntime.jsx("div", { className: "tw-w-full tw-px-squid-m tw-pb-[15px] tw-pt-[5px]", 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) || isFetching ? null : (jsxRuntime.jsxs("footer", { className: "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", children: [error ? (jsxRuntime.jsx("div", { className: "tw-px-squid-xs", children: jsxRuntime.jsx(ErrorMessage, { message: error.message }) })) : (jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin'), 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(BalanceButtonTag, { className: cn('tw-flex tw-h-squid-l tw-items-center tw-gap-1.5 tw-rounded-squid-s tw-px-squid-xs', isInteractive && 'hover:tw-bg-material-light-thin', direction === 'to' && 'tw-pointer-events-none'), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balance }), jsxRuntime.jsx(MaxIcon, {})] })] }))] }));
|
|
3145
3150
|
}
|
|
3146
3151
|
|
|
3147
3152
|
function SwapProgressViewHeader({ title, description, }) {
|
|
3148
3153
|
return (jsxRuntime.jsxs("header", { className: "tw-flex tw-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsxRuntime.jsx(BodyText, { size: "large", className: "tw-h-squid-m !tw-leading-[20px] tw-text-grey-300", children: title }), jsxRuntime.jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
|
|
3149
3154
|
}
|
|
3150
3155
|
|
|
3151
|
-
function SwapStepsCollapsed({ steps,
|
|
3156
|
+
function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
|
|
3152
3157
|
// handles if route component is mounted
|
|
3153
3158
|
const [isRouteVisible, setIsRouteVisible] = react.useState(false);
|
|
3154
|
-
const
|
|
3159
|
+
const currentStepIndex = Math.round(_currentStepIndex);
|
|
3155
3160
|
// handles if route component is animating to show
|
|
3156
3161
|
const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = react.useState(false);
|
|
3157
|
-
const currentStep = steps[
|
|
3158
|
-
const isLastStep =
|
|
3159
|
-
const isFirstStep =
|
|
3162
|
+
const currentStep = steps[currentStepIndex];
|
|
3163
|
+
const isLastStep = currentStepIndex === steps.length - 1;
|
|
3164
|
+
const isFirstStep = currentStepIndex === 0;
|
|
3160
3165
|
react.useEffect(() => {
|
|
3161
3166
|
// we do not want to unmount the route component if the animation to show route is running
|
|
3162
3167
|
if (isShowRouteAnimationRunning)
|
|
@@ -3164,18 +3169,21 @@ function SwapStepsCollapsed({ steps, currentStepCount: _currentStepCount, }) {
|
|
|
3164
3169
|
// unmount route component when the animation of hiding is done
|
|
3165
3170
|
const timeoutId = setTimeout(() => {
|
|
3166
3171
|
setIsRouteVisible(false);
|
|
3167
|
-
},
|
|
3172
|
+
}, 200);
|
|
3168
3173
|
return () => {
|
|
3169
3174
|
clearTimeout(timeoutId);
|
|
3170
3175
|
};
|
|
3171
3176
|
}, [isShowRouteAnimationRunning]);
|
|
3177
|
+
const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
|
|
3172
3178
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full tw-rounded-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { onClick: () => {
|
|
3173
3179
|
// mount route component and start animation
|
|
3174
3180
|
setIsRouteVisible(true);
|
|
3175
3181
|
setIsShowRouteAnimationRunning(true);
|
|
3176
|
-
}, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsxRuntime.jsx(SwapStepSeparator, {})] })), jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent }), !isFirstStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsxRuntime.jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className:
|
|
3177
|
-
|
|
3178
|
-
|
|
3182
|
+
}, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsxRuntime.jsx(SwapStepSeparator, {})] })), currentStep && (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent })), !isFirstStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsxRuntime.jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
|
|
3183
|
+
? 'tw-animate-fade-in'
|
|
3184
|
+
: 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
|
|
3185
|
+
? 'tw-animate-slide-to-top'
|
|
3186
|
+
: 'tw-animate-slide-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: collapseRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsxRuntime.jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
|
|
3179
3187
|
}
|
|
3180
3188
|
|
|
3181
3189
|
function TokenPair({ firstToken, secondToken }) {
|
|
@@ -3185,7 +3193,7 @@ function TokenPair({ firstToken, secondToken }) {
|
|
|
3185
3193
|
}
|
|
3186
3194
|
|
|
3187
3195
|
/**
|
|
3188
|
-
* Parsing the user readable config to css variables
|
|
3196
|
+
* Parsing the user readable config to css variables
|
|
3189
3197
|
* @param style
|
|
3190
3198
|
*/
|
|
3191
3199
|
const getParsedStyle = (style) => {
|
|
@@ -3255,6 +3263,7 @@ exports.Chip = Chip;
|
|
|
3255
3263
|
exports.DetailsToolbar = DetailsToolbar;
|
|
3256
3264
|
exports.DropdownMenu = DropdownMenu;
|
|
3257
3265
|
exports.DropdownMenuItem = DropdownMenuItem;
|
|
3266
|
+
exports.ErrorMessage = ErrorMessage;
|
|
3258
3267
|
exports.FeeButton = FeeButton;
|
|
3259
3268
|
exports.HeadingText = HeadingText;
|
|
3260
3269
|
exports.HistoryItem = HistoryItem;
|
|
@@ -3279,5 +3288,4 @@ exports.Switch = Switch;
|
|
|
3279
3288
|
exports.TokenPair = TokenPair;
|
|
3280
3289
|
exports.Tooltip = Tooltip;
|
|
3281
3290
|
exports.UsdAmount = UsdAmount;
|
|
3282
|
-
exports.WalletAddress = WalletAddress;
|
|
3283
3291
|
exports.useModal = useModal;
|
|
@@ -7,5 +7,5 @@ interface BoostButtonProps {
|
|
|
7
7
|
}) => void;
|
|
8
8
|
boostDisabledMessage?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function BoostButton({ boostMode
|
|
10
|
+
export declare function BoostButton({ boostMode, onToggleBoostMode, canToggleBoostMode, boostDisabledMessage, }: BoostButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -3,6 +3,7 @@ interface SwitchProps {
|
|
|
3
3
|
checked?: boolean;
|
|
4
4
|
onChange?: (checked: boolean) => void;
|
|
5
5
|
size: SwitchSize;
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function Switch({ checked, onChange, size }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function Switch({ checked, onChange, size, disabled, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare function ArrowRightIcon(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
-
export declare function ChevronArrowIcon(
|
|
2
|
+
export declare function ChevronArrowIcon({ size, className, }: {
|
|
3
|
+
size?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
3
6
|
export declare function ArrowTriangle(): import("react/jsx-runtime").JSX.Element;
|
|
4
7
|
export declare function ChevronTopSmallIcon(): import("react/jsx-runtime").JSX.Element;
|
|
5
8
|
export declare function ChevronLargeDownIcon({ size }: {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export declare function EmptyHeartIcon(
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare function EmptyHeartIcon({ className }: {
|
|
2
|
+
className?: string;
|
|
3
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function FilledHeartIcon({ className }: {
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function BrokenHeartIcon({ className }: {
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
4
10
|
export declare function HeartSmallIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoostMode, DetailsToolbarState } from '../../types/components';
|
|
2
2
|
interface DetailsToolbarProps {
|
|
3
3
|
state?: DetailsToolbarState;
|
|
4
|
-
errorMessage
|
|
4
|
+
errorMessage?: string;
|
|
5
5
|
boostMode?: BoostMode;
|
|
6
6
|
onToggleBoostMode?: ({ boostMode }: {
|
|
7
7
|
boostMode: BoostMode;
|
|
@@ -12,6 +12,10 @@ interface DetailsToolbarProps {
|
|
|
12
12
|
estimatedTime?: string;
|
|
13
13
|
canToggleBoostMode?: boolean;
|
|
14
14
|
boostDisabledMessage?: string;
|
|
15
|
+
helpButton?: {
|
|
16
|
+
label: string;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
};
|
|
15
19
|
}
|
|
16
|
-
export declare function DetailsToolbar({ state, errorMessage, boostMode, onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, }: DetailsToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function DetailsToolbar({ state, errorMessage, boostMode, onToggleBoostMode, onInvertSwapButtonClick, onFeeButtonClick, feeInUsd, estimatedTime, canToggleBoostMode, boostDisabledMessage, helpButton, }: DetailsToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface ModalProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
onBackdropClick?: () => void;
|
|
4
6
|
}
|
|
5
|
-
export declare function Modal({ children }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Modal({ children, className, onBackdropClick }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare function ProductCard({ children }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
2
|
+
export declare function ProductCard({ children }: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,6 +21,9 @@ interface SwapConfigurationProps {
|
|
|
21
21
|
onAmountChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
22
22
|
onWalletButtonClick?: () => void;
|
|
23
23
|
onAssetsButtonClick?: () => void;
|
|
24
|
+
error?: {
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
24
27
|
}
|
|
25
|
-
export declare function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd, balance, isFetching, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd, balance, isFetching, chain, token, direction, onAmountChange, onWalletButtonClick, onAssetsButtonClick, address, error, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
|
|
26
29
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SwapStep } from '../../types/components';
|
|
2
|
-
export declare function SwapStepsCollapsed({ steps,
|
|
2
|
+
export declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
|
|
3
3
|
steps: SwapStep[];
|
|
4
|
-
|
|
4
|
+
currentStepIndex: number;
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './Boost';
|
|
2
2
|
export * from './DetailsToolbar';
|
|
3
3
|
export * from './DropdownMenu';
|
|
4
|
+
export * from './ErrorMessage';
|
|
4
5
|
export * from './Menu';
|
|
5
6
|
export * from './Modal';
|
|
6
7
|
export * from './NavigationBar';
|
|
@@ -9,4 +10,3 @@ export * from './SwapConfiguration';
|
|
|
9
10
|
export * from './SwapProgressViewHeader';
|
|
10
11
|
export * from './SwapStepsCollapsed';
|
|
11
12
|
export * from './TokenPair';
|
|
12
|
-
export * from './WalletAddress';
|
|
@@ -10,7 +10,9 @@ interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
|
10
10
|
mainIcon?: React.ReactNode;
|
|
11
11
|
isSelected?: boolean;
|
|
12
12
|
className?: string;
|
|
13
|
+
onDetailClick?: () => void;
|
|
14
|
+
showDetailOnHoverOnly?: boolean;
|
|
13
15
|
}
|
|
14
16
|
type ListItemSize = 'small' | 'large';
|
|
15
|
-
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface AssetsViewProps {
|
|
3
3
|
chains: {
|
|
4
4
|
name: string;
|
|
@@ -25,9 +25,5 @@ interface AssetsViewProps {
|
|
|
25
25
|
}[];
|
|
26
26
|
}
|
|
27
27
|
export declare function AssetsView({ chains, favoriteTokens, popularTokens, userTokens, }: AssetsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const List: ({ children }:
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export declare const AddFavoriteToken: () => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export declare const RemoveFavoriteToken: () => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const List: ({ children }: React.PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
33
29
|
export {};
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
import { ConfigTheme } from '../../types/config';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Because the current daisy theme only accepts HSL css variables
|
|
5
|
-
* @param hex
|
|
6
|
-
* @returns HSL string
|
|
7
|
-
*/
|
|
8
|
-
export declare const toHSL: (hex: string) => string;
|
|
9
|
-
export declare const generateForegroundColorFrom: (input: string, percentage?: number) => string;
|
|
10
|
-
export declare const generateFocusColorFrom: (input: string) => string;
|
|
11
|
-
/**
|
|
12
|
-
* Parsing the user readable config to css variables with HSL values
|
|
3
|
+
* Parsing the user readable config to css variables
|
|
13
4
|
* @param style
|
|
14
5
|
*/
|
|
15
6
|
export declare const getParsedStyle: (style?: ConfigTheme) => {
|
|
16
7
|
[key: string]: string | undefined;
|
|
17
8
|
} | undefined;
|
|
18
|
-
export declare const isColorDark: (colorHEX: string | undefined) => boolean;
|
|
19
|
-
export declare const getListItemHoverClassName: ({ transparentWidget }: {
|
|
20
|
-
transparentWidget?: boolean | undefined;
|
|
21
|
-
}) => string;
|
|
22
|
-
export declare function getDominantColor({ imageUrl, sampleSize, }: {
|
|
23
|
-
imageUrl: string;
|
|
24
|
-
sampleSize?: number;
|
|
25
|
-
}): Promise<number[]>;
|
|
26
9
|
export declare function getContrastColor({ r, g, b, }: {
|
|
27
10
|
r: number;
|
|
28
11
|
g: number;
|
|
@@ -5,5 +5,7 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const LargeChecked: Story;
|
|
7
7
|
export declare const LargeUnchecked: Story;
|
|
8
|
+
export declare const LargeDisabled: Story;
|
|
8
9
|
export declare const SmallChecked: Story;
|
|
9
10
|
export declare const SmallUnchecked: Story;
|
|
11
|
+
export declare const SmallDisabled: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ErrorMessage } from '../../components/layout/ErrorMessage';
|
|
3
|
+
declare const meta: Meta<typeof ErrorMessage>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
@@ -14,3 +14,6 @@ export declare const HighPriceImpact: Story;
|
|
|
14
14
|
export declare const IsFetching: Story;
|
|
15
15
|
export declare const AllProps: Story;
|
|
16
16
|
export declare const ToDirection: Story;
|
|
17
|
+
export declare const FromAddressEmpty: Story;
|
|
18
|
+
export declare const ToAddressEmpty: Story;
|
|
19
|
+
export declare const Error: Story;
|
|
@@ -6,4 +6,5 @@ type Story = StoryObj<typeof meta>;
|
|
|
6
6
|
export declare const FirstStep: Story;
|
|
7
7
|
export declare const MiddleStep: Story;
|
|
8
8
|
export declare const LastStep: Story;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const ShortRoute: Story;
|
|
10
|
+
export declare const LongRoute: Story;
|
|
@@ -7,10 +7,13 @@ export declare const Large: Story;
|
|
|
7
7
|
export declare const LargeWithSubtitle: Story;
|
|
8
8
|
export declare const LargeWithDetail: Story;
|
|
9
9
|
export declare const LargeWithIcon: Story;
|
|
10
|
+
export declare const LargeWithDetailAndIcon: Story;
|
|
11
|
+
export declare const LargeShowDetailOnHoverOnly: Story;
|
|
10
12
|
export declare const LargeWithSecondaryImage: Story;
|
|
11
13
|
export declare const LargeSelected: Story;
|
|
12
14
|
export declare const LargeWithCustomIconAsImage: Story;
|
|
13
15
|
export declare const Small: Story;
|
|
14
16
|
export declare const SmallWithIcon: Story;
|
|
17
|
+
export declare const SmallShowDetailOnHoverOnly: Story;
|
|
15
18
|
export declare const SmallSelected: Story;
|
|
16
19
|
export declare const SmallWithCustomIconAsImage: Story;
|
|
@@ -12,7 +12,6 @@ export type SwapStepDescriptionBlock = {
|
|
|
12
12
|
export type SwapStep = {
|
|
13
13
|
descriptionBlocks: SwapStepDescriptionBlock[];
|
|
14
14
|
chipContent: React.ReactNode;
|
|
15
|
-
routeStepOrder: number;
|
|
16
15
|
};
|
|
17
16
|
export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
|
|
18
17
|
export type ThemeType = 'light' | 'dark';
|