@0xsquid/ui 0.27.6 → 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.
Files changed (46) hide show
  1. package/README.md +4 -4
  2. package/dist/cjs/index.js +513 -241
  3. package/dist/cjs/types/components/buttons/AssetsButton.d.ts +2 -2
  4. package/dist/cjs/types/components/buttons/Button.d.ts +5 -3
  5. package/dist/cjs/types/components/controls/Input.d.ts +3 -3
  6. package/dist/cjs/types/components/controls/NumericInput.d.ts +2 -2
  7. package/dist/cjs/types/components/icons/Generic.d.ts +28 -0
  8. package/dist/cjs/types/components/icons/Weather.d.ts +8 -0
  9. package/dist/cjs/types/components/typography/BodyText.d.ts +2 -2
  10. package/dist/cjs/types/components/typography/HeadingText.d.ts +2 -2
  11. package/dist/cjs/types/core/design-system.d.ts +9 -0
  12. package/dist/cjs/types/core/index.d.ts +1 -1
  13. package/dist/cjs/types/core/themes.d.ts +13 -8
  14. package/dist/cjs/types/core/utils.d.ts +11 -2
  15. package/dist/cjs/types/hooks/index.d.ts +1 -0
  16. package/dist/cjs/types/hooks/useUserTheme.d.ts +13 -0
  17. package/dist/cjs/types/providers/ThemeProvider.d.ts +11 -0
  18. package/dist/cjs/types/providers/index.d.ts +1 -1
  19. package/dist/cjs/types/services/internal/colorService.d.ts +9 -4
  20. package/dist/cjs/types/types/config.d.ts +28 -29
  21. package/dist/cjs/types/types/index.d.ts +2 -2
  22. package/dist/esm/index.js +502 -241
  23. package/dist/esm/types/components/buttons/AssetsButton.d.ts +2 -2
  24. package/dist/esm/types/components/buttons/Button.d.ts +5 -3
  25. package/dist/esm/types/components/controls/Input.d.ts +3 -3
  26. package/dist/esm/types/components/controls/NumericInput.d.ts +2 -2
  27. package/dist/esm/types/components/icons/Generic.d.ts +28 -0
  28. package/dist/esm/types/components/icons/Weather.d.ts +8 -0
  29. package/dist/esm/types/components/typography/BodyText.d.ts +2 -2
  30. package/dist/esm/types/components/typography/HeadingText.d.ts +2 -2
  31. package/dist/esm/types/core/design-system.d.ts +9 -0
  32. package/dist/esm/types/core/index.d.ts +1 -1
  33. package/dist/esm/types/core/themes.d.ts +13 -8
  34. package/dist/esm/types/core/utils.d.ts +11 -2
  35. package/dist/esm/types/hooks/index.d.ts +1 -0
  36. package/dist/esm/types/hooks/useUserTheme.d.ts +13 -0
  37. package/dist/esm/types/providers/ThemeProvider.d.ts +11 -0
  38. package/dist/esm/types/providers/index.d.ts +1 -1
  39. package/dist/esm/types/services/internal/colorService.d.ts +9 -4
  40. package/dist/esm/types/types/config.d.ts +28 -29
  41. package/dist/esm/types/types/index.d.ts +2 -2
  42. package/dist/index.css +1 -1
  43. package/dist/index.d.ts +82 -28
  44. package/package.json +2 -1
  45. package/dist/cjs/types/providers/SquidConfigProvider.d.ts +0 -9
  46. package/dist/esm/types/providers/SquidConfigProvider.d.ts +0 -9
package/dist/cjs/index.js CHANGED
@@ -2653,6 +2653,37 @@ const getFirstUniques = (array, key, count) => {
2653
2653
  }
2654
2654
  return uniqueItems;
2655
2655
  };
2656
+ function isObject$3(value) {
2657
+ return typeof value === "object" && !Array.isArray(value) && value !== null;
2658
+ }
2659
+ function flatten(obj, options = {}) {
2660
+ const parsed = {};
2661
+ function toKebabCase(key) {
2662
+ return key.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
2663
+ }
2664
+ function recurse(current, currentPrefix) {
2665
+ var _a;
2666
+ for (const [key, value] of Object.entries(current)) {
2667
+ const newPrefix = `${currentPrefix}${toKebabCase(key)}`;
2668
+ if (isObject$3(value)) {
2669
+ recurse(value, `${newPrefix}-`);
2670
+ }
2671
+ else if (typeof value === "string" || typeof value === "number") {
2672
+ parsed[`${(_a = options.prefix) !== null && _a !== void 0 ? _a : ""}${newPrefix}`] = String(value);
2673
+ }
2674
+ }
2675
+ }
2676
+ recurse(obj, "");
2677
+ return parsed;
2678
+ }
2679
+ // Map theme keys to css variables
2680
+ // Example { "accent-gold": "var(--accent-gold)" }
2681
+ function mapToCssVariables(obj) {
2682
+ return Object.entries(obj).reduce((acc, [key, { cssVariable }]) => {
2683
+ acc[key] = `var(${cssVariable})`;
2684
+ return acc;
2685
+ }, {});
2686
+ }
2656
2687
 
2657
2688
  const badgeSizeClassMap = {
2658
2689
  sm: "tw-w-4 tw-h-4",
@@ -2746,36 +2777,30 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
2746
2777
 
2747
2778
  // font size, line height, and letter spacing classes
2748
2779
  const textClassMap$1 = {
2749
- small: "tw-text-body-small tw-tracking-body-small tw-leading-body-small",
2750
- medium: "tw-text-body-medium tw-tracking-body-medium tw-leading-body-medium",
2751
- large: "tw-text-body-large tw-tracking-body-large tw-leading-body-large",
2780
+ small: "tw-text-body-small tw-tracking-body-small tw-leading-body-small tw-font-body-small",
2781
+ medium: "tw-text-body-medium tw-tracking-body-medium tw-leading-body-medium tw-font-body-medium",
2782
+ large: "tw-text-body-large tw-tracking-body-large tw-leading-body-large tw-font-body-large",
2752
2783
  };
2753
2784
  function BodyText(_a) {
2754
- var { size, children, bold, tight } = _a, props = __rest$1(_a, ["size", "children", "bold", "tight"]);
2755
- const fontWeightClass = bold
2756
- ? "tw-font-typography-bold"
2757
- : "tw-font-typography-regular";
2785
+ var { size, children, bold = false, tight = false } = _a, props = __rest$1(_a, ["size", "children", "bold", "tight"]);
2786
+ const fontWeightClass = bold ? "!tw-font-bold" : "!tw-font-regular";
2758
2787
  return (jsxRuntime.jsx("span", Object.assign({}, props, { className: cn(textClassMap$1[size], fontWeightClass, tight && "!tw-leading-[1]", props.className), children: children })));
2759
2788
  }
2760
2789
 
2761
2790
  function CaptionText(_a) {
2762
- var { children, bold } = _a, props = __rest$1(_a, ["children", "bold"]);
2763
- const boldClass = bold
2764
- ? "tw-font-typography-bold"
2765
- : "tw-font-typography-regular";
2766
- return (jsxRuntime.jsx("span", Object.assign({}, props, { className: cn(boldClass, "tw-text-caption tw-leading-caption", props.className), children: children })));
2791
+ var { children, bold = false } = _a, props = __rest$1(_a, ["children", "bold"]);
2792
+ const boldClass = bold && "!tw-font-bold";
2793
+ return (jsxRuntime.jsx("span", Object.assign({}, props, { className: cn(boldClass, "tw-text-caption tw-font-caption tw-leading-caption", props.className), children: children })));
2767
2794
  }
2768
2795
 
2769
2796
  // font size, line height, and letter spacing classes
2770
2797
  const textClassMap = {
2771
- small: "tw-text-heading-small tw-tracking-heading-small tw-leading-heading-small",
2772
- medium: "tw-text-heading-medium tw-tracking-heading-medium tw-leading-heading-medium",
2773
- large: "tw-text-heading-large tw-tracking-heading-large tw-leading-heading-large",
2774
- };
2775
- function HeadingText({ children, bold, size, className, }) {
2776
- const fontWeightClass = bold
2777
- ? "tw-font-heading-bold"
2778
- : "tw-font-heading-regular";
2798
+ small: "tw-text-heading-small tw-tracking-heading-small tw-leading-heading-small tw-font-heading-small",
2799
+ medium: "tw-text-heading-medium tw-tracking-heading-medium tw-leading-heading-medium tw-font-heading-medium",
2800
+ large: "tw-text-heading-large tw-tracking-heading-large tw-leading-heading-large tw-font-heading-large",
2801
+ };
2802
+ function HeadingText({ children, bold = false, size, className, }) {
2803
+ const fontWeightClass = bold ? "!tw-font-bold" : "!tw-font-regular";
2779
2804
  return (jsxRuntime.jsx("h6", { className: clsx(textClassMap[size], fontWeightClass, className), children: children }));
2780
2805
  }
2781
2806
 
@@ -3027,8 +3052,8 @@ const buttonSizeClassMap = {
3027
3052
  lg: "tw-p-1 tw-h-button",
3028
3053
  };
3029
3054
  const roundedClassMap = {
3030
- md: "tw-rounded-squid-m",
3031
- lg: "tw-rounded-squid-xxl",
3055
+ md: "tw-rounded-button-medium",
3056
+ lg: "tw-rounded-button-large",
3032
3057
  };
3033
3058
  const buttonVariantClassMap = {
3034
3059
  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",
@@ -3040,11 +3065,11 @@ const buttonVariantClassMap = {
3040
3065
  const buttonDisabledClass = "!tw-bg-grey-800 !tw-text-grey-600 tw-cursor-not-allowed";
3041
3066
  const loadingClassname = "tw-invisible tw-opacity-0";
3042
3067
  function Button$1(_a) {
3043
- 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"]);
3044
- const chipElement = chip ? (jsxRuntime.jsx(Chip, Object.assign({}, chip, { className: cn("tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10", chip.className) }))) : null;
3045
- const children = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!disabled && !isLoading && (jsxRuntime.jsx(ButtonHoverOverlay, { className: roundedClassMap[size] })), jsxRuntime.jsx("div", { className: "tw-relative tw-z-[5] tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", children: !label && !icon ? (props.children) : size === "lg" ? (jsxRuntime.jsx("span", { className: "tw-px-squid-m", children: jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "medium", children: label }) })) : size === "md" ? (label && !icon ? (
3068
+ 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"]);
3069
+ const chipElement = chip != null ? (jsxRuntime.jsx(Chip, Object.assign({}, chip, { className: cn("tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10", chip.className) }))) : null;
3070
+ const children = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!disabled && !isLoading && (jsxRuntime.jsx(ButtonHoverOverlay, { className: roundedClassMap[size] })), jsxRuntime.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" ? (jsxRuntime.jsx("span", { className: "tw-px-squid-m", children: jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "medium", children: label }) })) : size === "md" ? (label != null && icon == null ? (
3046
3071
  // label only
3047
- jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "small", children: label })) : !label && icon ? (
3072
+ jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : "", size: "small", children: label })) : label == null && icon != null ? (
3048
3073
  // icon only
3049
3074
  isLoading ? null : (icon)) : (
3050
3075
  // icon and label
@@ -3055,10 +3080,10 @@ function Button$1(_a) {
3055
3080
  // custom classes from props
3056
3081
  props.className);
3057
3082
  const ButtonWrapper = ({ children }) => (jsxRuntime.jsx("div", { className: cn("tw-relative", buttonWidthClassnameMap[size], roundedClassMap[size], containerClassName), children: children }));
3058
- if (link) {
3059
- return (jsxRuntime.jsxs(ButtonWrapper, { children: [jsxRuntime.jsx("a", { "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, children: children }), chipElement] }));
3083
+ if (link != null) {
3084
+ return (jsxRuntime.jsxs(ButtonWrapper, { children: [jsxRuntime.jsx("a", { ref: anchorRef, "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, rel: "noreferrer", children: children }), chipElement] }));
3060
3085
  }
3061
- return (jsxRuntime.jsxs(ButtonWrapper, { children: [jsxRuntime.jsx("button", Object.assign({}, props, { "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] }));
3086
+ return (jsxRuntime.jsxs(ButtonWrapper, { children: [jsxRuntime.jsx("button", Object.assign({}, props, { ref: buttonRef, "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] }));
3062
3087
  }
3063
3088
  const ButtonHoverOverlay = ({ className }) => {
3064
3089
  return (jsxRuntime.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) }));
@@ -3076,7 +3101,140 @@ function ArrowButton(_a) {
3076
3101
  "aria-disabled:tw-bg-grey-600 aria-disabled:tw-text-grey-800"), children: jsxRuntime.jsx(ArrowRightIcon, {}) })] })));
3077
3102
  }
3078
3103
 
3079
- const INTERNAL_SQUID_THEME_KEYS = [
3104
+ // const INTERNAL_THEME_COLOR_KEYS = [
3105
+ // "grey-100",
3106
+ // "grey-200",
3107
+ // "grey-300",
3108
+ // "grey-400",
3109
+ // "grey-500",
3110
+ // "grey-600",
3111
+ // "grey-700",
3112
+ // "grey-800",
3113
+ // "grey-900",
3114
+ // "royal-300",
3115
+ // "royal-400",
3116
+ // "royal-500",
3117
+ // "royal-700",
3118
+ // "status-positive",
3119
+ // "status-negative",
3120
+ // "status-partial",
3121
+ // "material-light-thin",
3122
+ // "material-light-average",
3123
+ // "material-light-thick",
3124
+ // "material-dark-thin",
3125
+ // "material-dark-average",
3126
+ // "material-dark-thick",
3127
+ // // grey-100 with 0.05 opacity
3128
+ // "grey-100-005",
3129
+ // // material-light and grey-900 blended color
3130
+ // "material-light-blend-grey-900",
3131
+ // // material-light and grey-300 blended color
3132
+ // "material-light-blend-grey-800",
3133
+ // "volt-700",
3134
+ // ] as const;
3135
+ // const THEME_BORDER_RADIUS_KEYS = ["button-lg", "button-md"] as const;
3136
+ // const THEME_TEXT_KEYS = [
3137
+ // "caption-size",
3138
+ // "caption-weight",
3139
+ // "body-large-size",
3140
+ // "body-large-weight",
3141
+ // "body-medium-size",
3142
+ // "body-medium-weight",
3143
+ // "body-small-size",
3144
+ // "body-small-weight",
3145
+ // "heading-small-size",
3146
+ // "heading-small-weight",
3147
+ // "heading-medium-size",
3148
+ // "heading-medium-weight",
3149
+ // "heading-large-size",
3150
+ // "heading-large-weight",
3151
+ // ] as const;
3152
+ // export type InternalThemeColors = Record<
3153
+ // (typeof INTERNAL_THEME_COLOR_KEYS)[number],
3154
+ // string
3155
+ // >;
3156
+ // export type ThemeBorderRadius = Record<
3157
+ // (typeof THEME_BORDER_RADIUS_KEYS)[number],
3158
+ // string
3159
+ // >;
3160
+ // export interface InternalSquidTheme {
3161
+ // colors: InternalThemeColors;
3162
+ // fontFamily: string;
3163
+ // text: ThemeText;
3164
+ // borderRadius: ThemeBorderRadius;
3165
+ // }
3166
+ // export interface SquidTheme {
3167
+ // colors: SquidThemeColors;
3168
+ // fontFamily?: string;
3169
+ // text?: ThemeText;
3170
+ // borderRadius?: ThemeBorderRadius;
3171
+ // }
3172
+ // // User-readable colors config
3173
+ // // renames:
3174
+ // // grey- to content-
3175
+ // // royal- to accent-
3176
+ // export interface SquidThemeColors {
3177
+ // "content-100": string;
3178
+ // "content-200": string;
3179
+ // "content-300": string;
3180
+ // "content-400": string;
3181
+ // "content-500": string;
3182
+ // "content-600": string;
3183
+ // "content-700": string;
3184
+ // "content-800": string;
3185
+ // "content-900": string;
3186
+ // "accent-300": string;
3187
+ // "accent-400": string;
3188
+ // "accent-500": string;
3189
+ // "accent-700": string;
3190
+ // "status-positive": string;
3191
+ // "status-negative": string;
3192
+ // "status-warning": string;
3193
+ // "highlight-700": string;
3194
+ // }
3195
+ // export type ThemeText = Record<(typeof THEME_TEXT_KEYS)[number], string>;
3196
+ // export const SQUID_THEME_CSS_VARIABLE_PREFIX = "--st-";
3197
+ // const themeColorKeysToCssVariablesMap = Object.fromEntries(
3198
+ // INTERNAL_THEME_COLOR_KEYS.map((key) => [
3199
+ // key,
3200
+ // {
3201
+ // cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}color-${key}`,
3202
+ // },
3203
+ // ]),
3204
+ // ) as Record<keyof InternalThemeColors, { cssVariable: string }>;
3205
+ // const themeBorderRadiusKeysToCssVariablesMap = Object.fromEntries(
3206
+ // THEME_BORDER_RADIUS_KEYS.map((key) => [
3207
+ // key,
3208
+ // {
3209
+ // cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}borderRadius-${key}`,
3210
+ // },
3211
+ // ]),
3212
+ // ) as Record<keyof ThemeBorderRadius, { cssVariable: string }>;
3213
+ // const themeTextKeysToCssVariablesMap = Object.fromEntries(
3214
+ // THEME_TEXT_KEYS.map((key) => [
3215
+ // key,
3216
+ // {
3217
+ // cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}text-${key}`,
3218
+ // },
3219
+ // ]),
3220
+ // ) as Record<keyof ThemeText, { cssVariable: string }>;
3221
+ // type ThemeCssVariableMap<T extends Record<string, any>> = {
3222
+ // [K in keyof T]: { cssVariable: string };
3223
+ // };
3224
+ // interface InternalThemeMap {
3225
+ // colors: ThemeCssVariableMap<InternalThemeColors>;
3226
+ // borderRadius: ThemeCssVariableMap<ThemeBorderRadius>;
3227
+ // text: ThemeCssVariableMap<ThemeText>;
3228
+ // }
3229
+ // export const internalThemeKeysToCssVariablesMap: InternalThemeMap = {
3230
+ // colors: themeColorKeysToCssVariablesMap,
3231
+ // borderRadius: themeBorderRadiusKeysToCssVariablesMap,
3232
+ // text: themeTextKeysToCssVariablesMap,
3233
+ // };
3234
+ // console.log({
3235
+ // internalThemeKeysToCssVariablesMap,
3236
+ // });
3237
+ const THEME_COLOR_KEYS = [
3080
3238
  "grey-100",
3081
3239
  "grey-200",
3082
3240
  "grey-300",
@@ -3099,24 +3257,56 @@ const INTERNAL_SQUID_THEME_KEYS = [
3099
3257
  "material-dark-thin",
3100
3258
  "material-dark-average",
3101
3259
  "material-dark-thick",
3260
+ "highlight-700",
3102
3261
  // grey-100 with 0.05 opacity
3103
3262
  "grey-100-005",
3104
3263
  // material-light and grey-900 blended color
3105
3264
  "material-light-blend-grey-900",
3106
3265
  // material-light and grey-300 blended color
3107
3266
  "material-light-blend-grey-800",
3108
- "volt-700",
3109
3267
  ];
3110
- const SQUID_THEME_CSS_VARIABLE_PREFIX = "--squid-theme-";
3268
+ const THEME_BORDER_RADIUS_KEYS = ["button-large", "button-medium"];
3269
+ const THEME_FONT_SIZE_KEYS = [
3270
+ "caption",
3271
+ "body-large",
3272
+ "body-medium",
3273
+ "body-small",
3274
+ "heading-small",
3275
+ "heading-medium",
3276
+ "heading-large",
3277
+ ];
3278
+ const THEME_FONT_WEIGHT_KEYS = [
3279
+ "caption",
3280
+ "body-small",
3281
+ "body-medium",
3282
+ "body-large",
3283
+ "heading-small",
3284
+ "heading-medium",
3285
+ "heading-large",
3286
+ ];
3287
+ const THEME_FONT_FAMILY_KEYS = ["squid-main"];
3111
3288
  /**
3112
- * Mapping between readable variables name and css variables used TailwindCSS config
3289
+ * 'st' = Squid Theme
3113
3290
  */
3114
- const themeTypesKeys = Object.fromEntries(INTERNAL_SQUID_THEME_KEYS.map((key) => [
3115
- key,
3116
- {
3117
- cssVariable: `${SQUID_THEME_CSS_VARIABLE_PREFIX}${key}`,
3118
- },
3119
- ]));
3291
+ const THEME_CSS_VARIABLE_PREFIX = "--st-";
3292
+ function keysToCssVariables(keys, prefix) {
3293
+ return keys.reduce((acc, key) => {
3294
+ acc[key] = {
3295
+ cssVariable: `${THEME_CSS_VARIABLE_PREFIX}${prefix}-${String(key)}`,
3296
+ };
3297
+ return acc;
3298
+ },
3299
+ // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter, @typescript-eslint/consistent-type-assertions
3300
+ {});
3301
+ }
3302
+ const themeKeysToCssVariables = {
3303
+ color: keysToCssVariables(THEME_COLOR_KEYS, "color"),
3304
+ borderRadius: keysToCssVariables(THEME_BORDER_RADIUS_KEYS, "border-radius"),
3305
+ // text: keysToCssVariables<ThemeText>(THEME_TEXT_KEYS, "text"),
3306
+ fontSize: keysToCssVariables(THEME_FONT_SIZE_KEYS, "font-size"),
3307
+ fontWeight: keysToCssVariables(THEME_FONT_WEIGHT_KEYS, "font-weight"),
3308
+ fontFamily: keysToCssVariables(THEME_FONT_FAMILY_KEYS, "font-family"),
3309
+ };
3120
3310
 
3121
3311
  function SearchIcon({ className, size = "24", }) {
3122
3312
  return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.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" }) }));
@@ -3134,9 +3324,11 @@ function Input(_a) {
3134
3324
  var _a;
3135
3325
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
3136
3326
  }, autoFocusTimeout);
3137
- return () => clearTimeout(timeoutId);
3327
+ return () => {
3328
+ clearTimeout(timeoutId);
3329
+ };
3138
3330
  }, [autoFocusTimeout]);
3139
- return (jsxRuntime.jsxs("div", { className: cn("tw-relative tw-w-full tw-text-grey-600", containerClassName), children: [jsxRuntime.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-font-typography-regular 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 ? (jsxRuntime.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 || jsxRuntime.jsx(SearchIcon, {}) })) : null, showActionButton ? (jsxRuntime.jsx("div", { className: "tw-absolute tw-inset-y-0 tw-right-1.5 tw-flex tw-items-center tw-justify-center", children: jsxRuntime.jsx(InputActionButton, Object.assign({}, actionButtonProps)) })) : null] }));
3331
+ return (jsxRuntime.jsxs("div", { className: cn("tw-relative tw-w-full tw-text-grey-600", containerClassName), children: [jsxRuntime.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 ? (jsxRuntime.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 || jsxRuntime.jsx(SearchIcon, {}) })) : null, showActionButton ? (jsxRuntime.jsx("div", { className: "tw-absolute tw-inset-y-0 tw-right-1.5 tw-flex tw-items-center tw-justify-center", children: jsxRuntime.jsx(InputActionButton, Object.assign({}, actionButtonProps)) })) : null] }));
3140
3332
  }
3141
3333
  const InputActionButton = ({ onClick, variant = "tertiary", label = "Paste", }) => {
3142
3334
  return (jsxRuntime.jsx(Button$1, { size: "md", variant: variant, onClick: onClick, className: "!tw-h-[30px] !tw-w-fit !tw-min-w-0", children: jsxRuntime.jsx(CaptionText, { children: label }) }));
@@ -16755,9 +16947,9 @@ const ANIMATION_DURATIONS = {
16755
16947
  BOOST_BUTTON: 500,
16756
16948
  };
16757
16949
  const ANIMATION_TIMINGS = {
16758
- EXPAND_ROUTE: "linear", //'cubic-bezier(.32, .72, 0, 1)',
16759
- COLLAPSE_ROUTE: "linear", //'cubic-bezier(.32, .72, 0, 1)',
16760
- CHANGE_SWAP_STEP: "linear", //'cubic-bezier(.4,0,.2,1)',
16950
+ EXPAND_ROUTE: "linear", // 'cubic-bezier(.32, .72, 0, 1)',
16951
+ COLLAPSE_ROUTE: "linear", // 'cubic-bezier(.32, .72, 0, 1)',
16952
+ CHANGE_SWAP_STEP: "linear", // 'cubic-bezier(.4,0,.2,1)',
16761
16953
  SHOW_ROUTE: "cubic-bezier(.165,.84,.44,1)",
16762
16954
  HIDE_ROUTE: "cubic-bezier(.165,.84,.44,1)",
16763
16955
  };
@@ -17271,6 +17463,12 @@ function SunIcon({ size = "24", className, }) {
17271
17463
  function MoonIcon({ size = "20", className, }) {
17272
17464
  return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.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" }) }));
17273
17465
  }
17466
+ function SunOutlinedIcon({ size = "24", className, }) {
17467
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.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" }) }));
17468
+ }
17469
+ function CrossedOutSunSolidIcon({ size = "20", className, }) {
17470
+ return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_3313_9942)", children: jsxRuntime.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" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_3313_9942", children: jsxRuntime.jsx("rect", { width: size, height: size, fill: "currentColor" }) }) })] }));
17471
+ }
17274
17472
 
17275
17473
  const dockIconClassname = "tw-text-grey-900";
17276
17474
  const dockIconSelectedClassname = "group-data-[squid-theme-type=dark]:tw-text-royal-700 group-data-[squid-theme-type=light]:tw-text-volt-700";
@@ -17338,59 +17536,33 @@ function SunriseSmallIcon({ className, size = "20", }) {
17338
17536
  function CoinsOutlinedIcon({ className, size = "24", }) {
17339
17537
  return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.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" }) }));
17340
17538
  }
17539
+ function PhoneIcon({ size = "24", className, }) {
17540
+ return (jsxRuntime.jsx("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", children: jsxRuntime.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" }) }));
17541
+ }
17542
+ function LaptopIcon({ size = "24", className, }) {
17543
+ return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: [jsxRuntime.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" }), jsxRuntime.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" })] }));
17544
+ }
17545
+ function CopyIcon({ size = "20", className, }) {
17546
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", className: className, children: jsxRuntime.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" }) }));
17547
+ }
17548
+ function FileDownloadIcon({ size = "20", className, }) {
17549
+ return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", children: [jsxRuntime.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" }), jsxRuntime.jsx("path", { d: "M12.1667 2.15481L16.6786 6.66666H13C12.5398 6.66666 12.1667 6.29356 12.1667 5.83332V2.15481Z", fill: "currentColor" })] }));
17550
+ }
17551
+ function CodeSolidSquareIcon({ size = "24", className, }) {
17552
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: jsxRuntime.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" }) }));
17553
+ }
17554
+ function CodeBracketsIcon({ size = "20", className, }) {
17555
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { 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" }) }));
17556
+ }
17557
+ function CommandIcon({ size = "22", className, }) {
17558
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 22 22", fill: "none", className: className, children: jsxRuntime.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" }) }));
17559
+ }
17341
17560
 
17342
17561
  function FeeButton(_a) {
17343
17562
  var { feeInUsd = "0", chipLabel = "Fee", className, tooltip } = _a, props = __rest$1(_a, ["feeInUsd", "chipLabel", "className", "tooltip"]);
17344
17563
  return (jsxRuntime.jsx(Tooltip, Object.assign({}, tooltip, { tooltipWidth: "max", containerClassName: "tw-rounded-squid-m tw-w-full", childrenClassName: "tw-rounded-squid-m", children: jsxRuntime.jsxs("button", Object.assign({}, props, { className: cn("tw-flex tw-h-squid-xl tw-w-full tw-items-center tw-gap-x-squid-xs tw-rounded-squid-m tw-px-squid-xs hover:tw-bg-material-light-thin", className), children: [jsxRuntime.jsx(Chip, { label: chipLabel, className: "tw-hidden mobile-xs:tw-flex" }), jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(UsdAmount, { usdAmount: feeInUsd }), jsxRuntime.jsx(ChevronDownSmallIcon, { className: "tw-text-grey-600" })] })] })) })));
17345
17564
  }
17346
17565
 
17347
- const lightTheme = {
17348
- // content
17349
- "content-100": "#17191C",
17350
- "content-200": "#292C32",
17351
- "content-300": "#292C32",
17352
- "content-400": "#676B7E",
17353
- "content-500": "#8A8FA8",
17354
- "content-600": "#A7ABBE",
17355
- "content-700": "#D1D6E0",
17356
- "content-800": "#EDEEF3",
17357
- "content-900": "#FBFBFD",
17358
- // accent
17359
- "accent-300": "#8C53C5",
17360
- "accent-400": "#9E79D2",
17361
- "accent-500": "#B893EC",
17362
- "accent-700": "#E3D0FD",
17363
- // status
17364
- "status-positive": "#17CF26",
17365
- "status-negative": "#FF5B4D",
17366
- "status-warning": "#EC9213",
17367
- // highlight
17368
- "highlight-700": "#E4FE53",
17369
- };
17370
- const darkTheme = {
17371
- // content
17372
- "content-100": "#FBFBFD",
17373
- "content-200": "#EDEFF3",
17374
- "content-300": "#D1D6E0",
17375
- "content-400": "#A7ABBE",
17376
- "content-500": "#8A8FA8",
17377
- "content-600": "#676B7E",
17378
- "content-700": "#4C515D",
17379
- "content-800": "#292C32",
17380
- "content-900": "#17191C",
17381
- // accent
17382
- "accent-300": "#D9BEF4",
17383
- "accent-400": "#B893EC",
17384
- "accent-500": "#9E79D2",
17385
- "accent-700": "#6B45A1",
17386
- // status
17387
- "status-positive": "#7AE870",
17388
- "status-negative": "#FF4D5B",
17389
- "status-warning": "#F3AF25",
17390
- // highlight
17391
- "highlight-700": "#08A054",
17392
- };
17393
-
17394
17566
  var createPlugin$2 = {};
17395
17567
 
17396
17568
  var createPlugin$1 = {};
@@ -17499,7 +17671,7 @@ const boxShadow = {
17499
17671
  const backgrounds = {
17500
17672
  "royal-light": "linear-gradient(180deg, #A577D8 0%, #BF91F2 100%)",
17501
17673
  "royal-dark": "linear-gradient(180deg, #BF91F2 0%, #A577D8 100%)",
17502
- "dark-cover": "linear-gradient(90deg, var(--squid-theme-material-dark-thick) 45.4%, transparent 50.85%, var(--squid-theme-material-dark-thick) 55.61%)",
17674
+ "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%)`,
17503
17675
  };
17504
17676
  const baseTailwindConfig = {
17505
17677
  prefix: "tw-",
@@ -17624,13 +17796,13 @@ const baseTailwindConfig = {
17624
17796
  },
17625
17797
  "100%": {
17626
17798
  "backdrop-filter": "blur(20px) saturate(150%)",
17627
- "background-color": `var(${themeTypesKeys["material-dark-average"].cssVariable})`,
17799
+ "background-color": `var(${themeKeysToCssVariables.color["material-dark-average"].cssVariable})`,
17628
17800
  },
17629
17801
  },
17630
17802
  "blur-out": {
17631
17803
  "0%": {
17632
17804
  "backdrop-filter": "blur(20px) saturate(150%)",
17633
- "background-color": `var(${themeTypesKeys["material-dark-average"].cssVariable})`,
17805
+ "background-color": `var(${themeKeysToCssVariables.color["material-dark-average"].cssVariable})`,
17634
17806
  },
17635
17807
  "100%": {
17636
17808
  "backdrop-filter": "blur(0px)",
@@ -17705,9 +17877,7 @@ const baseTailwindConfig = {
17705
17877
  33: "0.33",
17706
17878
  66: "0.66",
17707
17879
  },
17708
- fontFamily: {
17709
- geist: ["Geist", "sans-serif"],
17710
- },
17880
+ fontFamily: mapToCssVariables(themeKeysToCssVariables.fontFamily),
17711
17881
  letterSpacing: {
17712
17882
  // body text
17713
17883
  "body-small": "-0.366px",
@@ -17718,26 +17888,8 @@ const baseTailwindConfig = {
17718
17888
  "heading-medium": "-2.465px",
17719
17889
  "heading-large": "-3.525px",
17720
17890
  },
17721
- fontSize: {
17722
- // caption text
17723
- caption: "0.875rem", // 14px
17724
- // body text
17725
- "body-small": "1.14375rem", // 18.5px
17726
- "body-medium": "1.40625rem", // 22.5px
17727
- "body-large": "1.75625rem", // 28.1px
17728
- // heading
17729
- "heading-small": "2.1875rem", // 35px
17730
- "heading-medium": "3.08125rem", // 49.3px
17731
- "heading-large": "4.40625rem", // 70.5px
17732
- },
17733
- fontWeight: {
17734
- // body text and caption text
17735
- "typography-regular": "400",
17736
- "typography-bold": "600",
17737
- // headings
17738
- "heading-regular": "400",
17739
- "heading-bold": "600",
17740
- },
17891
+ fontSize: mapToCssVariables(themeKeysToCssVariables.fontSize),
17892
+ fontWeight: mapToCssVariables(themeKeysToCssVariables.fontWeight),
17741
17893
  lineHeight: {
17742
17894
  // caption text
17743
17895
  caption: "19.6px",
@@ -17757,14 +17909,11 @@ const baseTailwindConfig = {
17757
17909
  maxWidth: widths,
17758
17910
  maxHeight: heights,
17759
17911
  spacing: spacing$1,
17760
- borderRadius: spacing$1,
17912
+ borderRadius: Object.assign(Object.assign({}, spacing$1), mapToCssVariables(themeKeysToCssVariables.borderRadius)),
17761
17913
  boxShadow,
17762
17914
  backgroundImage: backgrounds,
17763
17915
  backdropBlur,
17764
- colors: Object.assign({}, Object.entries(themeTypesKeys).reduce((acc, [key, { cssVariable }]) => {
17765
- acc[key] = `var(${cssVariable})`;
17766
- return acc;
17767
- }, {})),
17916
+ colors: mapToCssVariables(themeKeysToCssVariables.color),
17768
17917
  },
17769
17918
  },
17770
17919
  plugins: [
@@ -17774,13 +17923,13 @@ const baseTailwindConfig = {
17774
17923
  ".focus-visible-within-outline:has(:focus-visible)": {
17775
17924
  "outline-style": "solid",
17776
17925
  "outline-width": "2px",
17777
- "outline-color": `var(${themeTypesKeys["royal-500"].cssVariable})`,
17926
+ "outline-color": `var(${themeKeysToCssVariables.color["royal-500"].cssVariable})`,
17778
17927
  },
17779
17928
  ".scrollbar-hidden": {
17780
17929
  scrollbarWidth: "none",
17781
17930
  },
17782
17931
  ".highlight-adjacent:has(button:hover)>button:first-child": {
17783
- backgroundColor: `var(${themeTypesKeys["material-light-thin"].cssVariable})`,
17932
+ backgroundColor: `var(${themeKeysToCssVariables.color["material-light-thin"].cssVariable})`,
17784
17933
  },
17785
17934
  ".highlight-adjacent:has(*:hover) .hide-on-parent-hover": {
17786
17935
  opacity: "0",
@@ -17793,6 +17942,91 @@ const baseTailwindConfig = {
17793
17942
  ],
17794
17943
  };
17795
17944
 
17945
+ const defaultFontSize = {
17946
+ caption: "0.875rem", // 14px
17947
+ "body-small": "1.14375rem", // 18.5px
17948
+ "body-medium": "1.40625rem", // 22.5px
17949
+ "body-large": "1.75625rem", // 28.1px
17950
+ "heading-small": "2.1875rem", // 35,px
17951
+ "heading-medium": "3.08125rem", // 49.3px
17952
+ "heading-large": "4.40625rem", // 70.5px
17953
+ };
17954
+ const defaultFontWeight = {
17955
+ caption: "400",
17956
+ "body-small": "400",
17957
+ "body-medium": "400",
17958
+ "body-large": "400",
17959
+ "heading-small": "400",
17960
+ "heading-medium": "400",
17961
+ "heading-large": "400",
17962
+ };
17963
+ const defaultFontFamily = {
17964
+ "squid-main": "Geist, sans-serif",
17965
+ };
17966
+ const defaultBorderRadius = {
17967
+ "button-large": spacing$1["squid-xxl"],
17968
+ "button-medium": spacing$1["squid-m"],
17969
+ };
17970
+ const lightTheme = {
17971
+ borderRadius: defaultBorderRadius,
17972
+ fontSize: defaultFontSize,
17973
+ fontWeight: defaultFontWeight,
17974
+ fontFamily: defaultFontFamily,
17975
+ color: {
17976
+ // content
17977
+ "grey-100": "#17191C",
17978
+ "grey-200": "#292C32",
17979
+ "grey-300": "#292C32",
17980
+ "grey-400": "#676B7E",
17981
+ "grey-500": "#8A8FA8",
17982
+ "grey-600": "#A7ABBE",
17983
+ "grey-700": "#D1D6E0",
17984
+ "grey-800": "#EDEEF3",
17985
+ "grey-900": "#FBFBFD",
17986
+ // accent
17987
+ "royal-300": "#8C53C5",
17988
+ "royal-400": "#9E79D2",
17989
+ "royal-500": "#B893EC",
17990
+ "royal-700": "#E3D0FD",
17991
+ // status
17992
+ "status-positive": "#17CF26",
17993
+ "status-negative": "#FF5B4D",
17994
+ "status-partial": "#EC9213",
17995
+ // highlight
17996
+ "highlight-700": "#E4FE53",
17997
+ },
17998
+ };
17999
+ const darkTheme = {
18000
+ borderRadius: defaultBorderRadius,
18001
+ fontSize: defaultFontSize,
18002
+ fontWeight: defaultFontWeight,
18003
+ fontFamily: defaultFontFamily,
18004
+ color: {
18005
+ // content
18006
+ "grey-100": "#FBFBFD",
18007
+ "grey-200": "#EDEFF3",
18008
+ "grey-300": "#D1D6E0",
18009
+ "grey-400": "#A7ABBE",
18010
+ "grey-500": "#8A8FA8",
18011
+ "grey-600": "#676B7E",
18012
+ "grey-700": "#4C515D",
18013
+ "grey-800": "#292C32",
18014
+ "grey-900": "#17191C",
18015
+ // accent
18016
+ "royal-300": "#D9BEF4",
18017
+ "royal-400": "#B893EC",
18018
+ "royal-500": "#9E79D2",
18019
+ "royal-700": "#6B45A1",
18020
+ // status
18021
+ "status-positive": "#7AE870",
18022
+ "status-negative": "#FF4D5B",
18023
+ "status-partial": "#F3AF25",
18024
+ // highlight
18025
+ "highlight-700": "#08A054",
18026
+ },
18027
+ };
18028
+ const defaultTheme = lightTheme;
18029
+
17796
18030
  function StopsButton(_a) {
17797
18031
  var { stopsCount = 0, estimatedTime = "0s", tooltip, providers } = _a, props = __rest$1(_a, ["stopsCount", "estimatedTime", "tooltip", "providers"]);
17798
18032
  return (jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsx(Providers, { providers: providers }), jsxRuntime.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: [jsxRuntime.jsx("span", { children: stopsCount }), jsxRuntime.jsx("span", { className: "tw-hidden mobile-lg:tw-block", children: Number(stopsCount) === 1 ? "stop" : "stops" })] }), jsxRuntime.jsx(ChevronDownSmallIcon, { className: "tw-text-grey-600" }), jsxRuntime.jsx("div", { className: "tw-pl-squid-xs", children: jsxRuntime.jsx(Chip, { label: estimatedTime }) })] })) })));
@@ -17849,7 +18083,7 @@ function Menu(_a) {
17849
18083
  return (jsxRuntime.jsx("div", Object.assign({}, props, { className: cn("tw-max-w-[320px]", containerClassName), ref: menuRef, children: jsxRuntime.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,
17850
18084
  // :before element to create a backdrop
17851
18085
  // Not applied to the div itself because the backdrop-filter spec does not apply nested backdrop filters
17852
- "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" ? (jsxRuntime.jsx(CaptionText, { className: "tw-z-20 tw-self-stretch !tw-leading-[10px]", children: children })) : (jsxRuntime.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 }))), jsxRuntime.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]) })] }) })));
18086
+ "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" ? (jsxRuntime.jsx(CaptionText, { className: "tw-z-20 tw-self-stretch !tw-leading-[10px]", children: children })) : (jsxRuntime.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 }))), jsxRuntime.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]) })] }) })));
17853
18087
  }
17854
18088
 
17855
18089
  function DropdownMenu({ dropdownRef, className, menuRef, isHidden = false, listClassName, containerClassName, children, contentWrapperProps, menuContentClassName, }) {
@@ -18759,6 +18993,69 @@ const useTimer = ({ immediateStart = true, }) => {
18759
18993
  return { timer, stopTimer, startTimer };
18760
18994
  };
18761
18995
 
18996
+ exports.ThemePreference = void 0;
18997
+ (function (ThemePreference) {
18998
+ ThemePreference["LIGHT"] = "light";
18999
+ ThemePreference["DARK"] = "dark";
19000
+ ThemePreference["SYSTEM"] = "system";
19001
+ })(exports.ThemePreference || (exports.ThemePreference = {}));
19002
+ const THEME_STORAGE_KEY = "__squid-app-theme-type__";
19003
+ const THEME_CHANGE_EVENT = "squid-app-theme-change";
19004
+ const THEME_MEDIA_QUERY = "(prefers-color-scheme: light)";
19005
+ function useUserTheme() {
19006
+ const [themePreference, setThemePreference] = React$1.useState(getInitialTheme);
19007
+ const [themeType, setThemeType] = React$1.useState(getEffectiveTheme(themePreference));
19008
+ React$1.useEffect(() => {
19009
+ const handleThemeChange = (e) => {
19010
+ setThemePreference(e.detail);
19011
+ };
19012
+ window.addEventListener(THEME_CHANGE_EVENT, handleThemeChange);
19013
+ return () => {
19014
+ window.removeEventListener(THEME_CHANGE_EVENT, handleThemeChange);
19015
+ };
19016
+ }, []);
19017
+ React$1.useEffect(() => {
19018
+ const mediaQuery = window.matchMedia(THEME_MEDIA_QUERY);
19019
+ const handleChange = () => {
19020
+ if (themePreference === exports.ThemePreference.SYSTEM) {
19021
+ setThemeType(mediaQuery.matches ? "light" : "dark");
19022
+ }
19023
+ };
19024
+ mediaQuery.addEventListener("change", handleChange);
19025
+ handleChange();
19026
+ return () => {
19027
+ mediaQuery.removeEventListener("change", handleChange);
19028
+ };
19029
+ }, [themePreference]);
19030
+ React$1.useEffect(() => {
19031
+ setThemeType(getEffectiveTheme(themePreference));
19032
+ }, [themePreference]);
19033
+ const setThemeManually = (theme) => {
19034
+ setThemePreference(theme);
19035
+ localStorage.setItem(THEME_STORAGE_KEY, theme);
19036
+ window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme }));
19037
+ };
19038
+ const isDarkMode = React$1.useMemo(() => themeType === "dark", [themeType]);
19039
+ return {
19040
+ themePreference,
19041
+ themeType,
19042
+ theme: isDarkMode ? darkTheme : lightTheme,
19043
+ setThemeManually,
19044
+ isDarkMode,
19045
+ };
19046
+ }
19047
+ function getInitialTheme() {
19048
+ var _a;
19049
+ if (typeof window === "undefined")
19050
+ return exports.ThemePreference.SYSTEM;
19051
+ return ((_a = localStorage.getItem(THEME_STORAGE_KEY)) !== null && _a !== void 0 ? _a : exports.ThemePreference.SYSTEM);
19052
+ }
19053
+ function getEffectiveTheme(themeType) {
19054
+ if (themeType !== exports.ThemePreference.SYSTEM)
19055
+ return themeType;
19056
+ return window.matchMedia(THEME_MEDIA_QUERY).matches ? "light" : "dark";
19057
+ }
19058
+
18762
19059
  function BaseDropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, link, control, detail, isSelected, itemRef, children, contentRef, }) {
18763
19060
  const ContentTag = link
18764
19061
  ? "a"
@@ -18946,7 +19243,7 @@ function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount,
18946
19243
  onClick,
18947
19244
  }
18948
19245
  : {};
18949
- return (jsxRuntime.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: [jsxRuntime.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: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsxRuntime.jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsxRuntime.jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsxRuntime.jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(CaptionText, { children: fromLabel }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronRightSmallIcon, {}) }), jsxRuntime.jsx(CaptionText, { children: toLabel })] }), jsxRuntime.jsx("div", { className: cn("tw-hide-on-parent-hover tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", !!dropdownMenuContent &&
19246
+ return (jsxRuntime.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: [jsxRuntime.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: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsxRuntime.jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsxRuntime.jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsxRuntime.jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(CaptionText, { children: fromLabel }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronRightSmallIcon, {}) }), jsxRuntime.jsx(CaptionText, { children: toLabel })] }), jsxRuntime.jsx("div", { className: cn("tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs tw-hide-on-parent-hover", !!dropdownMenuContent &&
18950
19247
  "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 })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx(BodyText, { size: "small", children: fromAmount }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), jsxRuntime.jsx(BodyText, { size: "small", children: toAmount })] })] })] })), !!dropdownMenuContent && (jsxRuntime.jsx(ListItemActionsButton, { ref: openDropdownButtonRef, onClick: openDropdown, isActive: isDropdownOpen, className: "peer-hover/history-item:tw-opacity-100" })), isDropdownOpen && !!dropdownMenuContent ? (jsxRuntime.jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
18951
19248
  dropdownPositionClassMap[dropdownStyles.position]), dropdownRef: dropdownRef, children: dropdownMenuContent })) : null] }));
18952
19249
  }
@@ -26689,11 +26986,11 @@ function NumericInput(_a) {
26689
26986
  const balanceFormatted = React$1.useMemo(() => {
26690
26987
  return formatTokenAmount(balance !== null && balance !== void 0 ? balance : "0");
26691
26988
  }, [balance]);
26692
- const containerClassname = "tw-px-squid-xs tw-pb-[15px] tw-pt-[5px] tw-text-heading-small tw-font-heading-regular mobile-lg:tw-px-squid-m tw-relative tw-h-[65px] mobile-sm-height:tw-h-[75px]";
26989
+ 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]";
26693
26990
  const inputRef = React$1.useRef(null);
26694
26991
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isInteractive && !isLoading ? (jsxRuntime.jsxs("form", { className: containerClassname, onSubmit: (e) => {
26695
26992
  e.preventDefault();
26696
- }, children: [userInputType === UserInputType.USD && (jsxRuntime.jsx("span", { className: "tw-absolute tw-left-5 tw-top-[11px] tw-leading-[43px] tw-text-grey-600 mobile-lg:tw-left-[30px]", children: "$" })), jsxRuntime.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))] })) : (jsxRuntime.jsx("div", { className: cn(containerClassname, (isLoading || Number(inputValue || 0) === 0) && loadingClassName), children: jsxRuntime.jsx("div", { className: "tw-flex tw-h-[55px] tw-w-full tw-items-center tw-rounded-squid-s tw-bg-transparent tw-px-squid-xs tw-py-squid-s tw-text-heading-small tw-font-heading-regular tw-text-grey-300 mobile-sm-height:tw-h-[65px]", children: jsxRuntime.jsx("span", { children: inputValue || 0 }) }) })), !showDetails ? null : (jsxRuntime.jsxs("footer", { className: cn("tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-xs tw-text-grey-500 mobile-lg:tw-px-squid-m", isLoading && loadingClassName), children: [error ? (jsxRuntime.jsx("div", { className: "tw-px-squid-xs", children: jsxRuntime.jsx(ErrorMessage, { message: error.message }) })) : (jsxRuntime.jsx(Tooltip, Object.assign({}, (isLoading
26993
+ }, children: [userInputType === UserInputType.USD && (jsxRuntime.jsx("span", { className: "tw-absolute tw-left-5 tw-top-[11px] tw-leading-[43px] tw-text-grey-600 mobile-lg:tw-left-[30px]", children: "$" })), jsxRuntime.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))] })) : (jsxRuntime.jsx("div", { className: cn(containerClassname, (isLoading || Number(inputValue || 0) === 0) && loadingClassName), children: jsxRuntime.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: jsxRuntime.jsx("span", { children: inputValue || 0 }) }) })), !showDetails ? null : (jsxRuntime.jsxs("footer", { className: cn("tw-flex tw-h-squid-m tw-max-h-squid-m tw-items-center tw-justify-between tw-gap-2 tw-px-squid-xs tw-text-grey-500 mobile-lg:tw-px-squid-m", isLoading && loadingClassName), children: [error ? (jsxRuntime.jsx("div", { className: "tw-px-squid-xs", children: jsxRuntime.jsx(ErrorMessage, { message: error.message }) })) : (jsxRuntime.jsx(Tooltip, Object.assign({}, (isLoading
26697
26994
  ? undefined
26698
26995
  : userInputType === UserInputType.TOKEN
26699
26996
  ? inputModeButton === null || inputModeButton === void 0 ? void 0 : inputModeButton.tokenModeTooltip
@@ -26710,7 +27007,7 @@ function NumericInput(_a) {
26710
27007
  : notInteractiveChipClassName), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsx(CaptionText, { children: balanceFormatted }), jsxRuntime.jsx(Chip, { label: "Max" })] }) }))] }))] }));
26711
27008
  }
26712
27009
 
26713
- function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }) {
27010
+ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected = false, }) {
26714
27011
  const [isInputVisible, setIsInputVisible] = React$1.useState(false);
26715
27012
  const [inputValue, setInputValue] = React$1.useState(String(value !== null && value !== void 0 ? value : 0));
26716
27013
  React$1.useEffect(() => {
@@ -26740,11 +27037,14 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSel
26740
27037
  }, [onChange]);
26741
27038
  const handleKeyDown = React$1.useCallback((e) => {
26742
27039
  // block unwanted (but still valid) characters
26743
- if (["e", "E", "+", "-"].includes(e.key))
26744
- return e.preventDefault();
27040
+ if (["e", "E", "+", "-"].includes(e.key)) {
27041
+ e.preventDefault();
27042
+ return;
27043
+ }
26745
27044
  // close input when pressing escape
26746
- if (e.key === "Escape")
26747
- return handleCloseInput();
27045
+ if (e.key === "Escape") {
27046
+ handleCloseInput();
27047
+ }
26748
27048
  }, []);
26749
27049
  const handleOpenInput = React$1.useCallback(() => {
26750
27050
  setIsInputVisible(true);
@@ -26752,7 +27052,7 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSel
26752
27052
  const handleCloseInput = React$1.useCallback(() => {
26753
27053
  setIsInputVisible(false);
26754
27054
  }, []);
26755
- return (jsxRuntime.jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.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-medium tw-leading-[10px] -tw-outline-offset-2 placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin", value === 0 || value === undefined
27055
+ return (jsxRuntime.jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.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
26756
27056
  ? "tw-text-grey-600"
26757
27057
  : "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, jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === "percentage" ? "%" : "$" })] }), jsxRuntime.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: jsxRuntime.jsx(Chip, { icon: jsxRuntime.jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsxRuntime.jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsxRuntime.jsx("form", { onSubmit: (e) => {
26758
27058
  e.preventDefault();
@@ -26894,7 +27194,7 @@ function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarnin
26894
27194
  if (event.key === "Enter" || event.key === " ") {
26895
27195
  handleUpdateValue();
26896
27196
  }
26897
- }, 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-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin"), children: jsxRuntime.jsx(CircleMinusIcon, {}) }), jsxRuntime.jsxs("div", { className: "tw-relative", children: [jsxRuntime.jsx(Input, { step: 0.1, min: min, max: max, isWarning: isWarning, defaultValue: initialValue || "0", placeholder: "0", showIcon: false, type: "number", inputRef: inputRef, onChange: (event) => {
27197
+ }, 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: jsxRuntime.jsx(CircleMinusIcon, {}) }), jsxRuntime.jsxs("div", { className: "tw-relative", children: [jsxRuntime.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) => {
26898
27198
  var _a;
26899
27199
  if (!inputDecoratorRef.current || !inputRef.current)
26900
27200
  return;
@@ -26919,7 +27219,7 @@ function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarnin
26919
27219
  if (event.key === "Enter" || event.key === " ") {
26920
27220
  handleUpdateValue();
26921
27221
  }
26922
- }, 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-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin"), children: jsxRuntime.jsx(CirclePlusIcon, {}) })] })] }) }));
27222
+ }, 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: jsxRuntime.jsx(CirclePlusIcon, {}) })] })] }) }));
26923
27223
  }
26924
27224
 
26925
27225
  const imageClass = "tw-w-[40px] tw-aspect-square tw-flex tw-items-center tw-justify-center";
@@ -26951,9 +27251,9 @@ const outlineWidthMap = {
26951
27251
  };
26952
27252
  function AssetsButton({ chain, token, onClick, variant = "primary", isLoading = false, tooltip, }) {
26953
27253
  var _a;
26954
- const defaultBgColor = `var(${themeTypesKeys[themeKeyVariantMap[variant]].cssVariable})`;
27254
+ const defaultBgColor = `var(${themeKeysToCssVariables.color[themeKeyVariantMap[variant]].cssVariable})`;
26955
27255
  const outlineWidth = outlineWidthMap[isLoading ? "loading" : !!token && !!chain ? "full" : "empty"];
26956
- const chainBgColor = (_a = (chain && chain.bgColor)) !== null && _a !== void 0 ? _a : defaultBgColor;
27256
+ const chainBgColor = (_a = chain === null || chain === void 0 ? void 0 : chain.bgColor) !== null && _a !== void 0 ? _a : defaultBgColor;
26957
27257
  const tokenBgColor = (chain && token && !isLoading && token.bgColor) || defaultBgColor;
26958
27258
  const bgGradient = React$1.useMemo(() => {
26959
27259
  if (!chain || isLoading) {
@@ -26982,7 +27282,7 @@ function AssetsButton({ chain, token, onClick, variant = "primary", isLoading =
26982
27282
  function FilterButton({ selected, numApplied = 0, onClick, }) {
26983
27283
  return (jsxRuntime.jsxs("div", { className: "tw-relative", children: [jsxRuntime.jsx(Button$1, { variant: "tertiary", size: "md", className: cn(selected
26984
27284
  ? "!tw-bg-grey-500 !tw-text-grey-800"
26985
- : "!tw-border-transparent !tw-bg-grey-800 !tw-text-grey-500"), onClick: onClick, children: jsxRuntime.jsx(FilterIcon, {}) }), numApplied > 0 && (jsxRuntime.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-[#E4FE53] tw-text-center tw-leading-[1] tw-text-grey-200 dark:tw-text-grey-900", children: jsxRuntime.jsx(CaptionText, { children: numApplied }) }))] }));
27285
+ : "!tw-border-transparent !tw-bg-grey-800 !tw-text-grey-500"), onClick: onClick, children: jsxRuntime.jsx(FilterIcon, {}) }), numApplied > 0 && (jsxRuntime.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: jsxRuntime.jsx(CaptionText, { children: numApplied }) }))] }));
26986
27286
  }
26987
27287
 
26988
27288
  function SettingsButton({ label, isSelected = false, onClick, }) {
@@ -26990,9 +27290,10 @@ function SettingsButton({ label, isSelected = false, onClick, }) {
26990
27290
  }
26991
27291
 
26992
27292
  const IconButton = React$1.forwardRef((_a, ref) => {
26993
- var { icon } = _a, props = __rest$1(_a, ["icon"]);
26994
- return (jsxRuntime.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", props.disabled ? "tw-text-grey-600" : "tw-text-grey-300", props.className), children: icon })));
27293
+ var { icon, disabled = false } = _a, props = __rest$1(_a, ["icon", "disabled"]);
27294
+ return (jsxRuntime.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 })));
26995
27295
  });
27296
+ IconButton.displayName = "IconButton";
26996
27297
 
26997
27298
  function AssetsView({ chains, favoriteTokens, popularTokens, userTokens, }) {
26998
27299
  const matchesMobileLg = useMediaQuery(MEDIA_QUERIES.MOBILE_LG.media);
@@ -62297,27 +62598,7 @@ function WalletsView() {
62297
62598
  return (jsxRuntime.jsxs(Modal, { maxHeight: true, children: [jsxRuntime.jsxs(ModalContent, { addGap: true, children: [jsxRuntime.jsx("div", { className: "tw-px-squid-xs tw-py-squid-xxs", children: jsxRuntime.jsx(Input, { placeholder: "Select your wallet" }) }), jsxRuntime.jsxs("ul", { className: "tw-flex tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-py-squid-xxs", children: [jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", detail: "Installed", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", detail: "Installed", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), jsxRuntime.jsx("span", { className: "tw-text-material-light-thin", children: jsxRuntime.jsx(ModalContentDivider, {}) }), jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", subtitle: "Connect with an Injected Wallet", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Browser Extension" }), mainImageUrl: "/assets/images/avatar.png" }), jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), " ", jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), " ", jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" }), " ", jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Rainbow" }), mainImageUrl: "/assets/images/avatar.png" }), jsxRuntime.jsx(ListItem, { icon: jsxRuntime.jsx("span", { className: "tw-text-material-light-average", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), className: "tw-bg-transparent tw-text-royal-400", itemTitle: jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px] tw-text-grey-300", children: "Metamask" }), mainImageUrl: "/assets/images/punks.png" })] })] }), jsxRuntime.jsx(Button$1, { size: "lg", variant: "secondary", label: "Cancel" })] }));
62298
62599
  }
62299
62600
 
62300
- // list of the theme variables that need to be replaced
62301
- // from the user readable theme config
62302
- // to the internal theme config
62303
- const themeKeysToReplace = [
62304
- {
62305
- userKey: "content",
62306
- internalKey: "grey",
62307
- },
62308
- {
62309
- userKey: "accent",
62310
- internalKey: "royal",
62311
- },
62312
- {
62313
- userKey: "status-warning",
62314
- internalKey: "status-partial",
62315
- },
62316
- {
62317
- userKey: "highlight",
62318
- internalKey: "volt",
62319
- },
62320
- ];
62601
+ /* eslint-disable @typescript-eslint/prefer-reduce-type-parameter */
62321
62602
  /**
62322
62603
  * Parses the user readable config to css variables
62323
62604
  * Also maps the public theme variables to the internal theme variables
@@ -62339,22 +62620,12 @@ const themeKeysToReplace = [
62339
62620
  */
62340
62621
  const parseSquidTheme = (userTheme) => {
62341
62622
  var _a, _b;
62342
- if (!userTheme)
62623
+ if (userTheme == null)
62343
62624
  return undefined;
62344
- let squidTheme = Object.entries(userTheme).reduce((internalKeys, [userKey, userValue]) => {
62345
- // content-* -> grey-*
62346
- // accent-* -> royal-*
62347
- const keyToReplace = themeKeysToReplace.find((k) => userKey.includes(k.userKey));
62348
- if (keyToReplace) {
62349
- const newKey = userKey.replace(keyToReplace.userKey, keyToReplace.internalKey);
62350
- internalKeys[newKey] = userValue;
62351
- }
62352
- else {
62353
- internalKeys[userKey] = userValue;
62354
- }
62355
- return internalKeys;
62356
- }, {});
62357
- // add material-{light,dark}-{thin,average,thick} colors to the squid theme object
62625
+ console.log({
62626
+ userTheme,
62627
+ });
62628
+ // add material-{light,dark}-{thin,average,thick} colors to the squid theme object
62358
62629
  // using the following formula:
62359
62630
  // material-light-thin -> grey-100 + 10% opacity
62360
62631
  // material-light-average -> grey-100 + 33% opacity
@@ -62363,50 +62634,38 @@ const parseSquidTheme = (userTheme) => {
62363
62634
  // material-dark-average -> grey-900 + 33% opacity
62364
62635
  // material-dark-thick -> grey-900 + 66% opacity
62365
62636
  const materialVariants = {
62366
- "material-light-thin": getHexColorFromOpacityPercentage(squidTheme["grey-100"], 0.1),
62367
- "material-light-average": getHexColorFromOpacityPercentage(squidTheme["grey-100"], 0.33),
62368
- "material-light-thick": getHexColorFromOpacityPercentage(squidTheme["grey-100"], 0.66),
62369
- "material-dark-thin": getHexColorFromOpacityPercentage(squidTheme["grey-900"], 0.1),
62370
- "material-dark-average": getHexColorFromOpacityPercentage(squidTheme["grey-900"], 0.33),
62371
- "material-dark-thick": getHexColorFromOpacityPercentage(squidTheme["grey-900"], 0.66),
62637
+ "material-light-thin": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.1),
62638
+ "material-light-average": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.33),
62639
+ "material-light-thick": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.66),
62640
+ "material-dark-thin": getHexColorFromOpacityPercentage(userTheme.color["grey-900"], 0.1),
62641
+ "material-dark-average": getHexColorFromOpacityPercentage(userTheme.color["grey-900"], 0.33),
62642
+ "material-dark-thick": getHexColorFromOpacityPercentage(userTheme.color["grey-900"], 0.66),
62372
62643
  };
62373
- squidTheme = Object.assign(Object.assign({}, squidTheme), materialVariants);
62374
- const styleKeys = Object.keys(themeTypesKeys);
62375
- const parsed = styleKeys.map((sk) => {
62376
- const themeItem = themeTypesKeys[sk];
62377
- let userValue = squidTheme[sk];
62378
- return {
62379
- [themeItem.cssVariable]: userValue,
62380
- };
62381
- });
62382
- // adds a variant with 0.05 opacity for each color
62383
- // will result in variables like this:
62384
- // var(--squid-theme-grey-100-005) --> grey-100 with 0.05 opacity
62385
- // styleKeys.forEach((sk) => {
62386
- // const themeItem = themeTypesKeys[sk]
62387
- // const valueWith005Opacity = getHexColorFromOpacityPercentage(
62388
- // style[sk], // i.e "#ffffff"
62389
- // 0.05,
62390
- // )
62391
- // // { "--squid-theme-grey-100-005": "#ffffff80" }
62392
- // parsed.push({
62393
- // [`${themeItem.cssVariable}-005`]: valueWith005Opacity,
62394
- // })
62395
- // })
62396
- parsed.push({
62397
- [themeTypesKeys["grey-100-005"].cssVariable]: getHexColorFromOpacityPercentage(squidTheme["grey-100"], 0.05),
62398
- });
62399
- // color representing the blend of material-light and grey-900
62400
- parsed.push({
62401
- [themeTypesKeys["material-light-blend-grey-900"].cssVariable]: (_a = blendColors(squidTheme["material-light-thin"], squidTheme["grey-900"])) !== null && _a !== void 0 ? _a : "",
62402
- });
62403
- // color representing the blend of material-light and grey-300
62404
- parsed.push({
62405
- [themeTypesKeys["material-light-blend-grey-800"].cssVariable]: (_b = blendColors(squidTheme["material-light-thin"], squidTheme["grey-800"])) !== null && _b !== void 0 ? _b : "",
62406
- });
62407
- return parsed.reduce((a, v) => {
62408
- const key = Object.keys(v)[0];
62409
- return Object.assign(Object.assign({}, a), { [key]: v[key] });
62644
+ const opacityVariants = {
62645
+ // opacity variants
62646
+ "grey-100-005": getHexColorFromOpacityPercentage(userTheme.color["grey-100"], 0.05),
62647
+ // color representing the blend of material-light and grey-900
62648
+ "material-light-blend-grey-900": (_a = blendColors(materialVariants["material-light-thin"], userTheme.color["grey-900"])) !== null && _a !== void 0 ? _a : "",
62649
+ // color representing the blend of material-light and grey-300
62650
+ "material-light-blend-grey-800": (_b = blendColors(materialVariants["material-light-thin"], userTheme.color["grey-800"])) !== null && _b !== void 0 ? _b : "",
62651
+ };
62652
+ // Adds the internal colors to the user theme
62653
+ const internalTheme = Object.assign(Object.assign({}, userTheme), { color: Object.assign(Object.assign(Object.assign({}, userTheme.color), materialVariants), opacityVariants) });
62654
+ // return flatten(
62655
+ // {
62656
+ // ...userTheme,
62657
+ // colors: {
62658
+ // ...userTheme,
62659
+ // ...materialVariants,
62660
+ // ...opacityVariants,
62661
+ // },
62662
+ // },
62663
+ // {
62664
+ // prefix: SQUID_THEME_CSS_VARIABLE_PREFIX,
62665
+ // },
62666
+ // );
62667
+ return flatten(internalTheme, {
62668
+ prefix: THEME_CSS_VARIABLE_PREFIX,
62410
62669
  });
62411
62670
  };
62412
62671
  /**
@@ -62425,20 +62684,21 @@ function getHexColorFromOpacityPercentage(color, opacity) {
62425
62684
  .padStart(2, "0")).toUpperCase();
62426
62685
  }
62427
62686
  function hexToRgb(hex) {
62687
+ var _a;
62428
62688
  // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
62429
- let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
62430
- hex = hex.replace(shorthandRegex, function (m, r, g, b, a) {
62431
- return r + r + g + g + b + b + (a ? a + a : "");
62689
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
62690
+ const cleanHex = hex.replace(shorthandRegex, function (m, r, g, b, a) {
62691
+ return r + r + g + g + b + b + (a != null ? a + a : "");
62432
62692
  });
62433
- let result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(hex);
62434
- return result
62435
- ? {
62436
- r: parseInt(result[1], 16),
62437
- g: parseInt(result[2], 16),
62438
- b: parseInt(result[3], 16),
62439
- a: result[4] ? parseInt(result[4], 16) / 255 : 1,
62440
- }
62441
- : null;
62693
+ 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 : []);
62694
+ if (r == null || g == null || b == null)
62695
+ return null;
62696
+ return {
62697
+ r: parseInt(r, 16),
62698
+ g: parseInt(g, 16),
62699
+ b: parseInt(b, 16),
62700
+ a: a != null ? parseInt(a, 16) / 255 : 1,
62701
+ };
62442
62702
  }
62443
62703
  function rgbToHex(r, g, b) {
62444
62704
  return ("#" +
@@ -62455,19 +62715,20 @@ function rgbToHex(r, g, b) {
62455
62715
  // let resultingColor = blendColors(foregroundColor, bgColor)
62456
62716
  // console.log(resultingColor) // Output: ~#2f3033
62457
62717
  function blendColors(foreground, background) {
62458
- let fg = hexToRgb(foreground);
62459
- let bg = hexToRgb(background);
62460
- if (!fg || !bg)
62718
+ const fg = hexToRgb(foreground);
62719
+ const bg = hexToRgb(background);
62720
+ if (fg == null || bg == null)
62461
62721
  return null;
62462
- let r = Math.round(fg.r * fg.a + bg.r * (1 - fg.a));
62463
- let g = Math.round(fg.g * fg.a + bg.g * (1 - fg.a));
62464
- let b = Math.round(fg.b * fg.a + bg.b * (1 - fg.a));
62722
+ const r = Math.round(fg.r * fg.a + bg.r * (1 - fg.a));
62723
+ const g = Math.round(fg.g * fg.a + bg.g * (1 - fg.a));
62724
+ const b = Math.round(fg.b * fg.a + bg.b * (1 - fg.a));
62465
62725
  return rgbToHex(r, g, b);
62466
62726
  }
62467
62727
 
62468
- function SquidConfigProvider({ theme = lightTheme, children, themeType = "light", }) {
62728
+ function ThemeProvider(_a) {
62729
+ var { theme = lightTheme, children, themeType = "light" } = _a, props = __rest$1(_a, ["theme", "children", "themeType"]);
62469
62730
  const parsedStyle = parseSquidTheme(theme);
62470
- return (jsxRuntime.jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-h-d-screen tw-group tw-relative tw-flex tw-font-geist mobile-lg:tw-h-auto", children: children }));
62731
+ return (jsxRuntime.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 })));
62471
62732
  }
62472
62733
 
62473
62734
  exports.ActionLayout = ActionLayout;
@@ -62544,6 +62805,8 @@ exports.CircleX = CircleX;
62544
62805
  exports.CircleXFilledIcon = CircleXFilledIcon;
62545
62806
  exports.ClockOutlineIcon = ClockOutlineIcon;
62546
62807
  exports.ClockSolidIcon = ClockSolidIcon;
62808
+ exports.CodeBracketsIcon = CodeBracketsIcon;
62809
+ exports.CodeSolidSquareIcon = CodeSolidSquareIcon;
62547
62810
  exports.CoinsAddIcon = CoinsAddIcon;
62548
62811
  exports.CoinsIcon = CoinsIcon;
62549
62812
  exports.CoinsOutlinedIcon = CoinsOutlinedIcon;
@@ -62551,11 +62814,14 @@ exports.Collapse = Collapse;
62551
62814
  exports.CollapsibleMenu = CollapsibleMenu;
62552
62815
  exports.CollectionIcon = CollectionIcon;
62553
62816
  exports.ColorPaletteIcon = ColorPaletteIcon;
62817
+ exports.CommandIcon = CommandIcon;
62554
62818
  exports.CompassRoundOutlinedIcon = CompassRoundOutlinedIcon;
62555
62819
  exports.CompassRoundSolidIcon = CompassRoundSolidIcon;
62556
62820
  exports.ConsoleIcon = ConsoleIcon;
62557
62821
  exports.Copy = Copy;
62822
+ exports.CopyIcon = CopyIcon;
62558
62823
  exports.CrossAnimatedIcon = CrossAnimatedIcon;
62824
+ exports.CrossedOutSunSolidIcon = CrossedOutSunSolidIcon;
62559
62825
  exports.DashboardFast = DashboardFast;
62560
62826
  exports.DescriptionBlocks = DescriptionBlocks;
62561
62827
  exports.DetailsToolbar = DetailsToolbar;
@@ -62584,6 +62850,7 @@ exports.FeeButton = FeeButton;
62584
62850
  exports.FeesAction = FeesAction;
62585
62851
  exports.FeesLines = FeesLines;
62586
62852
  exports.FeesTotal = FeesTotal;
62853
+ exports.FileDownloadIcon = FileDownloadIcon;
62587
62854
  exports.FilledHeartIcon = FilledHeartIcon;
62588
62855
  exports.FilterAscendingIcon = FilterAscendingIcon;
62589
62856
  exports.FilterButton = FilterButton;
@@ -62612,6 +62879,7 @@ exports.InteractionHeader = InteractionHeader;
62612
62879
  exports.InteractionProperties = InteractionProperties;
62613
62880
  exports.InteractionTransactionView = InteractionTransactionView;
62614
62881
  exports.Join = Join;
62882
+ exports.LaptopIcon = LaptopIcon;
62615
62883
  exports.LightningIcon = LightningIcon;
62616
62884
  exports.LimitIcon = LimitIcon;
62617
62885
  exports.LinkIcon = LinkIcon;
@@ -62638,6 +62906,7 @@ exports.NotAllowedIcon = NotAllowedIcon;
62638
62906
  exports.NumericInput = NumericInput;
62639
62907
  exports.PathSquareIcon = PathSquareIcon;
62640
62908
  exports.PercentIcon = PercentIcon;
62909
+ exports.PhoneIcon = PhoneIcon;
62641
62910
  exports.PieChartIcon = PieChartIcon;
62642
62911
  exports.PipeSeparator = PipeSeparator;
62643
62912
  exports.PlusIcon = PlusIcon;
@@ -62676,13 +62945,13 @@ exports.SparklesIcon = SparklesIcon;
62676
62945
  exports.SquareArrowCenter = SquareArrowCenter;
62677
62946
  exports.SquareArrowTopLeftIcon = SquareArrowTopLeftIcon;
62678
62947
  exports.SquareArrowTopRight2Icon = SquareArrowTopRight2Icon;
62679
- exports.SquidConfigProvider = SquidConfigProvider;
62680
62948
  exports.SquidLogo = SquidLogo;
62681
62949
  exports.StakeAction = StakeAction;
62682
62950
  exports.StartAction = StartAction;
62683
62951
  exports.StocksIcon = StocksIcon;
62684
62952
  exports.SuccessAction = SuccessAction;
62685
62953
  exports.SunIcon = SunIcon;
62954
+ exports.SunOutlinedIcon = SunOutlinedIcon;
62686
62955
  exports.SunriseIcon = SunriseIcon;
62687
62956
  exports.SunriseSmallIcon = SunriseSmallIcon;
62688
62957
  exports.SwapAction = SwapAction;
@@ -62705,6 +62974,7 @@ exports.Switch = Switch;
62705
62974
  exports.TagIcon = TagIcon;
62706
62975
  exports.TagIconFilled = TagIconFilled;
62707
62976
  exports.TextSkeleton = TextSkeleton;
62977
+ exports.ThemeProvider = ThemeProvider;
62708
62978
  exports.ThumbsUp = ThumbsUp;
62709
62979
  exports.Tick = Tick;
62710
62980
  exports.TimeFliesIcon = TimeFliesIcon;
@@ -62737,6 +63007,7 @@ exports.XSocial = XSocial;
62737
63007
  exports.baseTailwindConfig = baseTailwindConfig;
62738
63008
  exports.cn = cn;
62739
63009
  exports.darkTheme = darkTheme;
63010
+ exports.defaultTheme = defaultTheme;
62740
63011
  exports.lightTheme = lightTheme;
62741
63012
  exports.linkActionTimelineProps = linkActionTimelineProps;
62742
63013
  exports.statusTextClassMap = statusTextClassMap;
@@ -62746,4 +63017,5 @@ exports.useMediaQuery = useMediaQuery;
62746
63017
  exports.useOnResize = useOnResize;
62747
63018
  exports.useRect = useRect;
62748
63019
  exports.useTimer = useTimer;
63020
+ exports.useUserTheme = useUserTheme;
62749
63021
  exports.useVersion = useVersion;