@rango-dev/widget-embedded 0.28.3-next.5 → 0.28.3-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +12 -21
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +4 -7
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +60 -105
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +12 -21
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts +16 -28
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +32 -56
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HistoryGroupedList/HistoryGroupedList.styles.d.ts +24 -42
- package/dist/components/HistoryGroupedList/HistoryGroupedList.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +16 -28
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/PageContainer.d.ts +4 -7
- package/dist/components/Layout/PageContainer.d.ts.map +1 -1
- package/dist/components/Layout/ScrollableArea.d.ts +4 -7
- package/dist/components/Layout/ScrollableArea.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +4 -7
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +56 -98
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts +16 -28
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +33 -57
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +85 -148
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts +20 -35
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +8 -14
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +16 -28
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +40 -70
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +20 -35
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +16 -28
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.styles.d.ts +12 -21
- package/dist/components/Quotes/Quotes.styles.d.ts.map +1 -1
- package/dist/components/RefreshModal/RefreshModal.styles.d.ts +5 -8
- package/dist/components/RefreshModal/RefreshModal.styles.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts +4 -7
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +12 -21
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +20 -35
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +60 -105
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +12 -21
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +8 -14
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
- package/dist/components/SwitchFromAndTo/SwitchFromAndTo.styles.d.ts +8 -14
- package/dist/components/SwitchFromAndTo/SwitchFromAndTo.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +72 -126
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +16 -28
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.styles.d.ts +4 -7
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.styles.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts +4 -7
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +8 -14
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.styles.d.ts +8 -14
- package/dist/containers/Inputs/Inputs.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +12 -21
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +5 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +7 -10
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +2 -1
- package/dist/utils/ui.d.ts.map +1 -1
- package/dist/widget-embedded.build.json +1 -1
- package/package.json +2 -2
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +86 -23
- package/src/components/ConfirmWalletsModal/WalletList.tsx +4 -2
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -0
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +1 -1
- package/src/components/Quote/Quote.styles.ts +5 -5
- package/src/components/TokenList/TokenList.tsx +8 -13
- package/src/store/wallets.ts +7 -2
- package/src/types/config.ts +7 -3
- package/src/utils/colors.ts +160 -117
- package/src/utils/ui.ts +28 -33
package/src/utils/ui.ts
CHANGED
|
@@ -8,14 +8,15 @@ import {
|
|
|
8
8
|
} from '@rango-dev/ui';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { expandToGenerateThemeColors } from '../utils/colors';
|
|
12
12
|
import { toHash } from '../utils/hash';
|
|
13
13
|
|
|
14
14
|
import { THEME_CLASS_NAME_PREFIX } from './configs';
|
|
15
15
|
|
|
16
|
+
type Tokens = Parameters<typeof createTheme>[0];
|
|
16
17
|
interface CustomizedThemeValues {
|
|
17
18
|
id: string;
|
|
18
|
-
tokens:
|
|
19
|
+
tokens: Tokens;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
interface CustomizedTheme {
|
|
@@ -27,48 +28,42 @@ export function customizedThemeTokens(
|
|
|
27
28
|
colors: WidgetTheme['colors']
|
|
28
29
|
): CustomizedTheme {
|
|
29
30
|
const baseColors = baseThemeTokens.colors;
|
|
31
|
+
const baseDarkColors = {
|
|
32
|
+
...baseColors,
|
|
33
|
+
...defaultDarkColors,
|
|
34
|
+
};
|
|
35
|
+
let lightTheme: CustomizedTheme['light'] = undefined;
|
|
36
|
+
let darkTheme: CustomizedTheme['dark'] = undefined;
|
|
30
37
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
...defaultDarkColors,
|
|
35
|
-
},
|
|
36
|
-
true,
|
|
37
|
-
colors?.dark
|
|
38
|
-
);
|
|
39
|
-
const lightColorsWithDefaults = generateColors(
|
|
40
|
-
baseColors,
|
|
41
|
-
false,
|
|
42
|
-
colors?.light
|
|
43
|
-
);
|
|
44
|
-
const hasDefaultDarkColors = Object.keys(darkColorsWithDefaults).length > 0;
|
|
45
|
-
const hasDefaultLightColors = Object.keys(lightColorsWithDefaults).length > 0;
|
|
46
|
-
|
|
47
|
-
let light: CustomizedTheme['light'] = undefined;
|
|
48
|
-
let dark: CustomizedTheme['dark'] = undefined;
|
|
49
|
-
|
|
50
|
-
if (hasDefaultLightColors) {
|
|
51
|
-
const tokens = { colors: lightColorsWithDefaults };
|
|
38
|
+
if (colors?.light) {
|
|
39
|
+
const lightColors = expandToGenerateThemeColors(baseColors, colors.light);
|
|
40
|
+
const tokens = { colors: lightColors };
|
|
52
41
|
const id = `${THEME_CLASS_NAME_PREFIX}-light-${toHash(tokens)}`;
|
|
53
|
-
|
|
42
|
+
lightTheme = {
|
|
54
43
|
id,
|
|
55
|
-
tokens,
|
|
44
|
+
tokens: tokens as Tokens,
|
|
56
45
|
};
|
|
57
46
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
|
|
48
|
+
if (colors?.dark) {
|
|
49
|
+
const darkColors = expandToGenerateThemeColors(
|
|
50
|
+
baseDarkColors,
|
|
51
|
+
colors.dark,
|
|
52
|
+
{
|
|
53
|
+
reverseNeutralRange: true,
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
const tokens = { colors: darkColors };
|
|
62
57
|
const id = `${THEME_CLASS_NAME_PREFIX}-dark-${toHash(tokens)}`;
|
|
63
|
-
|
|
58
|
+
darkTheme = {
|
|
64
59
|
id,
|
|
65
|
-
tokens,
|
|
60
|
+
tokens: tokens as Tokens,
|
|
66
61
|
};
|
|
67
62
|
}
|
|
68
63
|
|
|
69
64
|
return {
|
|
70
|
-
light,
|
|
71
|
-
dark,
|
|
65
|
+
light: lightTheme,
|
|
66
|
+
dark: darkTheme,
|
|
72
67
|
};
|
|
73
68
|
}
|
|
74
69
|
|