@aurora-is-near/intents-swap-widget 3.14.1 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{config-QBojKcju.js → config-DWuCYXia.js} +7 -7
- package/dist/{config-QBojKcju.js.map → config-DWuCYXia.js.map} +1 -1
- package/dist/config.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/ext/alchemy/index.js +1 -1
- package/dist/ext/index.js +1 -1
- package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
- package/dist/features/BalanceRpcLoader/index.js +1 -1
- package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
- package/dist/features/ChainsDropdown/AllNetworksIcon.js +1 -1
- package/dist/features/ChainsDropdown/AllNetworksIcon.js.map +1 -1
- package/dist/features/ChainsDropdown/index.js +2 -9
- package/dist/features/ChainsDropdown/index.js.map +1 -1
- package/dist/features/DepositMethodSwitcher.js +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +1 -1
- package/dist/features/SendAddress/index.js +1 -1
- package/dist/features/SendAddress/useNotification.js +1 -1
- package/dist/features/SubmitButton/index.js +1 -1
- package/dist/features/SuccessScreen/CheckIcon.js +1 -1
- package/dist/features/SuccessScreen/CheckIcon.js.map +1 -1
- package/dist/features/SuccessScreen/index.js +1 -1
- package/dist/features/SwapDirectionSwitcher.js +1 -1
- package/dist/features/SwapQuote/SwapQuote.js +1 -1
- package/dist/features/SwapQuote/index.js +1 -1
- package/dist/features/TokenInput/TokenInput.js +1 -1
- package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
- package/dist/features/TokenInput/TokenInputSource.js +1 -1
- package/dist/features/TokenInput/TokenInputTarget.js +1 -1
- package/dist/features/TokenInput/WalletBalance.js +1 -1
- package/dist/features/TokenInput/hooks/index.js +1 -1
- package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
- package/dist/features/TokenInput/index.js +1 -1
- package/dist/features/TokensList/TokenItem.js +1 -1
- package/dist/features/TokensList/TokensList.js +1 -1
- package/dist/features/TokensList/index.js +1 -1
- package/dist/features/TokensModal.js +1 -1
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +1 -1
- package/dist/features/WalletCompatibilityCheck/index.js +1 -1
- package/dist/features/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAllTokens.js +1 -1
- package/dist/hooks/useChains.js +1 -1
- package/dist/hooks/useCompatibilityCheck.js +1 -1
- package/dist/hooks/useDefaultToken.js +1 -1
- package/dist/hooks/useExternalDepositStatus/index.js +1 -1
- package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
- package/dist/hooks/useIntentsBalance.js +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
- package/dist/hooks/useMakeDepositAddress.js +1 -1
- package/dist/hooks/useMakeIntentsTransfer.js +1 -1
- package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
- package/dist/hooks/useMakeQuote.js +1 -1
- package/dist/hooks/useMakeQuoteTransfer.js +1 -1
- package/dist/hooks/useMakeTransfer.js +1 -1
- package/dist/hooks/useMergedBalance.js +1 -1
- package/dist/hooks/useSwitchChain.js +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/hooks/useTokenInputPair.js +1 -1
- package/dist/hooks/useTokens.js +1 -1
- package/dist/hooks/useTokensFiltered.js +1 -1
- package/dist/hooks/useTokensIntentsUnique.js +1 -1
- package/dist/index.js +1 -1
- package/dist/machine/effects/index.js +1 -1
- package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
- package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
- package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
- package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
- package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
- package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
- package/dist/machine/effects/useWalletConnEffect.js +1 -1
- package/dist/machine/events/index.js +1 -1
- package/dist/machine/events/tokenSelect.js +1 -1
- package/dist/machine/events/validateInputAndMoveTo.js +1 -1
- package/dist/machine/events/validateInputs.js +1 -1
- package/dist/machine/index.js +1 -1
- package/dist/machine/snap.js +1 -1
- package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
- package/dist/machine/subscriptions/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/ThemeProvider.js +1 -1
- package/dist/theme/createColorPalette.d.ts +4 -1
- package/dist/theme/createColorPalette.js +26 -29
- package/dist/theme/createColorPalette.js.map +1 -1
- package/dist/types/theme.d.ts +1 -1
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +1 -1
- package/src/features/ChainsDropdown/AllNetworksIcon.tsx +1 -1
- package/src/features/ChainsDropdown/index.tsx +1 -5
- package/src/features/SuccessScreen/CheckIcon.tsx +1 -1
- package/src/theme/ThemeProvider.tsx +13 -9
- package/src/theme/createColorPalette.ts +13 -17
- package/src/types/theme.ts +1 -1
|
@@ -2,12 +2,15 @@ import chroma from 'chroma-js';
|
|
|
2
2
|
import { Hsluv } from 'hsluv';
|
|
3
3
|
import { ColorPalette } from '../types/theme';
|
|
4
4
|
|
|
5
|
-
const VALUE_STOP = 500;
|
|
6
|
-
|
|
7
5
|
// All available stops (including 0 and 1000 for calculation)
|
|
8
6
|
const ALL_STOPS = [
|
|
9
7
|
0, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950, 1000,
|
|
10
|
-
];
|
|
8
|
+
] as const;
|
|
9
|
+
|
|
10
|
+
const LIGHTNESS_MIN = 0;
|
|
11
|
+
const LIGHTNESS_MAX = 100;
|
|
12
|
+
|
|
13
|
+
export type ColorStop = (typeof ALL_STOPS)[number];
|
|
11
14
|
|
|
12
15
|
/**
|
|
13
16
|
* Chroma-js based implementation for stable palette generation.
|
|
@@ -18,14 +21,8 @@ const ALL_STOPS = [
|
|
|
18
21
|
export const createColorPalette = (
|
|
19
22
|
baseColor: `#${string}`,
|
|
20
23
|
mode: 'light' | 'dark',
|
|
24
|
+
colorStop: ColorStop,
|
|
21
25
|
): ColorPalette => {
|
|
22
|
-
// 1. Create hue scale
|
|
23
|
-
const valueStopIndex = ALL_STOPS.indexOf(VALUE_STOP);
|
|
24
|
-
|
|
25
|
-
if (valueStopIndex === -1) {
|
|
26
|
-
throw new Error(`Invalid valueStop: ${VALUE_STOP}`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
26
|
const hueScale = ALL_STOPS.map((stop) => {
|
|
30
27
|
const tweakValue = 0;
|
|
31
28
|
|
|
@@ -49,9 +46,9 @@ export const createColorPalette = (
|
|
|
49
46
|
|
|
50
47
|
// Create the three anchor points
|
|
51
48
|
const distributionAnchors = [
|
|
52
|
-
{ stop: 0, tweak:
|
|
53
|
-
{ stop:
|
|
54
|
-
{ stop: 1000, tweak:
|
|
49
|
+
{ stop: 0, tweak: LIGHTNESS_MAX },
|
|
50
|
+
{ stop: colorStop, tweak: lightnessValue },
|
|
51
|
+
{ stop: 1000, tweak: LIGHTNESS_MIN },
|
|
55
52
|
];
|
|
56
53
|
|
|
57
54
|
// Interpolate for missing stops
|
|
@@ -67,7 +64,7 @@ export const createColorPalette = (
|
|
|
67
64
|
let leftAnchor;
|
|
68
65
|
let rightAnchor;
|
|
69
66
|
|
|
70
|
-
if (stop <
|
|
67
|
+
if (stop < colorStop) {
|
|
71
68
|
[leftAnchor, rightAnchor] = distributionAnchors;
|
|
72
69
|
} else {
|
|
73
70
|
[leftAnchor, rightAnchor] = distributionAnchors.slice(1);
|
|
@@ -88,7 +85,7 @@ export const createColorPalette = (
|
|
|
88
85
|
});
|
|
89
86
|
|
|
90
87
|
const hexColors = ALL_STOPS.map((stop, stopIndex): string => {
|
|
91
|
-
if (stop ===
|
|
88
|
+
if (stop === colorStop) {
|
|
92
89
|
return baseColor.toUpperCase();
|
|
93
90
|
}
|
|
94
91
|
|
|
@@ -126,7 +123,7 @@ export const createColorPalette = (
|
|
|
126
123
|
return newColor.hex().toUpperCase();
|
|
127
124
|
});
|
|
128
125
|
|
|
129
|
-
const themeValues = mode === '
|
|
126
|
+
const themeValues = mode === 'dark' ? hexColors : [...hexColors].reverse();
|
|
130
127
|
|
|
131
128
|
const getStopValue = (index: number): string => {
|
|
132
129
|
const value = themeValues[index];
|
|
@@ -150,6 +147,5 @@ export const createColorPalette = (
|
|
|
150
147
|
800: getStopValue(9),
|
|
151
148
|
900: getStopValue(10),
|
|
152
149
|
950: getStopValue(11),
|
|
153
|
-
975: getStopValue(12),
|
|
154
150
|
};
|
|
155
151
|
};
|