@rango-dev/widget-embedded 0.24.2-next.5 → 0.24.2-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.
Files changed (55) hide show
  1. package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -1
  2. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +1 -0
  3. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
  4. package/dist/components/Quote/Quote.d.ts.map +1 -1
  5. package/dist/components/Quote/Quote.types.d.ts +3 -0
  6. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  7. package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
  8. package/dist/components/Quotes/Quotes.d.ts.map +1 -1
  9. package/dist/components/Quotes/Quotes.types.d.ts +1 -0
  10. package/dist/components/Quotes/Quotes.types.d.ts.map +1 -1
  11. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  12. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  13. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +325 -0
  14. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  15. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -1
  16. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +328 -0
  17. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
  18. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +162 -0
  19. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
  20. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +2 -1
  21. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  22. package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -1
  23. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  24. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +3 -1
  25. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  26. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
  27. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  28. package/dist/hooks/useWalletList.d.ts.map +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/index.js.map +4 -4
  31. package/dist/pages/WalletsPage.d.ts.map +1 -1
  32. package/dist/utils/wallets.d.ts.map +1 -1
  33. package/package.json +2 -2
  34. package/src/components/HeaderButtons/HeaderButtons.tsx +2 -1
  35. package/src/components/HeaderButtons/HeaderButtons.types.ts +1 -0
  36. package/src/components/Quote/Quote.tsx +95 -74
  37. package/src/components/Quote/Quote.types.ts +3 -0
  38. package/src/components/Quote/QuoteTrigger.tsx +10 -6
  39. package/src/components/Quotes/Quotes.tsx +4 -1
  40. package/src/components/Quotes/Quotes.types.ts +1 -0
  41. package/src/components/SwapDetails/SwapDetails.helpers.tsx +16 -10
  42. package/src/components/SwapDetails/SwapDetails.styles.ts +10 -1
  43. package/src/components/SwapDetails/SwapDetails.tsx +44 -23
  44. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +19 -11
  45. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +24 -0
  46. package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +8 -0
  47. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
  48. package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +4 -2
  49. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +7 -0
  50. package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
  51. package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
  52. package/src/containers/Settings/Lists.tsx +12 -12
  53. package/src/hooks/useWalletList.ts +8 -1
  54. package/src/pages/WalletsPage.tsx +1 -2
  55. package/src/utils/wallets.ts +7 -1
@@ -4,3 +4,11 @@ export const WalletContainer = styled('div', {
4
4
  display: 'flex',
5
5
  justifyContent: 'center',
6
6
  });
7
+
8
+ export const TooltipErrorContent = styled('div', {
9
+ maxWidth: 280,
10
+ '& ._typography': {
11
+ wordWrap: 'break-word',
12
+ display: 'block',
13
+ },
14
+ });
@@ -37,7 +37,7 @@ export interface CompleteModalPropTypes {
37
37
  displayName: string;
38
38
  image: string;
39
39
  };
40
- description?: string;
40
+ description?: React.ReactNode;
41
41
  diagnosisUrl?: string | null;
42
42
  }
43
43
 
@@ -22,7 +22,7 @@ export function ExpandedQuotes(props: PropTypes) {
22
22
  const containerClass = isDelayedVisible ? '' : 'is-hidden';
23
23
  const { config } = useAppStore();
24
24
  const fullExpandedMode = config?.variant === 'full-expanded';
25
-
25
+ const container = getExpanded();
26
26
  useEffect(() => {
27
27
  let timeout: ReturnType<typeof setTimeout> | null = null;
28
28
 
@@ -53,8 +53,9 @@ export function ExpandedQuotes(props: PropTypes) {
53
53
  title={i18n.t('Routes')}
54
54
  suffix={
55
55
  <>
56
- <SelectStrategy container={getExpanded()} />
56
+ <SelectStrategy container={container} />
57
57
  <HeaderButtons
58
+ container={container}
58
59
  onClickRefresh={onClickRefresh}
59
60
  hidden={['history', 'notifications', 'settings']}
60
61
  />
@@ -67,6 +68,7 @@ export function ExpandedQuotes(props: PropTypes) {
67
68
  fetch={fetch}
68
69
  hasSort={false}
69
70
  loading={loading}
71
+ container={getExpanded()}
70
72
  onClickOnQuote={onClickOnQuote}
71
73
  fullExpandedMode={fullExpandedMode}
72
74
  />
@@ -8,6 +8,13 @@ export const QuoteContainer = styled('div', {
8
8
  });
9
9
  export const FooterStepAlarm = styled('div', {
10
10
  paddingBottom: '$15',
11
+ variants: {
12
+ dense: {
13
+ true: {
14
+ paddingBottom: 0,
15
+ },
16
+ },
17
+ },
11
18
  });
12
19
 
13
20
  export const FooterAlert = styled('div', {
@@ -26,6 +26,7 @@ export function QuoteInfo(props: PropTypes) {
26
26
  selected,
27
27
  onClickAllRoutes,
28
28
  fullExpandedMode = false,
29
+ container,
29
30
  } = props;
30
31
  const { inputAmount, inputUsdValue, toToken } = useQuoteStore();
31
32
 
@@ -59,6 +60,7 @@ export function QuoteInfo(props: PropTypes) {
59
60
  <Quote
60
61
  quote={quote}
61
62
  error={error}
63
+ container={container}
62
64
  showModalFee={showModalFee}
63
65
  warning={warning}
64
66
  tagHidden={tagHidden}
@@ -15,4 +15,5 @@ export type PropTypes = {
15
15
  selected?: boolean;
16
16
  showModalFee?: boolean;
17
17
  fullExpandedMode?: boolean;
18
+ container?: HTMLElement;
18
19
  };
@@ -4,12 +4,12 @@ import type { ListPropTypes, SvgIconProps } from '@rango-dev/ui';
4
4
  import { i18n } from '@lingui/core';
5
5
  import {
6
6
  AutoThemeIcon,
7
- BridgeIcon,
7
+ BridgesIcon,
8
8
  ChevronRightIcon,
9
9
  DarkModeIcon,
10
10
  Divider,
11
- DoneIcon,
12
11
  ExchangeIcon,
12
+ InfinityIcon,
13
13
  InfoIcon,
14
14
  LanguageIcon,
15
15
  LightModeIcon,
@@ -42,7 +42,7 @@ const ThemeSection = styled('div', {
42
42
  const themesList = [
43
43
  {
44
44
  id: ThemeModeEnum.LIGHT,
45
- icon: <LightModeIcon color="black" size={16} />,
45
+ icon: <LightModeIcon color="black" size={24} />,
46
46
  tooltip: (
47
47
  <Typography size="xsmall" variant="body">
48
48
  {i18n.t('Light')}
@@ -51,7 +51,7 @@ const themesList = [
51
51
  },
52
52
  {
53
53
  id: ThemeModeEnum.DARK,
54
- icon: <DarkModeIcon color="black" size={14} />,
54
+ icon: <DarkModeIcon color="black" size={24} />,
55
55
  tooltip: (
56
56
  <Typography size="xsmall" variant="body">
57
57
  {i18n.t('Dark')}
@@ -60,7 +60,7 @@ const themesList = [
60
60
  },
61
61
  {
62
62
  id: ThemeModeEnum.AUTO,
63
- icon: <AutoThemeIcon color="black" size={16} />,
63
+ icon: <AutoThemeIcon color="black" size={24} />,
64
64
  tooltip: (
65
65
  <Typography size="xsmall" variant="body">
66
66
  {i18n.t('Auto')}
@@ -70,7 +70,7 @@ const themesList = [
70
70
  ];
71
71
 
72
72
  const getThemeIcon = (theme: ThemeMode) => {
73
- const iconProps: SvgIconProps = { color: 'gray', size: 14 };
73
+ const iconProps: SvgIconProps = { color: 'gray', size: 16 };
74
74
 
75
75
  switch (theme) {
76
76
  case 'auto':
@@ -161,7 +161,7 @@ export function SettingsLists() {
161
161
  </>
162
162
  ),
163
163
  onClick: () => navigate(navigationRoutes.bridges),
164
- start: <BridgeIcon color="gray" size={14} />,
164
+ start: <BridgesIcon color="gray" size={16} />,
165
165
  };
166
166
 
167
167
  const exchangeItem = {
@@ -178,10 +178,10 @@ export function SettingsLists() {
178
178
  totalExchangeSources
179
179
  )}
180
180
  <Divider direction="horizontal" size={8} />
181
- <ChevronRightIcon color="gray" />
181
+ <ChevronRightIcon color="black" />
182
182
  </>
183
183
  ),
184
- start: <ExchangeIcon color="gray" size={14} />,
184
+ start: <ExchangeIcon color="gray" size={16} />,
185
185
  onClick: () => navigate(navigationRoutes.exchanges),
186
186
  };
187
187
 
@@ -192,14 +192,14 @@ export function SettingsLists() {
192
192
  {i18n.t('Language')}
193
193
  </Typography>
194
194
  ),
195
- start: <LanguageIcon color="gray" size={14} />,
195
+ start: <LanguageIcon color="gray" size={16} />,
196
196
  end: (
197
197
  <>
198
198
  <Typography variant="body" size="medium">
199
199
  {currentLanguage}
200
200
  </Typography>
201
201
  <Divider direction="horizontal" size={8} />
202
- <ChevronRightIcon color="gray" />
202
+ <ChevronRightIcon color="black" />
203
203
  </>
204
204
  ),
205
205
  onClick: () => navigate(navigationRoutes.languages),
@@ -230,7 +230,7 @@ export function SettingsLists() {
230
230
  </Tooltip>
231
231
  </>
232
232
  ),
233
- start: <DoneIcon color="gray" size={14} />,
233
+ start: <InfinityIcon color="gray" size={16} />,
234
234
  end: <Switch checked={infiniteApprove} />,
235
235
  onClick: toggleInfiniteApprove,
236
236
  };
@@ -5,6 +5,7 @@ import type { BlockchainMeta } from 'rango-sdk';
5
5
  import { WalletState } from '@rango-dev/ui';
6
6
  import { useWallets } from '@rango-dev/wallets-react';
7
7
  import {
8
+ detectMobileScreens,
8
9
  KEPLR_COMPATIBLE_WALLETS,
9
10
  type WalletType,
10
11
  WalletTypes,
@@ -47,13 +48,19 @@ export function useWalletList(params: Params) {
47
48
  walletConnectProjectId: config?.walletConnectProjectId,
48
49
  }) || ALL_SUPPORTED_WALLETS;
49
50
 
50
- const wallets = mapWalletTypesToWalletInfo(
51
+ let wallets = mapWalletTypesToWalletInfo(
51
52
  state,
52
53
  getWalletInfo,
53
54
  listAvailableWalletTypes,
54
55
  chain
55
56
  );
56
57
 
58
+ wallets = detectMobileScreens()
59
+ ? wallets.filter(
60
+ (wallet) => wallet.showOnMobile || state(wallet.type).installed
61
+ )
62
+ : wallets;
63
+
57
64
  const sortedWallets = sortWalletsBasedOnConnectionState(wallets);
58
65
  const [error, setError] = useState('');
59
66
 
@@ -13,12 +13,11 @@ import { getContainer } from '../utils/common';
13
13
 
14
14
  const ListContainer = styled('div', {
15
15
  display: 'flex',
16
- justifyContent: 'space-evenly',
16
+ justifyContent: 'center',
17
17
  alignItems: 'center',
18
18
  gap: '$10',
19
19
  flexWrap: 'wrap',
20
20
  paddingTop: '$5',
21
- height: '100%',
22
21
  });
23
22
 
24
23
  const Container = styled(PageContainer, {
@@ -77,7 +77,12 @@ export function mapWalletTypesToWalletInfo(
77
77
  return true;
78
78
  })
79
79
  .map((type) => {
80
- const { name, img: image, installLink } = getWalletInfo(type);
80
+ const {
81
+ name,
82
+ img: image,
83
+ installLink,
84
+ showOnMobile,
85
+ } = getWalletInfo(type);
81
86
  const state = mapStatusToWalletState(getState(type));
82
87
  return {
83
88
  title: name,
@@ -85,6 +90,7 @@ export function mapWalletTypesToWalletInfo(
85
90
  link: detectInstallLink(installLink),
86
91
  state,
87
92
  type,
93
+ showOnMobile,
88
94
  };
89
95
  });
90
96
  }