@0xsquid/ui 0.27.5 → 0.27.7-beta.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/README.md +4 -4
- package/dist/cjs/index.js +537 -247
- package/dist/cjs/types/components/buttons/AssetsButton.d.ts +2 -2
- package/dist/cjs/types/components/buttons/Button.d.ts +5 -3
- package/dist/cjs/types/components/controls/Input.d.ts +3 -3
- package/dist/cjs/types/components/controls/NumericInput.d.ts +2 -2
- package/dist/cjs/types/components/icons/Generic.d.ts +44 -0
- package/dist/cjs/types/components/icons/Weather.d.ts +8 -0
- package/dist/cjs/types/components/layout/InfoBox.d.ts +3 -3
- package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +2 -1
- package/dist/cjs/types/components/typography/BodyText.d.ts +2 -2
- package/dist/cjs/types/components/typography/HeadingText.d.ts +2 -2
- package/dist/cjs/types/components/views/SwapDetailsView.d.ts +2 -1
- package/dist/cjs/types/core/design-system.d.ts +9 -0
- package/dist/cjs/types/core/externalLinks.d.ts +2 -0
- package/dist/cjs/types/core/index.d.ts +1 -1
- package/dist/cjs/types/core/themes.d.ts +13 -8
- package/dist/cjs/types/core/utils.d.ts +11 -2
- package/dist/cjs/types/hooks/index.d.ts +1 -0
- package/dist/cjs/types/hooks/useUserTheme.d.ts +13 -0
- package/dist/cjs/types/providers/ThemeProvider.d.ts +11 -0
- package/dist/cjs/types/providers/index.d.ts +1 -1
- package/dist/cjs/types/services/internal/colorService.d.ts +9 -4
- package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +1 -0
- package/dist/cjs/types/stories/views/SwapDetailsView.stories.d.ts +1 -0
- package/dist/cjs/types/types/config.d.ts +28 -29
- package/dist/cjs/types/types/index.d.ts +2 -2
- package/dist/esm/index.js +522 -247
- package/dist/esm/types/components/buttons/AssetsButton.d.ts +2 -2
- package/dist/esm/types/components/buttons/Button.d.ts +5 -3
- package/dist/esm/types/components/controls/Input.d.ts +3 -3
- package/dist/esm/types/components/controls/NumericInput.d.ts +2 -2
- package/dist/esm/types/components/icons/Generic.d.ts +44 -0
- package/dist/esm/types/components/icons/Weather.d.ts +8 -0
- package/dist/esm/types/components/layout/InfoBox.d.ts +3 -3
- package/dist/esm/types/components/layout/SwapConfiguration.d.ts +2 -1
- package/dist/esm/types/components/typography/BodyText.d.ts +2 -2
- package/dist/esm/types/components/typography/HeadingText.d.ts +2 -2
- package/dist/esm/types/components/views/SwapDetailsView.d.ts +2 -1
- package/dist/esm/types/core/design-system.d.ts +9 -0
- package/dist/esm/types/core/externalLinks.d.ts +2 -0
- package/dist/esm/types/core/index.d.ts +1 -1
- package/dist/esm/types/core/themes.d.ts +13 -8
- package/dist/esm/types/core/utils.d.ts +11 -2
- package/dist/esm/types/hooks/index.d.ts +1 -0
- package/dist/esm/types/hooks/useUserTheme.d.ts +13 -0
- package/dist/esm/types/providers/ThemeProvider.d.ts +11 -0
- package/dist/esm/types/providers/index.d.ts +1 -1
- package/dist/esm/types/services/internal/colorService.d.ts +9 -4
- package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +1 -0
- package/dist/esm/types/stories/views/SwapDetailsView.stories.d.ts +1 -0
- package/dist/esm/types/types/config.d.ts +28 -29
- package/dist/esm/types/types/index.d.ts +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +104 -32
- package/package.json +2 -1
- package/dist/cjs/types/providers/SquidConfigProvider.d.ts +0 -9
- package/dist/esm/types/providers/SquidConfigProvider.d.ts +0 -9
package/dist/esm/index.js
CHANGED
|
@@ -2633,6 +2633,37 @@ const getFirstUniques = (array, key, count) => {
|
|
|
2633
2633
|
}
|
|
2634
2634
|
return uniqueItems;
|
|
2635
2635
|
};
|
|
2636
|
+
function isObject$3(value) {
|
|
2637
|
+
return typeof value === "object" && !Array.isArray(value) && value !== null;
|
|
2638
|
+
}
|
|
2639
|
+
function flatten(obj, options = {}) {
|
|
2640
|
+
const parsed = {};
|
|
2641
|
+
function toKebabCase(key) {
|
|
2642
|
+
return key.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2643
|
+
}
|
|
2644
|
+
function recurse(current, currentPrefix) {
|
|
2645
|
+
var _a;
|
|
2646
|
+
for (const [key, value] of Object.entries(current)) {
|
|
2647
|
+
const newPrefix = `${currentPrefix}${toKebabCase(key)}`;
|
|
2648
|
+
if (isObject$3(value)) {
|
|
2649
|
+
recurse(value, `${newPrefix}-`);
|
|
2650
|
+
}
|
|
2651
|
+
else if (typeof value === "string" || typeof value === "number") {
|
|
2652
|
+
parsed[`${(_a = options.prefix) !== null && _a !== void 0 ? _a : ""}${newPrefix}`] = String(value);
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
recurse(obj, "");
|
|
2657
|
+
return parsed;
|
|
2658
|
+
}
|
|
2659
|
+
// Map theme keys to css variables
|
|
2660
|
+
// Example { "accent-gold": "var(--accent-gold)" }
|
|
2661
|
+
function mapToCssVariables(obj) {
|
|
2662
|
+
return Object.entries(obj).reduce((acc, [key, { cssVariable }]) => {
|
|
2663
|
+
acc[key] = `var(${cssVariable})`;
|
|
2664
|
+
return acc;
|
|
2665
|
+
}, {});
|
|
2666
|
+
}
|
|
2636
2667
|
|
|
2637
2668
|
const badgeSizeClassMap = {
|
|
2638
2669
|
sm: "tw-w-4 tw-h-4",
|
|
@@ -2726,36 +2757,30 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
2726
2757
|
|
|
2727
2758
|
// font size, line height, and letter spacing classes
|
|
2728
2759
|
const textClassMap$1 = {
|
|
2729
|
-
small: "tw-text-body-small tw-tracking-body-small tw-leading-body-small",
|
|
2730
|
-
medium: "tw-text-body-medium tw-tracking-body-medium tw-leading-body-medium",
|
|
2731
|
-
large: "tw-text-body-large tw-tracking-body-large tw-leading-body-large",
|
|
2760
|
+
small: "tw-text-body-small tw-tracking-body-small tw-leading-body-small tw-font-body-small",
|
|
2761
|
+
medium: "tw-text-body-medium tw-tracking-body-medium tw-leading-body-medium tw-font-body-medium",
|
|
2762
|
+
large: "tw-text-body-large tw-tracking-body-large tw-leading-body-large tw-font-body-large",
|
|
2732
2763
|
};
|
|
2733
2764
|
function BodyText(_a) {
|
|
2734
|
-
var { size, children, bold, tight } = _a, props = __rest$1(_a, ["size", "children", "bold", "tight"]);
|
|
2735
|
-
const fontWeightClass = bold
|
|
2736
|
-
? "tw-font-typography-bold"
|
|
2737
|
-
: "tw-font-typography-regular";
|
|
2765
|
+
var { size, children, bold = false, tight = false } = _a, props = __rest$1(_a, ["size", "children", "bold", "tight"]);
|
|
2766
|
+
const fontWeightClass = bold ? "!tw-font-bold" : "!tw-font-regular";
|
|
2738
2767
|
return (jsx("span", Object.assign({}, props, { className: cn(textClassMap$1[size], fontWeightClass, tight && "!tw-leading-[1]", props.className), children: children })));
|
|
2739
2768
|
}
|
|
2740
2769
|
|
|
2741
2770
|
function CaptionText(_a) {
|
|
2742
|
-
var { children, bold } = _a, props = __rest$1(_a, ["children", "bold"]);
|
|
2743
|
-
const boldClass = bold
|
|
2744
|
-
|
|
2745
|
-
: "tw-font-typography-regular";
|
|
2746
|
-
return (jsx("span", Object.assign({}, props, { className: cn(boldClass, "tw-text-caption tw-leading-caption", props.className), children: children })));
|
|
2771
|
+
var { children, bold = false } = _a, props = __rest$1(_a, ["children", "bold"]);
|
|
2772
|
+
const boldClass = bold && "!tw-font-bold";
|
|
2773
|
+
return (jsx("span", Object.assign({}, props, { className: cn(boldClass, "tw-text-caption tw-font-caption tw-leading-caption", props.className), children: children })));
|
|
2747
2774
|
}
|
|
2748
2775
|
|
|
2749
2776
|
// font size, line height, and letter spacing classes
|
|
2750
2777
|
const textClassMap = {
|
|
2751
|
-
small: "tw-text-heading-small tw-tracking-heading-small tw-leading-heading-small",
|
|
2752
|
-
medium: "tw-text-heading-medium tw-tracking-heading-medium tw-leading-heading-medium",
|
|
2753
|
-
large: "tw-text-heading-large tw-tracking-heading-large tw-leading-heading-large",
|
|
2754
|
-
};
|
|
2755
|
-
function HeadingText({ children, bold, size, className, }) {
|
|
2756
|
-
const fontWeightClass = bold
|
|
2757
|
-
? "tw-font-heading-bold"
|
|
2758
|
-
: "tw-font-heading-regular";
|
|
2778
|
+
small: "tw-text-heading-small tw-tracking-heading-small tw-leading-heading-small tw-font-heading-small",
|
|
2779
|
+
medium: "tw-text-heading-medium tw-tracking-heading-medium tw-leading-heading-medium tw-font-heading-medium",
|
|
2780
|
+
large: "tw-text-heading-large tw-tracking-heading-large tw-leading-heading-large tw-font-heading-large",
|
|
2781
|
+
};
|
|
2782
|
+
function HeadingText({ children, bold = false, size, className, }) {
|
|
2783
|
+
const fontWeightClass = bold ? "!tw-font-bold" : "!tw-font-regular";
|
|
2759
2784
|
return (jsx("h6", { className: clsx(textClassMap[size], fontWeightClass, className), children: children }));
|
|
2760
2785
|
}
|
|
2761
2786
|
|
|
@@ -3007,8 +3032,8 @@ const buttonSizeClassMap = {
|
|
|
3007
3032
|
lg: "tw-p-1 tw-h-button",
|
|
3008
3033
|
};
|
|
3009
3034
|
const roundedClassMap = {
|
|
3010
|
-
md: "tw-rounded-
|
|
3011
|
-
lg: "tw-rounded-
|
|
3035
|
+
md: "tw-rounded-button-medium",
|
|
3036
|
+
lg: "tw-rounded-button-large",
|
|
3012
3037
|
};
|
|
3013
3038
|
const buttonVariantClassMap = {
|
|
3014
3039
|
primary: "tw-bg-royal-500 group-data-[squid-theme-type=light]:tw-text-grey-900 group-data-[squid-theme-type=dark]:tw-text-grey-100",
|
|
@@ -3020,11 +3045,11 @@ const buttonVariantClassMap = {
|
|
|
3020
3045
|
const buttonDisabledClass = "!tw-bg-grey-800 !tw-text-grey-600 tw-cursor-not-allowed";
|
|
3021
3046
|
const loadingClassname = "tw-invisible tw-opacity-0";
|
|
3022
3047
|
function Button$1(_a) {
|
|
3023
|
-
var { label, disabled, size, variant, icon, link, isLoading = false, chip, containerClassName } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "chip", "containerClassName"]);
|
|
3024
|
-
const chipElement = chip ? (jsx(Chip, Object.assign({}, chip, { className: cn("tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10", chip.className) }))) : null;
|
|
3025
|
-
const children = (jsxs(Fragment, { children: [!disabled && !isLoading && (jsx(ButtonHoverOverlay, { className: roundedClassMap[size] })), jsx("div", { className: "tw-relative tw-z-[5] tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", children:
|
|
3048
|
+
var { label, disabled = false, size, variant, icon, link, isLoading = false, chip, containerClassName, anchorRef, buttonRef } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "chip", "containerClassName", "anchorRef", "buttonRef"]);
|
|
3049
|
+
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;
|
|
3050
|
+
const children = (jsxs(Fragment, { children: [!disabled && !isLoading && (jsx(ButtonHoverOverlay, { className: roundedClassMap[size] })), 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 ? (props.children) : size === "lg" ? (jsx("span", { className: "tw-px-squid-m", children: jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "medium", children: label }) })) : size === "md" ? (label != null && icon == null ? (
|
|
3026
3051
|
// label only
|
|
3027
|
-
jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "small", children: label })) :
|
|
3052
|
+
jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "small", children: label })) : label == null && icon != null ? (
|
|
3028
3053
|
// icon only
|
|
3029
3054
|
isLoading ? null : (icon)) : (
|
|
3030
3055
|
// icon and label
|
|
@@ -3035,10 +3060,10 @@ function Button$1(_a) {
|
|
|
3035
3060
|
// custom classes from props
|
|
3036
3061
|
props.className);
|
|
3037
3062
|
const ButtonWrapper = ({ children }) => (jsx("div", { className: cn("tw-relative", buttonWidthClassnameMap[size], roundedClassMap[size], containerClassName), children: children }));
|
|
3038
|
-
if (link) {
|
|
3039
|
-
return (jsxs(ButtonWrapper, { children: [jsx("a", { "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, children: children }), chipElement] }));
|
|
3063
|
+
if (link != null) {
|
|
3064
|
+
return (jsxs(ButtonWrapper, { children: [jsx("a", { ref: anchorRef, "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, rel: "noreferrer", children: children }), chipElement] }));
|
|
3040
3065
|
}
|
|
3041
|
-
return (jsxs(ButtonWrapper, { children: [jsx("button", Object.assign({}, props, { "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] }));
|
|
3066
|
+
return (jsxs(ButtonWrapper, { children: [jsx("button", Object.assign({}, props, { ref: buttonRef, "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] }));
|
|
3042
3067
|
}
|
|
3043
3068
|
const ButtonHoverOverlay = ({ className }) => {
|
|
3044
3069
|
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) }));
|
|
@@ -3056,7 +3081,140 @@ function ArrowButton(_a) {
|
|
|
3056
3081
|
"aria-disabled:tw-bg-grey-600 aria-disabled:tw-text-grey-800"), children: jsx(ArrowRightIcon, {}) })] })));
|
|
3057
3082
|
}
|
|
3058
3083
|
|
|
3059
|
-
const
|
|
3084
|
+
// const INTERNAL_THEME_COLOR_KEYS = [
|
|
3085
|
+
// "grey-100",
|
|
3086
|
+
// "grey-200",
|
|
3087
|
+
// "grey-300",
|
|
3088
|
+
// "grey-400",
|
|
3089
|
+
// "grey-500",
|
|
3090
|
+
// "grey-600",
|
|
3091
|
+
// "grey-700",
|
|
3092
|
+
// "grey-800",
|
|
3093
|
+
// "grey-900",
|
|
3094
|
+
// "royal-300",
|
|
3095
|
+
// "royal-400",
|
|
3096
|
+
// "royal-500",
|
|
3097
|
+
// "royal-700",
|
|
3098
|
+
// "status-positive",
|
|
3099
|
+
// "status-negative",
|
|
3100
|
+
// "status-partial",
|
|
3101
|
+
// "material-light-thin",
|
|
3102
|
+
// "material-light-average",
|
|
3103
|
+
// "material-light-thick",
|
|
3104
|
+
// "material-dark-thin",
|
|
3105
|
+
// "material-dark-average",
|
|
3106
|
+
// "material-dark-thick",
|
|
3107
|
+
// // grey-100 with 0.05 opacity
|
|
3108
|
+
// "grey-100-005",
|
|
3109
|
+
// // material-light and grey-900 blended color
|
|
3110
|
+
// "material-light-blend-grey-900",
|
|
3111
|
+
// // material-light and grey-300 blended color
|
|
3112
|
+
// "material-light-blend-grey-800",
|
|
3113
|
+
// "volt-700",
|
|
3114
|
+
// ] as const;
|
|
3115
|
+
// const THEME_BORDER_RADIUS_KEYS = ["button-lg", "button-md"] as const;
|
|
3116
|
+
// const THEME_TEXT_KEYS = [
|
|
3117
|
+
// "caption-size",
|
|
3118
|
+
// "caption-weight",
|
|
3119
|
+
// "body-large-size",
|
|
3120
|
+
// "body-large-weight",
|
|
3121
|
+
// "body-medium-size",
|
|
3122
|
+
// "body-medium-weight",
|
|
3123
|
+
// "body-small-size",
|
|
3124
|
+
// "body-small-weight",
|
|
3125
|
+
// "heading-small-size",
|
|
3126
|
+
// "heading-small-weight",
|
|
3127
|
+
// "heading-medium-size",
|
|
3128
|
+
// "heading-medium-weight",
|
|
3129
|
+
// "heading-large-size",
|
|
3130
|
+
// "heading-large-weight",
|
|
3131
|
+
// ] as const;
|
|
3132
|
+
// export type InternalThemeColors = Record<
|
|
3133
|
+
// (typeof INTERNAL_THEME_COLOR_KEYS)[number],
|
|
3134
|
+
// string
|
|
3135
|
+
// >;
|
|
3136
|
+
// export type ThemeBorderRadius = Record<
|
|
3137
|
+
// (typeof THEME_BORDER_RADIUS_KEYS)[number],
|
|
3138
|
+
// string
|
|
3139
|
+
// >;
|
|
3140
|
+
// export interface InternalSquidTheme {
|
|
3141
|
+
// colors: InternalThemeColors;
|
|
3142
|
+
// fontFamily: string;
|
|
3143
|
+
// text: ThemeText;
|
|
3144
|
+
// borderRadius: ThemeBorderRadius;
|
|
3145
|
+
// }
|
|
3146
|
+
// export interface SquidTheme {
|
|
3147
|
+
// colors: SquidThemeColors;
|
|
3148
|
+
// fontFamily?: string;
|
|
3149
|
+
// text?: ThemeText;
|
|
3150
|
+
// borderRadius?: ThemeBorderRadius;
|
|
3151
|
+
// }
|
|
3152
|
+
// // User-readable colors config
|
|
3153
|
+
// // renames:
|
|
3154
|
+
// // grey- to content-
|
|
3155
|
+
// // royal- to accent-
|
|
3156
|
+
// export interface SquidThemeColors {
|
|
3157
|
+
// "content-100": string;
|
|
3158
|
+
// "content-200": string;
|
|
3159
|
+
// "content-300": string;
|
|
3160
|
+
// "content-400": string;
|
|
3161
|
+
// "content-500": string;
|
|
3162
|
+
// "content-600": string;
|
|
3163
|
+
// "content-700": string;
|
|
3164
|
+
// "content-800": string;
|
|
3165
|
+
// "content-900": string;
|
|
3166
|
+
// "accent-300": string;
|
|
3167
|
+
// "accent-400": string;
|
|
3168
|
+
// "accent-500": string;
|
|
3169
|
+
// "accent-700": string;
|
|
3170
|
+
// "status-positive": string;
|
|
3171
|
+
// "status-negative": string;
|
|
3172
|
+
// "status-warning": string;
|
|
3173
|
+
// "highlight-700": string;
|
|
3174
|
+
// }
|
|
3175
|
+
// export type ThemeText = Record<(typeof THEME_TEXT_KEYS)[number], string>;
|
|
3176
|
+
// export const SQUID_THEME_CSS_VARIABLE_PREFIX = "--st-";
|
|
3177
|
+
// const themeColorKeysToCssVariablesMap = Object.fromEntries(
|
|
3178
|
+
// INTERNAL_THEME_COLOR_KEYS.map((key) => [
|
|
3179
|
+
// key,
|
|
3180
|
+
// {
|
|
3181
|
+
// cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}color-${key}`,
|
|
3182
|
+
// },
|
|
3183
|
+
// ]),
|
|
3184
|
+
// ) as Record<keyof InternalThemeColors, { cssVariable: string }>;
|
|
3185
|
+
// const themeBorderRadiusKeysToCssVariablesMap = Object.fromEntries(
|
|
3186
|
+
// THEME_BORDER_RADIUS_KEYS.map((key) => [
|
|
3187
|
+
// key,
|
|
3188
|
+
// {
|
|
3189
|
+
// cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}borderRadius-${key}`,
|
|
3190
|
+
// },
|
|
3191
|
+
// ]),
|
|
3192
|
+
// ) as Record<keyof ThemeBorderRadius, { cssVariable: string }>;
|
|
3193
|
+
// const themeTextKeysToCssVariablesMap = Object.fromEntries(
|
|
3194
|
+
// THEME_TEXT_KEYS.map((key) => [
|
|
3195
|
+
// key,
|
|
3196
|
+
// {
|
|
3197
|
+
// cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}text-${key}`,
|
|
3198
|
+
// },
|
|
3199
|
+
// ]),
|
|
3200
|
+
// ) as Record<keyof ThemeText, { cssVariable: string }>;
|
|
3201
|
+
// type ThemeCssVariableMap<T extends Record<string, any>> = {
|
|
3202
|
+
// [K in keyof T]: { cssVariable: string };
|
|
3203
|
+
// };
|
|
3204
|
+
// interface InternalThemeMap {
|
|
3205
|
+
// colors: ThemeCssVariableMap<InternalThemeColors>;
|
|
3206
|
+
// borderRadius: ThemeCssVariableMap<ThemeBorderRadius>;
|
|
3207
|
+
// text: ThemeCssVariableMap<ThemeText>;
|
|
3208
|
+
// }
|
|
3209
|
+
// export const internalThemeKeysToCssVariablesMap: InternalThemeMap = {
|
|
3210
|
+
// colors: themeColorKeysToCssVariablesMap,
|
|
3211
|
+
// borderRadius: themeBorderRadiusKeysToCssVariablesMap,
|
|
3212
|
+
// text: themeTextKeysToCssVariablesMap,
|
|
3213
|
+
// };
|
|
3214
|
+
// console.log({
|
|
3215
|
+
// internalThemeKeysToCssVariablesMap,
|
|
3216
|
+
// });
|
|
3217
|
+
const THEME_COLOR_KEYS = [
|
|
3060
3218
|
"grey-100",
|
|
3061
3219
|
"grey-200",
|
|
3062
3220
|
"grey-300",
|
|
@@ -3079,24 +3237,56 @@ const INTERNAL_SQUID_THEME_KEYS = [
|
|
|
3079
3237
|
"material-dark-thin",
|
|
3080
3238
|
"material-dark-average",
|
|
3081
3239
|
"material-dark-thick",
|
|
3240
|
+
"highlight-700",
|
|
3082
3241
|
// grey-100 with 0.05 opacity
|
|
3083
3242
|
"grey-100-005",
|
|
3084
3243
|
// material-light and grey-900 blended color
|
|
3085
3244
|
"material-light-blend-grey-900",
|
|
3086
3245
|
// material-light and grey-300 blended color
|
|
3087
3246
|
"material-light-blend-grey-800",
|
|
3088
|
-
"volt-700",
|
|
3089
3247
|
];
|
|
3090
|
-
const
|
|
3248
|
+
const THEME_BORDER_RADIUS_KEYS = ["button-large", "button-medium"];
|
|
3249
|
+
const THEME_FONT_SIZE_KEYS = [
|
|
3250
|
+
"caption",
|
|
3251
|
+
"body-large",
|
|
3252
|
+
"body-medium",
|
|
3253
|
+
"body-small",
|
|
3254
|
+
"heading-small",
|
|
3255
|
+
"heading-medium",
|
|
3256
|
+
"heading-large",
|
|
3257
|
+
];
|
|
3258
|
+
const THEME_FONT_WEIGHT_KEYS = [
|
|
3259
|
+
"caption",
|
|
3260
|
+
"body-small",
|
|
3261
|
+
"body-medium",
|
|
3262
|
+
"body-large",
|
|
3263
|
+
"heading-small",
|
|
3264
|
+
"heading-medium",
|
|
3265
|
+
"heading-large",
|
|
3266
|
+
];
|
|
3267
|
+
const THEME_FONT_FAMILY_KEYS = ["squid-main"];
|
|
3091
3268
|
/**
|
|
3092
|
-
*
|
|
3269
|
+
* 'st' = Squid Theme
|
|
3093
3270
|
*/
|
|
3094
|
-
const
|
|
3095
|
-
|
|
3096
|
-
{
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3271
|
+
const THEME_CSS_VARIABLE_PREFIX = "--st-";
|
|
3272
|
+
function keysToCssVariables(keys, prefix) {
|
|
3273
|
+
return keys.reduce((acc, key) => {
|
|
3274
|
+
acc[key] = {
|
|
3275
|
+
cssVariable: `${THEME_CSS_VARIABLE_PREFIX}${prefix}-${String(key)}`,
|
|
3276
|
+
};
|
|
3277
|
+
return acc;
|
|
3278
|
+
},
|
|
3279
|
+
// eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter, @typescript-eslint/consistent-type-assertions
|
|
3280
|
+
{});
|
|
3281
|
+
}
|
|
3282
|
+
const themeKeysToCssVariables = {
|
|
3283
|
+
color: keysToCssVariables(THEME_COLOR_KEYS, "color"),
|
|
3284
|
+
borderRadius: keysToCssVariables(THEME_BORDER_RADIUS_KEYS, "border-radius"),
|
|
3285
|
+
// text: keysToCssVariables<ThemeText>(THEME_TEXT_KEYS, "text"),
|
|
3286
|
+
fontSize: keysToCssVariables(THEME_FONT_SIZE_KEYS, "font-size"),
|
|
3287
|
+
fontWeight: keysToCssVariables(THEME_FONT_WEIGHT_KEYS, "font-weight"),
|
|
3288
|
+
fontFamily: keysToCssVariables(THEME_FONT_FAMILY_KEYS, "font-family"),
|
|
3289
|
+
};
|
|
3100
3290
|
|
|
3101
3291
|
function SearchIcon({ className, size = "24", }) {
|
|
3102
3292
|
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" }) }));
|
|
@@ -3114,9 +3304,11 @@ function Input(_a) {
|
|
|
3114
3304
|
var _a;
|
|
3115
3305
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3116
3306
|
}, autoFocusTimeout);
|
|
3117
|
-
return () =>
|
|
3307
|
+
return () => {
|
|
3308
|
+
clearTimeout(timeoutId);
|
|
3309
|
+
};
|
|
3118
3310
|
}, [autoFocusTimeout]);
|
|
3119
|
-
return (jsxs("div", { className: cn("tw-relative tw-w-full tw-text-grey-600", containerClassName), children: [jsx("input", Object.assign({}, props, { ref: inputRef, "aria-invalid": isError, className: cn("tw-relative tw-h-10 tw-w-full tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-900 tw-text-body-small tw-
|
|
3311
|
+
return (jsxs("div", { className: cn("tw-relative tw-w-full tw-text-grey-600", containerClassName), children: [jsx("input", Object.assign({}, props, { ref: inputRef, "aria-invalid": isError, className: cn("tw-font-regular tw-relative tw-h-10 tw-w-full tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-900 tw-text-body-small tw-text-grey-300 placeholder:tw-text-grey-600 invalid:tw-outline-status-negative", showIcon ? "tw-pl-[40px]" : "tw-px-squid-s", showActionButton ? "tw-pr-[70px]" : "tw-pr-2.5", isError && "!tw-outline-status-negative", className, isWarning && "focus-visible:tw-outline-status-partial"), placeholder: placeholder })), showIcon ? (jsx("div", { className: "tw-absolute tw-inset-y-0 tw-left-0 tw-flex tw-h-full tw-w-[44px] tw-items-center tw-justify-center tw-px-squid-xs", children: icon || jsx(SearchIcon, {}) })) : null, showActionButton ? (jsx("div", { className: "tw-absolute tw-inset-y-0 tw-right-1.5 tw-flex tw-items-center tw-justify-center", children: jsx(InputActionButton, Object.assign({}, actionButtonProps)) })) : null] }));
|
|
3120
3312
|
}
|
|
3121
3313
|
const InputActionButton = ({ onClick, variant = "tertiary", label = "Paste", }) => {
|
|
3122
3314
|
return (jsx(Button$1, { size: "md", variant: variant, onClick: onClick, className: "!tw-h-[30px] !tw-w-fit !tw-min-w-0", children: jsx(CaptionText, { children: label }) }));
|
|
@@ -16735,9 +16927,9 @@ const ANIMATION_DURATIONS = {
|
|
|
16735
16927
|
BOOST_BUTTON: 500,
|
|
16736
16928
|
};
|
|
16737
16929
|
const ANIMATION_TIMINGS = {
|
|
16738
|
-
EXPAND_ROUTE: "linear", //'cubic-bezier(.32, .72, 0, 1)',
|
|
16739
|
-
COLLAPSE_ROUTE: "linear", //'cubic-bezier(.32, .72, 0, 1)',
|
|
16740
|
-
CHANGE_SWAP_STEP: "linear", //'cubic-bezier(.4,0,.2,1)',
|
|
16930
|
+
EXPAND_ROUTE: "linear", // 'cubic-bezier(.32, .72, 0, 1)',
|
|
16931
|
+
COLLAPSE_ROUTE: "linear", // 'cubic-bezier(.32, .72, 0, 1)',
|
|
16932
|
+
CHANGE_SWAP_STEP: "linear", // 'cubic-bezier(.4,0,.2,1)',
|
|
16741
16933
|
SHOW_ROUTE: "cubic-bezier(.165,.84,.44,1)",
|
|
16742
16934
|
HIDE_ROUTE: "cubic-bezier(.165,.84,.44,1)",
|
|
16743
16935
|
};
|
|
@@ -17251,6 +17443,12 @@ function SunIcon({ size = "24", className, }) {
|
|
|
17251
17443
|
function MoonIcon({ size = "20", className, }) {
|
|
17252
17444
|
return (jsx("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M10.0463 2.99972C10.2292 2.73432 10.2427 2.38723 10.0809 2.10846C9.91903 1.8297 9.61096 1.66925 9.28979 1.69647C5.02109 2.05816 1.66992 5.63639 1.66992 9.9982C1.66992 14.5997 5.40018 18.33 10.0017 18.33C14.3636 18.33 17.9419 14.9787 18.3035 10.7098C18.3307 10.3887 18.1702 10.0806 17.8914 9.91879C17.6127 9.75698 17.2656 9.77044 17.0002 9.95336C16.1951 10.5083 15.2201 10.8331 14.1667 10.8331C11.4052 10.8331 9.16667 8.59452 9.16667 5.8331C9.16667 4.77977 9.49145 3.80481 10.0463 2.99972Z", fill: "currentColor" }) }));
|
|
17253
17445
|
}
|
|
17446
|
+
function SunOutlinedIcon({ size = "24", className, }) {
|
|
17447
|
+
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: "M12 3V2M12 22V21M18.3598 5.64005L19.0698 4.93005M4.93016 19.07L5.64016 18.36M21 12H22M2 12H3M18.3598 18.36L19.0698 19.07M4.93016 4.93005L5.64016 5.64005M15.5355 8.46447C17.4882 10.4171 17.4882 13.5829 15.5355 15.5355C13.5829 17.4882 10.4171 17.4882 8.46447 15.5355C6.51185 13.5829 6.51185 10.4171 8.46447 8.46447C10.4171 6.51185 13.5829 6.51185 15.5355 8.46447Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
17448
|
+
}
|
|
17449
|
+
function CrossedOutSunSolidIcon({ size = "20", className, }) {
|
|
17450
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsx("g", { clipPath: "url(#clip0_3313_9942)", children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 0.833313C10.4603 0.833313 10.8334 1.20641 10.8334 1.66665V2.49998C10.8334 2.96022 10.4603 3.33331 10 3.33331C9.5398 3.33331 9.16671 2.96022 9.16671 2.49998V1.66665C9.16671 1.20641 9.5398 0.833313 10 0.833313ZM10 16.6667C10.4603 16.6667 10.8334 17.0398 10.8334 17.5V18.3333C10.8334 18.7936 10.4603 19.1667 10 19.1667C9.5398 19.1667 9.16671 18.7936 9.16671 18.3333V17.5C9.16671 17.0398 9.5398 16.6667 10 16.6667ZM16.6667 10C16.6667 9.53976 17.0398 9.16666 17.5 9.16666H18.3334C18.7936 9.16666 19.1667 9.53976 19.1667 10C19.1667 10.4602 18.7936 10.8333 18.3334 10.8333H17.5C17.0398 10.8333 16.6667 10.4602 16.6667 10ZM0.833374 10C0.833374 9.53976 1.20647 9.16666 1.66671 9.16666H2.50004C2.96028 9.16666 3.33337 9.53976 3.33337 10C3.33337 10.4602 2.96028 10.8333 2.50004 10.8333H1.66671C1.20647 10.8333 0.833374 10.4602 0.833374 10ZM14.7107 14.7107C15.0361 14.3853 15.5637 14.3853 15.8892 14.7107L16.4808 15.3024C16.8063 15.6278 16.8063 16.1554 16.4808 16.4809C16.1554 16.8063 15.6278 16.8063 15.3023 16.4809L14.7107 15.8892C14.3852 15.5638 14.3852 15.0361 14.7107 14.7107ZM3.51925 3.5191C3.84469 3.19366 4.37232 3.19366 4.69776 3.5191L5.28943 4.11077C5.61486 4.43621 5.61486 4.96384 5.28943 5.28928C4.96399 5.61472 4.43635 5.61472 4.11091 5.28928L3.51925 4.69761C3.19381 4.37218 3.19381 3.84454 3.51925 3.5191ZM6.46451 6.46445C7.91429 5.01466 10.0329 4.64131 11.8271 5.34441L5.34447 11.8271C4.64137 10.0328 5.01472 7.91423 6.46451 6.46445ZM8.17288 14.6555L14.6556 8.17282C15.3587 9.96708 14.9854 12.0857 13.5356 13.5355C12.0858 14.9853 9.96714 15.3587 8.17288 14.6555ZM17.2071 4.20709C17.5976 3.81657 17.5976 3.1834 17.2071 2.79288C16.8166 2.40235 16.1834 2.40235 15.7929 2.79288L2.79289 15.7929C2.40237 16.1834 2.40237 16.8166 2.79289 17.2071C3.18342 17.5976 3.81658 17.5976 4.20711 17.2071L17.2071 4.20709Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: "clip0_3313_9942", children: jsx("rect", { width: size, height: size, fill: "currentColor" }) }) })] }));
|
|
17451
|
+
}
|
|
17254
17452
|
|
|
17255
17453
|
const dockIconClassname = "tw-text-grey-900";
|
|
17256
17454
|
const dockIconSelectedClassname = "group-data-[squid-theme-type=dark]:tw-text-royal-700 group-data-[squid-theme-type=light]:tw-text-volt-700";
|
|
@@ -17306,59 +17504,45 @@ function ImageIcon({ size = "20", className, }) {
|
|
|
17306
17504
|
function FilterTimelineIcon({ size = "20", className, }) {
|
|
17307
17505
|
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsx("path", { d: "M5.00117 3.33325C5.46141 3.33325 5.8345 3.70635 5.8345 4.16659V13.8206L6.91042 12.7442C7.23577 12.4186 7.76341 12.4185 8.08894 12.7438C8.41446 13.0692 8.4146 13.5968 8.08925 13.9224L5.59058 16.4224C5.43434 16.5787 5.22241 16.6665 5.00139 16.6666C4.78038 16.6666 4.56839 16.5789 4.41207 16.4227L1.91074 13.9227C1.58521 13.5973 1.58507 13.0697 1.91042 12.7442C2.23577 12.4186 2.76341 12.4185 3.08894 12.7438L4.16784 13.8222V4.16659C4.16784 3.70635 4.54093 3.33325 5.00117 3.33325Z", fill: "currentColor" }), jsx("path", { d: "M9.99984 4.99992C9.5396 4.99992 9.1665 5.37301 9.1665 5.83325C9.1665 6.29349 9.5396 6.66659 9.99984 6.66659H16.6665C17.1267 6.66659 17.4998 6.29349 17.4998 5.83325C17.4998 5.37301 17.1267 4.99992 16.6665 4.99992H9.99984Z", fill: "currentColor" }), jsx("path", { d: "M13.3332 13.3333C12.8729 13.3333 12.4998 13.7063 12.4998 14.1666C12.4998 14.6268 12.8729 14.9999 13.3332 14.9999H16.6665C17.1267 14.9999 17.4998 14.6268 17.4998 14.1666C17.4998 13.7063 17.1267 13.3333 16.6665 13.3333H13.3332Z", fill: "currentColor" }), jsx("path", { d: "M10.8332 9.99992C10.8332 9.53968 11.2063 9.16659 11.6665 9.16659H16.6665C17.1267 9.16659 17.4998 9.53968 17.4998 9.99992C17.4998 10.4602 17.1267 10.8333 16.6665 10.8333H11.6665C11.2063 10.8333 10.8332 10.4602 10.8332 9.99992Z", fill: "currentColor" })] }));
|
|
17308
17506
|
}
|
|
17507
|
+
function NewspaperIcon({ className, size = "24", }) {
|
|
17508
|
+
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: "M12 8C12 6.34315 13.3431 5 15 5H20C21.1046 5 22 5.89543 22 7V17C22 18.1046 21.1046 19 20 19H15.277C14.5966 19 13.9296 19.1642 13.3508 19.5219C12.772 19.8796 12.3043 20.3914 12 21M12 8C12 6.34315 10.6569 5 9 5H4C2.89543 5 2 5.89543 2 7V17C2 18.1046 2.89543 19 4 19H8.723C9.40341 19 10.0704 19.1642 10.6492 19.5219C11.228 19.8796 11.6957 20.3914 12 21M12 8V21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
17509
|
+
}
|
|
17510
|
+
function AtomIcon({ className, size = "24", }) {
|
|
17511
|
+
return (jsxs("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: "M19.4739 4.52612C21.0463 6.09858 18.9749 10.7195 14.8472 14.8472C10.7195 18.9749 6.09858 21.0463 4.52612 19.4739C2.95366 17.9014 5.0251 13.2805 9.15281 9.15281C13.2805 5.0251 17.9014 2.95366 19.4739 4.52612Z", stroke: "currentColor", strokeWidth: "2" }), jsx("path", { d: "M19.4739 19.4739C17.9014 21.0463 13.2805 18.9749 9.15281 14.8472C5.0251 10.7195 2.95366 6.09858 4.52612 4.52612C6.09858 2.95366 10.7195 5.0251 14.8472 9.15281C18.9749 13.2805 21.0463 17.9014 19.4739 19.4739Z", stroke: "currentColor", strokeWidth: "2" })] }));
|
|
17512
|
+
}
|
|
17513
|
+
function SunriseSmallIcon({ className, size = "20", }) {
|
|
17514
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.99984 1.66663C10.4601 1.66663 10.8332 2.03972 10.8332 2.49996V3.33329C10.8332 3.79353 10.4601 4.16663 9.99984 4.16663C9.5396 4.16663 9.1665 3.79353 9.1665 3.33329V2.49996C9.1665 2.03972 9.5396 1.66663 9.99984 1.66663ZM1.6665 9.99996C1.6665 9.53972 2.0396 9.16663 2.49984 9.16663H3.33317C3.79341 9.16663 4.1665 9.53972 4.1665 9.99996C4.1665 10.4602 3.79341 10.8333 3.33317 10.8333H2.49984C2.0396 10.8333 1.6665 10.4602 1.6665 9.99996ZM15.8332 9.99996C15.8332 9.53972 16.2063 9.16663 16.6665 9.16663H17.4998C17.9601 9.16663 18.3332 9.53972 18.3332 9.99996C18.3332 10.4602 17.9601 10.8333 17.4998 10.8333H16.6665C16.2063 10.8333 15.8332 10.4602 15.8332 9.99996Z", fill: "currentColor" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.1241 5.87517C13.7987 5.54973 13.7987 5.0221 14.1241 4.69666L14.7134 4.1074C15.0388 3.78197 15.5665 3.78197 15.8919 4.1074C16.2173 4.43284 16.2173 4.96048 15.8919 5.28592L15.3026 5.87517C14.9772 6.20061 14.4496 6.20061 14.1241 5.87517Z", fill: "currentColor" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.6665 13.3333C1.6665 12.8731 2.0396 12.5 2.49984 12.5H17.4998C17.9601 12.5 18.3332 12.8731 18.3332 13.3333C18.3332 13.7935 17.9601 14.1666 17.4998 14.1666H2.49984C2.0396 14.1666 1.6665 13.7935 1.6665 13.3333ZM4.99984 16.6666C4.99984 16.2064 5.37293 15.8333 5.83317 15.8333H14.1665C14.6267 15.8333 14.9998 16.2064 14.9998 16.6666C14.9998 17.1269 14.6267 17.5 14.1665 17.5H5.83317C5.37293 17.5 4.99984 17.1269 4.99984 16.6666Z", fill: "currentColor" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.10785 4.1074C4.43328 3.78197 4.96092 3.78197 5.28636 4.1074L5.87561 4.69666C6.20105 5.0221 6.20105 5.54973 5.87561 5.87517C5.55018 6.20061 5.02254 6.20061 4.6971 5.87517L4.10785 5.28591C3.78241 4.96048 3.78241 4.43284 4.10785 4.1074Z", fill: "currentColor" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.6665 10.8333C6.20627 10.8333 5.83317 10.4602 5.83317 9.99996C5.83317 7.69877 7.69865 5.83329 9.99984 5.83329C12.301 5.83329 14.1665 7.69877 14.1665 9.99996C14.1665 10.4602 13.7934 10.8333 13.3332 10.8333C11.9184 10.8333 8.08126 10.8333 6.6665 10.8333Z", fill: "currentColor" })] }));
|
|
17515
|
+
}
|
|
17516
|
+
function CoinsOutlinedIcon({ className, size = "24", }) {
|
|
17517
|
+
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 16C5.68629 16 3 13.3137 3 10C3 6.68629 5.68629 4 9 4C11.4597 4 13.5737 5.48012 14.5 7.59829M21 14C21 17.3137 18.3137 20 15 20C12.3841 20 10.1591 18.3259 9.33811 15.9906C9.11911 15.3677 9 14.6978 9 14C9 10.7998 11.5055 8.1847 14.6619 8.00937C14.7738 8.00315 14.8865 8 15 8C18.3137 8 21 10.6863 21 14Z", stroke: "currentColor", strokeWidth: "2" }) }));
|
|
17518
|
+
}
|
|
17519
|
+
function PhoneIcon({ size = "24", className, }) {
|
|
17520
|
+
return (jsx("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", children: jsx("path", { d: "M10.5 19H14.5M8.5 22H16.5C17.6046 22 18.5 21.1046 18.5 20V4C18.5 2.89543 17.6046 2 16.5 2H8.5C7.39543 2 6.5 2.89543 6.5 4V20C6.5 21.1046 7.39543 22 8.5 22Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
|
|
17521
|
+
}
|
|
17522
|
+
function LaptopIcon({ size = "24", className, }) {
|
|
17523
|
+
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" })] }));
|
|
17524
|
+
}
|
|
17525
|
+
function CopyIcon({ size = "20", className, }) {
|
|
17526
|
+
return (jsx("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: "M7.16663 6.66666V3.54166C7.16663 2.50612 8.00609 1.66666 9.04163 1.66666H16.9583C17.9938 1.66666 18.8333 2.50612 18.8333 3.54166V11.4583C18.8333 12.4939 17.9938 13.3333 16.9583 13.3333H13.8333V16.4583C13.8333 17.4939 12.9938 18.3333 11.9583 18.3333H4.04163C3.00609 18.3333 2.16663 17.4939 2.16663 16.4583V8.54166C2.16663 7.50612 3.00609 6.66666 4.04163 6.66666H7.16663ZM9.04163 13.3333C8.00609 13.3333 7.16663 12.4939 7.16663 11.4583V8.33332H4.04163C3.92657 8.33332 3.83329 8.4266 3.83329 8.54166V16.4583C3.83329 16.5734 3.92657 16.6667 4.04163 16.6667H11.9583C12.0734 16.6667 12.1666 16.5734 12.1666 16.4583V13.3333H9.04163Z", fill: "currentColor" }) }));
|
|
17527
|
+
}
|
|
17528
|
+
function FileDownloadIcon({ size = "20", className, }) {
|
|
17529
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", 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" })] }));
|
|
17530
|
+
}
|
|
17531
|
+
function CodeSolidSquareIcon({ size = "24", className, }) {
|
|
17532
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.5 6C3.5 4.34315 4.84315 3 6.5 3H18.5C20.1569 3 21.5 4.34315 21.5 6V18C21.5 19.6569 20.1569 21 18.5 21H6.5C4.84315 21 3.5 19.6569 3.5 18V6ZM11.2071 8.79289C11.5976 9.18342 11.5976 9.81658 11.2071 10.2071L9.41421 12L11.2071 13.7929C11.5976 14.1834 11.5976 14.8166 11.2071 15.2071C10.8166 15.5976 10.1834 15.5976 9.79289 15.2071L8 13.4142C7.21895 12.6332 7.21895 11.3668 8 10.5858L9.79289 8.79289C10.1834 8.40237 10.8166 8.40237 11.2071 8.79289ZM15.2071 8.79289C14.8166 8.40237 14.1834 8.40237 13.7929 8.79289C13.4024 9.18342 13.4024 9.81658 13.7929 10.2071L15.5858 12L13.7929 13.7929C13.4024 14.1834 13.4024 14.8166 13.7929 15.2071C14.1834 15.5976 14.8166 15.5976 15.2071 15.2071L17 13.4142C17.781 12.6332 17.781 11.3668 17 10.5858L15.2071 8.79289Z", fill: "currentColor" }) }));
|
|
17533
|
+
}
|
|
17534
|
+
function CodeBracketsIcon({ size = "20", className, }) {
|
|
17535
|
+
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: "M11.8688 2.5249C12.3153 2.63652 12.5867 3.08896 12.4751 3.53546L9.14178 16.8688C9.03015 17.3153 8.57771 17.5868 8.13121 17.4752C7.68472 17.3635 7.41325 16.9111 7.52487 16.4646L10.8582 3.13123C10.9698 2.68474 11.4223 2.41327 11.8688 2.5249ZM5.58925 6.07746C5.91469 6.4029 5.91469 6.93053 5.58925 7.25597L3.43443 9.41079C3.10899 9.73623 3.10899 10.2639 3.43443 10.5893L5.58925 12.7441C5.91469 13.0696 5.91469 13.5972 5.58925 13.9226C5.26381 14.2481 4.73617 14.2481 4.41074 13.9226L2.25591 11.7678C1.2796 10.7915 1.27961 9.20859 2.25592 8.23228L4.41074 6.07746C4.73617 5.75202 5.26381 5.75202 5.58925 6.07746ZM14.4107 6.07746C14.7362 5.75202 15.2638 5.75202 15.5892 6.07746L17.7441 8.23228C18.7204 9.20859 18.7204 10.7915 17.7441 11.7678L15.5892 13.9226C15.2638 14.2481 14.7362 14.2481 14.4107 13.9226C14.0853 13.5972 14.0853 13.0696 14.4107 12.7441L16.5656 10.5893C16.891 10.2639 16.891 9.73623 16.5656 9.41079L14.4107 7.25597C14.0853 6.93053 14.0853 6.4029 14.4107 6.07746Z", fill: "currentColor" }) }));
|
|
17536
|
+
}
|
|
17537
|
+
function CommandIcon({ size = "22", className, }) {
|
|
17538
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 22 22", fill: "none", className: className, children: jsx("path", { d: "M8 17V17C8 16.0219 8.28951 15.0657 8.83205 14.2519L13.1679 7.74808C13.7105 6.93427 14 5.97808 14 5V5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
17539
|
+
}
|
|
17309
17540
|
|
|
17310
17541
|
function FeeButton(_a) {
|
|
17311
17542
|
var { feeInUsd = "0", chipLabel = "Fee", className, tooltip } = _a, props = __rest$1(_a, ["feeInUsd", "chipLabel", "className", "tooltip"]);
|
|
17312
17543
|
return (jsx(Tooltip, Object.assign({}, tooltip, { tooltipWidth: "max", containerClassName: "tw-rounded-squid-m tw-w-full", childrenClassName: "tw-rounded-squid-m", children: jsxs("button", Object.assign({}, props, { className: cn("tw-flex tw-h-squid-xl tw-w-full tw-items-center tw-gap-x-squid-xs tw-rounded-squid-m tw-px-squid-xs hover:tw-bg-material-light-thin", className), children: [jsx(Chip, { label: chipLabel, className: "tw-hidden mobile-xs:tw-flex" }), jsxs("span", { className: "tw-flex tw-items-center", children: [jsx(UsdAmount, { usdAmount: feeInUsd }), jsx(ChevronDownSmallIcon, { className: "tw-text-grey-600" })] })] })) })));
|
|
17313
17544
|
}
|
|
17314
17545
|
|
|
17315
|
-
const lightTheme = {
|
|
17316
|
-
// content
|
|
17317
|
-
"content-100": "#17191C",
|
|
17318
|
-
"content-200": "#292C32",
|
|
17319
|
-
"content-300": "#292C32",
|
|
17320
|
-
"content-400": "#676B7E",
|
|
17321
|
-
"content-500": "#8A8FA8",
|
|
17322
|
-
"content-600": "#A7ABBE",
|
|
17323
|
-
"content-700": "#D1D6E0",
|
|
17324
|
-
"content-800": "#EDEEF3",
|
|
17325
|
-
"content-900": "#FBFBFD",
|
|
17326
|
-
// accent
|
|
17327
|
-
"accent-300": "#8C53C5",
|
|
17328
|
-
"accent-400": "#9E79D2",
|
|
17329
|
-
"accent-500": "#B893EC",
|
|
17330
|
-
"accent-700": "#E3D0FD",
|
|
17331
|
-
// status
|
|
17332
|
-
"status-positive": "#17CF26",
|
|
17333
|
-
"status-negative": "#FF5B4D",
|
|
17334
|
-
"status-warning": "#EC9213",
|
|
17335
|
-
// highlight
|
|
17336
|
-
"highlight-700": "#E4FE53",
|
|
17337
|
-
};
|
|
17338
|
-
const darkTheme = {
|
|
17339
|
-
// content
|
|
17340
|
-
"content-100": "#FBFBFD",
|
|
17341
|
-
"content-200": "#EDEFF3",
|
|
17342
|
-
"content-300": "#D1D6E0",
|
|
17343
|
-
"content-400": "#A7ABBE",
|
|
17344
|
-
"content-500": "#8A8FA8",
|
|
17345
|
-
"content-600": "#676B7E",
|
|
17346
|
-
"content-700": "#4C515D",
|
|
17347
|
-
"content-800": "#292C32",
|
|
17348
|
-
"content-900": "#17191C",
|
|
17349
|
-
// accent
|
|
17350
|
-
"accent-300": "#D9BEF4",
|
|
17351
|
-
"accent-400": "#B893EC",
|
|
17352
|
-
"accent-500": "#9E79D2",
|
|
17353
|
-
"accent-700": "#6B45A1",
|
|
17354
|
-
// status
|
|
17355
|
-
"status-positive": "#7AE870",
|
|
17356
|
-
"status-negative": "#FF4D5B",
|
|
17357
|
-
"status-warning": "#F3AF25",
|
|
17358
|
-
// highlight
|
|
17359
|
-
"highlight-700": "#08A054",
|
|
17360
|
-
};
|
|
17361
|
-
|
|
17362
17546
|
var createPlugin$2 = {};
|
|
17363
17547
|
|
|
17364
17548
|
var createPlugin$1 = {};
|
|
@@ -17467,7 +17651,7 @@ const boxShadow = {
|
|
|
17467
17651
|
const backgrounds = {
|
|
17468
17652
|
"royal-light": "linear-gradient(180deg, #A577D8 0%, #BF91F2 100%)",
|
|
17469
17653
|
"royal-dark": "linear-gradient(180deg, #BF91F2 0%, #A577D8 100%)",
|
|
17470
|
-
"dark-cover":
|
|
17654
|
+
"dark-cover": `linear-gradient(90deg, var(${themeKeysToCssVariables.color["material-dark-thick"].cssVariable}) 45.4%, transparent 50.85%, var(${themeKeysToCssVariables.color["material-dark-thick"].cssVariable}) 55.61%)`,
|
|
17471
17655
|
};
|
|
17472
17656
|
const baseTailwindConfig = {
|
|
17473
17657
|
prefix: "tw-",
|
|
@@ -17592,13 +17776,13 @@ const baseTailwindConfig = {
|
|
|
17592
17776
|
},
|
|
17593
17777
|
"100%": {
|
|
17594
17778
|
"backdrop-filter": "blur(20px) saturate(150%)",
|
|
17595
|
-
"background-color": `var(${
|
|
17779
|
+
"background-color": `var(${themeKeysToCssVariables.color["material-dark-average"].cssVariable})`,
|
|
17596
17780
|
},
|
|
17597
17781
|
},
|
|
17598
17782
|
"blur-out": {
|
|
17599
17783
|
"0%": {
|
|
17600
17784
|
"backdrop-filter": "blur(20px) saturate(150%)",
|
|
17601
|
-
"background-color": `var(${
|
|
17785
|
+
"background-color": `var(${themeKeysToCssVariables.color["material-dark-average"].cssVariable})`,
|
|
17602
17786
|
},
|
|
17603
17787
|
"100%": {
|
|
17604
17788
|
"backdrop-filter": "blur(0px)",
|
|
@@ -17673,9 +17857,7 @@ const baseTailwindConfig = {
|
|
|
17673
17857
|
33: "0.33",
|
|
17674
17858
|
66: "0.66",
|
|
17675
17859
|
},
|
|
17676
|
-
fontFamily:
|
|
17677
|
-
geist: ["Geist", "sans-serif"],
|
|
17678
|
-
},
|
|
17860
|
+
fontFamily: mapToCssVariables(themeKeysToCssVariables.fontFamily),
|
|
17679
17861
|
letterSpacing: {
|
|
17680
17862
|
// body text
|
|
17681
17863
|
"body-small": "-0.366px",
|
|
@@ -17686,26 +17868,8 @@ const baseTailwindConfig = {
|
|
|
17686
17868
|
"heading-medium": "-2.465px",
|
|
17687
17869
|
"heading-large": "-3.525px",
|
|
17688
17870
|
},
|
|
17689
|
-
fontSize:
|
|
17690
|
-
|
|
17691
|
-
caption: "0.875rem", // 14px
|
|
17692
|
-
// body text
|
|
17693
|
-
"body-small": "1.14375rem", // 18.5px
|
|
17694
|
-
"body-medium": "1.40625rem", // 22.5px
|
|
17695
|
-
"body-large": "1.75625rem", // 28.1px
|
|
17696
|
-
// heading
|
|
17697
|
-
"heading-small": "2.1875rem", // 35px
|
|
17698
|
-
"heading-medium": "3.08125rem", // 49.3px
|
|
17699
|
-
"heading-large": "4.40625rem", // 70.5px
|
|
17700
|
-
},
|
|
17701
|
-
fontWeight: {
|
|
17702
|
-
// body text and caption text
|
|
17703
|
-
"typography-regular": "400",
|
|
17704
|
-
"typography-bold": "600",
|
|
17705
|
-
// headings
|
|
17706
|
-
"heading-regular": "400",
|
|
17707
|
-
"heading-bold": "600",
|
|
17708
|
-
},
|
|
17871
|
+
fontSize: mapToCssVariables(themeKeysToCssVariables.fontSize),
|
|
17872
|
+
fontWeight: mapToCssVariables(themeKeysToCssVariables.fontWeight),
|
|
17709
17873
|
lineHeight: {
|
|
17710
17874
|
// caption text
|
|
17711
17875
|
caption: "19.6px",
|
|
@@ -17725,14 +17889,11 @@ const baseTailwindConfig = {
|
|
|
17725
17889
|
maxWidth: widths,
|
|
17726
17890
|
maxHeight: heights,
|
|
17727
17891
|
spacing: spacing$1,
|
|
17728
|
-
borderRadius: spacing$1,
|
|
17892
|
+
borderRadius: Object.assign(Object.assign({}, spacing$1), mapToCssVariables(themeKeysToCssVariables.borderRadius)),
|
|
17729
17893
|
boxShadow,
|
|
17730
17894
|
backgroundImage: backgrounds,
|
|
17731
17895
|
backdropBlur,
|
|
17732
|
-
colors:
|
|
17733
|
-
acc[key] = `var(${cssVariable})`;
|
|
17734
|
-
return acc;
|
|
17735
|
-
}, {})),
|
|
17896
|
+
colors: mapToCssVariables(themeKeysToCssVariables.color),
|
|
17736
17897
|
},
|
|
17737
17898
|
},
|
|
17738
17899
|
plugins: [
|
|
@@ -17742,13 +17903,13 @@ const baseTailwindConfig = {
|
|
|
17742
17903
|
".focus-visible-within-outline:has(:focus-visible)": {
|
|
17743
17904
|
"outline-style": "solid",
|
|
17744
17905
|
"outline-width": "2px",
|
|
17745
|
-
"outline-color": `var(${
|
|
17906
|
+
"outline-color": `var(${themeKeysToCssVariables.color["royal-500"].cssVariable})`,
|
|
17746
17907
|
},
|
|
17747
17908
|
".scrollbar-hidden": {
|
|
17748
17909
|
scrollbarWidth: "none",
|
|
17749
17910
|
},
|
|
17750
17911
|
".highlight-adjacent:has(button:hover)>button:first-child": {
|
|
17751
|
-
backgroundColor: `var(${
|
|
17912
|
+
backgroundColor: `var(${themeKeysToCssVariables.color["material-light-thin"].cssVariable})`,
|
|
17752
17913
|
},
|
|
17753
17914
|
".highlight-adjacent:has(*:hover) .hide-on-parent-hover": {
|
|
17754
17915
|
opacity: "0",
|
|
@@ -17761,9 +17922,94 @@ const baseTailwindConfig = {
|
|
|
17761
17922
|
],
|
|
17762
17923
|
};
|
|
17763
17924
|
|
|
17925
|
+
const defaultFontSize = {
|
|
17926
|
+
caption: "0.875rem", // 14px
|
|
17927
|
+
"body-small": "1.14375rem", // 18.5px
|
|
17928
|
+
"body-medium": "1.40625rem", // 22.5px
|
|
17929
|
+
"body-large": "1.75625rem", // 28.1px
|
|
17930
|
+
"heading-small": "2.1875rem", // 35,px
|
|
17931
|
+
"heading-medium": "3.08125rem", // 49.3px
|
|
17932
|
+
"heading-large": "4.40625rem", // 70.5px
|
|
17933
|
+
};
|
|
17934
|
+
const defaultFontWeight = {
|
|
17935
|
+
caption: "400",
|
|
17936
|
+
"body-small": "400",
|
|
17937
|
+
"body-medium": "400",
|
|
17938
|
+
"body-large": "400",
|
|
17939
|
+
"heading-small": "400",
|
|
17940
|
+
"heading-medium": "400",
|
|
17941
|
+
"heading-large": "400",
|
|
17942
|
+
};
|
|
17943
|
+
const defaultFontFamily = {
|
|
17944
|
+
"squid-main": "Geist, sans-serif",
|
|
17945
|
+
};
|
|
17946
|
+
const defaultBorderRadius = {
|
|
17947
|
+
"button-large": spacing$1["squid-xxl"],
|
|
17948
|
+
"button-medium": spacing$1["squid-m"],
|
|
17949
|
+
};
|
|
17950
|
+
const lightTheme = {
|
|
17951
|
+
borderRadius: defaultBorderRadius,
|
|
17952
|
+
fontSize: defaultFontSize,
|
|
17953
|
+
fontWeight: defaultFontWeight,
|
|
17954
|
+
fontFamily: defaultFontFamily,
|
|
17955
|
+
color: {
|
|
17956
|
+
// content
|
|
17957
|
+
"grey-100": "#17191C",
|
|
17958
|
+
"grey-200": "#292C32",
|
|
17959
|
+
"grey-300": "#292C32",
|
|
17960
|
+
"grey-400": "#676B7E",
|
|
17961
|
+
"grey-500": "#8A8FA8",
|
|
17962
|
+
"grey-600": "#A7ABBE",
|
|
17963
|
+
"grey-700": "#D1D6E0",
|
|
17964
|
+
"grey-800": "#EDEEF3",
|
|
17965
|
+
"grey-900": "#FBFBFD",
|
|
17966
|
+
// accent
|
|
17967
|
+
"royal-300": "#8C53C5",
|
|
17968
|
+
"royal-400": "#9E79D2",
|
|
17969
|
+
"royal-500": "#B893EC",
|
|
17970
|
+
"royal-700": "#E3D0FD",
|
|
17971
|
+
// status
|
|
17972
|
+
"status-positive": "#17CF26",
|
|
17973
|
+
"status-negative": "#FF5B4D",
|
|
17974
|
+
"status-partial": "#EC9213",
|
|
17975
|
+
// highlight
|
|
17976
|
+
"highlight-700": "#E4FE53",
|
|
17977
|
+
},
|
|
17978
|
+
};
|
|
17979
|
+
const darkTheme = {
|
|
17980
|
+
borderRadius: defaultBorderRadius,
|
|
17981
|
+
fontSize: defaultFontSize,
|
|
17982
|
+
fontWeight: defaultFontWeight,
|
|
17983
|
+
fontFamily: defaultFontFamily,
|
|
17984
|
+
color: {
|
|
17985
|
+
// content
|
|
17986
|
+
"grey-100": "#FBFBFD",
|
|
17987
|
+
"grey-200": "#EDEFF3",
|
|
17988
|
+
"grey-300": "#D1D6E0",
|
|
17989
|
+
"grey-400": "#A7ABBE",
|
|
17990
|
+
"grey-500": "#8A8FA8",
|
|
17991
|
+
"grey-600": "#676B7E",
|
|
17992
|
+
"grey-700": "#4C515D",
|
|
17993
|
+
"grey-800": "#292C32",
|
|
17994
|
+
"grey-900": "#17191C",
|
|
17995
|
+
// accent
|
|
17996
|
+
"royal-300": "#D9BEF4",
|
|
17997
|
+
"royal-400": "#B893EC",
|
|
17998
|
+
"royal-500": "#9E79D2",
|
|
17999
|
+
"royal-700": "#6B45A1",
|
|
18000
|
+
// status
|
|
18001
|
+
"status-positive": "#7AE870",
|
|
18002
|
+
"status-negative": "#FF4D5B",
|
|
18003
|
+
"status-partial": "#F3AF25",
|
|
18004
|
+
// highlight
|
|
18005
|
+
"highlight-700": "#08A054",
|
|
18006
|
+
},
|
|
18007
|
+
};
|
|
18008
|
+
const defaultTheme = lightTheme;
|
|
18009
|
+
|
|
17764
18010
|
function StopsButton(_a) {
|
|
17765
18011
|
var { stopsCount = 0, estimatedTime = "0s", tooltip, providers } = _a, props = __rest$1(_a, ["stopsCount", "estimatedTime", "tooltip", "providers"]);
|
|
17766
|
-
return (jsx(Tooltip, Object.assign({}, tooltip, { tooltipWidth: "max", containerClassName: "mobile-lg:tw-w-[190px] tw-rounded-squid-m tw-justify-end tw-flex", childrenClassName: "tw-rounded-squid-m tw-w-fit", children: jsxs("button", Object.assign({}, props, { onClick: props.disabled ? undefined : props.onClick, className: "tw-group/stops-button tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-justify-end tw-rounded-squid-m tw-pr-squid-xs hover:tw-bg-material-light-thin", children: [jsx(Providers, { providers: providers }), jsxs(CaptionText, { className: "tw-flex tw-max-w-full tw-items-center tw-gap-[3px] tw-truncate tw-text-grey-500 mobile-lg:tw-w-[50px]", children: [jsx("span", { children: stopsCount }), jsx("span", { className: "tw-hidden mobile-lg:tw-block", children: "stops" })] }), jsx(ChevronDownSmallIcon, { className: "tw-text-grey-600" }), jsx("div", { className: "tw-pl-squid-xs", children: jsx(Chip, { label: estimatedTime }) })] })) })));
|
|
18012
|
+
return (jsx(Tooltip, Object.assign({}, tooltip, { tooltipWidth: "max", containerClassName: "mobile-lg:tw-w-[190px] tw-rounded-squid-m tw-justify-end tw-flex", childrenClassName: "tw-rounded-squid-m tw-w-fit", children: jsxs("button", Object.assign({}, props, { onClick: props.disabled ? undefined : props.onClick, className: "tw-group/stops-button tw-flex tw-h-squid-xl tw-flex-1 tw-items-center tw-justify-end tw-rounded-squid-m tw-pr-squid-xs hover:tw-bg-material-light-thin", children: [jsx(Providers, { providers: providers }), jsxs(CaptionText, { className: "tw-flex tw-max-w-full tw-items-center tw-gap-[3px] tw-truncate tw-text-grey-500 mobile-lg:tw-w-[50px]", children: [jsx("span", { children: stopsCount }), jsx("span", { className: "tw-hidden mobile-lg:tw-block", children: Number(stopsCount) === 1 ? "stop" : "stops" })] }), jsx(ChevronDownSmallIcon, { className: "tw-text-grey-600" }), jsx("div", { className: "tw-pl-squid-xs", children: jsx(Chip, { label: estimatedTime }) })] })) })));
|
|
17767
18013
|
}
|
|
17768
18014
|
const MAX_PROVIDERS = 4;
|
|
17769
18015
|
const spacing = {
|
|
@@ -17817,7 +18063,7 @@ function Menu(_a) {
|
|
|
17817
18063
|
return (jsx("div", Object.assign({}, props, { className: cn("tw-max-w-[320px]", containerClassName), ref: menuRef, children: jsxs("div", { className: cn("tw-relative tw-inline-flex tw-max-w-full tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-m tw-bg-material-dark-thick tw-p-squid-xs tw-text-center tw-text-material-light-thick group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-2 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-2", borderRadiusClassMap[rounded], contentClassName,
|
|
17818
18064
|
// :before element to create a backdrop
|
|
17819
18065
|
// Not applied to the div itself because the backdrop-filter spec does not apply nested backdrop filters
|
|
17820
|
-
"before:tw-absolute before:tw-inset-0 before:-tw-z-[1] before:tw-h-full before:tw-w-full before:tw-rounded-squid-m before:tw-backdrop-blur/20 before:tw-backdrop-saturate-150"), children: [typeof children === "string" ? (jsx(CaptionText, { className: "tw-z-20 tw-self-stretch !tw-leading-[10px]", children: children })) : (jsx("div", Object.assign({}, contentWrapperProps, { className: cn("tw-z-20 tw-max-w-full tw-text-caption", contentWrapperProps === null || contentWrapperProps === void 0 ? void 0 : contentWrapperProps.className), children: children }))), jsx("div", { className: cn("tw-absolute tw-inset-0 tw-z-10 tw-h-full tw-w-full tw-border tw-border-material-light-thin tw-bg-material-light-thin", borderRadiusClassMap[rounded]) })] }) })));
|
|
18066
|
+
"before:tw-absolute before:tw-inset-0 before:-tw-z-[1] before:tw-h-full before:tw-w-full before:tw-rounded-squid-m before:tw-backdrop-blur/20 before:tw-backdrop-saturate-150"), children: [typeof children === "string" ? (jsx(CaptionText, { className: "tw-z-20 tw-self-stretch !tw-leading-[10px]", children: children })) : (jsx("div", Object.assign({}, contentWrapperProps, { className: cn("tw-z-20 tw-max-w-full tw-text-caption tw-font-caption", contentWrapperProps === null || contentWrapperProps === void 0 ? void 0 : contentWrapperProps.className), children: children }))), jsx("div", { className: cn("tw-absolute tw-inset-0 tw-z-10 tw-h-full tw-w-full tw-border tw-border-material-light-thin tw-bg-material-light-thin", borderRadiusClassMap[rounded]) })] }) })));
|
|
17821
18067
|
}
|
|
17822
18068
|
|
|
17823
18069
|
function DropdownMenu({ dropdownRef, className, menuRef, isHidden = false, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, }) {
|
|
@@ -17825,7 +18071,7 @@ function DropdownMenu({ dropdownRef, className, menuRef, isHidden = false, listC
|
|
|
17825
18071
|
}
|
|
17826
18072
|
|
|
17827
18073
|
function InfoBox({ title, description, icon }) {
|
|
17828
|
-
return (jsxs("div", { className: "tw-align-self-stretch tw-flex tw-flex-col tw-items-center tw-gap-squid-xs tw-px-squid-m tw-pb-squid-l tw-pt-squid-xs tw-text-royal-400", children: [icon, jsxs("div", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xxs tw-text-center", children: [jsx(BodyText, { size: "small", className: "!tw-leading-[9px]", children: title }), jsx(CaptionText, { className: "tw-text-grey-500", children: description })] })] }));
|
|
18074
|
+
return (jsxs("div", { className: "tw-align-self-stretch tw-flex tw-flex-col tw-items-center tw-gap-squid-xs tw-px-squid-m tw-pb-squid-l tw-pt-squid-xs tw-text-royal-400", children: [icon, jsxs("div", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xxs tw-text-center", children: [jsx(BodyText, { size: "small", className: "!tw-leading-[9px]", children: title }), typeof description === "string" ? (jsx(CaptionText, { className: "tw-text-grey-500", children: description })) : (description)] })] }));
|
|
17829
18075
|
}
|
|
17830
18076
|
|
|
17831
18077
|
const modalWidthClassMap = {
|
|
@@ -18495,7 +18741,7 @@ function LogoContainer({ children }) {
|
|
|
18495
18741
|
return (jsx("div", { className: "tw-flex tw-h-[60px] tw-w-[60px] tw-items-center tw-justify-center", children: children }));
|
|
18496
18742
|
}
|
|
18497
18743
|
|
|
18498
|
-
function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp = false, chain, token, direction = "from", onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive = true, isLoading = false, inputModeButton, balanceButton, assetsButton, walletButton, }) {
|
|
18744
|
+
function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp = false, chain, token, direction = "from", onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive = true, isLoading = false, inputModeButton, balanceButton, assetsButton, walletButton, showNumericInputDetails = true, }) {
|
|
18499
18745
|
var _a, _b, _c;
|
|
18500
18746
|
const isWalletButtonInteractive = !isLoading && !!(walletButton === null || walletButton === void 0 ? void 0 : walletButton.onClick);
|
|
18501
18747
|
const WalletButtonTag = isWalletButtonInteractive ? "button" : "div";
|
|
@@ -18515,7 +18761,7 @@ function SwapConfiguration({ amount, tokenPrice = 0, isFetching: isFetchingProp
|
|
|
18515
18761
|
}, balance: balance, criticalPriceImpactPercentage: criticalPriceImpactPercentage, error: error, formatIfVerySmall: {
|
|
18516
18762
|
token: "0.001",
|
|
18517
18763
|
usd: "0.01",
|
|
18518
|
-
}, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails:
|
|
18764
|
+
}, maxUsdDecimals: maxUsdDecimals, isLoading: isFetching, priceImpactPercentage: priceImpactPercentage, showDetails: showNumericInputDetails, direction: direction, forcedAmount: amount, inputModeButton: inputModeButton, balanceButton: balanceButton, isInteractive: isInputInteractive && !isLoading })] }));
|
|
18519
18765
|
}
|
|
18520
18766
|
|
|
18521
18767
|
function SwapProgressViewHeader({ title, description, }) {
|
|
@@ -18727,6 +18973,69 @@ const useTimer = ({ immediateStart = true, }) => {
|
|
|
18727
18973
|
return { timer, stopTimer, startTimer };
|
|
18728
18974
|
};
|
|
18729
18975
|
|
|
18976
|
+
var ThemePreference;
|
|
18977
|
+
(function (ThemePreference) {
|
|
18978
|
+
ThemePreference["LIGHT"] = "light";
|
|
18979
|
+
ThemePreference["DARK"] = "dark";
|
|
18980
|
+
ThemePreference["SYSTEM"] = "system";
|
|
18981
|
+
})(ThemePreference || (ThemePreference = {}));
|
|
18982
|
+
const THEME_STORAGE_KEY = "__squid-app-theme-type__";
|
|
18983
|
+
const THEME_CHANGE_EVENT = "squid-app-theme-change";
|
|
18984
|
+
const THEME_MEDIA_QUERY = "(prefers-color-scheme: light)";
|
|
18985
|
+
function useUserTheme() {
|
|
18986
|
+
const [themePreference, setThemePreference] = useState(getInitialTheme);
|
|
18987
|
+
const [themeType, setThemeType] = useState(getEffectiveTheme(themePreference));
|
|
18988
|
+
useEffect(() => {
|
|
18989
|
+
const handleThemeChange = (e) => {
|
|
18990
|
+
setThemePreference(e.detail);
|
|
18991
|
+
};
|
|
18992
|
+
window.addEventListener(THEME_CHANGE_EVENT, handleThemeChange);
|
|
18993
|
+
return () => {
|
|
18994
|
+
window.removeEventListener(THEME_CHANGE_EVENT, handleThemeChange);
|
|
18995
|
+
};
|
|
18996
|
+
}, []);
|
|
18997
|
+
useEffect(() => {
|
|
18998
|
+
const mediaQuery = window.matchMedia(THEME_MEDIA_QUERY);
|
|
18999
|
+
const handleChange = () => {
|
|
19000
|
+
if (themePreference === ThemePreference.SYSTEM) {
|
|
19001
|
+
setThemeType(mediaQuery.matches ? "light" : "dark");
|
|
19002
|
+
}
|
|
19003
|
+
};
|
|
19004
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
19005
|
+
handleChange();
|
|
19006
|
+
return () => {
|
|
19007
|
+
mediaQuery.removeEventListener("change", handleChange);
|
|
19008
|
+
};
|
|
19009
|
+
}, [themePreference]);
|
|
19010
|
+
useEffect(() => {
|
|
19011
|
+
setThemeType(getEffectiveTheme(themePreference));
|
|
19012
|
+
}, [themePreference]);
|
|
19013
|
+
const setThemeManually = (theme) => {
|
|
19014
|
+
setThemePreference(theme);
|
|
19015
|
+
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
19016
|
+
window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme }));
|
|
19017
|
+
};
|
|
19018
|
+
const isDarkMode = useMemo(() => themeType === "dark", [themeType]);
|
|
19019
|
+
return {
|
|
19020
|
+
themePreference,
|
|
19021
|
+
themeType,
|
|
19022
|
+
theme: isDarkMode ? darkTheme : lightTheme,
|
|
19023
|
+
setThemeManually,
|
|
19024
|
+
isDarkMode,
|
|
19025
|
+
};
|
|
19026
|
+
}
|
|
19027
|
+
function getInitialTheme() {
|
|
19028
|
+
var _a;
|
|
19029
|
+
if (typeof window === "undefined")
|
|
19030
|
+
return ThemePreference.SYSTEM;
|
|
19031
|
+
return ((_a = localStorage.getItem(THEME_STORAGE_KEY)) !== null && _a !== void 0 ? _a : ThemePreference.SYSTEM);
|
|
19032
|
+
}
|
|
19033
|
+
function getEffectiveTheme(themeType) {
|
|
19034
|
+
if (themeType !== ThemePreference.SYSTEM)
|
|
19035
|
+
return themeType;
|
|
19036
|
+
return window.matchMedia(THEME_MEDIA_QUERY).matches ? "light" : "dark";
|
|
19037
|
+
}
|
|
19038
|
+
|
|
18730
19039
|
function BaseDropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, link, control, detail, isSelected, itemRef, children, contentRef, }) {
|
|
18731
19040
|
const ContentTag = link
|
|
18732
19041
|
? "a"
|
|
@@ -18914,7 +19223,7 @@ function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount,
|
|
|
18914
19223
|
onClick,
|
|
18915
19224
|
}
|
|
18916
19225
|
: {};
|
|
18917
|
-
return (jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex 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", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/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 })] }), jsx("div", { className: cn("tw-
|
|
19226
|
+
return (jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex 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", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/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 })] }), jsx("div", { className: cn("tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs tw-hide-on-parent-hover", !!dropdownMenuContent &&
|
|
18918
19227
|
"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", isDropdownOpen && "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 })] })] })] })), !!dropdownMenuContent && (jsx(ListItemActionsButton, { ref: openDropdownButtonRef, onClick: openDropdown, isActive: isDropdownOpen, className: "peer-hover/history-item:tw-opacity-100" })), isDropdownOpen && !!dropdownMenuContent ? (jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
|
|
18919
19228
|
dropdownPositionClassMap[dropdownStyles.position]), dropdownRef: dropdownRef, children: dropdownMenuContent })) : null] }));
|
|
18920
19229
|
}
|
|
@@ -26657,11 +26966,11 @@ function NumericInput(_a) {
|
|
|
26657
26966
|
const balanceFormatted = useMemo(() => {
|
|
26658
26967
|
return formatTokenAmount(balance !== null && balance !== void 0 ? balance : "0");
|
|
26659
26968
|
}, [balance]);
|
|
26660
|
-
const containerClassname = "tw-px-squid-xs tw-pb-[15px] tw-pt-[5px] tw-text-heading-small tw-font-
|
|
26969
|
+
const containerClassname = "tw-px-squid-xs tw-pb-[15px] tw-pt-[5px] tw-text-heading-small tw-font-regular mobile-lg:tw-px-squid-m tw-relative tw-h-[65px] mobile-sm-height:tw-h-[75px]";
|
|
26661
26970
|
const inputRef = useRef(null);
|
|
26662
26971
|
return (jsxs(Fragment, { children: [isInteractive && !isLoading ? (jsxs("form", { className: containerClassname, onSubmit: (e) => {
|
|
26663
26972
|
e.preventDefault();
|
|
26664
|
-
}, children: [userInputType === UserInputType.USD && (jsx("span", { className: "tw-absolute tw-left-5 tw-top-[11px] tw-leading-[43px] tw-text-grey-600 mobile-lg:tw-left-[30px]", children: "$" })), jsx("input", Object.assign({ ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, placeholder: "0", className: cn("tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-grey-300 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-400 focus:tw-outline-none", userInputType === UserInputType.USD && "tw-pl-[33px]") }, props))] })) : (jsx("div", { className: cn(containerClassname, (isLoading || Number(inputValue || 0) === 0) && loadingClassName), children: jsx("div", { className: "tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-
|
|
26973
|
+
}, children: [userInputType === UserInputType.USD && (jsx("span", { className: "tw-absolute tw-left-5 tw-top-[11px] tw-leading-[43px] tw-text-grey-600 mobile-lg:tw-left-[30px]", children: "$" })), jsx("input", Object.assign({ ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, placeholder: "0", className: cn("tw-h-[55px] tw-w-full tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-grey-300 placeholder:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin focus:tw-text-royal-400 focus:tw-outline-none", userInputType === UserInputType.USD && "tw-pl-[33px]") }, props))] })) : (jsx("div", { className: cn(containerClassname, (isLoading || Number(inputValue || 0) === 0) && loadingClassName), children: jsx("div", { className: "tw-font-regular tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-text-grey-300 mobile-sm-height:tw-h-[65px]", children: jsx("span", { children: inputValue || 0 }) }) })), !showDetails ? null : (jsxs("footer", { className: cn("tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-xs tw-text-grey-500 mobile-lg:tw-px-squid-m", isLoading && loadingClassName), children: [error ? (jsx("div", { className: "tw-px-squid-xs", children: jsx(ErrorMessage, { message: error.message }) })) : (jsx(Tooltip, Object.assign({}, (isLoading
|
|
26665
26974
|
? undefined
|
|
26666
26975
|
: userInputType === UserInputType.TOKEN
|
|
26667
26976
|
? inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.tokenModeTooltip
|
|
@@ -26678,7 +26987,7 @@ function NumericInput(_a) {
|
|
|
26678
26987
|
: notInteractiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balanceFormatted }), jsx(Chip, { label: "Max" })] }) }))] }))] }));
|
|
26679
26988
|
}
|
|
26680
26989
|
|
|
26681
|
-
function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }) {
|
|
26990
|
+
function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected = false, }) {
|
|
26682
26991
|
const [isInputVisible, setIsInputVisible] = useState(false);
|
|
26683
26992
|
const [inputValue, setInputValue] = useState(String(value !== null && value !== void 0 ? value : 0));
|
|
26684
26993
|
useEffect(() => {
|
|
@@ -26708,11 +27017,14 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSel
|
|
|
26708
27017
|
}, [onChange]);
|
|
26709
27018
|
const handleKeyDown = useCallback((e) => {
|
|
26710
27019
|
// block unwanted (but still valid) characters
|
|
26711
|
-
if (["e", "E", "+", "-"].includes(e.key))
|
|
26712
|
-
|
|
27020
|
+
if (["e", "E", "+", "-"].includes(e.key)) {
|
|
27021
|
+
e.preventDefault();
|
|
27022
|
+
return;
|
|
27023
|
+
}
|
|
26713
27024
|
// close input when pressing escape
|
|
26714
|
-
if (e.key === "Escape")
|
|
26715
|
-
|
|
27025
|
+
if (e.key === "Escape") {
|
|
27026
|
+
handleCloseInput();
|
|
27027
|
+
}
|
|
26716
27028
|
}, []);
|
|
26717
27029
|
const handleOpenInput = useCallback(() => {
|
|
26718
27030
|
setIsInputVisible(true);
|
|
@@ -26720,7 +27032,7 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSel
|
|
|
26720
27032
|
const handleCloseInput = useCallback(() => {
|
|
26721
27033
|
setIsInputVisible(false);
|
|
26722
27034
|
}, []);
|
|
26723
|
-
return (jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxs("button", { 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-xs tw-pr-[40px] tw-text-left tw-text-caption
|
|
27035
|
+
return (jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxs("button", { 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-xs tw-pr-[40px] tw-text-left tw-text-caption tw-font-caption tw-leading-[10px] -tw-outline-offset-2 placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin", value === 0 || value === undefined
|
|
26724
27036
|
? "tw-text-grey-600"
|
|
26725
27037
|
: "tw-text-grey-300", isInputVisible ? "tw-bg-material-light-thin" : "tw-bg-transparent", isSelected && "tw-outline tw-outline-2 tw-outline-royal-500"), children: [value !== null && value !== void 0 ? value : 0, jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === "percentage" ? "%" : "$" })] }), jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsx(Chip, { icon: jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsx("form", { onSubmit: (e) => {
|
|
26726
27038
|
e.preventDefault();
|
|
@@ -26862,7 +27174,7 @@ function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarnin
|
|
|
26862
27174
|
if (event.key === "Enter" || event.key === " ") {
|
|
26863
27175
|
handleUpdateValue();
|
|
26864
27176
|
}
|
|
26865
|
-
}, onMouseLeave: handleUpdateValue, className: cn("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
|
|
27177
|
+
}, onMouseLeave: handleUpdateValue, className: cn("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(CircleMinusIcon, {}) }), jsxs("div", { className: "tw-relative", children: [jsx(Input, { step: 0.1, min: min, max: max, isWarning: isWarning, defaultValue: initialValue !== null && initialValue !== void 0 ? initialValue : "0", placeholder: "0", showIcon: false, type: "number", inputRef: inputRef, onChange: (event) => {
|
|
26866
27178
|
var _a;
|
|
26867
27179
|
if (!inputDecoratorRef.current || !inputRef.current)
|
|
26868
27180
|
return;
|
|
@@ -26887,7 +27199,7 @@ function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarnin
|
|
|
26887
27199
|
if (event.key === "Enter" || event.key === " ") {
|
|
26888
27200
|
handleUpdateValue();
|
|
26889
27201
|
}
|
|
26890
|
-
}, 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
|
|
27202
|
+
}, 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, {}) })] })] }) }));
|
|
26891
27203
|
}
|
|
26892
27204
|
|
|
26893
27205
|
const imageClass = "tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center";
|
|
@@ -26919,9 +27231,9 @@ const outlineWidthMap = {
|
|
|
26919
27231
|
};
|
|
26920
27232
|
function AssetsButton({ chain, token, onClick, variant = "primary", isLoading = false, tooltip, }) {
|
|
26921
27233
|
var _a;
|
|
26922
|
-
const defaultBgColor = `var(${
|
|
27234
|
+
const defaultBgColor = `var(${themeKeysToCssVariables.color[themeKeyVariantMap[variant]].cssVariable})`;
|
|
26923
27235
|
const outlineWidth = outlineWidthMap[isLoading ? "loading" : !!token && !!chain ? "full" : "empty"];
|
|
26924
|
-
const chainBgColor = (_a =
|
|
27236
|
+
const chainBgColor = (_a = chain === null || chain === void 0 ? void 0 : chain.bgColor) !== null && _a !== void 0 ? _a : defaultBgColor;
|
|
26925
27237
|
const tokenBgColor = (chain && token && !isLoading && token.bgColor) || defaultBgColor;
|
|
26926
27238
|
const bgGradient = useMemo(() => {
|
|
26927
27239
|
if (!chain || isLoading) {
|
|
@@ -26950,7 +27262,7 @@ function AssetsButton({ chain, token, onClick, variant = "primary", isLoading =
|
|
|
26950
27262
|
function FilterButton({ selected, numApplied = 0, onClick, }) {
|
|
26951
27263
|
return (jsxs("div", { className: "tw-relative", children: [jsx(Button$1, { variant: "tertiary", size: "md", className: cn(selected
|
|
26952
27264
|
? "!tw-bg-grey-500 !tw-text-grey-800"
|
|
26953
|
-
: "!tw-border-transparent !tw-bg-grey-800 !tw-text-grey-500"), onClick: onClick, children: jsx(FilterIcon, {}) }), numApplied > 0 && (jsx("div", { className: "tw-absolute tw-right-0 tw-top-0 tw-h-squid-m tw-w-squid-xl -tw-translate-y-1/2 tw-translate-x-1/2 tw-rounded-full tw-bg-
|
|
27265
|
+
: "!tw-border-transparent !tw-bg-grey-800 !tw-text-grey-500"), onClick: onClick, children: jsx(FilterIcon, {}) }), numApplied > 0 && (jsx("div", { className: "tw-absolute tw-right-0 tw-top-0 tw-h-squid-m tw-w-squid-xl -tw-translate-y-1/2 tw-translate-x-1/2 tw-rounded-full tw-bg-volt-700 tw-text-center tw-leading-[1] tw-text-grey-200 dark:tw-text-grey-900", children: jsx(CaptionText, { children: numApplied }) }))] }));
|
|
26954
27266
|
}
|
|
26955
27267
|
|
|
26956
27268
|
function SettingsButton({ label, isSelected = false, onClick, }) {
|
|
@@ -26958,9 +27270,10 @@ function SettingsButton({ label, isSelected = false, onClick, }) {
|
|
|
26958
27270
|
}
|
|
26959
27271
|
|
|
26960
27272
|
const IconButton = forwardRef((_a, ref) => {
|
|
26961
|
-
var { icon } = _a, props = __rest$1(_a, ["icon"]);
|
|
26962
|
-
return (jsx("button", Object.assign({}, props, { ref: ref, className: cn("tw-flex tw-h-8 tw-w-8 tw-min-w-8 tw-items-center tw-justify-center tw-rounded-squid-xs hover:tw-bg-material-light-thin",
|
|
27273
|
+
var { icon, disabled = false } = _a, props = __rest$1(_a, ["icon", "disabled"]);
|
|
27274
|
+
return (jsx("button", Object.assign({}, props, { ref: ref, disabled: disabled, className: cn("tw-flex tw-h-8 tw-w-8 tw-min-w-8 tw-items-center tw-justify-center tw-rounded-squid-xs hover:tw-bg-material-light-thin", disabled ? "tw-text-grey-600" : "tw-text-grey-300", props.className), children: icon })));
|
|
26963
27275
|
});
|
|
27276
|
+
IconButton.displayName = "IconButton";
|
|
26964
27277
|
|
|
26965
27278
|
function AssetsView({ chains, favoriteTokens, popularTokens, userTokens, }) {
|
|
26966
27279
|
const matchesMobileLg = useMediaQuery(MEDIA_QUERIES.MOBILE_LG.media);
|
|
@@ -27104,11 +27417,13 @@ const SearchAddress = ({ type }) => {
|
|
|
27104
27417
|
}, icon: jsx("img", { src: "/assets/images/blast.jpg", className: "tw-rounded-squid-xxs" }) })) : null, jsx(Button$1, { size: "md", variant: "primary", icon: jsx(ArrowRightIcon, {}), disabled: type === "recipientEmpty" })] })] }));
|
|
27105
27418
|
};
|
|
27106
27419
|
|
|
27107
|
-
|
|
27420
|
+
const ROUTING_TOKEN_SUPPORT_ARTICLE = "https://support.squidrouter.com/squid-overview/liquidity-pools/what-is-a-routing-token";
|
|
27421
|
+
|
|
27422
|
+
function SwapDetailsView({ isLoading, canToggleBoostMode = true, displayBoostMode = false, }) {
|
|
27108
27423
|
const [isModalOpen, setIsModalOpen] = useState(true);
|
|
27109
27424
|
return (jsx(Fragment, { children: jsxs(Modal, { isOpen: isModalOpen, onBackdropClick: () => {
|
|
27110
27425
|
setIsModalOpen(false);
|
|
27111
|
-
}, children: [jsxs(ModalContent, { children: [jsx(Settings, { canToggleBoostMode: canToggleBoostMode }), jsxs("ul", { className: "tw-flex tw-flex-col tw-items-start tw-gap-squid-xxs tw-self-stretch tw-py-squid-
|
|
27426
|
+
}, children: [jsxs(ModalContent, { children: [displayBoostMode && (jsx(Settings, { canToggleBoostMode: canToggleBoostMode })), jsxs("ul", { className: "tw-flex tw-flex-col tw-items-start tw-gap-squid-xxs tw-self-stretch tw-py-squid-m", children: [jsx(PropertyListItem, { isLoading: isLoading, icon: jsx(ArrowBottomTopIcon, {}), label: "Exchange rate", detail: "1 ETH = 4,031.05 USDC" }), jsx(PropertyListItem, { isLoading: isLoading, icon: jsx(ArrowWallDownIcon, {}), label: "Receive minimum", detail: "750.5 USDC" }), jsx(PropertyListItem, { isLoading: isLoading, icon: jsx(GasIcon, {}), label: "Cross-chain gas fees", detail: jsxs(Fragment, { children: [jsx(CaptionText, { children: "0.02534 ETH" }), jsx(CaptionText, { className: "tw-text-grey-500", children: "$9.92" })] }) }), jsx(PropertyListItem, { isLoading: isLoading, icon: jsx(ReorderIcon, {}), label: "Expected gas refund", detail: jsxs(Fragment, { children: [jsx(CaptionText, { children: "-0.06336 ETH" }), jsx(CaptionText, { className: "tw-text-grey-500", children: "-$2.48" })] }) }), jsx(PropertyListItem, { isLoading: isLoading, icon: jsx(ReceiptBillIcon, {}), label: "Total fee", detail: jsxs(Fragment, { children: [jsx(CaptionText, { children: "0.0177 ETH" }), jsx(CaptionText, { className: "tw-text-grey-500", children: "$7.43" })] }) })] }), jsx("span", { children: jsx(InfoBox, { icon: jsx(SnapIcon, {}), title: "Squid's price commitment", description: jsx(Fragment, { children: jsxs(CaptionText, { className: "tw-text-grey-500", children: ["In case of market prices fluctuating significantly, your transaction may revert and you will receive one of Squid's routing tokens on the destination chain instead.", " ", jsx("a", { className: "tw-text-grey-300", href: ROUTING_TOKEN_SUPPORT_ARTICLE, target: "_blank", children: "Learn more" })] }) }) }) })] }), jsx(Button$1, { size: "lg", variant: "secondary", label: "Close", onClick: () => {
|
|
27112
27427
|
setIsModalOpen(false);
|
|
27113
27428
|
} })] }) }));
|
|
27114
27429
|
}
|
|
@@ -62263,27 +62578,7 @@ function WalletsView() {
|
|
|
62263
62578
|
return (jsxs(Modal, { maxHeight: true, children: [jsxs(ModalContent, { addGap: true, children: [jsx("div", { className: "tw-px-squid-xs tw-py-squid-xxs", children: jsx(Input, { placeholder: "Select your wallet" }) }), jsxs("ul", { className: "tw-flex tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-py-squid-xxs", children: [jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", detail: "Installed", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", detail: "Installed", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), jsx("span", { className: "tw-text-material-light-thin", children: jsx(ModalContentDivider, {}) }), jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", subtitle: "Connect with an Injected Wallet", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Browser Extension" }), mainImageUrl: "/assets/images/avatar.png" }), jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), " ", jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), " ", jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), " ", jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsx(ListItem, { icon: jsx("span", { className: "tw-text-material-light-average", children: jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" })] })] }), jsx(Button$1, { size: "lg", variant: "secondary", label: "Cancel" })] }));
|
|
62264
62579
|
}
|
|
62265
62580
|
|
|
62266
|
-
|
|
62267
|
-
// from the user readable theme config
|
|
62268
|
-
// to the internal theme config
|
|
62269
|
-
const themeKeysToReplace = [
|
|
62270
|
-
{
|
|
62271
|
-
userKey: "content",
|
|
62272
|
-
internalKey: "grey",
|
|
62273
|
-
},
|
|
62274
|
-
{
|
|
62275
|
-
userKey: "accent",
|
|
62276
|
-
internalKey: "royal",
|
|
62277
|
-
},
|
|
62278
|
-
{
|
|
62279
|
-
userKey: "status-warning",
|
|
62280
|
-
internalKey: "status-partial",
|
|
62281
|
-
},
|
|
62282
|
-
{
|
|
62283
|
-
userKey: "highlight",
|
|
62284
|
-
internalKey: "volt",
|
|
62285
|
-
},
|
|
62286
|
-
];
|
|
62581
|
+
/* eslint-disable @typescript-eslint/prefer-reduce-type-parameter */
|
|
62287
62582
|
/**
|
|
62288
62583
|
* Parses the user readable config to css variables
|
|
62289
62584
|
* Also maps the public theme variables to the internal theme variables
|
|
@@ -62305,22 +62600,12 @@ const themeKeysToReplace = [
|
|
|
62305
62600
|
*/
|
|
62306
62601
|
const parseSquidTheme = (userTheme) => {
|
|
62307
62602
|
var _a, _b;
|
|
62308
|
-
if (
|
|
62603
|
+
if (userTheme == null)
|
|
62309
62604
|
return undefined;
|
|
62310
|
-
|
|
62311
|
-
|
|
62312
|
-
|
|
62313
|
-
|
|
62314
|
-
if (keyToReplace) {
|
|
62315
|
-
const newKey = userKey.replace(keyToReplace.userKey, keyToReplace.internalKey);
|
|
62316
|
-
internalKeys[newKey] = userValue;
|
|
62317
|
-
}
|
|
62318
|
-
else {
|
|
62319
|
-
internalKeys[userKey] = userValue;
|
|
62320
|
-
}
|
|
62321
|
-
return internalKeys;
|
|
62322
|
-
}, {});
|
|
62323
|
-
// add material-{light,dark}-{thin,average,thick} colors to the squid theme object
|
|
62605
|
+
console.log({
|
|
62606
|
+
userTheme,
|
|
62607
|
+
});
|
|
62608
|
+
// add material-{light,dark}-{thin,average,thick} colors to the squid theme object
|
|
62324
62609
|
// using the following formula:
|
|
62325
62610
|
// material-light-thin -> grey-100 + 10% opacity
|
|
62326
62611
|
// material-light-average -> grey-100 + 33% opacity
|
|
@@ -62329,50 +62614,38 @@ const parseSquidTheme = (userTheme) => {
|
|
|
62329
62614
|
// material-dark-average -> grey-900 + 33% opacity
|
|
62330
62615
|
// material-dark-thick -> grey-900 + 66% opacity
|
|
62331
62616
|
const materialVariants = {
|
|
62332
|
-
"material-light-thin": getHexColorFromOpacityPercentage(
|
|
62333
|
-
"material-light-average": getHexColorFromOpacityPercentage(
|
|
62334
|
-
"material-light-thick": getHexColorFromOpacityPercentage(
|
|
62335
|
-
"material-dark-thin": getHexColorFromOpacityPercentage(
|
|
62336
|
-
"material-dark-average": getHexColorFromOpacityPercentage(
|
|
62337
|
-
"material-dark-thick": getHexColorFromOpacityPercentage(
|
|
62617
|
+
"material-light-thin": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.1),
|
|
62618
|
+
"material-light-average": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.33),
|
|
62619
|
+
"material-light-thick": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.66),
|
|
62620
|
+
"material-dark-thin": getHexColorFromOpacityPercentage(userTheme.color["grey-900"], 0.1),
|
|
62621
|
+
"material-dark-average": getHexColorFromOpacityPercentage(userTheme.color["grey-900"], 0.33),
|
|
62622
|
+
"material-dark-thick": getHexColorFromOpacityPercentage(userTheme.color["grey-900"], 0.66),
|
|
62338
62623
|
};
|
|
62339
|
-
|
|
62340
|
-
|
|
62341
|
-
|
|
62342
|
-
|
|
62343
|
-
|
|
62344
|
-
|
|
62345
|
-
|
|
62346
|
-
|
|
62347
|
-
|
|
62348
|
-
|
|
62349
|
-
//
|
|
62350
|
-
//
|
|
62351
|
-
//
|
|
62352
|
-
//
|
|
62353
|
-
//
|
|
62354
|
-
//
|
|
62355
|
-
//
|
|
62356
|
-
//
|
|
62357
|
-
//
|
|
62358
|
-
//
|
|
62359
|
-
//
|
|
62360
|
-
// }
|
|
62361
|
-
//
|
|
62362
|
-
|
|
62363
|
-
|
|
62364
|
-
});
|
|
62365
|
-
// color representing the blend of material-light and grey-900
|
|
62366
|
-
parsed.push({
|
|
62367
|
-
[themeTypesKeys["material-light-blend-grey-900"].cssVariable]: (_a = blendColors(squidTheme["material-light-thin"], squidTheme["grey-900"])) !== null && _a !== void 0 ? _a : "",
|
|
62368
|
-
});
|
|
62369
|
-
// color representing the blend of material-light and grey-300
|
|
62370
|
-
parsed.push({
|
|
62371
|
-
[themeTypesKeys["material-light-blend-grey-800"].cssVariable]: (_b = blendColors(squidTheme["material-light-thin"], squidTheme["grey-800"])) !== null && _b !== void 0 ? _b : "",
|
|
62372
|
-
});
|
|
62373
|
-
return parsed.reduce((a, v) => {
|
|
62374
|
-
const key = Object.keys(v)[0];
|
|
62375
|
-
return Object.assign(Object.assign({}, a), { [key]: v[key] });
|
|
62624
|
+
const opacityVariants = {
|
|
62625
|
+
// opacity variants
|
|
62626
|
+
"grey-100-005": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.05),
|
|
62627
|
+
// color representing the blend of material-light and grey-900
|
|
62628
|
+
"material-light-blend-grey-900": (_a = blendColors(materialVariants["material-light-thin"], userTheme.color["grey-900"])) !== null && _a !== void 0 ? _a : "",
|
|
62629
|
+
// color representing the blend of material-light and grey-300
|
|
62630
|
+
"material-light-blend-grey-800": (_b = blendColors(materialVariants["material-light-thin"], userTheme.color["grey-800"])) !== null && _b !== void 0 ? _b : "",
|
|
62631
|
+
};
|
|
62632
|
+
// Adds the internal colors to the user theme
|
|
62633
|
+
const internalTheme = Object.assign(Object.assign({}, userTheme), { color: Object.assign(Object.assign(Object.assign({}, userTheme.color), materialVariants), opacityVariants) });
|
|
62634
|
+
// return flatten(
|
|
62635
|
+
// {
|
|
62636
|
+
// ...userTheme,
|
|
62637
|
+
// colors: {
|
|
62638
|
+
// ...userTheme,
|
|
62639
|
+
// ...materialVariants,
|
|
62640
|
+
// ...opacityVariants,
|
|
62641
|
+
// },
|
|
62642
|
+
// },
|
|
62643
|
+
// {
|
|
62644
|
+
// prefix: SQUID_THEME_CSS_VARIABLE_PREFIX,
|
|
62645
|
+
// },
|
|
62646
|
+
// );
|
|
62647
|
+
return flatten(internalTheme, {
|
|
62648
|
+
prefix: THEME_CSS_VARIABLE_PREFIX,
|
|
62376
62649
|
});
|
|
62377
62650
|
};
|
|
62378
62651
|
/**
|
|
@@ -62391,20 +62664,21 @@ function getHexColorFromOpacityPercentage(color, opacity) {
|
|
|
62391
62664
|
.padStart(2, "0")).toUpperCase();
|
|
62392
62665
|
}
|
|
62393
62666
|
function hexToRgb(hex) {
|
|
62667
|
+
var _a;
|
|
62394
62668
|
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
|
62395
|
-
|
|
62396
|
-
|
|
62397
|
-
return r + r + g + g + b + b + (a ? a + a : "");
|
|
62669
|
+
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
|
|
62670
|
+
const cleanHex = hex.replace(shorthandRegex, function (m, r, g, b, a) {
|
|
62671
|
+
return r + r + g + g + b + b + (a != null ? a + a : "");
|
|
62398
62672
|
});
|
|
62399
|
-
|
|
62400
|
-
|
|
62401
|
-
|
|
62402
|
-
|
|
62403
|
-
|
|
62404
|
-
|
|
62405
|
-
|
|
62406
|
-
|
|
62407
|
-
|
|
62673
|
+
const [, r, g, b, a] = ((_a = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(cleanHex)) !== null && _a !== void 0 ? _a : []);
|
|
62674
|
+
if (r == null || g == null || b == null)
|
|
62675
|
+
return null;
|
|
62676
|
+
return {
|
|
62677
|
+
r: parseInt(r, 16),
|
|
62678
|
+
g: parseInt(g, 16),
|
|
62679
|
+
b: parseInt(b, 16),
|
|
62680
|
+
a: a != null ? parseInt(a, 16) / 255 : 1,
|
|
62681
|
+
};
|
|
62408
62682
|
}
|
|
62409
62683
|
function rgbToHex(r, g, b) {
|
|
62410
62684
|
return ("#" +
|
|
@@ -62421,19 +62695,20 @@ function rgbToHex(r, g, b) {
|
|
|
62421
62695
|
// let resultingColor = blendColors(foregroundColor, bgColor)
|
|
62422
62696
|
// console.log(resultingColor) // Output: ~#2f3033
|
|
62423
62697
|
function blendColors(foreground, background) {
|
|
62424
|
-
|
|
62425
|
-
|
|
62426
|
-
if (
|
|
62698
|
+
const fg = hexToRgb(foreground);
|
|
62699
|
+
const bg = hexToRgb(background);
|
|
62700
|
+
if (fg == null || bg == null)
|
|
62427
62701
|
return null;
|
|
62428
|
-
|
|
62429
|
-
|
|
62430
|
-
|
|
62702
|
+
const r = Math.round(fg.r * fg.a + bg.r * (1 - fg.a));
|
|
62703
|
+
const g = Math.round(fg.g * fg.a + bg.g * (1 - fg.a));
|
|
62704
|
+
const b = Math.round(fg.b * fg.a + bg.b * (1 - fg.a));
|
|
62431
62705
|
return rgbToHex(r, g, b);
|
|
62432
62706
|
}
|
|
62433
62707
|
|
|
62434
|
-
function
|
|
62708
|
+
function ThemeProvider(_a) {
|
|
62709
|
+
var { theme = lightTheme, children, themeType = "light" } = _a, props = __rest$1(_a, ["theme", "children", "themeType"]);
|
|
62435
62710
|
const parsedStyle = parseSquidTheme(theme);
|
|
62436
|
-
return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-
|
|
62711
|
+
return (jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-font-squid-main tw-group tw-relative tw-flex tw-h-d-screen mobile-lg:tw-h-auto", props.className), children: children })));
|
|
62437
62712
|
}
|
|
62438
62713
|
|
|
62439
|
-
export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CoinsAddIcon, CoinsIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CrossAnimatedIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon,
|
|
62714
|
+
export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, 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, Copy, CopyIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, TagIcon, TagIconFilled, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, cn, darkTheme, defaultTheme, lightTheme, linkActionTimelineProps, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
|