@0xsquid/ui 2.6.2 → 2.6.4
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 +221 -72
- package/dist/cjs/types/components/buttons/Button.d.ts +4 -1
- package/dist/cjs/types/components/controls/Switch.d.ts +1 -1
- package/dist/cjs/types/components/icons/Arrow.d.ts +2 -1
- package/dist/cjs/types/components/icons/Generic.d.ts +11 -2
- package/dist/cjs/types/components/icons/Social.d.ts +9 -1
- package/dist/cjs/types/components/icons/index.d.ts +0 -1
- package/dist/cjs/types/components/layout/DropdownMenu.d.ts +2 -1
- package/dist/cjs/types/components/lists/ListItem.d.ts +4 -1
- package/dist/cjs/types/components/views/SwapProgressView.d.ts +3 -2
- package/dist/cjs/types/core/utils.d.ts +7 -0
- package/dist/cjs/types/hooks/useColorFromSeed.d.ts +1 -0
- package/dist/cjs/types/hooks/useDropdownMenu.d.ts +5 -5
- package/dist/cjs/types/stories/buttons/AssetsButton.stories.d.ts +1 -0
- package/dist/cjs/types/stories/buttons/Button.stories.d.ts +30 -15
- package/dist/cjs/types/stories/controls/Switch.stories.d.ts +5 -3
- package/dist/cjs/types/stories/layout/AppContainer.stories.d.ts +1 -1
- package/dist/cjs/types/stories/lists/ListItem.stories.d.ts +3 -0
- package/dist/cjs/types/stories/views/MainView.stories.d.ts +1 -1
- package/dist/cjs/types/stories/views/SwapDetailsView.stories.d.ts +1 -1
- package/dist/cjs/types/types/components.d.ts +1 -1
- package/dist/cjs/types/types/config.d.ts +3 -3
- package/dist/cjs/types/types/index.d.ts +1 -1
- package/dist/esm/index.js +215 -70
- package/dist/esm/types/components/buttons/Button.d.ts +4 -1
- package/dist/esm/types/components/controls/Switch.d.ts +1 -1
- package/dist/esm/types/components/icons/Arrow.d.ts +2 -1
- package/dist/esm/types/components/icons/Generic.d.ts +11 -2
- package/dist/esm/types/components/icons/Social.d.ts +9 -1
- package/dist/esm/types/components/icons/index.d.ts +0 -1
- package/dist/esm/types/components/layout/DropdownMenu.d.ts +2 -1
- package/dist/esm/types/components/lists/ListItem.d.ts +4 -1
- package/dist/esm/types/components/views/SwapProgressView.d.ts +3 -2
- package/dist/esm/types/core/utils.d.ts +7 -0
- package/dist/esm/types/hooks/useColorFromSeed.d.ts +1 -0
- package/dist/esm/types/hooks/useDropdownMenu.d.ts +5 -5
- package/dist/esm/types/stories/buttons/AssetsButton.stories.d.ts +1 -0
- package/dist/esm/types/stories/buttons/Button.stories.d.ts +30 -15
- package/dist/esm/types/stories/controls/Switch.stories.d.ts +5 -3
- package/dist/esm/types/stories/layout/AppContainer.stories.d.ts +1 -1
- package/dist/esm/types/stories/lists/ListItem.stories.d.ts +3 -0
- package/dist/esm/types/stories/views/MainView.stories.d.ts +1 -1
- package/dist/esm/types/stories/views/SwapDetailsView.stories.d.ts +1 -1
- package/dist/esm/types/types/components.d.ts +1 -1
- package/dist/esm/types/types/config.d.ts +3 -3
- package/dist/esm/types/types/index.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +43 -23
- package/package.json +1 -1
- package/dist/cjs/types/components/icons/Copy.d.ts +0 -5
- package/dist/esm/types/components/icons/Copy.d.ts +0 -5
package/dist/esm/index.js
CHANGED
|
@@ -97,6 +97,13 @@ const THEME_COLOR_KEYS = [
|
|
|
97
97
|
"button-md-secondary-text",
|
|
98
98
|
"button-md-tertiary-bg",
|
|
99
99
|
"button-md-tertiary-text",
|
|
100
|
+
// sm button variant colors
|
|
101
|
+
"button-sm-primary-bg",
|
|
102
|
+
"button-sm-primary-text",
|
|
103
|
+
"button-sm-secondary-bg",
|
|
104
|
+
"button-sm-secondary-text",
|
|
105
|
+
"button-sm-tertiary-bg",
|
|
106
|
+
"button-sm-tertiary-text",
|
|
100
107
|
// input colors
|
|
101
108
|
"input-placeholder",
|
|
102
109
|
"input-text",
|
|
@@ -126,12 +133,18 @@ const THEME_COLOR_KEYS = [
|
|
|
126
133
|
"material-light-blend-grey-800",
|
|
127
134
|
];
|
|
128
135
|
const THEME_BORDER_RADIUS_KEYS = [
|
|
136
|
+
// lg button
|
|
129
137
|
"button-lg-primary",
|
|
130
138
|
"button-lg-secondary",
|
|
131
139
|
"button-lg-tertiary",
|
|
140
|
+
// md button
|
|
132
141
|
"button-md-primary",
|
|
133
142
|
"button-md-secondary",
|
|
134
143
|
"button-md-tertiary",
|
|
144
|
+
// sm button
|
|
145
|
+
"button-sm-primary",
|
|
146
|
+
"button-sm-secondary",
|
|
147
|
+
"button-sm-tertiary",
|
|
135
148
|
"container",
|
|
136
149
|
"input",
|
|
137
150
|
"menu-sm",
|
|
@@ -2933,6 +2946,19 @@ function mapToCssVariables(obj) {
|
|
|
2933
2946
|
return acc;
|
|
2934
2947
|
}, {});
|
|
2935
2948
|
}
|
|
2949
|
+
/**
|
|
2950
|
+
* Simple hash function to create a deterministic index from a given string.
|
|
2951
|
+
* @param {string} str - The input string to hash.
|
|
2952
|
+
* @param {number} max - The maximum value for the hash.
|
|
2953
|
+
* @returns {number} - The index within the array.
|
|
2954
|
+
*/
|
|
2955
|
+
function hashStringToIndex(str, max) {
|
|
2956
|
+
let index = 0;
|
|
2957
|
+
for (let i = 0; i < str.length; i++) {
|
|
2958
|
+
index = (index * 31 + str.charCodeAt(i)) % max;
|
|
2959
|
+
}
|
|
2960
|
+
return index;
|
|
2961
|
+
}
|
|
2936
2962
|
|
|
2937
2963
|
const spacing$1 = {
|
|
2938
2964
|
"squid-xxs": "0.3125rem", // 5px
|
|
@@ -3327,12 +3353,18 @@ const defaultFontFamily = {
|
|
|
3327
3353
|
"squid-main": "Geist, sans-serif",
|
|
3328
3354
|
};
|
|
3329
3355
|
const defaultBorderRadius = {
|
|
3356
|
+
// lg button
|
|
3330
3357
|
"button-lg-primary": spacing$1["squid-xxl"],
|
|
3331
3358
|
"button-lg-secondary": spacing$1["squid-xxl"],
|
|
3332
3359
|
"button-lg-tertiary": spacing$1["squid-xxl"],
|
|
3360
|
+
// md button
|
|
3333
3361
|
"button-md-primary": spacing$1["squid-m"],
|
|
3334
3362
|
"button-md-secondary": spacing$1["squid-m"],
|
|
3335
3363
|
"button-md-tertiary": spacing$1["squid-m"],
|
|
3364
|
+
// sm button
|
|
3365
|
+
"button-sm-primary": spacing$1["squid-m"],
|
|
3366
|
+
"button-sm-secondary": spacing$1["squid-m"],
|
|
3367
|
+
"button-sm-tertiary": spacing$1["squid-m"],
|
|
3336
3368
|
container: spacing$1["squid-l"],
|
|
3337
3369
|
input: "9999px",
|
|
3338
3370
|
"menu-sm": spacing$1["squid-s"],
|
|
@@ -3374,18 +3406,27 @@ const lightTheme = {
|
|
|
3374
3406
|
"animation-bg": "#B893EC",
|
|
3375
3407
|
"animation-text": "#FBFBFD",
|
|
3376
3408
|
// buttons
|
|
3409
|
+
// lg button
|
|
3377
3410
|
"button-lg-primary-bg": "#B893EC",
|
|
3378
3411
|
"button-lg-primary-text": "#FBFBFD",
|
|
3379
3412
|
"button-lg-secondary-bg": "#17191C",
|
|
3380
3413
|
"button-lg-secondary-text": "#EDEEF3",
|
|
3381
3414
|
"button-lg-tertiary-bg": "#EDEEF3",
|
|
3382
3415
|
"button-lg-tertiary-text": "#292C32",
|
|
3416
|
+
// md button
|
|
3383
3417
|
"button-md-primary-bg": "#B893EC",
|
|
3384
3418
|
"button-md-primary-text": "#FBFBFD",
|
|
3385
3419
|
"button-md-secondary-bg": "#17191C",
|
|
3386
3420
|
"button-md-secondary-text": "#EDEEF3",
|
|
3387
3421
|
"button-md-tertiary-bg": "#EDEEF3",
|
|
3388
3422
|
"button-md-tertiary-text": "#292C32",
|
|
3423
|
+
// sm button
|
|
3424
|
+
"button-sm-primary-bg": "#B893EC",
|
|
3425
|
+
"button-sm-primary-text": "#FBFBFD",
|
|
3426
|
+
"button-sm-secondary-bg": "#17191C",
|
|
3427
|
+
"button-sm-secondary-text": "#EDEEF3",
|
|
3428
|
+
"button-sm-tertiary-bg": "#EDEEF3",
|
|
3429
|
+
"button-sm-tertiary-text": "#292C32",
|
|
3389
3430
|
// input
|
|
3390
3431
|
"input-bg": "#FBFBFD",
|
|
3391
3432
|
"input-placeholder": "#A7ABBE",
|
|
@@ -3434,18 +3475,27 @@ const darkTheme = {
|
|
|
3434
3475
|
"animation-bg": "#9E79D2",
|
|
3435
3476
|
"animation-text": "#FBFBFD",
|
|
3436
3477
|
// buttons
|
|
3478
|
+
// lg button
|
|
3437
3479
|
"button-lg-primary-bg": "#9E79D2",
|
|
3438
3480
|
"button-lg-primary-text": "#FBFBFD",
|
|
3439
3481
|
"button-lg-secondary-bg": "#FBFBFD",
|
|
3440
3482
|
"button-lg-secondary-text": "#292C32",
|
|
3441
3483
|
"button-lg-tertiary-bg": "#292C32",
|
|
3442
3484
|
"button-lg-tertiary-text": "#D1D6E0",
|
|
3485
|
+
// md button
|
|
3443
3486
|
"button-md-primary-bg": "#9E79D2",
|
|
3444
3487
|
"button-md-primary-text": "#FBFBFD",
|
|
3445
3488
|
"button-md-secondary-bg": "#FBFBFD",
|
|
3446
3489
|
"button-md-secondary-text": "#292C32",
|
|
3447
3490
|
"button-md-tertiary-bg": "#292C32",
|
|
3448
3491
|
"button-md-tertiary-text": "#D1D6E0",
|
|
3492
|
+
// sm button
|
|
3493
|
+
"button-sm-primary-bg": "#9E79D2",
|
|
3494
|
+
"button-sm-primary-text": "#FBFBFD",
|
|
3495
|
+
"button-sm-secondary-bg": "#FBFBFD",
|
|
3496
|
+
"button-sm-secondary-text": "#292C32",
|
|
3497
|
+
"button-sm-tertiary-bg": "#292C32",
|
|
3498
|
+
"button-sm-tertiary-text": "#D1D6E0",
|
|
3449
3499
|
// input
|
|
3450
3500
|
"input-bg": "#17191C",
|
|
3451
3501
|
"input-placeholder": "#676B7E",
|
|
@@ -3524,7 +3574,7 @@ const boxShadowClassMap = {
|
|
|
3524
3574
|
xlarge: "tw-shadow-elevation-light-2",
|
|
3525
3575
|
xxlarge: "tw-shadow-elevation-dark-1",
|
|
3526
3576
|
};
|
|
3527
|
-
const roundedClassMap
|
|
3577
|
+
const roundedClassMap = {
|
|
3528
3578
|
xxs: "tw-rounded-squid-xxs",
|
|
3529
3579
|
xs: "tw-rounded-squid-xs",
|
|
3530
3580
|
s: "tw-rounded-squid-s",
|
|
@@ -3553,7 +3603,7 @@ const borderClassMap = {
|
|
|
3553
3603
|
};
|
|
3554
3604
|
function Image$1(_a) {
|
|
3555
3605
|
var { src, size = "medium", className: propsClassName, placeholderImageUrl, border = "none", rounded = "xxs", shadow = false, children, containerProps } = _a, props = __rest$1(_a, ["src", "size", "className", "placeholderImageUrl", "border", "rounded", "shadow", "children", "containerProps"]);
|
|
3556
|
-
const className = cn("tw-object-cover tw-aspect-square tw-relative tw-duration-300 tw-transition-[width,height] tw-max-w-full tw-bg-grey-500", sizeClassMap$1[size], propsClassName, roundedClassMap
|
|
3606
|
+
const className = cn("tw-object-cover tw-aspect-square tw-relative tw-duration-300 tw-transition-[width,height] tw-max-w-full tw-bg-grey-500", sizeClassMap$1[size], propsClassName, roundedClassMap[rounded], shadow && boxShadowClassMap[size], borderClassMap[border]);
|
|
3557
3607
|
const [imageState, setImageState] = useState(ImageState.LOADED);
|
|
3558
3608
|
return (jsxs("div", Object.assign({}, containerProps, { className: cn("tw-relative", containerProps === null || containerProps === void 0 ? void 0 : containerProps.className), children: [border === "gradient" && (jsx("span", { style: {
|
|
3559
3609
|
borderRadius: gradientRoundedClassMap[rounded],
|
|
@@ -3740,8 +3790,8 @@ function ArrowUpIcon() {
|
|
|
3740
3790
|
function ArrowCornerDownRightIcon({ size = "24", className, }) {
|
|
3741
3791
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 4C4.55228 4 5 4.44772 5 5V13C5 13.5523 5.44772 14 6 14H17.5858L15.2929 11.7071C14.9024 11.3166 14.9024 10.6834 15.2929 10.2929C15.6834 9.90237 16.3166 9.90237 16.7071 10.2929L20.7071 14.2929C21.0976 14.6834 21.0976 15.3166 20.7071 15.7071L16.7071 19.7071C16.3166 20.0976 15.6834 20.0976 15.2929 19.7071C14.9024 19.3166 14.9024 18.6834 15.2929 18.2929L17.5858 16H6C4.34315 16 3 14.6569 3 13V5C3 4.44772 3.44772 4 4 4Z", fill: "currentColor" }) }));
|
|
3742
3792
|
}
|
|
3743
|
-
function ChevronDownSmallIcon({ size = "16", className, }) {
|
|
3744
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsx("path", { d: "M5.33325 6.66666L7.52851 8.86192C7.78886 9.12227 8.21097 9.12227 8.47132 8.86192L10.6666 6.66666", stroke: "currentColor", strokeWidth:
|
|
3793
|
+
function ChevronDownSmallIcon({ size = "16", strokeWidth = "2", className, }) {
|
|
3794
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsx("path", { d: "M5.33325 6.66666L7.52851 8.86192C7.78886 9.12227 8.21097 9.12227 8.47132 8.86192L10.6666 6.66666", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
3745
3795
|
}
|
|
3746
3796
|
function ArrowDownIcon({ size = "24", className, }) {
|
|
3747
3797
|
return (jsx("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 25", fill: "none", children: jsx("path", { d: "M18 14.5L12 20.5L6 14.5M12 19.5V4.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
@@ -3849,11 +3899,6 @@ function PowerIcon({ size = "24", className, }) {
|
|
|
3849
3899
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M7.02331 4.5C4.59826 6.11238 3 8.86954 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 8.86954 19.4017 6.11238 16.9767 4.5M12 2V7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
3850
3900
|
}
|
|
3851
3901
|
|
|
3852
|
-
function Copy(_a) {
|
|
3853
|
-
var { size = "24", strokeWidth = "2" } = _a, props = __rest$1(_a, ["size", "strokeWidth"]);
|
|
3854
|
-
return (jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24" }, props, { children: jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: strokeWidth, vectorEffect: "non-scaling-stroke", d: "M9 9V5.25A2.25 2.25 0 0111.25 3h7.5A2.25 2.25 0 0121 5.25v7.5A2.25 2.25 0 0118.75 15H15m-2.25-6h-7.5A2.25 2.25 0 003 11.25v7.5A2.25 2.25 0 005.25 21h7.5A2.25 2.25 0 0015 18.75v-7.5A2.25 2.25 0 0012.75 9z" }) })));
|
|
3855
|
-
}
|
|
3856
|
-
|
|
3857
3902
|
function CrossAnimatedIcon({ size = 24, isOpen, transitionDuration, className, }) {
|
|
3858
3903
|
const rotateDegrees = isOpen ? 45 : 0;
|
|
3859
3904
|
return (jsxs("div", { style: {
|
|
@@ -3978,11 +4023,11 @@ function PhoneIcon({ size = "24", className, }) {
|
|
|
3978
4023
|
function LaptopIcon({ size = "24", className, }) {
|
|
3979
4024
|
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: [jsx("path", { d: "M4.5 6C4.5 4.89543 5.39543 4 6.5 4H18.5C19.6046 4 20.5 4.89543 20.5 6V15C20.5 15.5523 20.0523 16 19.5 16H5.5C4.94772 16 4.5 15.5523 4.5 15V6Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" }), jsx("path", { d: "M2.5 16H22.5V18C22.5 19.1046 21.6046 20 20.5 20H4.5C3.39543 20 2.5 19.1046 2.5 18V16Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" })] }));
|
|
3980
4025
|
}
|
|
3981
|
-
function CopyOutlinedIcon({ size = "24", className, }) {
|
|
3982
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M9 9V5.25C9 4.00736 10.0074 3 11.25 3H18.75C19.9926 3 21 4.00736 21 5.25V12.75C21 13.9926 19.9926 15 18.75 15H15M12.75 9H5.25C4.00736 9 3 10.0074 3 11.25V18.75C3 19.9926 4.00736 21 5.25 21H12.75C13.9926 21 15 19.9926 15 18.75V11.25C15 10.0074 13.9926 9 12.75 9Z", stroke: "currentColor", strokeWidth:
|
|
4026
|
+
function CopyOutlinedIcon({ size = "24", strokeWidth = "2", className, }) {
|
|
4027
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M9 9V5.25C9 4.00736 10.0074 3 11.25 3H18.75C19.9926 3 21 4.00736 21 5.25V12.75C21 13.9926 19.9926 15 18.75 15H15M12.75 9H5.25C4.00736 9 3 10.0074 3 11.25V18.75C3 19.9926 4.00736 21 5.25 21H12.75C13.9926 21 15 19.9926 15 18.75V11.25C15 10.0074 13.9926 9 12.75 9Z", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
3983
4028
|
}
|
|
3984
|
-
function
|
|
3985
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0
|
|
4029
|
+
function Copy2Icon({ size = "20", className, }) {
|
|
4030
|
+
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", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.3327 4.37496C18.3327 2.87919 17.1201 1.66663 15.6243 1.66663H9.37435C7.87858 1.66663 6.66602 2.87919 6.66602 4.37496V6.66663H4.37435C2.87858 6.66663 1.66602 7.87919 1.66602 9.37496V15.625C1.66602 17.1207 2.87858 18.3333 4.37435 18.3333H10.6243C12.1201 18.3333 13.3327 17.1207 13.3327 15.625V13.3333H15.6243C17.1201 13.3333 18.3327 12.1207 18.3327 10.625V4.37496ZM13.3327 11.6666H15.6243C16.1996 11.6666 16.666 11.2003 16.666 10.625V4.37496C16.666 3.79966 16.1996 3.33329 15.6243 3.33329H9.37435C8.79905 3.33329 8.33268 3.79966 8.33268 4.37496V6.66663H10.6243C12.1201 6.66663 13.3327 7.87919 13.3327 9.37496V11.6666Z", fill: "currentColor" }) }));
|
|
3986
4031
|
}
|
|
3987
4032
|
function FileDownloadIcon({ size = "20", className, }) {
|
|
3988
4033
|
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", className: className, children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.33337 1.66666H10.5V5.83332C10.5 7.21404 11.6193 8.33332 13 8.33332H17.1667V15.8333C17.1667 17.214 16.0474 18.3333 14.6667 18.3333H6.33337C4.95266 18.3333 3.83337 17.214 3.83337 15.8333V4.16666C3.83337 2.78594 4.95266 1.66666 6.33337 1.66666ZM13.1726 14.3392L11.0893 16.4226C10.7639 16.748 10.2362 16.748 9.91079 16.4226L7.82745 14.3392C7.50201 14.0138 7.50201 13.4862 7.82745 13.1607C8.15289 12.8353 8.68053 12.8353 9.00596 13.1607L9.66671 13.8215V10.8333C9.66671 10.3731 10.0398 9.99999 10.5 9.99999C10.9603 9.99999 11.3334 10.3731 11.3334 10.8333V13.8215L11.9941 13.1607C12.3196 12.8353 12.8472 12.8353 13.1726 13.1607C13.4981 13.4862 13.4981 14.0138 13.1726 14.3392Z", fill: "currentColor" }), jsx("path", { d: "M12.1667 2.15481L16.6786 6.66666H13C12.5398 6.66666 12.1667 6.29356 12.1667 5.83332V2.15481Z", fill: "currentColor" })] }));
|
|
@@ -4017,6 +4062,12 @@ function ArrowExpandIcon({ className, size = "24", }) {
|
|
|
4017
4062
|
function MoneyBagIcon({ className, size = "24", }) {
|
|
4018
4063
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M9.5 8H14.5M9.5 8C9.5 8 3.99996 11 4 16C4.00003 20.0207 7.97931 21 12 21C16.0207 21 20 20.0207 20 16C20 11 14.5 8 14.5 8M9.5 8L8.55725 5.48601C8.23089 4.6157 8.56249 3.64123 9.45158 3.37016C10.1074 3.1702 10.9686 3 12 3C13.0314 3 13.8926 3.1702 14.5484 3.37016C15.4375 3.64123 15.7691 4.6157 15.4427 5.48601L14.5 8", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
4019
4064
|
}
|
|
4065
|
+
function PluginIcon({ size = "16", className, }) {
|
|
4066
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsx("path", { d: "M6.66675 1.99998C6.66675 1.63179 6.36827 1.33331 6.00008 1.33331C5.63189 1.33331 5.33341 1.63179 5.33341 1.99998V3.99998H4.66675C3.56218 3.99998 2.66675 4.89541 2.66675 5.99998V9.33331C2.66675 11.1743 4.15913 12.6666 6.00008 12.6666H7.33341V14C7.33341 14.3682 7.63189 14.6666 8.00008 14.6666C8.36827 14.6666 8.66675 14.3682 8.66675 14V12.6666H10.0001C11.841 12.6666 13.3334 11.1743 13.3334 9.33331V5.99998C13.3334 4.89541 12.438 3.99998 11.3334 3.99998H10.6667V1.99998C10.6667 1.63179 10.3683 1.33331 10.0001 1.33331C9.63189 1.33331 9.33341 1.63179 9.33341 1.99998V3.99998H6.66675V1.99998Z", fill: "currentColor" }) }));
|
|
4067
|
+
}
|
|
4068
|
+
function CircleCheckIcon({ className, size = "24", }) {
|
|
4069
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM15.774 10.1333C16.1237 9.70582 16.0607 9.0758 15.6332 8.72607C15.2058 8.37635 14.5758 8.43935 14.226 8.86679L10.4258 13.5116L9.20711 12.2929C8.81658 11.9024 8.18342 11.9024 7.79289 12.2929C7.40237 12.6834 7.40237 13.3166 7.79289 13.7071L9.79289 15.7071C9.99267 15.9069 10.2676 16.0129 10.5498 15.9988C10.832 15.9847 11.095 15.8519 11.274 15.6333L15.774 10.1333Z", fill: "currentColor" }) }));
|
|
4070
|
+
}
|
|
4020
4071
|
|
|
4021
4072
|
function EmptyHeartIcon({ className }) {
|
|
4022
4073
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M21 10C21 15.75 12.75 20 12 20C11.25 20 3 15.75 3 10C3 6 5.5 4 8 4C10.5 4 12 5.5 12 5.5C12 5.5 13.5 4 16 4C18.5 4 21 6 21 10Z", stroke: "currentColor", strokeWidth: "2", strokeLinejoin: "round" }) }));
|
|
@@ -4122,7 +4173,7 @@ function SearchIcon({ className, size = "24", }) {
|
|
|
4122
4173
|
return (jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M20 20L16.05 16.05M18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
|
|
4123
4174
|
}
|
|
4124
4175
|
|
|
4125
|
-
function
|
|
4176
|
+
function XSocialIcon({ className, size = "24", }) {
|
|
4126
4177
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M17.4033 3.5H20.2852L13.989 10.701L21.396 20.5H15.5964L11.054 14.557L5.85637 20.5H2.97269L9.70709 12.7977L2.60156 3.5H8.54839L12.6544 8.93215L17.4033 3.5ZM16.3918 18.7738H17.9887L7.68067 5.13549H5.96702L16.3918 18.7738Z", fill: "currentColor" }) }));
|
|
4127
4178
|
}
|
|
4128
4179
|
function GithubIcon({ size = "24", className, }) {
|
|
@@ -4134,6 +4185,12 @@ function DiscordIcon({ size = "24", className, }) {
|
|
|
4134
4185
|
function MirrorIcon({ size = "24", className, }) {
|
|
4135
4186
|
return (jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M6 9C6 5.68629 8.68629 3 12 3C15.3137 3 18 5.68629 18 9V20C18 20.5523 17.5523 21 17 21H7C6.44771 21 6 20.5523 6 20V9Z", stroke: "currentColor", strokeWidth: "2" }) }));
|
|
4136
4187
|
}
|
|
4188
|
+
function FarcasterIcon({ size = "20", className, }) {
|
|
4189
|
+
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", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.8884 2H4.77734V4.28529L15.8884 4.28571V2ZM18.1115 16.2853V16.8567H13.667V16.2853C13.667 15.9696 13.9156 15.7139 14.2225 15.7139L14.2221 11.0971C14.2221 8.88795 12.481 7.0971 10.3332 7.0971C8.20241 7.0971 6.47187 8.85978 6.44466 11.0448V15.7139C6.75155 15.7139 7.00011 15.9696 7.00011 16.2853V16.8567H2.55566V16.2853C2.55566 15.9696 2.80428 15.7139 3.11122 15.7139L3.11133 6.57185H2.55556L2 4.28613H18.6667L18.1111 6.57185H17.556V15.7139C17.8629 15.7139 18.1115 15.9696 18.1115 16.2853ZM18.6669 17.4289C18.6669 17.1132 18.4185 16.8567 18.1115 16.8567H13.667C13.36 16.8567 13.1113 17.1132 13.1113 17.4289V18.0003H18.6669V17.4289ZM7.00011 16.8567C7.30706 16.8567 7.55555 17.1132 7.55555 17.4289V18.0003H2V17.4289C2 17.1132 2.24871 16.8567 2.55566 16.8567H7.00011Z", fill: "currentColor" }) }));
|
|
4190
|
+
}
|
|
4191
|
+
function TelegramIcon({ className, size = "20", }) {
|
|
4192
|
+
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", { d: "M1.31748 8.8995C6.46345 6.66525 9.89405 5.19215 11.6094 4.48047C16.5127 2.44826 17.5302 2.09531 18.1949 2.08349C18.341 2.08102 18.6664 2.11703 18.8788 2.28828C19.0553 2.43259 19.105 2.62776 19.1298 2.76465C19.1518 2.90154 19.1822 3.21354 19.1574 3.45708C18.8926 6.2389 17.7427 12.9895 17.158 16.1053C16.9126 17.4237 16.4244 17.8657 15.9528 17.9089C14.927 18.0029 14.1492 17.2337 13.1564 16.5852C11.6038 15.5701 10.7269 14.9384 9.21842 13.948C7.47552 12.8034 8.60617 12.1742 9.59896 11.1461C9.85819 10.877 14.3754 6.78262 14.4608 6.41126C14.4719 6.3648 14.483 6.19162 14.3782 6.10036C14.2761 6.00883 14.1244 6.04016 14.0141 6.0649C13.8569 6.10009 11.3776 7.73509 6.56812 10.9696C5.8649 11.4518 5.22787 11.6868 4.65426 11.6744C4.02549 11.661 2.81216 11.3193 1.91037 11.0274C0.807272 10.6692 -0.0724949 10.4798 0.0047222 9.87149C0.0433308 9.55482 0.481884 9.23074 1.31748 8.8995Z", fill: "currentColor" }) }));
|
|
4193
|
+
}
|
|
4137
4194
|
|
|
4138
4195
|
function SortIcon() {
|
|
4139
4196
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: jsx("path", { d: "M3 5H21M9 19H15M6 12H18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
|
|
@@ -4343,9 +4400,9 @@ function UsdAmount({ usdAmount }) {
|
|
|
4343
4400
|
}
|
|
4344
4401
|
|
|
4345
4402
|
function HashLink({ showTx = false, hash, showCopyButton = false, url, children, className, formattedHash, copyIconSize = "16", }) {
|
|
4346
|
-
return (jsxs("div", { className: cn("tw-flex tw-items-center", className), children: [showTx && jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children : formattedHash, url && (jsx("a", { href: url, target: "_blank", className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", rel: "noreferrer", children: jsx(SquareArrowTopRight2Icon, { strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-text-royal-500" }) })), showCopyButton && (jsx("span", {
|
|
4347
|
-
|
|
4348
|
-
|
|
4403
|
+
return (jsxs("div", { className: cn("tw-flex tw-items-center", className), children: [showTx && jsx("span", { className: "tw-mr-squid-xs tw-text-grey-700", children: "TX" }), children !== null && children !== void 0 ? children : formattedHash, url && (jsx("a", { href: url, target: "_blank", className: "tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", rel: "noreferrer", children: jsx(SquareArrowTopRight2Icon, { strokeWidth: "1.5", className: "tw-h-[1.2em] tw-w-[1.2em] tw-text-royal-500" }) })), showCopyButton && (jsx("span", { onClick: () => {
|
|
4404
|
+
navigator.clipboard.writeText(hash).catch(() => { });
|
|
4405
|
+
}, className: "tw-cursor-pointer tw-rounded-squid-s tw-px-squid-xxs hover:tw-bg-material-light-thin", children: jsx(CopyOutlinedIcon, { size: copyIconSize, strokeWidth: "2.5", className: "tw-text-royal-500" }) }))] }));
|
|
4349
4406
|
}
|
|
4350
4407
|
|
|
4351
4408
|
function WalletLink({ imageURI, address }) {
|
|
@@ -4377,16 +4434,23 @@ function Chip(_a) {
|
|
|
4377
4434
|
return (jsx("div", Object.assign({}, props, { className: cn("tw-flex tw-h-squid-m tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-grey-500 tw-text-grey-900", icon && "tw-w-squid-m", props.className), children: label ? (jsx(CaptionText, { className: "tw-min-w-squid-xl tw-text-nowrap tw-px-squid-xxs tw-text-center", children: label })) : (icon) })));
|
|
4378
4435
|
}
|
|
4379
4436
|
|
|
4437
|
+
const loaderSizeMap = {
|
|
4438
|
+
sm: "16px",
|
|
4439
|
+
md: "24px",
|
|
4440
|
+
lg: "36px",
|
|
4441
|
+
};
|
|
4380
4442
|
const baseButtonClassName = "tw-border tw-relative tw-overflow-hidden tw-group/base-button tw-flex tw-items-center tw-justify-center";
|
|
4381
4443
|
const buttonWidthClassnameMap = {
|
|
4444
|
+
sm: "tw-w-max",
|
|
4382
4445
|
md: "tw-min-w-[60px]",
|
|
4383
4446
|
lg: "tw-w-full",
|
|
4384
4447
|
};
|
|
4385
4448
|
const buttonSizeClassMap = {
|
|
4386
4449
|
md: "tw-px-squid-xs tw-py-squid-xxs tw-h-squid-xl",
|
|
4387
4450
|
lg: "tw-p-1 tw-h-button",
|
|
4451
|
+
sm: "tw-h-squid-l tw-px-squid-xs",
|
|
4388
4452
|
};
|
|
4389
|
-
const
|
|
4453
|
+
const buttonRoundedClassMap = {
|
|
4390
4454
|
lg: {
|
|
4391
4455
|
primary: "tw-rounded-button-lg-primary",
|
|
4392
4456
|
secondary: "tw-rounded-button-lg-secondary",
|
|
@@ -4397,6 +4461,11 @@ const roundedClassMap = {
|
|
|
4397
4461
|
secondary: "tw-rounded-button-md-secondary",
|
|
4398
4462
|
tertiary: "tw-rounded-button-md-tertiary",
|
|
4399
4463
|
},
|
|
4464
|
+
sm: {
|
|
4465
|
+
primary: "tw-rounded-button-sm-primary",
|
|
4466
|
+
secondary: "tw-rounded-button-sm-secondary",
|
|
4467
|
+
tertiary: "tw-rounded-button-sm-tertiary",
|
|
4468
|
+
},
|
|
4400
4469
|
};
|
|
4401
4470
|
const buttonVariantClassMap = {
|
|
4402
4471
|
lg: {
|
|
@@ -4409,35 +4478,42 @@ const buttonVariantClassMap = {
|
|
|
4409
4478
|
secondary: "tw-bg-button-md-secondary-bg tw-text-button-md-secondary-text",
|
|
4410
4479
|
tertiary: "tw-bg-button-md-tertiary-bg tw-text-button-md-tertiary-text",
|
|
4411
4480
|
},
|
|
4481
|
+
sm: {
|
|
4482
|
+
primary: "tw-bg-button-sm-primary-bg tw-text-button-sm-primary-text",
|
|
4483
|
+
secondary: "tw-bg-button-sm-secondary-bg tw-text-button-sm-secondary-text",
|
|
4484
|
+
tertiary: "tw-bg-button-sm-tertiary-bg tw-text-button-sm-tertiary-text",
|
|
4485
|
+
},
|
|
4412
4486
|
};
|
|
4413
4487
|
// right now all variants have the same disabled styles
|
|
4414
4488
|
// in the future, we can add more disabled styles for different variants
|
|
4415
4489
|
const buttonDisabledClass = "!tw-bg-grey-800 !tw-text-grey-600 tw-cursor-not-allowed";
|
|
4416
4490
|
const loadingClassname = "tw-invisible tw-opacity-0";
|
|
4417
4491
|
function Button$1(_a) {
|
|
4418
|
-
var { label, disabled = false, size, variant, icon, link, isLoading = false, showLoader = false, chip, containerClassName, anchorRef, buttonRef } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "showLoader", "chip", "containerClassName", "anchorRef", "buttonRef"]);
|
|
4492
|
+
var { label, disabled = false, size, variant, icon, link, isLoading = false, showLoader = false, loaderSize = "md", chip, containerClassName, anchorRef, buttonRef } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "showLoader", "loaderSize", "chip", "containerClassName", "anchorRef", "buttonRef"]);
|
|
4419
4493
|
const chipElement = chip != null ? (jsx(Chip, Object.assign({}, chip, { className: cn("tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10", chip.className) }))) : null;
|
|
4420
|
-
const children = (jsxs(Fragment, { children: [!disabled && !isLoading && (jsx(ButtonHoverOverlay, { className:
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
// icon and label
|
|
4426
|
-
jsxs(Fragment, { children: [icon, jsx(BodyText, { className: "tw-pr-1", size: "small", children: label })] }))) : null })] }));
|
|
4427
|
-
const className = cn(baseButtonClassName, buttonSizeClassMap[size], buttonWidthClassnameMap[size], buttonVariantClassMap[size][variant], "tw-border-material-light-thin", !disabled && !isLoading && "hover:tw-border-material-light-average", roundedClassMap[size][variant],
|
|
4494
|
+
const children = (jsxs(Fragment, { children: [!disabled && !isLoading && (jsx(ButtonHoverOverlay, { className: buttonRoundedClassMap[size][variant] })), jsx("div", { className: "tw-relative tw-z-[5] tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", children: label == null && icon == null && !showLoader ? (props.children) : (jsxs("span", { className: cn("tw-flex tw-items-center tw-justify-center", size === "lg"
|
|
4495
|
+
? "tw-gap-squid-xs tw-px-squid-m"
|
|
4496
|
+
: "tw-gap-squid-xxs"), children: [showLoader && jsx(Loader, { size: loaderSizeMap[loaderSize] }), !isLoading && icon, label != null &&
|
|
4497
|
+
(size === "sm" ? (jsx(CaptionText, { className: cn(isLoading && loadingClassname, icon != null && "tw-pr-1"), children: label })) : (jsx(BodyText, { className: cn(isLoading && loadingClassname, icon != null && "tw-pr-1"), size: size === "lg" ? "medium" : "small", children: label })))] })) })] }));
|
|
4498
|
+
const className = cn(baseButtonClassName, buttonSizeClassMap[size], buttonWidthClassnameMap[size], buttonVariantClassMap[size][variant], "tw-border-material-light-thin", !disabled && !isLoading && "hover:tw-border-material-light-average", buttonRoundedClassMap[size][variant],
|
|
4428
4499
|
// disabled styles
|
|
4429
4500
|
disabled && buttonDisabledClass, isLoading && "tw-cursor-not-allowed",
|
|
4430
4501
|
// custom classes from props
|
|
4431
4502
|
props.className);
|
|
4432
|
-
const
|
|
4503
|
+
const buttonWrapperProps = {
|
|
4504
|
+
className: containerClassName,
|
|
4505
|
+
size,
|
|
4506
|
+
variant,
|
|
4507
|
+
};
|
|
4433
4508
|
if (link != null) {
|
|
4434
|
-
return (jsxs(ButtonWrapper, { children: [jsx("a", { ref: anchorRef, "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, rel: "noreferrer", children: children }), chipElement] }));
|
|
4509
|
+
return (jsxs(ButtonWrapper, Object.assign({}, buttonWrapperProps, { children: [jsx("a", { ref: anchorRef, "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, rel: "noreferrer", children: children }), chipElement] })));
|
|
4435
4510
|
}
|
|
4436
|
-
return (jsxs(ButtonWrapper, { children: [jsx("button", Object.assign({}, props, { type: "button", ref: buttonRef, "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] }));
|
|
4511
|
+
return (jsxs(ButtonWrapper, Object.assign({}, buttonWrapperProps, { children: [jsx("button", Object.assign({}, props, { type: "button", ref: buttonRef, "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] })));
|
|
4437
4512
|
}
|
|
4438
4513
|
const ButtonHoverOverlay = ({ className }) => {
|
|
4439
4514
|
return (jsx("span", { className: cn("tw-absolute tw-inset-0 tw-z-0 tw-hidden tw-h-full tw-w-full tw-bg-material-light-thin group-hover/base-button:tw-block", className) }));
|
|
4440
4515
|
};
|
|
4516
|
+
const ButtonWrapper = ({ children, size, variant, className, }) => (jsx("div", { className: cn("tw-relative", buttonWidthClassnameMap[size], buttonRoundedClassMap[size][variant], className), children: children }));
|
|
4441
4517
|
|
|
4442
4518
|
function AccountsButton(_a) {
|
|
4443
4519
|
var { imageUrls } = _a, props = __rest$1(_a, ["imageUrls"]);
|
|
@@ -4463,6 +4539,26 @@ function ArrowButton(_a) {
|
|
|
4463
4539
|
"aria-disabled:tw-bg-grey-600 aria-disabled:tw-text-grey-800"), children: jsx(ArrowRightIcon, {}) })] })));
|
|
4464
4540
|
}
|
|
4465
4541
|
|
|
4542
|
+
const colors = [
|
|
4543
|
+
"#D94E41",
|
|
4544
|
+
"#E58845",
|
|
4545
|
+
"#D9BA21",
|
|
4546
|
+
"#B1CC29",
|
|
4547
|
+
"#66CC33",
|
|
4548
|
+
"#19A654",
|
|
4549
|
+
"#56BFB6",
|
|
4550
|
+
"#45B0E5",
|
|
4551
|
+
"#3973E5",
|
|
4552
|
+
"#7562D9",
|
|
4553
|
+
"#B167E5",
|
|
4554
|
+
"#E573BF",
|
|
4555
|
+
];
|
|
4556
|
+
function useColorFromSeed(seed) {
|
|
4557
|
+
return useMemo(() => {
|
|
4558
|
+
return colors[hashStringToIndex(seed, colors.length)];
|
|
4559
|
+
}, [seed]);
|
|
4560
|
+
}
|
|
4561
|
+
|
|
4466
4562
|
function Input(_a) {
|
|
4467
4563
|
var { placeholder = "Search", showIcon = true, className, icon, isError = false, isWarning = false, containerClassName, actionButtonProps, autoFocusTimeout, inputRef: inputRefProp } = _a, props = __rest$1(_a, ["placeholder", "showIcon", "className", "icon", "isError", "isWarning", "containerClassName", "actionButtonProps", "autoFocusTimeout", "inputRef"]);
|
|
4468
4564
|
const showActionButton = actionButtonProps != null;
|
|
@@ -18849,8 +18945,8 @@ function DetailsToolbar({ errorMessage, helpButton, isLoading, isEmpty, flipButt
|
|
|
18849
18945
|
"group-hover/flip-button:tw-rotate-180") }) }) }))) }), jsx("div", { className: cn(detailClassName, "tw-justify-end"), children: !!stopsButton && jsx(StopsButton, Object.assign({}, stopsButton)) })] })) }));
|
|
18850
18946
|
}
|
|
18851
18947
|
|
|
18852
|
-
function DropdownMenu({ dropdownRef, className, menuRef, isHidden = false, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, }) {
|
|
18853
|
-
return (
|
|
18948
|
+
function DropdownMenu({ dropdownRef, className, menuRef, isHidden = false, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, trigger, }) {
|
|
18949
|
+
return (jsxs("div", { ref: dropdownRef, className: cn("tw-relative", containerClassName), children: [trigger, jsx(Menu, { menuRef: menuRef, rounded: "sm", containerClassName: cn("tw-absolute tw-right-0 tw-z-30", className), contentClassName: cn("!tw-p-0", menuContentClassName), contentWrapperProps: contentWrapperProps, children: !isHidden && (jsx("ul", { className: cn("tw-flex tw-max-w-full tw-flex-col tw-gap-squid-xxs tw-px-0 tw-py-squid-xxs", listClassName), children: children })) })] }));
|
|
18854
18950
|
}
|
|
18855
18951
|
|
|
18856
18952
|
function InfoBox({ title, description, icon }) {
|
|
@@ -19011,19 +19107,20 @@ function AccountListItem({ isConnected, imageUrls = [], imageUrl, badgeUrl, acti
|
|
|
19011
19107
|
|
|
19012
19108
|
const SPACING = 10;
|
|
19013
19109
|
function useDropdownMenu(props) {
|
|
19014
|
-
const {
|
|
19015
|
-
const [isDropdownOpen,
|
|
19110
|
+
const { initialIsDropdownOpen, itemsContainerRef } = props !== null && props !== void 0 ? props : {};
|
|
19111
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState(Boolean(initialIsDropdownOpen));
|
|
19016
19112
|
const dropdownRef = useRef(null);
|
|
19017
19113
|
const openDropdownButtonRef = useRef(null);
|
|
19018
19114
|
useEffect(() => {
|
|
19019
19115
|
const handleClickOutside = (event) => {
|
|
19020
|
-
// close
|
|
19116
|
+
// close dropdown if the user clicked outside of it
|
|
19021
19117
|
var _a;
|
|
19022
|
-
|
|
19118
|
+
const hasClickedOutside = dropdownRef.current &&
|
|
19023
19119
|
event.target !== openDropdownButtonRef.current &&
|
|
19024
19120
|
!dropdownRef.current.contains(event.target) &&
|
|
19025
|
-
!((_a = openDropdownButtonRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))
|
|
19026
|
-
|
|
19121
|
+
!((_a = openDropdownButtonRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target));
|
|
19122
|
+
if (hasClickedOutside) {
|
|
19123
|
+
setIsDropdownOpen(false);
|
|
19027
19124
|
}
|
|
19028
19125
|
};
|
|
19029
19126
|
if (isDropdownOpen) {
|
|
@@ -19034,10 +19131,10 @@ function useDropdownMenu(props) {
|
|
|
19034
19131
|
};
|
|
19035
19132
|
}, [dropdownRef, isDropdownOpen]);
|
|
19036
19133
|
const openDropdown = useCallback(() => {
|
|
19037
|
-
|
|
19134
|
+
setIsDropdownOpen((prev) => !prev);
|
|
19038
19135
|
}, []);
|
|
19039
19136
|
const closeDropdown = useCallback(() => {
|
|
19040
|
-
|
|
19137
|
+
setIsDropdownOpen(false);
|
|
19041
19138
|
}, []);
|
|
19042
19139
|
const [dropdownStyles, setDropdownStyles] = useState(null);
|
|
19043
19140
|
const itemRef = useRef(null);
|
|
@@ -19077,10 +19174,11 @@ function useDropdownMenu(props) {
|
|
|
19077
19174
|
// if the dropdown is not visible at top or bottom of the item
|
|
19078
19175
|
// we just center it
|
|
19079
19176
|
if (!isDropdownVisibleAtItemTopOrBottom) {
|
|
19080
|
-
|
|
19177
|
+
setDropdownStyles({
|
|
19081
19178
|
position: "center",
|
|
19082
19179
|
maxHeight,
|
|
19083
19180
|
});
|
|
19181
|
+
return;
|
|
19084
19182
|
}
|
|
19085
19183
|
// finally, if the dropdown fits, position it where it has more space
|
|
19086
19184
|
if (distanceBetweenItemBottomAndContainerBottomEdge >=
|
|
@@ -19354,7 +19452,7 @@ const collapsedListItemClassMap = {
|
|
|
19354
19452
|
large: "tw-w-[80px]",
|
|
19355
19453
|
};
|
|
19356
19454
|
function ListItem(_a) {
|
|
19357
|
-
var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, placeholderImageUrl, size = "large", mainIcon, className, isSelected = false, onDetailClick, showDetailOnHoverOnly, rounded = "xxs", detailButtonClassName, loading, containerProps, compactOnMobile, extraPadding = true, itemsContainerRef, dropdownMenuContent, imageGroup, multilineSubtitle = false } = _a, props = __rest$1(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "placeholderImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps", "compactOnMobile", "extraPadding", "itemsContainerRef", "dropdownMenuContent", "imageGroup", "multilineSubtitle"]);
|
|
19455
|
+
var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, placeholderImageUrl, size = "large", mainIcon, className, isSelected = false, onDetailClick, showDetailOnHoverOnly, rounded = "xxs", detailButtonClassName, loading, containerProps, compactOnMobile, extraPadding = true, itemsContainerRef, dropdownMenuContent, imageGroup, multilineSubtitle = false, control } = _a, props = __rest$1(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "placeholderImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps", "compactOnMobile", "extraPadding", "itemsContainerRef", "dropdownMenuContent", "imageGroup", "multilineSubtitle", "control"]);
|
|
19358
19456
|
const { isDropdownOpen, dropdownRef, openDropdown, closeDropdown, openDropdownButtonRef, itemRef, menuRef, dropdownStyles, } = useDropdownMenu({
|
|
19359
19457
|
itemsContainerRef,
|
|
19360
19458
|
});
|
|
@@ -19390,9 +19488,11 @@ function ListItem(_a) {
|
|
|
19390
19488
|
}
|
|
19391
19489
|
return null;
|
|
19392
19490
|
};
|
|
19393
|
-
const isInteractive = !!props.onClick;
|
|
19394
|
-
const ItemTag = isInteractive ? "button" : "div";
|
|
19395
|
-
const itemProps = isInteractive
|
|
19491
|
+
const isInteractive = !!props.onClick || !!control;
|
|
19492
|
+
const ItemTag = isInteractive ? (control ? "label" : "button") : "div";
|
|
19493
|
+
const itemProps = isInteractive
|
|
19494
|
+
? props
|
|
19495
|
+
: {};
|
|
19396
19496
|
const handleInteraction = (e) => {
|
|
19397
19497
|
var _a;
|
|
19398
19498
|
e.preventDefault();
|
|
@@ -19409,9 +19509,9 @@ function ListItem(_a) {
|
|
|
19409
19509
|
};
|
|
19410
19510
|
return (jsxs("li", Object.assign({}, containerProps, { ref: itemRef, className: cn("tw-relative tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300 tw-highlight-adjacent", !multilineSubtitle && listItemSizeMap[size], extraPadding && "tw-px-squid-xs", compactOnMobile
|
|
19411
19511
|
? `${collapsedListItemClassMap[size]} mobile-lg:tw-w-full`
|
|
19412
|
-
: "tw-w-full", className), children: [jsxs(ItemTag, Object.assign({}, itemProps, { onClick: handleItemClick, className: cn("tw-group/list-item tw-peer/list-item tw-relative tw-flex tw-w-full tw-max-w-full tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs", !multilineSubtitle
|
|
19512
|
+
: "tw-w-full", className), children: [jsxs(ItemTag, Object.assign({}, itemProps, { onClick: control == null ? handleItemClick : undefined, className: cn("tw-group/list-item tw-peer/list-item tw-relative tw-flex tw-w-full tw-max-w-full tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs", !multilineSubtitle
|
|
19413
19513
|
? "tw-items-center tw-py-squid-xxs"
|
|
19414
|
-
: "tw-py-squid-xs", (isSelected || isDropdownOpen) && "tw-bg-material-light-thin", isInteractive && "hover:tw-bg-material-light-thin", isInteractive && "tw-text-left tw-normal-case"), children: [size === "large" ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon !== null && mainIcon !== void 0 ? mainIcon : (imageGroup != null ? (jsx(ImageGroup, { size: "small", imageUrls: imageGroup })) : (jsx(BadgeImage, { image: {
|
|
19514
|
+
: "tw-py-squid-xs", (isSelected || isDropdownOpen) && "tw-bg-material-light-thin", isInteractive && control == null && "hover:tw-bg-material-light-thin", isInteractive && "tw-text-left tw-normal-case"), children: [size === "large" ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon !== null && mainIcon !== void 0 ? mainIcon : (imageGroup != null ? (jsx(ImageGroup, { size: "small", imageUrls: imageGroup })) : (jsx(BadgeImage, { image: {
|
|
19415
19515
|
src: mainImageUrl,
|
|
19416
19516
|
placeholderImageUrl,
|
|
19417
19517
|
size: "xlarge",
|
|
@@ -19431,7 +19531,7 @@ function ListItem(_a) {
|
|
|
19431
19531
|
: "tw-flex", isDetailInteractive && "hover:tw-bg-material-light-thin", detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] }))), !!dropdownMenuContent && (jsx(ListItemActionsButton, { ref: openDropdownButtonRef, onClick: (e) => {
|
|
19432
19532
|
e.stopPropagation();
|
|
19433
19533
|
isDropdownOpen ? closeDropdown() : openDropdown();
|
|
19434
|
-
}, isActive: isDropdownOpen, className: "tw-z-20 peer-hover/list-item:tw-opacity-100" }))] })), isDropdownOpen && !!dropdownMenuContent ? (jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
|
|
19534
|
+
}, isActive: isDropdownOpen, className: "tw-z-20 peer-hover/list-item:tw-opacity-100" })), control] })), isDropdownOpen && !!dropdownMenuContent ? (jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
|
|
19435
19535
|
dropdownPositionClassMap$1[dropdownStyles.position]), dropdownRef: dropdownRef, children: dropdownMenuContent })) : null] })));
|
|
19436
19536
|
}
|
|
19437
19537
|
const ListItemActionsButton = forwardRef((_a, ref) => {
|
|
@@ -27526,19 +27626,23 @@ function Switch({ checked = false, onChange, size, disabled = false, inputProps,
|
|
|
27526
27626
|
// size styles
|
|
27527
27627
|
switchSizeClassMap[size],
|
|
27528
27628
|
// checked styles
|
|
27529
|
-
checked ? "tw-bg-
|
|
27629
|
+
disabled || !checked ? "tw-bg-grey-800" : "tw-bg-status-positive",
|
|
27530
27630
|
// disabled styles
|
|
27531
27631
|
disabled ? "tw-cursor-not-allowed" : "tw-cursor-pointer",
|
|
27532
27632
|
// Focus visible styles
|
|
27533
27633
|
"tw-focus-visible-within-outline"), children: [jsx("input", Object.assign({}, inputProps, { 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" })), jsx("span", { style: {
|
|
27534
|
-
filter:
|
|
27634
|
+
filter: disabled
|
|
27635
|
+
? "drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.10)) drop-shadow(0px 1px 5px rgba(0, 0, 0, 0.10))"
|
|
27636
|
+
: "drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.33)) drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.20))",
|
|
27535
27637
|
}, className: clsx("tw-absolute tw-rounded-full tw-border tw-border-material-light-thin tw-transition-all",
|
|
27536
27638
|
// size styles
|
|
27537
27639
|
switchKnobSizeClassMap[size],
|
|
27538
27640
|
// checked styles
|
|
27539
|
-
switchKnobCheckedClassMap[size][checked ? "checked" : "unchecked"],
|
|
27540
|
-
? "group-data-[squid-theme-type=dark]:tw-bg-grey-
|
|
27541
|
-
:
|
|
27641
|
+
switchKnobCheckedClassMap[size][checked ? "checked" : "unchecked"], disabled
|
|
27642
|
+
? "group-data-[squid-theme-type=dark]:tw-bg-grey-700 group-data-[squid-theme-type=light]:tw-bg-grey-900"
|
|
27643
|
+
: checked
|
|
27644
|
+
? "group-data-[squid-theme-type=dark]:tw-bg-grey-100 group-data-[squid-theme-type=light]:tw-bg-grey-900"
|
|
27645
|
+
: "tw-bg-grey-500") })] }));
|
|
27542
27646
|
}
|
|
27543
27647
|
|
|
27544
27648
|
function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarning = false, }) {
|
|
@@ -27652,7 +27756,8 @@ function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarnin
|
|
|
27652
27756
|
}, onMouseLeave: handleUpdateValue, className: cn("tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xxs tw-text-left tw-text-caption tw-font-caption tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin"), children: jsx(CirclePlusIcon, {}) })] })] }) }));
|
|
27653
27757
|
}
|
|
27654
27758
|
|
|
27655
|
-
const
|
|
27759
|
+
const imageWrapperClassName = "tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center";
|
|
27760
|
+
const tokenImageClassName = "tw-absolute tw-h-squid-xl tw-w-squid-xl tw-rounded-full tw-object-cover";
|
|
27656
27761
|
const themeKeyVariantMap = {
|
|
27657
27762
|
primary: "grey-800",
|
|
27658
27763
|
accent: "royal-500",
|
|
@@ -27672,6 +27777,12 @@ var AssetsButtonState;
|
|
|
27672
27777
|
AssetsButtonState[AssetsButtonState["EMPTY"] = 2] = "EMPTY";
|
|
27673
27778
|
AssetsButtonState[AssetsButtonState["LOADING"] = 3] = "LOADING";
|
|
27674
27779
|
})(AssetsButtonState || (AssetsButtonState = {}));
|
|
27780
|
+
var ImageLoadingState;
|
|
27781
|
+
(function (ImageLoadingState) {
|
|
27782
|
+
ImageLoadingState[ImageLoadingState["LOADING"] = 0] = "LOADING";
|
|
27783
|
+
ImageLoadingState[ImageLoadingState["LOADED"] = 1] = "LOADED";
|
|
27784
|
+
ImageLoadingState[ImageLoadingState["ERROR"] = 2] = "ERROR";
|
|
27785
|
+
})(ImageLoadingState || (ImageLoadingState = {}));
|
|
27675
27786
|
const outlineWidthMap = {
|
|
27676
27787
|
[AssetsButtonState.LOADING]: {
|
|
27677
27788
|
inner: 75,
|
|
@@ -27691,7 +27802,9 @@ const outlineWidthMap = {
|
|
|
27691
27802
|
},
|
|
27692
27803
|
};
|
|
27693
27804
|
function AssetsButton({ chain, token, onClick, variant = "primary", isLoading = false, tooltip, emptyTokenLabel = "Select token", }) {
|
|
27694
|
-
var _a, _b;
|
|
27805
|
+
var _a, _b, _c, _d;
|
|
27806
|
+
const [tokenImageLoadingState, setTokenImageLoadingState] = useState(ImageLoadingState.LOADING);
|
|
27807
|
+
const fallbackBgColor = useColorFromSeed((_a = token === null || token === void 0 ? void 0 : token.symbol) !== null && _a !== void 0 ? _a : "");
|
|
27695
27808
|
const state = useMemo(() => {
|
|
27696
27809
|
if (chain != null && !isLoading) {
|
|
27697
27810
|
if (token != null) {
|
|
@@ -27706,10 +27819,27 @@ function AssetsButton({ chain, token, onClick, variant = "primary", isLoading =
|
|
|
27706
27819
|
}, [token, chain, isLoading]);
|
|
27707
27820
|
const defaultBgColor = `var(${themeKeysToCssVariables.color[themeKeyVariantMap[variant]].cssVariable})`;
|
|
27708
27821
|
const outlineWidth = outlineWidthMap[state];
|
|
27709
|
-
const chainBgColor = (
|
|
27710
|
-
const
|
|
27711
|
-
?
|
|
27712
|
-
:
|
|
27822
|
+
const chainBgColor = (_b = chain === null || chain === void 0 ? void 0 : chain.bgColor) !== null && _b !== void 0 ? _b : defaultBgColor;
|
|
27823
|
+
const tokenTextColor = tokenImageLoadingState === ImageLoadingState.ERROR
|
|
27824
|
+
? "#fff"
|
|
27825
|
+
: token === null || token === void 0 ? void 0 : token.textColor;
|
|
27826
|
+
const tokenBgColor = useMemo(() => {
|
|
27827
|
+
if (state !== AssetsButtonState.FULL) {
|
|
27828
|
+
return defaultBgColor;
|
|
27829
|
+
}
|
|
27830
|
+
if (tokenImageLoadingState === ImageLoadingState.ERROR) {
|
|
27831
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
27832
|
+
return fallbackBgColor || defaultBgColor;
|
|
27833
|
+
}
|
|
27834
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
27835
|
+
return (token === null || token === void 0 ? void 0 : token.bgColor) || defaultBgColor;
|
|
27836
|
+
}, [
|
|
27837
|
+
state,
|
|
27838
|
+
token === null || token === void 0 ? void 0 : token.bgColor,
|
|
27839
|
+
defaultBgColor,
|
|
27840
|
+
tokenImageLoadingState,
|
|
27841
|
+
fallbackBgColor,
|
|
27842
|
+
]);
|
|
27713
27843
|
const bgGradient = useMemo(() => {
|
|
27714
27844
|
switch (state) {
|
|
27715
27845
|
case AssetsButtonState.EMPTY:
|
|
@@ -27727,12 +27857,22 @@ function AssetsButton({ chain, token, onClick, variant = "primary", isLoading =
|
|
|
27727
27857
|
? "tw-cursor-not-allowed"
|
|
27728
27858
|
: "tw-group/assets-button"), children: [jsx("svg", { className: "tw-absolute tw-left-0 tw-z-10 tw-h-[40px] tw-w-[72px] tw-text-material-light-thin", viewBox: "0 0 72 40", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: jsx("path", { d: "m57.86 5.86c-.53.53-1.05 1.06-1.56 1.59-3.29 3.38-6.37 6.55-10.3 6.55s-7.01-3.17-10.3-6.55c-.51-.53-1.03-1.06-1.56-1.59-3.9-3.91-9.02-5.86-14.14-5.86s-10.24 1.95-14.14 5.86c-3.91 3.9-5.86 9.02-5.86 14.14s1.95 10.24 5.86 14.14c3.91 3.91 9.02 5.86 14.14 5.86s10.24-1.95 14.14-5.86c.52-.53 1.04-1.06 1.55-1.58 3.29-3.39 6.37-6.56 10.31-6.56s7.02 3.17 10.31 6.56c.51.53 1.03 1.06 1.55 1.58 3.91 3.91 9.02 5.86 14.14 5.86v-40c-5.12 0-10.24 1.95-14.14 5.86zm14.14 33.14c-5.07 0-9.85-1.98-13.43-5.56-.52-.52-1.02-1.04-1.54-1.57-3.43-3.53-6.67-6.86-11.02-6.86s-7.6 3.33-11.04 6.88c-.5.52-1.01 1.04-1.53 1.56-3.59 3.59-8.36 5.57-13.44 5.57s-9.85-1.98-13.43-5.57c-3.59-3.59-5.56-8.36-5.56-13.43s1.98-9.85 5.56-13.44c3.58-3.6 8.35-5.58 13.43-5.58s9.85 1.98 13.44 5.57c.52.52 1.04 1.05 1.55 1.58 3.43 3.53 6.66 6.86 11.02 6.86s7.59-3.33 11.02-6.86c.51-.52 1.02-1.05 1.55-1.58 3.59-3.59 8.36-5.56 13.43-5.56v38z" }) }), jsxs("svg", { className: "tw-absolute -tw-left-[2px] -tw-top-[2px] tw-z-20 tw-hidden group-hover/assets-button:tw-block", xmlns: "http://www.w3.org/2000/svg", width: outlineWidth.inner, height: "44", viewBox: `0 0 ${outlineWidth.inner} 44`, fill: "none", children: [jsx("clipPath", { id: "halfClip1", children: jsx("rect", { x: "0", y: "0", width: outlineWidth.inner, height: "44" }) }), jsx("path", { d: "M59.1506 36.849L59.1508 36.8492C63.2511 40.9496 68.6272 43 74.0001 43H145C156.598 43 166 33.598 166 22C166 10.402 156.598 1 145 1H74.0001C68.6272 0.999977 63.2511 3.05042 59.1508 7.15076C58.6183 7.68325 58.0958 8.22097 57.5842 8.74755L57.5817 8.75009C55.9228 10.4574 54.3925 12.0283 52.8031 13.1834C51.2282 14.3279 49.6791 15 48 15C46.3209 15 44.7718 14.3279 43.1969 13.1834C41.6075 12.0283 40.0772 10.4574 38.4183 8.75009L38.4159 8.74759C37.9042 8.22101 37.3817 7.68327 36.8492 7.15076C32.7489 3.05042 27.3728 0.999977 21.9999 1C16.6271 1.00002 11.251 3.05047 7.15076 7.15076C3.05045 11.2511 1 16.6272 1 22C1 27.3728 3.05045 32.7489 7.15076 36.8492C11.251 40.9495 16.6271 43 21.9999 43C27.3728 43 32.7489 40.9496 36.8492 36.8492L36.8494 36.849C37.3794 36.3188 37.8994 35.7834 38.4088 35.2589L38.4108 35.2569C40.0704 33.5483 41.6019 31.9756 43.1928 30.8191C44.7691 29.6731 46.3197 29 48 29C49.6803 29 51.2309 29.6731 52.8072 30.8191C54.3981 31.9756 55.9296 33.5483 57.5892 35.2569L57.5912 35.2589C58.1006 35.7834 58.6206 36.3188 59.1506 36.849Z", stroke: "currentColor", className: "tw-text-grey-900", strokeWidth: "2", clipPath: "url(#halfClip1)" })] }), jsxs("svg", { className: "tw-absolute -tw-left-[4px] -tw-top-[4px] tw-z-10 tw-hidden group-hover/assets-button:tw-block", xmlns: "http://www.w3.org/2000/svg", width: outlineWidth.outer, height: "48", viewBox: `0 0 ${outlineWidth.outer} 48`, fill: "none", children: [jsx("clipPath", { id: "halfClip2", children: jsx("rect", { x: "0", y: "0", width: outlineWidth.outer, height: "48" }) }), jsx("path", { d: "M60.4432 39.5559L60.4437 39.5564C64.7391 43.8517 70.3729 46 76.0001 46H147C159.15 46 169 36.1503 169 24C169 11.8497 159.15 2 147 2H76.0001C70.3729 1.99998 64.7391 4.14825 60.4437 8.44365C59.9062 8.98109 59.3797 9.52298 58.8697 10.0479L58.8645 10.0532C57.1905 11.7761 55.7217 13.2796 54.2152 14.3745C52.7378 15.4481 51.3923 16 50 16C48.6077 16 47.2622 15.4481 45.7848 14.3745C44.2783 13.2796 42.8095 11.7761 41.1355 10.0532L41.1305 10.0481C40.6205 9.52314 40.0939 8.98117 39.5563 8.44365C35.2609 4.14825 29.6271 1.99998 23.9999 2C18.3727 2.00002 12.739 4.1483 8.44365 8.44365C4.14827 12.739 2 18.3728 2 24C2 29.6272 4.14827 35.261 8.44365 39.5564C12.739 43.8517 18.3727 46 23.9999 46C29.6271 46 35.2609 43.8517 39.5563 39.5564L39.5568 39.5559C40.0917 39.0207 40.6159 38.481 41.1237 37.9582L41.1281 37.9537C42.8028 36.2295 44.2728 34.7243 45.7808 33.6279C47.2597 32.5528 48.6066 32 50 32C51.3934 32 52.7403 32.5528 54.2192 33.6279C55.7272 34.7243 57.1972 36.2295 58.8719 37.9537L58.8763 37.9582C59.3841 38.481 59.9083 39.0207 60.4432 39.5559Z", stroke: "currentColor", className: "tw-text-material-light-average", strokeWidth: "4", clipPath: "url(#halfClip2)" })] }), jsx("div", { className: cn("tw-assets-button-mask tw-flex tw-h-squid-xl tw-w-[92px] tw-items-center tw-justify-between", state !== AssetsButtonState.FULL && "!tw-w-[72px]"), style: {
|
|
27729
27859
|
backgroundImage: bgGradient,
|
|
27730
|
-
}, children: jsx("div", { className: clsx(
|
|
27731
|
-
state === AssetsButtonState.FULL ? (jsx("img", { src: chain === null || chain === void 0 ? void 0 : chain.iconUrl, alt: "", className: "tw-h-squid-xl tw-w-squid-xl tw-rounded-full tw-object-cover" })) : (state !== AssetsButtonState.LOADING && (jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsx(PlusIcon, {}) }))) }) }), state === AssetsButtonState.FULL ? (jsxs("div", { className: clsx(
|
|
27860
|
+
}, children: jsx("div", { className: clsx(imageWrapperClassName), children: state === AssetsButtonState.CHAIN_ONLY ||
|
|
27861
|
+
state === AssetsButtonState.FULL ? (jsx("img", { src: chain === null || chain === void 0 ? void 0 : chain.iconUrl, alt: "", className: "tw-h-squid-xl tw-w-squid-xl tw-rounded-full tw-object-cover" })) : (state !== AssetsButtonState.LOADING && (jsx("span", { className: emptyChainIconTextClassNameMap[variant], children: jsx(PlusIcon, {}) }))) }) }), state === AssetsButtonState.FULL ? (jsxs("div", { className: clsx(imageWrapperClassName, "tw-absolute tw-left-[54px] tw-z-[5] tw-h-squid-xl tw-overflow-hidden"), children: [jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px]", style: {
|
|
27732
27862
|
backgroundColor: tokenBgColor,
|
|
27733
|
-
} }),
|
|
27863
|
+
} }), tokenImageLoadingState === ImageLoadingState.ERROR && (
|
|
27864
|
+
// show fallback
|
|
27865
|
+
jsx("div", { style: { color: tokenTextColor }, className: cn(tokenImageClassName, "tw-flex tw-items-center tw-justify-center tw-text-body-small"), children: (_d = (_c = token === null || token === void 0 ? void 0 : token.symbol) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.toUpperCase() })), jsx("img", { onLoad: () => {
|
|
27866
|
+
setTokenImageLoadingState(ImageLoadingState.LOADED);
|
|
27867
|
+
}, onError: () => {
|
|
27868
|
+
setTokenImageLoadingState(ImageLoadingState.ERROR);
|
|
27869
|
+
}, src: token === null || token === void 0 ? void 0 : token.iconUrl, alt: token === null || token === void 0 ? void 0 : token.symbol, className: cn(tokenImageClassName,
|
|
27870
|
+
// when image load failed, hide it with opacity: 0 instead of display: none
|
|
27871
|
+
// so new images can load and update the loading state
|
|
27872
|
+
tokenImageLoadingState === ImageLoadingState.ERROR &&
|
|
27873
|
+
"tw-opacity-0") }), jsx("div", { className: "tw-absolute tw-right-0 tw-h-full tw-w-[22px] tw-border-b\n tw-border-t tw-border-material-light-thin" })] })) : null, jsxs("div", { className: cn("tw-relative tw-flex tw-h-squid-xl tw-w-fit tw-min-w-fit tw-items-center tw-gap-squid-xxs tw-rounded-br-full tw-rounded-tr-full tw-border tw-border-l-0 tw-border-material-light-thin tw-py-squid-xs tw-pr-squid-xs before:tw-absolute before:-tw-inset-[3px] before:tw-z-[1] before:tw-w-[calc(100%+3px)] before:tw-translate-x-[3px] before:tw-rounded-br-full before:tw-rounded-tr-full before:tw-border-2 before:tw-border-l-0 before:tw-border-transparent after:tw-absolute after:-tw-inset-[5px] after:tw-z-0 after:tw-w-[calc(100%+4px)] after:tw-translate-x-[6px] after:tw-rounded-br-full after:tw-rounded-tr-full after:tw-border-4 after:tw-border-l-0 after:tw-border-transparent group-hover/assets-button:before:tw-border-grey-900 group-hover/assets-button:after:tw-border-material-light-average", state === AssetsButtonState.FULL && "tw-pl-[7px]"), style: {
|
|
27734
27874
|
backgroundColor: tokenBgColor,
|
|
27735
|
-
color:
|
|
27875
|
+
color: tokenTextColor,
|
|
27736
27876
|
}, children: [jsx(BodyText, { size: "small", className: cn("tw-leading-[13px]", state === AssetsButtonState.LOADING && "tw-min-w-[135px]"), children: state === AssetsButtonState.FULL
|
|
27737
27877
|
? token === null || token === void 0 ? void 0 : token.symbol
|
|
27738
27878
|
: state !== AssetsButtonState.LOADING && emptyTokenLabel }), state !== AssetsButtonState.LOADING && (jsx(ChevronLargeRightIcon, { className: "tw-w-4 tw-min-w-4 tw-opacity-66" }))] })] }) })));
|
|
@@ -69198,7 +69338,7 @@ const swapProgressButtonTexts = {
|
|
|
69198
69338
|
[SwapState.PARTIAL_SUCCESS]: "Cancel",
|
|
69199
69339
|
[SwapState.NEEDS_GAS]: "Go to Axelarscan",
|
|
69200
69340
|
};
|
|
69201
|
-
function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete,
|
|
69341
|
+
function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, addGasLink, shareSwapDropdownContent, }) {
|
|
69202
69342
|
const [showSwapInfoSection, setShowSwapInfoSection] = useState(true);
|
|
69203
69343
|
const isFirstRenderRef = useRef(true);
|
|
69204
69344
|
const { timer, stopTimer, startTimer } = useTimer({
|
|
@@ -69257,7 +69397,7 @@ function SwapProgressView({ steps, isOpen = true, handleClose, handleComplete, s
|
|
|
69257
69397
|
height: "100%",
|
|
69258
69398
|
maxHeight: "100%",
|
|
69259
69399
|
width: "auto",
|
|
69260
|
-
}, autoplay: true, loop: true, src: swapProgressAnimations[swapState] }) }), jsx("div", { className: "tw-relative tw-flex tw-h-squid-m tw-w-full tw-items-end tw-justify-between tw-self-stretch tw-px-squid-m", children: swapState === SwapState.COMPLETED ? (jsxs(Fragment, { children: [jsx("span", { className: "-tw-mb-1 -tw-ml-1", children: jsx(SwapSuccessIcon, {}) }), jsx(
|
|
69400
|
+
}, autoplay: true, loop: true, src: swapProgressAnimations[swapState] }) }), jsx("div", { className: "tw-relative tw-flex tw-h-squid-m tw-w-full tw-items-end tw-justify-between tw-self-stretch tw-px-squid-m", children: swapState === SwapState.COMPLETED ? (jsxs(Fragment, { children: [jsx("span", { className: "-tw-mb-1 -tw-ml-1", children: jsx(SwapSuccessIcon, {}) }), jsx(ShareSwapButton, { dropdownContent: shareSwapDropdownContent })] })) : swapState === SwapState.ERROR ? (jsx(SwapErrorTopMenu, { supportLink: supportLink, type: "error" })) : swapState === SwapState.PARTIAL_SUCCESS ? (jsx(SwapErrorTopMenu, { supportLink: supportLink, type: "warning" })) : (jsx(TokenPair, { firstToken: {
|
|
69261
69401
|
bgColor: fromToken.bgColor,
|
|
69262
69402
|
logoURI: fromToken.logoUrl,
|
|
69263
69403
|
}, secondToken: {
|
|
@@ -69281,8 +69421,6 @@ const TrackTransactionView = forwardRef((props, ref) => {
|
|
|
69281
69421
|
currentStepIndex: rawSteps.length - 1,
|
|
69282
69422
|
};
|
|
69283
69423
|
}
|
|
69284
|
-
// Vercel build throws an error for findLastIndex, probably related to the Node version being used
|
|
69285
|
-
// @ts-expect-error - TODO: Fix this
|
|
69286
69424
|
const lastSuccessfulStepIndex = rawSteps.findLastIndex((s) => s.status === "executed" || s.status === "success");
|
|
69287
69425
|
if (swapState === SwapState.PROGRESS) {
|
|
69288
69426
|
onTxStart();
|
|
@@ -69320,8 +69458,6 @@ const TrackTransactionView = forwardRef((props, ref) => {
|
|
|
69320
69458
|
};
|
|
69321
69459
|
}
|
|
69322
69460
|
if (swapState === SwapState.PARTIAL_SUCCESS) {
|
|
69323
|
-
// Vercel build throws an error for findLastIndex, probably related to the Node version being used
|
|
69324
|
-
// @ts-expect-error - TODO: Fix this
|
|
69325
69461
|
const lastWarningStepIndex = rawSteps.findLastIndex((s) => s.status === "warning");
|
|
69326
69462
|
if (lastWarningStepIndex !== -1) {
|
|
69327
69463
|
return {
|
|
@@ -69355,6 +69491,15 @@ const SwapErrorTopMenu = ({ supportLink, type, }) => {
|
|
|
69355
69491
|
return (jsxs(Fragment, { children: [jsx("span", { className: "-tw-mb-1 -tw-ml-1", children: type === "error" ? jsx(SwapErrorIcon, {}) : jsx(SwapWarningIcon, {}) }), jsx(Button$1, { size: "md", variant: "secondary", label: "Get help", link: supportLink, title: "Contact support" })] }));
|
|
69356
69492
|
};
|
|
69357
69493
|
TrackTransactionView.displayName = "TrackTransactionView";
|
|
69494
|
+
function ShareSwapButton({ dropdownContent, }) {
|
|
69495
|
+
const containerRef = useContainerStore((state) => state.containerRef);
|
|
69496
|
+
const { dropdownRef, isDropdownOpen, openDropdown, menuRef } = useDropdownMenu({
|
|
69497
|
+
itemsContainerRef: containerRef,
|
|
69498
|
+
});
|
|
69499
|
+
return (jsx(DropdownMenu, { dropdownRef: dropdownRef, menuRef: menuRef, className: "-tw-bottom-[calc(100%+5px)] tw-left-1/2 tw-right-[unset] tw-top-[calc(100%+5px)] -tw-translate-x-1/2", isHidden: !isDropdownOpen, trigger: jsx(Button$1, { size: "md", variant: "secondary", onClick: () => {
|
|
69500
|
+
openDropdown();
|
|
69501
|
+
}, children: jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(BodyText, { size: "small", className: "tw-px-squid-xxs", children: "Share" }), jsx(ChevronDownSmallIcon, { size: "24", strokeWidth: "1.5" })] }) }), children: dropdownContent }));
|
|
69502
|
+
}
|
|
69358
69503
|
|
|
69359
69504
|
function TransactionViewLayout(_a) {
|
|
69360
69505
|
var { isLoading, header, properties, actions, fees } = _a, props = __rest$1(_a, ["isLoading", "header", "properties", "actions", "fees"]);
|
|
@@ -69740,4 +69885,4 @@ function ThemeProvider(_a) {
|
|
|
69740
69885
|
return (jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-group tw-relative tw-flex tw-font-squid-main tw-h-d-screen mobile-lg:tw-h-auto", props.className), children: children })));
|
|
69741
69886
|
}
|
|
69742
69887
|
|
|
69743
|
-
export { ANIMATION_DURATIONS, AccountListItem, AccountsButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, Announcement, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowExpandIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, CelebrateIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon,
|
|
69888
|
+
export { ANIMATION_DURATIONS, AccountListItem, AccountsButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, Announcement, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowExpandIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, CelebrateIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleCheckIcon, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy2Icon, CopyOutlinedIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DepositAddressView, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FarcasterIcon, FavouriteFilterIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HighestPriceRangeIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageGroup, ImageIcon, ImageSparkle, ImageStack, ImageState, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoneyBagIcon, MoonIcon, NavigationBar, NewsIcon, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PauseIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PluginIcon, PlusIcon, PoopIcon, PowerIcon, PriceChange, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, QrCodeIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileFilledIcon, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, SquidVector, StakeAction, StarLinesIcon, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, Tab, Tabs, TagIcon, TagIconFilled, TelegramIcon, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenDetailsView, TokenGroup, TokenGroups, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, TxProgressViewHeader, UnsupportedPairNotice, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WrapAction, XSocialIcon, adjustColorForContrast, baseTailwindConfig, blendColors, buttonRoundedClassMap, cn, darkTheme, getColorBrightness, getContrastColor, getHexColorFromOpacityPercentage, getWalletCardBackground, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseColor, parseSquidTheme, pxToRem, remToPx, rgbToHex, spacing$1 as spacing, statusTextClassMap, themeKeysToCssVariables, transactionErrorPauseAnimation, transactionFailureAnimation, transactionHalfSuccessAnimation, transactionPendingAnimation, transactionProcessingAnimation, transactionRejectedAnimation, transactionSuccessAnimation, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
|