@0xsquid/ui 0.11.0 → 0.12.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 +63 -40
- package/dist/cjs/types/components/icons/Arrow.d.ts +2 -1
- package/dist/cjs/types/components/icons/EmojiSad.d.ts +4 -0
- package/dist/cjs/types/components/lists/HistoryItem.d.ts +4 -2
- 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/stories/lists/HistoryItem.stories.d.ts +2 -0
- package/dist/cjs/types/stories/lists/SwapStepItem.stories.d.ts +2 -1
- package/dist/cjs/types/types/config.d.ts +2 -0
- package/dist/esm/index.js +63 -40
- package/dist/esm/types/components/icons/Arrow.d.ts +2 -1
- package/dist/esm/types/components/icons/EmojiSad.d.ts +4 -0
- package/dist/esm/types/components/lists/HistoryItem.d.ts +4 -2
- 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/stories/lists/HistoryItem.stories.d.ts +2 -0
- package/dist/esm/types/stories/lists/SwapStepItem.stories.d.ts +2 -1
- package/dist/esm/types/types/config.d.ts +2 -0
- package/dist/index.css +51 -44
- package/dist/index.d.ts +9 -5
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2668,8 +2668,8 @@ function ChevronArrowIcon({ size = '16', className, }) {
|
|
|
2668
2668
|
function ArrowTriangle() {
|
|
2669
2669
|
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" }) }));
|
|
2670
2670
|
}
|
|
2671
|
-
function ChevronLargeDownIcon({ size = '24' }) {
|
|
2672
|
-
return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M3 10.5L11.0287 14.9604C11.6328 15.296 12.3672 15.296 12.9713 14.9604L21 10.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
2671
|
+
function ChevronLargeDownIcon({ size = '24', className, }) {
|
|
2672
|
+
return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.jsx("path", { d: "M3 10.5L11.0287 14.9604C11.6328 15.296 12.3672 15.296 12.9713 14.9604L21 10.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
2673
2673
|
}
|
|
2674
2674
|
function ChevronLargeRightIcon({ size = '16', className, }) {
|
|
2675
2675
|
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.66675 14L9.64035 8.64754C9.86407 8.24484 9.86407 7.75519 9.64035 7.35249L6.66675 2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
@@ -2758,6 +2758,9 @@ const themeTypesKeys = {
|
|
|
2758
2758
|
'status-positive': {
|
|
2759
2759
|
cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}status-positive`,
|
|
2760
2760
|
},
|
|
2761
|
+
'status-partial': {
|
|
2762
|
+
cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}status-partial`,
|
|
2763
|
+
},
|
|
2761
2764
|
};
|
|
2762
2765
|
|
|
2763
2766
|
function PlusIcon() {
|
|
@@ -2963,10 +2966,20 @@ const switchSizeClassMap = {
|
|
|
2963
2966
|
small: 'tw-w-[36px] tw-h-squid-m tw-p-0.5',
|
|
2964
2967
|
large: 'tw-w-[54px] tw-h-squid-l tw-p-[3px]',
|
|
2965
2968
|
};
|
|
2966
|
-
const
|
|
2969
|
+
const switchKnobSizeClassMap = {
|
|
2967
2970
|
small: 'tw-w-4 tw-h-4',
|
|
2968
2971
|
large: 'tw-w-6 tw-h-6',
|
|
2969
2972
|
};
|
|
2973
|
+
const switchKnobCheckedClassMap = {
|
|
2974
|
+
large: {
|
|
2975
|
+
checked: 'tw-left-[26px]',
|
|
2976
|
+
unchecked: 'tw-left-[2px]',
|
|
2977
|
+
},
|
|
2978
|
+
small: {
|
|
2979
|
+
checked: 'tw-left-[17px]',
|
|
2980
|
+
unchecked: 'tw-left-[1px]',
|
|
2981
|
+
},
|
|
2982
|
+
};
|
|
2970
2983
|
function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
2971
2984
|
return (
|
|
2972
2985
|
// Switch container
|
|
@@ -2980,11 +2993,11 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
|
2980
2993
|
filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
|
|
2981
2994
|
}, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
|
|
2982
2995
|
// size styles
|
|
2983
|
-
|
|
2984
|
-
//
|
|
2985
|
-
checked
|
|
2986
|
-
? '
|
|
2987
|
-
: '
|
|
2996
|
+
switchKnobSizeClassMap[size],
|
|
2997
|
+
// checked styles
|
|
2998
|
+
switchKnobCheckedClassMap[size][checked ? 'checked' : 'unchecked'], checked
|
|
2999
|
+
? 'group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900'
|
|
3000
|
+
: 'tw-bg-grey-500') })] }));
|
|
2988
3001
|
}
|
|
2989
3002
|
|
|
2990
3003
|
const borderRadiusClassMap = {
|
|
@@ -3115,6 +3128,9 @@ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessa
|
|
|
3115
3128
|
function EmojiSadIcon({ className }) {
|
|
3116
3129
|
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" }) }));
|
|
3117
3130
|
}
|
|
3131
|
+
function EmojiMeh({ className, size = '20', }) {
|
|
3132
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, 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 10ZM7.25 9C7.94036 9 8.5 8.32843 8.5 7.5C8.5 6.67157 7.94036 6 7.25 6C6.55964 6 6 6.67157 6 7.5C6 8.32843 6.55964 9 7.25 9ZM14 7.5C14 8.32843 13.4404 9 12.75 9C12.0596 9 11.5 8.32843 11.5 7.5C11.5 6.67157 12.0596 6 12.75 6C13.4404 6 14 6.67157 14 7.5ZM7 12C6.44772 12 6 12.4477 6 13C6 13.5523 6.44772 14 7 14H13C13.5523 14 14 13.5523 14 13C14 12.4477 13.5523 12 13 12H7Z", fill: "currentColor" }) }));
|
|
3133
|
+
}
|
|
3118
3134
|
|
|
3119
3135
|
function ErrorMessage({ message, showIcon = true }) {
|
|
3120
3136
|
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: [showIcon ? jsxRuntime.jsx(EmojiSadIcon, {}) : null, jsxRuntime.jsx(CaptionText, { children: message })] }));
|
|
@@ -3137,7 +3153,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
|
|
|
3137
3153
|
return 'full';
|
|
3138
3154
|
}, [errorMessage, isLoading, isEmpty]);
|
|
3139
3155
|
const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
|
|
3140
|
-
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 }) })] })) }));
|
|
3156
|
+
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-group/arrow-button tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsxRuntime.jsx(ChevronLargeDownIcon, { className: "tw-transition-transform tw-duration-150 group-hover/arrow-button:tw-rotate-180" }) })) }), jsxRuntime.jsx("div", { className: detailClassName, children: jsxRuntime.jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
|
|
3141
3157
|
}
|
|
3142
3158
|
|
|
3143
3159
|
function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }) {
|
|
@@ -3194,37 +3210,31 @@ const statusBadge = {
|
|
|
3194
3210
|
containerClassName: 'tw-bg-royal-400',
|
|
3195
3211
|
},
|
|
3196
3212
|
failed: {
|
|
3197
|
-
badge: (jsxRuntime.jsx("span", { className: "
|
|
3213
|
+
badge: (jsxRuntime.jsx("span", { className: "tw-bg-grey-900", children: jsxRuntime.jsx(EmojiSadIcon, { className: "tw-text-status-negative" }) })),
|
|
3198
3214
|
containerClassName: 'tw-bg-status-negative',
|
|
3199
3215
|
},
|
|
3216
|
+
warning: {
|
|
3217
|
+
badge: (jsxRuntime.jsx("span", { className: "tw-bg-grey-900", children: jsxRuntime.jsx(EmojiMeh, { className: "tw-text-status-partial" }) })),
|
|
3218
|
+
containerClassName: 'tw-bg-status-partial',
|
|
3219
|
+
},
|
|
3200
3220
|
};
|
|
3201
|
-
function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }) {
|
|
3221
|
+
function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, warningLabel, onClick, }) {
|
|
3202
3222
|
const { isDropdownOpen, dropdownRef, openDropdownButtonRef, openDropdown } = useDropdownMenu();
|
|
3203
3223
|
const [dropdownPosition, setDropdownPosition] = react.useState(null);
|
|
3204
3224
|
const itemRef = react.useRef(null);
|
|
3205
3225
|
const menuRef = react.useRef(null);
|
|
3206
|
-
const
|
|
3226
|
+
const statusLabel = react.useMemo(() => {
|
|
3207
3227
|
switch (status) {
|
|
3208
3228
|
case 'completed':
|
|
3209
|
-
return {
|
|
3210
|
-
label: dateCompleted,
|
|
3211
|
-
className: '',
|
|
3212
|
-
};
|
|
3229
|
+
return jsxRuntime.jsx(CaptionText, { children: dateCompleted });
|
|
3213
3230
|
case 'pending':
|
|
3214
|
-
return {
|
|
3215
|
-
label: 'Pending',
|
|
3216
|
-
className: 'tw-text-royal-400',
|
|
3217
|
-
};
|
|
3231
|
+
return jsxRuntime.jsx(CaptionText, { className: "tw-text-royal-400", children: "Pending" });
|
|
3218
3232
|
case 'failed':
|
|
3219
|
-
return {
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
};
|
|
3233
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(CaptionText, { className: "tw-text-status-negative", children: "Fail" }), jsxRuntime.jsx(CaptionText, { children: dateCompleted })] }));
|
|
3234
|
+
case 'warning':
|
|
3235
|
+
return (jsxRuntime.jsx(CaptionText, { className: "tw-text-status-partial", children: warningLabel }));
|
|
3223
3236
|
default:
|
|
3224
|
-
return
|
|
3225
|
-
label: '',
|
|
3226
|
-
className: '',
|
|
3227
|
-
};
|
|
3237
|
+
return null;
|
|
3228
3238
|
}
|
|
3229
3239
|
}, [status, dateCompleted]);
|
|
3230
3240
|
// Effect to find the best position for the dropdown menu, so it's always visible for the user
|
|
@@ -3271,10 +3281,17 @@ function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount,
|
|
|
3271
3281
|
setDropdownPosition('top');
|
|
3272
3282
|
}
|
|
3273
3283
|
}, [isDropdownOpen, menuRef, dropdownPosition, itemRef]);
|
|
3274
|
-
|
|
3275
|
-
|
|
3284
|
+
const isInteractive = !!onClick;
|
|
3285
|
+
const ItemTag = isInteractive ? 'button' : 'div';
|
|
3286
|
+
const itemTagProps = isInteractive
|
|
3287
|
+
? {
|
|
3288
|
+
onClick,
|
|
3289
|
+
}
|
|
3290
|
+
: {};
|
|
3291
|
+
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(ItemTag, Object.assign({}, itemTagProps, { className: cn('tw-group/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isInteractive && '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('tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs', !!dropdownMenuItems &&
|
|
3292
|
+
'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: statusLabel })] }), 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,
|
|
3276
3293
|
// only show dropdown menu if there is a position defined for it
|
|
3277
|
-
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] }) }));
|
|
3294
|
+
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] })) }));
|
|
3278
3295
|
}
|
|
3279
3296
|
|
|
3280
3297
|
const listItemSizeMap = {
|
|
@@ -3282,27 +3299,28 @@ const listItemSizeMap = {
|
|
|
3282
3299
|
large: 'tw-max-w-list-item-large tw-h-list-item-large tw-px-squid-xs',
|
|
3283
3300
|
};
|
|
3284
3301
|
function ListItem(_a) {
|
|
3285
|
-
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"]);
|
|
3302
|
+
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"]);
|
|
3286
3303
|
// 'small' variant does not have detail
|
|
3287
3304
|
const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
|
|
3288
|
-
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-
|
|
3305
|
+
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-xxs',
|
|
3289
3306
|
// 'large' variant has extra padding
|
|
3290
|
-
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className:
|
|
3291
|
-
((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-
|
|
3307
|
+
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
3308
|
+
((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-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500", children: subtitle })) : null)] }), showDetail && (jsxRuntime.jsxs("button", { onClick: (event) => {
|
|
3292
3309
|
// prevent click event from bubbling up to parent
|
|
3293
3310
|
event.stopPropagation();
|
|
3294
3311
|
onDetailClick === null || onDetailClick === void 0 ? void 0 : onDetailClick();
|
|
3295
3312
|
}, 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
|
|
3296
3313
|
? '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'
|
|
3297
|
-
: '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] }))] })) }));
|
|
3314
|
+
: '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] }))] })) })));
|
|
3298
3315
|
}
|
|
3299
3316
|
|
|
3300
3317
|
function MenuItem({ label, imageUrl, icon }) {
|
|
3301
3318
|
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 })] }));
|
|
3302
3319
|
}
|
|
3303
3320
|
|
|
3304
|
-
function SectionTitle(
|
|
3305
|
-
|
|
3321
|
+
function SectionTitle(_a) {
|
|
3322
|
+
var { title, icon, accessory, actionIcon, className } = _a, props = __rest(_a, ["title", "icon", "accessory", "actionIcon", "className"]);
|
|
3323
|
+
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] })));
|
|
3306
3324
|
}
|
|
3307
3325
|
|
|
3308
3326
|
function HelpIcon({ size = '20', className, }) {
|
|
@@ -3358,13 +3376,13 @@ function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = fals
|
|
|
3358
3376
|
value
|
|
3359
3377
|
.trim()
|
|
3360
3378
|
.split(' ')
|
|
3361
|
-
.map((word, i) => (jsxRuntime.jsx(BodyText, { size: "small", className: "tw-leading-[
|
|
3379
|
+
.map((word, i) => (jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
|
|
3362
3380
|
}
|
|
3363
3381
|
else if (type === 'image') {
|
|
3364
3382
|
return (jsxRuntime.jsx("img", { src: value, className: "tw-h-squid-m tw-w-squid-m tw-rounded-full" }, index));
|
|
3365
3383
|
}
|
|
3366
3384
|
return null;
|
|
3367
|
-
}) })
|
|
3385
|
+
}) })] })] }));
|
|
3368
3386
|
}
|
|
3369
3387
|
|
|
3370
3388
|
function DropdownMenu({ dropdownRef, items, className, menuRef, isHidden = false, listClassName, }) {
|
|
@@ -3539,6 +3557,7 @@ const lightTheme = {
|
|
|
3539
3557
|
// status
|
|
3540
3558
|
'status-positive': '#11D421',
|
|
3541
3559
|
'status-negative': '#FF5B4D',
|
|
3560
|
+
'status-warning': '#EC9213',
|
|
3542
3561
|
// transparent
|
|
3543
3562
|
'transparent-light-thin': '#17191C1A', // 10% opacity
|
|
3544
3563
|
'transparent-light-average': '#17191C54', // 33% opacity
|
|
@@ -3561,6 +3580,10 @@ const themeKeysToReplace = [
|
|
|
3561
3580
|
userKey: 'transparent',
|
|
3562
3581
|
internalKey: 'material',
|
|
3563
3582
|
},
|
|
3583
|
+
{
|
|
3584
|
+
userKey: 'status-warning',
|
|
3585
|
+
internalKey: 'status-partial',
|
|
3586
|
+
},
|
|
3564
3587
|
];
|
|
3565
3588
|
/**
|
|
3566
3589
|
* Parsing the user readable config to css variables
|
|
@@ -5,8 +5,9 @@ export declare function ChevronArrowIcon({ size, className, }: {
|
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function ArrowTriangle(): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function ChevronTopSmallIcon(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function ChevronLargeDownIcon({ size }: {
|
|
8
|
+
export declare function ChevronLargeDownIcon({ size, className, }: {
|
|
9
9
|
size?: string;
|
|
10
|
+
className?: string;
|
|
10
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export declare function ChevronTopIcon(): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare function ChevronLargeRightIcon({ size, className, }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DropdownMenuItemProps } from './DropdownMenuItem';
|
|
3
|
-
type HistoryItemStatus = 'completed' | 'pending' | 'failed';
|
|
3
|
+
type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
|
|
4
4
|
interface HistoryItemProps {
|
|
5
5
|
firstImageUrl: string;
|
|
6
6
|
secondImageUrl: string;
|
|
@@ -12,6 +12,8 @@ interface HistoryItemProps {
|
|
|
12
12
|
toAmount: string;
|
|
13
13
|
dropdownMenuItems?: DropdownMenuItemProps[];
|
|
14
14
|
itemsContainerRef?: React.RefObject<HTMLElement>;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
warningLabel?: string;
|
|
15
17
|
}
|
|
16
|
-
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, warningLabel, onClick, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
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 {};
|
|
@@ -6,4 +6,6 @@ type Story = StoryObj<typeof meta>;
|
|
|
6
6
|
export declare const Completed: Story;
|
|
7
7
|
export declare const Pending: Story;
|
|
8
8
|
export declare const Failed: Story;
|
|
9
|
+
export declare const Warning: Story;
|
|
9
10
|
export declare const WithActions: Story;
|
|
11
|
+
export declare const IsClickable: Story;
|
|
@@ -8,6 +8,7 @@ export declare const Pending: Story;
|
|
|
8
8
|
export declare const Progress: Story;
|
|
9
9
|
export declare const CustomDescription: Story;
|
|
10
10
|
export declare const ShowSeparator: Story;
|
|
11
|
+
export declare const Link: Story;
|
|
11
12
|
export declare const LongDescription: Story;
|
|
12
13
|
export declare const LongDescriptionWithSeparator: Story;
|
|
13
|
-
export declare const
|
|
14
|
+
export declare const LongDescriptionWithSeparatorAndLink: Story;
|
|
@@ -16,6 +16,7 @@ export interface InternalSquidTheme {
|
|
|
16
16
|
'royal-500': string;
|
|
17
17
|
'status-positive': string;
|
|
18
18
|
'status-negative': string;
|
|
19
|
+
'status-partial': string;
|
|
19
20
|
'material-light-thin': string;
|
|
20
21
|
'material-light-average': string;
|
|
21
22
|
'material-light-thick': string;
|
|
@@ -37,6 +38,7 @@ export type SquidTheme = {
|
|
|
37
38
|
'accent-500': string;
|
|
38
39
|
'status-positive': string;
|
|
39
40
|
'status-negative': string;
|
|
41
|
+
'status-warning': string;
|
|
40
42
|
'transparent-light-thin': string;
|
|
41
43
|
'transparent-light-average': string;
|
|
42
44
|
'transparent-light-thick': string;
|
package/dist/esm/index.js
CHANGED
|
@@ -2666,8 +2666,8 @@ function ChevronArrowIcon({ size = '16', className, }) {
|
|
|
2666
2666
|
function ArrowTriangle() {
|
|
2667
2667
|
return (jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: 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" }) }));
|
|
2668
2668
|
}
|
|
2669
|
-
function ChevronLargeDownIcon({ size = '24' }) {
|
|
2670
|
-
return (jsx("svg", { width: size, height: size, viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M3 10.5L11.0287 14.9604C11.6328 15.296 12.3672 15.296 12.9713 14.9604L21 10.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
2669
|
+
function ChevronLargeDownIcon({ size = '24', className, }) {
|
|
2670
|
+
return (jsx("svg", { width: size, height: size, viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M3 10.5L11.0287 14.9604C11.6328 15.296 12.3672 15.296 12.9713 14.9604L21 10.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
2671
2671
|
}
|
|
2672
2672
|
function ChevronLargeRightIcon({ size = '16', className, }) {
|
|
2673
2673
|
return (jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M6.66675 14L9.64035 8.64754C9.86407 8.24484 9.86407 7.75519 9.64035 7.35249L6.66675 2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
@@ -2756,6 +2756,9 @@ const themeTypesKeys = {
|
|
|
2756
2756
|
'status-positive': {
|
|
2757
2757
|
cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}status-positive`,
|
|
2758
2758
|
},
|
|
2759
|
+
'status-partial': {
|
|
2760
|
+
cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}status-partial`,
|
|
2761
|
+
},
|
|
2759
2762
|
};
|
|
2760
2763
|
|
|
2761
2764
|
function PlusIcon() {
|
|
@@ -2961,10 +2964,20 @@ const switchSizeClassMap = {
|
|
|
2961
2964
|
small: 'tw-w-[36px] tw-h-squid-m tw-p-0.5',
|
|
2962
2965
|
large: 'tw-w-[54px] tw-h-squid-l tw-p-[3px]',
|
|
2963
2966
|
};
|
|
2964
|
-
const
|
|
2967
|
+
const switchKnobSizeClassMap = {
|
|
2965
2968
|
small: 'tw-w-4 tw-h-4',
|
|
2966
2969
|
large: 'tw-w-6 tw-h-6',
|
|
2967
2970
|
};
|
|
2971
|
+
const switchKnobCheckedClassMap = {
|
|
2972
|
+
large: {
|
|
2973
|
+
checked: 'tw-left-[26px]',
|
|
2974
|
+
unchecked: 'tw-left-[2px]',
|
|
2975
|
+
},
|
|
2976
|
+
small: {
|
|
2977
|
+
checked: 'tw-left-[17px]',
|
|
2978
|
+
unchecked: 'tw-left-[1px]',
|
|
2979
|
+
},
|
|
2980
|
+
};
|
|
2968
2981
|
function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
2969
2982
|
return (
|
|
2970
2983
|
// Switch container
|
|
@@ -2978,11 +2991,11 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
|
2978
2991
|
filter: 'drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))',
|
|
2979
2992
|
}, className: clsx('tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all',
|
|
2980
2993
|
// size styles
|
|
2981
|
-
|
|
2982
|
-
//
|
|
2983
|
-
checked
|
|
2984
|
-
? '
|
|
2985
|
-
: '
|
|
2994
|
+
switchKnobSizeClassMap[size],
|
|
2995
|
+
// checked styles
|
|
2996
|
+
switchKnobCheckedClassMap[size][checked ? 'checked' : 'unchecked'], checked
|
|
2997
|
+
? 'group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900'
|
|
2998
|
+
: 'tw-bg-grey-500') })] }));
|
|
2986
2999
|
}
|
|
2987
3000
|
|
|
2988
3001
|
const borderRadiusClassMap = {
|
|
@@ -3113,6 +3126,9 @@ function Boost({ boostMode, onToggleBoostMode, estimatedTime, boostDisabledMessa
|
|
|
3113
3126
|
function EmojiSadIcon({ className }) {
|
|
3114
3127
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", className: className, children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20ZM13.5341 12.4645C11.5815 10.5118 8.41568 10.5118 6.46306 12.4645C6.07254 12.855 6.07254 13.4882 6.46306 13.8787C6.85358 14.2692 7.48675 14.2692 7.87727 13.8787C9.04885 12.7071 10.9483 12.7071 12.1199 13.8787C12.5104 14.2692 13.1436 14.2692 13.5341 13.8787C13.9247 13.4882 13.9247 12.855 13.5341 12.4645ZM8.5 7.5C8.5 8.32843 7.94036 9 7.25 9C6.55964 9 6 8.32843 6 7.5C6 6.67157 6.55964 6 7.25 6C7.94036 6 8.5 6.67157 8.5 7.5ZM12.75 9C13.4404 9 14 8.32843 14 7.5C14 6.67157 13.4404 6 12.75 6C12.0596 6 11.5 6.67157 11.5 7.5C11.5 8.32843 12.0596 9 12.75 9Z", fill: "currentColor" }) }));
|
|
3115
3128
|
}
|
|
3129
|
+
function EmojiMeh({ className, size = '20', }) {
|
|
3130
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10ZM7.25 9C7.94036 9 8.5 8.32843 8.5 7.5C8.5 6.67157 7.94036 6 7.25 6C6.55964 6 6 6.67157 6 7.5C6 8.32843 6.55964 9 7.25 9ZM14 7.5C14 8.32843 13.4404 9 12.75 9C12.0596 9 11.5 8.32843 11.5 7.5C11.5 6.67157 12.0596 6 12.75 6C13.4404 6 14 6.67157 14 7.5ZM7 12C6.44772 12 6 12.4477 6 13C6 13.5523 6.44772 14 7 14H13C13.5523 14 14 13.5523 14 13C14 12.4477 13.5523 12 13 12H7Z", fill: "currentColor" }) }));
|
|
3131
|
+
}
|
|
3116
3132
|
|
|
3117
3133
|
function ErrorMessage({ message, showIcon = true }) {
|
|
3118
3134
|
return (jsxs("div", { className: "tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-status-negative", children: [showIcon ? jsx(EmojiSadIcon, {}) : null, jsx(CaptionText, { children: message })] }));
|
|
@@ -3135,7 +3151,7 @@ function DetailsToolbar({ errorMessage, boostMode = 'normal', onToggleBoostMode,
|
|
|
3135
3151
|
return 'full';
|
|
3136
3152
|
}, [errorMessage, isLoading, isEmpty]);
|
|
3137
3153
|
const detailClassName = cn('tw-w-[190px]', detailStateClassMap[state]);
|
|
3138
|
-
return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-[480px] tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500', state === 'error' ? 'tw-px-squid-l' : 'tw-px-squid-m'), children: state === 'error' && errorMessage ? (jsxs(Fragment, { children: [jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsx(Button, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsx(Loader, { size: "32" })) : (jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsx(ChevronLargeDownIcon, {}) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
|
|
3154
|
+
return (jsx("aside", { className: cn('tw-flex tw-h-[50px] tw-w-[480px] tw-items-center tw-justify-around tw-border-t tw-border-t-material-light-thin tw-bg-grey-900 tw-py-squid-xxs tw-text-grey-500', state === 'error' ? 'tw-px-squid-l' : 'tw-px-squid-m'), children: state === 'error' && errorMessage ? (jsxs(Fragment, { children: [jsx(ErrorMessage, { message: errorMessage }), helpButton ? (jsx(Button, { onClick: helpButton.onClick, size: "md", variant: "tertiary", label: helpButton.label })) : null] })) : (jsxs(Fragment, { children: [jsx("div", { className: detailClassName, children: jsx(FeeButton, { feeInUsd: feeInUsd, onClick: onFeeButtonClick }) }), jsx("div", { className: "tw-flex tw-h-squid-xl tw-w-squid-xxl tw-items-center tw-justify-center", children: state === 'loading' ? (jsx(Loader, { size: "32" })) : (jsx(Button, { variant: "tertiary", size: "md", onClick: onInvertSwapButtonClick, className: "tw-group/arrow-button tw-border-transparent tw-bg-transparent hover:tw-bg-material-light-thin", icon: jsx(ChevronLargeDownIcon, { className: "tw-transition-transform tw-duration-150 group-hover/arrow-button:tw-rotate-180" }) })) }), jsx("div", { className: detailClassName, children: jsx(Boost, { estimatedTime: estimatedTime !== null && estimatedTime !== void 0 ? estimatedTime : '0s', boostMode: boostMode, onToggleBoostMode: onToggleBoostMode, canToggleBoostMode: state === 'loading' ? false : canToggleBoostMode, boostDisabledMessage: boostDisabledMessage, boostTooltipDisplayDelayMs: boostTooltipDisplayDelayMs }) })] })) }));
|
|
3139
3155
|
}
|
|
3140
3156
|
|
|
3141
3157
|
function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }) {
|
|
@@ -3192,37 +3208,31 @@ const statusBadge = {
|
|
|
3192
3208
|
containerClassName: 'tw-bg-royal-400',
|
|
3193
3209
|
},
|
|
3194
3210
|
failed: {
|
|
3195
|
-
badge: (jsx("span", { className: "
|
|
3211
|
+
badge: (jsx("span", { className: "tw-bg-grey-900", children: jsx(EmojiSadIcon, { className: "tw-text-status-negative" }) })),
|
|
3196
3212
|
containerClassName: 'tw-bg-status-negative',
|
|
3197
3213
|
},
|
|
3214
|
+
warning: {
|
|
3215
|
+
badge: (jsx("span", { className: "tw-bg-grey-900", children: jsx(EmojiMeh, { className: "tw-text-status-partial" }) })),
|
|
3216
|
+
containerClassName: 'tw-bg-status-partial',
|
|
3217
|
+
},
|
|
3198
3218
|
};
|
|
3199
|
-
function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }) {
|
|
3219
|
+
function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, warningLabel, onClick, }) {
|
|
3200
3220
|
const { isDropdownOpen, dropdownRef, openDropdownButtonRef, openDropdown } = useDropdownMenu();
|
|
3201
3221
|
const [dropdownPosition, setDropdownPosition] = useState(null);
|
|
3202
3222
|
const itemRef = useRef(null);
|
|
3203
3223
|
const menuRef = useRef(null);
|
|
3204
|
-
const
|
|
3224
|
+
const statusLabel = useMemo(() => {
|
|
3205
3225
|
switch (status) {
|
|
3206
3226
|
case 'completed':
|
|
3207
|
-
return {
|
|
3208
|
-
label: dateCompleted,
|
|
3209
|
-
className: '',
|
|
3210
|
-
};
|
|
3227
|
+
return jsx(CaptionText, { children: dateCompleted });
|
|
3211
3228
|
case 'pending':
|
|
3212
|
-
return {
|
|
3213
|
-
label: 'Pending',
|
|
3214
|
-
className: 'tw-text-royal-400',
|
|
3215
|
-
};
|
|
3229
|
+
return jsx(CaptionText, { className: "tw-text-royal-400", children: "Pending" });
|
|
3216
3230
|
case 'failed':
|
|
3217
|
-
return {
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
};
|
|
3231
|
+
return (jsxs(Fragment, { children: [jsx(CaptionText, { className: "tw-text-status-negative", children: "Fail" }), jsx(CaptionText, { children: dateCompleted })] }));
|
|
3232
|
+
case 'warning':
|
|
3233
|
+
return (jsx(CaptionText, { className: "tw-text-status-partial", children: warningLabel }));
|
|
3221
3234
|
default:
|
|
3222
|
-
return
|
|
3223
|
-
label: '',
|
|
3224
|
-
className: '',
|
|
3225
|
-
};
|
|
3235
|
+
return null;
|
|
3226
3236
|
}
|
|
3227
3237
|
}, [status, dateCompleted]);
|
|
3228
3238
|
// Effect to find the best position for the dropdown menu, so it's always visible for the user
|
|
@@ -3269,10 +3279,17 @@ function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount,
|
|
|
3269
3279
|
setDropdownPosition('top');
|
|
3270
3280
|
}
|
|
3271
3281
|
}, [isDropdownOpen, menuRef, dropdownPosition, itemRef]);
|
|
3272
|
-
|
|
3273
|
-
|
|
3282
|
+
const isInteractive = !!onClick;
|
|
3283
|
+
const ItemTag = isInteractive ? 'button' : 'div';
|
|
3284
|
+
const itemTagProps = isInteractive
|
|
3285
|
+
? {
|
|
3286
|
+
onClick,
|
|
3287
|
+
}
|
|
3288
|
+
: {};
|
|
3289
|
+
return (jsx("li", { ref: itemRef, className: "tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", children: jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn('tw-group/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isInteractive && 'hover:tw-bg-material-light-thin'), children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsx("span", { className: cn('tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5', statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), !!dropdownMenuItems && (jsx("button", { className: "tw-peer tw-absolute tw-right-squid-xxs tw-top-squid-xxs tw-flex tw-h-squid-xl tw-w-squid-xl tw-items-center tw-justify-center tw-rounded-squid-xs tw-bg-material-light-thin tw-p-2 tw-text-grey-300 tw-opacity-0 tw-transition-opacity focus:tw-opacity-100 group-hover/history-item:tw-opacity-100", onClick: openDropdown, ref: openDropdownButtonRef, children: jsx(DotGrid1x3HorizontalIcon, { size: "24" }) })), jsx("div", { className: cn('tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs', !!dropdownMenuItems &&
|
|
3290
|
+
'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: statusLabel })] }), jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsx(BodyText, { size: "small", children: fromAmount }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronLargeRightIcon, {}) }), jsx(BodyText, { size: "small", children: toAmount })] })] }), isDropdownOpen && !!dropdownMenuItems ? (jsx(DropdownMenu, { menuRef: menuRef,
|
|
3274
3291
|
// only show dropdown menu if there is a position defined for it
|
|
3275
|
-
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] }) }));
|
|
3292
|
+
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] })) }));
|
|
3276
3293
|
}
|
|
3277
3294
|
|
|
3278
3295
|
const listItemSizeMap = {
|
|
@@ -3280,27 +3297,28 @@ const listItemSizeMap = {
|
|
|
3280
3297
|
large: 'tw-max-w-list-item-large tw-h-list-item-large tw-px-squid-xs',
|
|
3281
3298
|
};
|
|
3282
3299
|
function ListItem(_a) {
|
|
3283
|
-
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"]);
|
|
3300
|
+
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"]);
|
|
3284
3301
|
// 'small' variant does not have detail
|
|
3285
3302
|
const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
|
|
3286
|
-
return (jsx("li", { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs("button", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && 'tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-
|
|
3303
|
+
return (jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs("button", Object.assign({}, props, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-cursor-pointer tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin', isSelected && 'tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
|
|
3287
3304
|
// 'large' variant has extra padding
|
|
3288
|
-
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className:
|
|
3289
|
-
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsx(CaptionText, { className: "tw-h-
|
|
3305
|
+
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
3306
|
+
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsx(CaptionText, { className: "tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500", children: subtitle })) : null)] }), showDetail && (jsxs("button", { onClick: (event) => {
|
|
3290
3307
|
// prevent click event from bubbling up to parent
|
|
3291
3308
|
event.stopPropagation();
|
|
3292
3309
|
onDetailClick === null || onDetailClick === void 0 ? void 0 : onDetailClick();
|
|
3293
3310
|
}, 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
|
|
3294
3311
|
? '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'
|
|
3295
|
-
: 'tw-flex', detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] }))] })) }));
|
|
3312
|
+
: 'tw-flex', detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] }))] })) })));
|
|
3296
3313
|
}
|
|
3297
3314
|
|
|
3298
3315
|
function MenuItem({ label, imageUrl, icon }) {
|
|
3299
3316
|
return (jsxs("li", { className: "tw-mx-squid-xxs tw-inline-flex tw-max-h-list-item-small tw-items-center tw-justify-start tw-gap-squid-xxs tw-rounded-squid-xs tw-bg-grey-900 tw-py-squid-xxs tw-pl-squid-xxs tw-pr-squid-xl tw-text-grey-300", children: [jsx("div", { className: "tw-h-squid-m tw-w-squid-m", children: imageUrl ? (jsx("img", { className: "tw-h-full tw-w-full tw-rounded-squid-xxs", src: imageUrl, alt: "" })) : icon ? (icon) : null }), jsx(CaptionText, { children: label })] }));
|
|
3300
3317
|
}
|
|
3301
3318
|
|
|
3302
|
-
function SectionTitle(
|
|
3303
|
-
|
|
3319
|
+
function SectionTitle(_a) {
|
|
3320
|
+
var { title, icon, accessory, actionIcon, className } = _a, props = __rest(_a, ["title", "icon", "accessory", "actionIcon", "className"]);
|
|
3321
|
+
return (jsxs("header", Object.assign({}, props, { className: cn('tw-flex tw-h-[46px] tw-w-full tw-items-center tw-gap-squid-xxs tw-bg-grey-900 tw-px-squid-m tw-pb-squid-xs tw-pt-squid-m tw-text-royal-400', className), children: [icon, jsx(CaptionText, { children: title }), accessory ? (jsx(CaptionText, { className: "tw-flex-1 tw-text-right tw-text-grey-500", children: accessory })) : actionIcon ? (jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end", children: actionIcon })) : null] })));
|
|
3304
3322
|
}
|
|
3305
3323
|
|
|
3306
3324
|
function HelpIcon({ size = '20', className, }) {
|
|
@@ -3356,13 +3374,13 @@ function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = fals
|
|
|
3356
3374
|
value
|
|
3357
3375
|
.trim()
|
|
3358
3376
|
.split(' ')
|
|
3359
|
-
.map((word, i) => (jsx(BodyText, { size: "small", className: "tw-leading-[
|
|
3377
|
+
.map((word, i) => (jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
|
|
3360
3378
|
}
|
|
3361
3379
|
else if (type === 'image') {
|
|
3362
3380
|
return (jsx("img", { src: value, className: "tw-h-squid-m tw-w-squid-m tw-rounded-full" }, index));
|
|
3363
3381
|
}
|
|
3364
3382
|
return null;
|
|
3365
|
-
}) })
|
|
3383
|
+
}) })] })] }));
|
|
3366
3384
|
}
|
|
3367
3385
|
|
|
3368
3386
|
function DropdownMenu({ dropdownRef, items, className, menuRef, isHidden = false, listClassName, }) {
|
|
@@ -3537,6 +3555,7 @@ const lightTheme = {
|
|
|
3537
3555
|
// status
|
|
3538
3556
|
'status-positive': '#11D421',
|
|
3539
3557
|
'status-negative': '#FF5B4D',
|
|
3558
|
+
'status-warning': '#EC9213',
|
|
3540
3559
|
// transparent
|
|
3541
3560
|
'transparent-light-thin': '#17191C1A', // 10% opacity
|
|
3542
3561
|
'transparent-light-average': '#17191C54', // 33% opacity
|
|
@@ -3559,6 +3578,10 @@ const themeKeysToReplace = [
|
|
|
3559
3578
|
userKey: 'transparent',
|
|
3560
3579
|
internalKey: 'material',
|
|
3561
3580
|
},
|
|
3581
|
+
{
|
|
3582
|
+
userKey: 'status-warning',
|
|
3583
|
+
internalKey: 'status-partial',
|
|
3584
|
+
},
|
|
3562
3585
|
];
|
|
3563
3586
|
/**
|
|
3564
3587
|
* Parsing the user readable config to css variables
|
|
@@ -5,8 +5,9 @@ export declare function ChevronArrowIcon({ size, className, }: {
|
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function ArrowTriangle(): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function ChevronTopSmallIcon(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function ChevronLargeDownIcon({ size }: {
|
|
8
|
+
export declare function ChevronLargeDownIcon({ size, className, }: {
|
|
9
9
|
size?: string;
|
|
10
|
+
className?: string;
|
|
10
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export declare function ChevronTopIcon(): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare function ChevronLargeRightIcon({ size, className, }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DropdownMenuItemProps } from './DropdownMenuItem';
|
|
3
|
-
type HistoryItemStatus = 'completed' | 'pending' | 'failed';
|
|
3
|
+
type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
|
|
4
4
|
interface HistoryItemProps {
|
|
5
5
|
firstImageUrl: string;
|
|
6
6
|
secondImageUrl: string;
|
|
@@ -12,6 +12,8 @@ interface HistoryItemProps {
|
|
|
12
12
|
toAmount: string;
|
|
13
13
|
dropdownMenuItems?: DropdownMenuItemProps[];
|
|
14
14
|
itemsContainerRef?: React.RefObject<HTMLElement>;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
warningLabel?: string;
|
|
15
17
|
}
|
|
16
|
-
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, warningLabel, onClick, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
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 {};
|
|
@@ -6,4 +6,6 @@ type Story = StoryObj<typeof meta>;
|
|
|
6
6
|
export declare const Completed: Story;
|
|
7
7
|
export declare const Pending: Story;
|
|
8
8
|
export declare const Failed: Story;
|
|
9
|
+
export declare const Warning: Story;
|
|
9
10
|
export declare const WithActions: Story;
|
|
11
|
+
export declare const IsClickable: Story;
|
|
@@ -8,6 +8,7 @@ export declare const Pending: Story;
|
|
|
8
8
|
export declare const Progress: Story;
|
|
9
9
|
export declare const CustomDescription: Story;
|
|
10
10
|
export declare const ShowSeparator: Story;
|
|
11
|
+
export declare const Link: Story;
|
|
11
12
|
export declare const LongDescription: Story;
|
|
12
13
|
export declare const LongDescriptionWithSeparator: Story;
|
|
13
|
-
export declare const
|
|
14
|
+
export declare const LongDescriptionWithSeparatorAndLink: Story;
|
|
@@ -16,6 +16,7 @@ export interface InternalSquidTheme {
|
|
|
16
16
|
'royal-500': string;
|
|
17
17
|
'status-positive': string;
|
|
18
18
|
'status-negative': string;
|
|
19
|
+
'status-partial': string;
|
|
19
20
|
'material-light-thin': string;
|
|
20
21
|
'material-light-average': string;
|
|
21
22
|
'material-light-thick': string;
|
|
@@ -37,6 +38,7 @@ export type SquidTheme = {
|
|
|
37
38
|
'accent-500': string;
|
|
38
39
|
'status-positive': string;
|
|
39
40
|
'status-negative': string;
|
|
41
|
+
'status-warning': string;
|
|
40
42
|
'transparent-light-thin': string;
|
|
41
43
|
'transparent-light-average': string;
|
|
42
44
|
'transparent-light-thick': string;
|
package/dist/index.css
CHANGED
|
@@ -681,6 +681,22 @@ video {
|
|
|
681
681
|
left: 15px;
|
|
682
682
|
}
|
|
683
683
|
|
|
684
|
+
.tw-left-\[17px\] {
|
|
685
|
+
left: 17px;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.tw-left-\[1px\] {
|
|
689
|
+
left: 1px;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.tw-left-\[26px\] {
|
|
693
|
+
left: 26px;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.tw-left-\[2px\] {
|
|
697
|
+
left: 2px;
|
|
698
|
+
}
|
|
699
|
+
|
|
684
700
|
.tw-left-\[54px\] {
|
|
685
701
|
left: 54px;
|
|
686
702
|
}
|
|
@@ -757,10 +773,6 @@ video {
|
|
|
757
773
|
z-index: 20;
|
|
758
774
|
}
|
|
759
775
|
|
|
760
|
-
.tw-z-30 {
|
|
761
|
-
z-index: 30;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
776
|
.tw-z-40 {
|
|
765
777
|
z-index: 40;
|
|
766
778
|
}
|
|
@@ -820,10 +832,6 @@ video {
|
|
|
820
832
|
margin-right: 1px;
|
|
821
833
|
}
|
|
822
834
|
|
|
823
|
-
.tw-mr-squid-xxs {
|
|
824
|
-
margin-right: 0.3125rem;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
835
|
.tw-mt-1 {
|
|
828
836
|
margin-top: 0.25rem;
|
|
829
837
|
}
|
|
@@ -884,10 +892,18 @@ video {
|
|
|
884
892
|
height: 10px;
|
|
885
893
|
}
|
|
886
894
|
|
|
895
|
+
.tw-h-\[14px\] {
|
|
896
|
+
height: 14px;
|
|
897
|
+
}
|
|
898
|
+
|
|
887
899
|
.tw-h-\[160px\] {
|
|
888
900
|
height: 160px;
|
|
889
901
|
}
|
|
890
902
|
|
|
903
|
+
.tw-h-\[17px\] {
|
|
904
|
+
height: 17px;
|
|
905
|
+
}
|
|
906
|
+
|
|
891
907
|
.tw-h-\[195px\] {
|
|
892
908
|
height: 195px;
|
|
893
909
|
}
|
|
@@ -988,10 +1004,6 @@ video {
|
|
|
988
1004
|
height: 2.5rem;
|
|
989
1005
|
}
|
|
990
1006
|
|
|
991
|
-
.tw-h-squid-xs {
|
|
992
|
-
height: 0.625rem;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
1007
|
.tw-h-squid-xxl {
|
|
996
1008
|
height: 3.75rem;
|
|
997
1009
|
}
|
|
@@ -1176,6 +1188,10 @@ video {
|
|
|
1176
1188
|
width: 480px;
|
|
1177
1189
|
}
|
|
1178
1190
|
|
|
1191
|
+
.tw-w-\[500px\] {
|
|
1192
|
+
width: 500px;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1179
1195
|
.tw-w-\[52px\] {
|
|
1180
1196
|
width: 52px;
|
|
1181
1197
|
}
|
|
@@ -1349,16 +1365,6 @@ video {
|
|
|
1349
1365
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1350
1366
|
}
|
|
1351
1367
|
|
|
1352
|
-
.-tw-translate-x-full {
|
|
1353
|
-
--tw-translate-x: -100%;
|
|
1354
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
.tw-translate-x-0 {
|
|
1358
|
-
--tw-translate-x: 0px;
|
|
1359
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
1368
|
.tw-translate-x-1\/4 {
|
|
1363
1369
|
--tw-translate-x: 25%;
|
|
1364
1370
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
@@ -1919,6 +1925,10 @@ video {
|
|
|
1919
1925
|
background-color: var(--squid-theme-status-negative);
|
|
1920
1926
|
}
|
|
1921
1927
|
|
|
1928
|
+
.tw-bg-status-partial {
|
|
1929
|
+
background-color: var(--squid-theme-status-partial);
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1922
1932
|
.tw-bg-status-positive {
|
|
1923
1933
|
background-color: var(--squid-theme-status-positive);
|
|
1924
1934
|
}
|
|
@@ -2314,14 +2324,14 @@ video {
|
|
|
2314
2324
|
line-height: 10px !important;
|
|
2315
2325
|
}
|
|
2316
2326
|
|
|
2317
|
-
.\!tw-leading-\[11px\] {
|
|
2318
|
-
line-height: 11px !important;
|
|
2319
|
-
}
|
|
2320
|
-
|
|
2321
2327
|
.\!tw-leading-\[13px\] {
|
|
2322
2328
|
line-height: 13px !important;
|
|
2323
2329
|
}
|
|
2324
2330
|
|
|
2331
|
+
.\!tw-leading-\[16px\] {
|
|
2332
|
+
line-height: 16px !important;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2325
2335
|
.\!tw-leading-\[17px\] {
|
|
2326
2336
|
line-height: 17px !important;
|
|
2327
2337
|
}
|
|
@@ -2350,10 +2360,6 @@ video {
|
|
|
2350
2360
|
line-height: 13px;
|
|
2351
2361
|
}
|
|
2352
2362
|
|
|
2353
|
-
.tw-leading-\[20px\] {
|
|
2354
|
-
line-height: 20px;
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
2363
|
.tw-leading-body-large {
|
|
2358
2364
|
line-height: 39.34px;
|
|
2359
2365
|
}
|
|
@@ -2463,6 +2469,10 @@ video {
|
|
|
2463
2469
|
color: var(--squid-theme-status-negative);
|
|
2464
2470
|
}
|
|
2465
2471
|
|
|
2472
|
+
.tw-text-status-partial {
|
|
2473
|
+
color: var(--squid-theme-status-partial);
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2466
2476
|
.tw-text-status-positive {
|
|
2467
2477
|
color: var(--squid-theme-status-positive);
|
|
2468
2478
|
}
|
|
@@ -2580,6 +2590,10 @@ video {
|
|
|
2580
2590
|
transition-duration: 100ms;
|
|
2581
2591
|
}
|
|
2582
2592
|
|
|
2593
|
+
.tw-duration-150 {
|
|
2594
|
+
transition-duration: 150ms;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2583
2597
|
.tw-duration-200 {
|
|
2584
2598
|
transition-duration: 200ms;
|
|
2585
2599
|
}
|
|
@@ -2644,16 +2658,8 @@ li {
|
|
|
2644
2658
|
);
|
|
2645
2659
|
}
|
|
2646
2660
|
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
a {
|
|
2650
|
-
outline: 2px solid transparent;
|
|
2651
|
-
outline-offset: -1px;
|
|
2652
|
-
}
|
|
2653
|
-
|
|
2654
|
-
button:focus,
|
|
2655
|
-
input:focus,
|
|
2656
|
-
a:focus {
|
|
2661
|
+
:focus-visible {
|
|
2662
|
+
outline-style: solid;
|
|
2657
2663
|
outline-width: 2px;
|
|
2658
2664
|
outline-color: var(--squid-theme-royal-500);
|
|
2659
2665
|
}
|
|
@@ -2755,14 +2761,15 @@ input[type='number'] {
|
|
|
2755
2761
|
opacity: 0.6;
|
|
2756
2762
|
}
|
|
2757
2763
|
|
|
2758
|
-
.tw-group\/swap-step-item:hover .group-hover\/swap-step-item\:tw-block {
|
|
2759
|
-
display: block;
|
|
2760
|
-
}
|
|
2761
|
-
|
|
2762
2764
|
.tw-group\/history-item:hover .group-hover\/history-item\:tw-hidden {
|
|
2763
2765
|
display: none;
|
|
2764
2766
|
}
|
|
2765
2767
|
|
|
2768
|
+
.tw-group\/arrow-button:hover .group-hover\/arrow-button\:tw-rotate-180 {
|
|
2769
|
+
--tw-rotate: 180deg;
|
|
2770
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2766
2773
|
.tw-group\/swap-step-item-button:hover .group-hover\/swap-step-item-button\:tw-from-grey-700 {
|
|
2767
2774
|
--tw-gradient-from: var(--squid-theme-grey-700) var(--tw-gradient-from-position);
|
|
2768
2775
|
--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);
|
package/dist/index.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ interface DropdownMenuItemProps {
|
|
|
200
200
|
}
|
|
201
201
|
declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
202
202
|
|
|
203
|
-
type HistoryItemStatus = 'completed' | 'pending' | 'failed';
|
|
203
|
+
type HistoryItemStatus = 'completed' | 'pending' | 'failed' | 'warning';
|
|
204
204
|
interface HistoryItemProps {
|
|
205
205
|
firstImageUrl: string;
|
|
206
206
|
secondImageUrl: string;
|
|
@@ -212,8 +212,10 @@ interface HistoryItemProps {
|
|
|
212
212
|
toAmount: string;
|
|
213
213
|
dropdownMenuItems?: DropdownMenuItemProps[];
|
|
214
214
|
itemsContainerRef?: React.RefObject<HTMLElement>;
|
|
215
|
+
onClick?: () => void;
|
|
216
|
+
warningLabel?: string;
|
|
215
217
|
}
|
|
216
|
-
declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, warningLabel, onClick, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
|
|
217
219
|
|
|
218
220
|
interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
219
221
|
itemTitle: string | React.ReactNode;
|
|
@@ -233,9 +235,10 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
233
235
|
loading?: {
|
|
234
236
|
subtitle?: boolean;
|
|
235
237
|
};
|
|
238
|
+
containerProps?: React.HTMLAttributes<HTMLLIElement>;
|
|
236
239
|
}
|
|
237
240
|
type ListItemSize = 'small' | 'large';
|
|
238
|
-
declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
|
|
241
|
+
declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
|
|
239
242
|
|
|
240
243
|
interface MenuItemProps {
|
|
241
244
|
label: string;
|
|
@@ -244,14 +247,14 @@ interface MenuItemProps {
|
|
|
244
247
|
}
|
|
245
248
|
declare function MenuItem({ label, imageUrl, icon }: MenuItemProps): react_jsx_runtime.JSX.Element;
|
|
246
249
|
|
|
247
|
-
interface SectionTitleProps {
|
|
250
|
+
interface SectionTitleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
248
251
|
title: string;
|
|
249
252
|
icon?: React.ReactNode;
|
|
250
253
|
accessory?: string | null;
|
|
251
254
|
actionIcon?: React.ReactNode;
|
|
252
255
|
className?: string;
|
|
253
256
|
}
|
|
254
|
-
declare function SectionTitle({ title, icon, accessory, actionIcon, className, }: SectionTitleProps): react_jsx_runtime.JSX.Element;
|
|
257
|
+
declare function SectionTitle({ title, icon, accessory, actionIcon, className, ...props }: SectionTitleProps): react_jsx_runtime.JSX.Element;
|
|
255
258
|
|
|
256
259
|
type SettingsControl = {
|
|
257
260
|
type: 'percentage';
|
|
@@ -473,6 +476,7 @@ type SquidTheme = {
|
|
|
473
476
|
'accent-500': string;
|
|
474
477
|
'status-positive': string;
|
|
475
478
|
'status-negative': string;
|
|
479
|
+
'status-warning': string;
|
|
476
480
|
'transparent-light-thin': string;
|
|
477
481
|
'transparent-light-average': string;
|
|
478
482
|
'transparent-light-thick': string;
|