@rango-dev/widget-embedded 0.20.1-next.16 → 0.20.1-next.18

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 (93) hide show
  1. package/dist/components/BlockchainList/BlockchainList.styles.d.ts +4 -0
  2. package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
  3. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +2 -0
  4. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
  5. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +488 -1102
  6. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  7. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  8. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +6 -0
  9. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
  10. package/dist/components/CustomCollapsible/CustomCollapsible.d.ts +5 -0
  11. package/dist/components/CustomCollapsible/CustomCollapsible.d.ts.map +1 -0
  12. package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts +654 -0
  13. package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts.map +1 -0
  14. package/dist/components/CustomCollapsible/CustomCollapsible.types.d.ts +10 -0
  15. package/dist/components/CustomCollapsible/CustomCollapsible.types.d.ts.map +1 -0
  16. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +10 -0
  17. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
  18. package/dist/components/Layout/Layout.styles.d.ts +6 -0
  19. package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
  20. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +2 -0
  21. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
  22. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +28 -0
  23. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
  24. package/dist/components/NoResult/NoResult.styles.d.ts +6 -0
  25. package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
  26. package/dist/components/NotificationContent/NotificationContent.styles.d.ts +8 -0
  27. package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
  28. package/dist/components/Quote/Quote.d.ts.map +1 -1
  29. package/dist/components/Quote/Quote.styles.d.ts +356 -2
  30. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  31. package/dist/components/Quote/Quote.types.d.ts +19 -0
  32. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  33. package/dist/components/Quote/QuoteCostDetails.d.ts +4 -0
  34. package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -0
  35. package/dist/components/Quote/QuoteCostDetails.styles.d.ts +806 -0
  36. package/dist/components/Quote/QuoteCostDetails.styles.d.ts.map +1 -0
  37. package/dist/components/Quote/QuoteSummary.styles.d.ts +4 -0
  38. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
  39. package/dist/components/Quote/QuoteTrigger .d.ts +4 -0
  40. package/dist/components/Quote/QuoteTrigger .d.ts.map +1 -0
  41. package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +8 -0
  42. package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
  43. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +20 -0
  44. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -1
  45. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +10 -0
  46. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
  47. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +8 -0
  48. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  49. package/dist/components/SearchInput/SearchInput.styles.d.ts +2 -0
  50. package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  51. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +8 -0
  52. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
  53. package/dist/components/Slippage/Slippage.styles.d.ts +10 -0
  54. package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
  55. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +24 -0
  56. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  57. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +2 -0
  58. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
  59. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +2 -0
  60. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
  61. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +10 -0
  62. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  63. package/dist/components/TokenList/TokenList.styles.d.ts +34 -0
  64. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  65. package/dist/components/WalletModal/WalletModalContent.styles.d.ts +8 -0
  66. package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
  67. package/dist/constants/quote.d.ts +12 -0
  68. package/dist/constants/quote.d.ts.map +1 -0
  69. package/dist/containers/App/App.styles.d.ts +2 -0
  70. package/dist/containers/App/App.styles.d.ts.map +1 -1
  71. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +10 -0
  72. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  73. package/dist/index.js +2 -1
  74. package/dist/index.js.map +4 -4
  75. package/dist/utils/quote.d.ts +5 -1
  76. package/dist/utils/quote.d.ts.map +1 -1
  77. package/dist/utils/swap.d.ts +5 -1
  78. package/dist/utils/swap.d.ts.map +1 -1
  79. package/package.json +2 -2
  80. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +27 -96
  81. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +24 -39
  82. package/src/components/CustomCollapsible/CustomCollapsible.styles.ts +75 -0
  83. package/src/components/CustomCollapsible/CustomCollapsible.tsx +55 -0
  84. package/src/components/CustomCollapsible/CustomCollapsible.types.ts +10 -0
  85. package/src/components/Quote/Quote.styles.ts +44 -5
  86. package/src/components/Quote/Quote.tsx +10 -77
  87. package/src/components/Quote/Quote.types.ts +22 -0
  88. package/src/components/Quote/QuoteCostDetails.styles.ts +50 -0
  89. package/src/components/Quote/QuoteCostDetails.tsx +218 -0
  90. package/src/components/Quote/QuoteTrigger .tsx +215 -0
  91. package/src/constants/quote.ts +23 -0
  92. package/src/utils/quote.ts +18 -1
  93. package/src/utils/swap.ts +35 -0
@@ -1,5 +1,5 @@
1
1
  import type { QuoteError, QuoteWarning, Wallet } from '../types';
2
- import type { PriceImpactWarningLevel } from '@rango-dev/ui';
2
+ import type { PriceImpactWarningLevel, Step } from '@rango-dev/ui';
3
3
  import type { SimulationAssetAndAmount, SimulationValidationStatus } from '@rango-dev/ui/dist/widget/ui/src/types/swaps';
4
4
  import type { Asset, BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
5
5
  import type { PendingSwap } from 'rango-types';
@@ -29,4 +29,8 @@ export declare function generateQuoteWarnings(quote: BestRouteResponse, params:
29
29
  }): QuoteWarning | null;
30
30
  export declare function generateQuoteErrors(quote: BestRouteResponse): QuoteError | null;
31
31
  export declare function getPriceImpact(inputUsdValue: BigNumber | string | null, outputUsdValue: BigNumber | string | null): number | null;
32
+ export declare const getUniqueBlockchains: (steps: Step[]) => {
33
+ displayName: string;
34
+ image: string;
35
+ }[];
32
36
  //# sourceMappingURL=quote.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/utils/quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,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AgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,cAAc,EAAE,EAC7B,MAAM,EAAE,KAAK,EAAE,GACd;IACD,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,OAAO,EAAE,KAAK,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CA4CA;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IACN,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,YAAY,GAAG,IAAI,CAiDrB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,GACvB,UAAU,GAAG,IAAI,CA+BnB;AAED,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,EACxC,cAAc,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GACxC,MAAM,GAAG,IAAI,CAcf;AAED,eAAO,MAAM,oBAAoB,UAAW,IAAI,EAAE;iBAEnB,MAAM;WAAS,MAAM;GAanD,CAAC"}
@@ -1,7 +1,8 @@
1
+ import type { FeesGroup } from '../constants/quote';
1
2
  import type { FetchStatus } from '../store/slices/data';
2
3
  import type { ConvertedToken, QuoteError, QuoteWarning, RecommendedSlippages, SwapButtonState, Wallet } from '../types';
3
4
  import type { WalletType } from '@rango-dev/wallets-shared';
4
- import type { BestRouteRequest, BestRouteResponse, BlockchainMeta, RecommendedSlippage, SwapResult, Token } from 'rango-sdk';
5
+ import type { BestRouteRequest, BestRouteResponse, BlockchainMeta, RecommendedSlippage, SwapFee, SwapResult, Token } from 'rango-sdk';
5
6
  import type { PendingSwap, PendingSwapStep } from 'rango-types';
6
7
  import BigNumber from 'bignumber.js';
7
8
  export declare function getOutputRatio(inputUsdValue: BigNumber | null, outputUsdValue: BigNumber | null): number;
@@ -27,6 +28,9 @@ export declare function requiredWallets(quote: BestRouteResponse | null): string
27
28
  export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
28
29
  export declare function getUsdFeeOfStep(step: SwapResult, allTokens: Token[]): BigNumber;
29
30
  export declare function getTotalFeeInUsd(swaps: SwapResult[], allTokens: Token[]): BigNumber;
31
+ export declare function getUsdFee(fee: SwapFee): BigNumber;
32
+ export declare function getTotalFeesInUsd(fees: SwapFee[]): BigNumber;
33
+ export declare function getFeesGroup(swaps: SwapResult[]): FeesGroup;
30
34
  export declare function hasHighFee(totalFeeInUsd: BigNumber | null): boolean;
31
35
  export declare function hasSlippageError(slippages: (RecommendedSlippage | null)[] | undefined): boolean;
32
36
  export declare function checkSlippageErrors(quote: BestRouteResponse): RecommendedSlippages | null;
@@ -1 +1 @@
1
- {"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,MAAM,EACP,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,KAAK,EACN,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,SAAS,MAAM,cAAc,CAAC;AAoBrC,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,IAAI,EAC/B,cAAc,EAAE,SAAS,GAAG,IA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"@rango-dev/widget-embedded",
3
- "version": "0.20.1-next.16",
3
+ "version": "0.20.1-next.18",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,7 +25,7 @@
25
25
  "@rango-dev/queue-manager-core": "^0.25.0",
26
26
  "@rango-dev/queue-manager-rango-preset": "^0.25.1-next.1",
27
27
  "@rango-dev/queue-manager-react": "^0.24.0",
28
- "@rango-dev/ui": "^0.26.1-next.8",
28
+ "@rango-dev/ui": "^0.26.1-next.10",
29
29
  "@rango-dev/wallets-react": "^0.11.1-next.1",
30
30
  "@rango-dev/wallets-shared": "^0.25.1-next.1",
31
31
  "bignumber.js": "^9.1.1",
@@ -1,34 +1,12 @@
1
- import * as Collapsible from '@radix-ui/react-collapsible';
2
1
  import {
3
2
  Button,
4
3
  css,
5
4
  darkTheme,
6
5
  IconButton,
7
- keyframes,
8
6
  styled,
9
7
  TextField,
10
8
  } from '@rango-dev/ui';
11
9
 
12
- export const EXPANDABLE_TRANSITION_DURATION = 300;
13
-
14
- const slideDown = keyframes({
15
- from: {
16
- height: 0,
17
- },
18
- to: {
19
- height: 'var(--radix-collapsible-content-height)',
20
- },
21
- });
22
-
23
- const slideUp = keyframes({
24
- from: {
25
- height: 'var(--radix-collapsible-content-height)',
26
- },
27
- to: {
28
- height: 0,
29
- },
30
- });
31
-
32
10
  export const Title = styled('div', {
33
11
  display: 'flex',
34
12
  flexDirection: 'column',
@@ -93,16 +71,6 @@ export const ShowMoreWallets = styled(WalletButton, {
93
71
  alignSelf: 'stretch',
94
72
  minHeight: '93px',
95
73
  });
96
-
97
- export const Trigger = styled(Collapsible.Trigger, {
98
- padding: '$0',
99
- border: 'none',
100
- outline: 'none',
101
- width: '100%',
102
- backgroundColor: 'transparent',
103
- fontFamily: 'inherit',
104
- });
105
-
106
74
  export const ShowMoreHeader = styled('div', {
107
75
  padding: '$20',
108
76
  display: 'flex',
@@ -132,20 +100,36 @@ export const walletsListStyles = css({
132
100
  height: '100%',
133
101
  });
134
102
 
135
- export const CollapsibleRoot = styled(Collapsible.Root, {
136
- backgroundColor: '$neutral200',
137
- borderRadius: '$sm',
138
- variants: {
139
- selected: {
140
- true: {
141
- outlineWidth: 1,
142
- outlineColor: '$secondary500',
143
- outlineStyle: 'solid',
144
- },
145
- },
103
+ export const CustomDestination = styled('div', {
104
+ padding: '$10 $0',
105
+ '& .button__content': {
106
+ display: 'flex',
107
+ alignItems: 'center',
146
108
  },
109
+ '& .alarms': { paddingTop: '$5' },
110
+ '& .collapsible_content': {
111
+ backgroundColor: '$neutral100',
112
+ },
113
+ '& .collapsible_root': {
114
+ backgroundColor: '$neutral200',
115
+ },
116
+ });
117
+
118
+ export const alarmsStyles = css({
119
+ paddingTop: '$5',
120
+ });
121
+
122
+ export const ConfirmButton = styled('div', {
123
+ display: 'flex',
124
+ });
125
+
126
+ export const StyledTextField = styled(TextField, {
127
+ backgroundColor: '$neutral100',
128
+ padding: '$0 $15 $15 $15',
147
129
  });
148
130
 
131
+ export const Wallets = styled('div', { overflow: 'visible', width: '100%' });
132
+
149
133
  export const CustomDestinationButton = styled(Button, {
150
134
  width: '100%',
151
135
  borderRadius: '$sm !important',
@@ -174,56 +158,3 @@ export const CustomDestinationButton = styled(Button, {
174
158
  outline: 0,
175
159
  },
176
160
  });
177
-
178
- export const CustomDestination = styled('div', {
179
- padding: '$10 $0',
180
- '& .button__content': {
181
- display: 'flex',
182
- alignItems: 'center',
183
- },
184
- '& .alarms': { paddingTop: '5px' },
185
- });
186
-
187
- export const alarmsStyles = css({
188
- paddingTop: '5px',
189
- });
190
-
191
- export const ExpandedIcon = styled('div', {
192
- transition: `all ${EXPANDABLE_TRANSITION_DURATION}ms ease`,
193
- variants: {
194
- orientation: {
195
- down: {
196
- transform: 'rotate(0)',
197
- },
198
- up: {
199
- transform: 'rotate(180deg)',
200
- },
201
- },
202
- },
203
- });
204
-
205
- export const ConfirmButton = styled('div', {
206
- display: 'flex',
207
- });
208
-
209
- export const StyledTextField = styled(TextField, {
210
- backgroundColor: '$neutral100',
211
- padding: '$0 $15 $15 $15',
212
- });
213
-
214
- export const CollapsibleContent = styled(Collapsible.Content, {
215
- backgroundColor: '$neutral100',
216
- overflow: 'hidden',
217
- variants: {
218
- open: {
219
- true: {
220
- animation: `${slideDown} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
221
- },
222
- false: {
223
- animation: `${slideUp} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
224
- },
225
- },
226
- },
227
- });
228
-
229
- export const Wallets = styled('div', { overflow: 'visible', width: '100%' });
@@ -15,7 +15,7 @@ import {
15
15
  Typography,
16
16
  WalletIcon,
17
17
  } from '@rango-dev/ui';
18
- import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
18
+ import React, { useEffect, useState } from 'react';
19
19
  import { useNavigate } from 'react-router-dom';
20
20
 
21
21
  import { RANGO_SWAP_BOX_ID } from '../../constants';
@@ -26,23 +26,20 @@ import { useQuoteStore } from '../../store/quote';
26
26
  import { useWalletsStore } from '../../store/wallets';
27
27
  import { getBlockchainShortNameFor } from '../../utils/meta';
28
28
  import { confirmSwapDisabled } from '../../utils/swap';
29
+ import { CustomCollapsible } from '../CustomCollapsible/CustomCollapsible';
30
+ import { ExpandedIcon } from '../CustomCollapsible/CustomCollapsible.styles';
29
31
 
30
32
  import { getRequiredWallets, isValidAddress } from './ConfirmWallets.helpers';
31
33
  import {
32
34
  alarmsStyles,
33
- CollapsibleContent,
34
- CollapsibleRoot,
35
35
  ConfirmButton,
36
36
  CustomDestination,
37
37
  CustomDestinationButton,
38
- EXPANDABLE_TRANSITION_DURATION,
39
- ExpandedIcon,
40
38
  ListContainer,
41
39
  NavigateBack,
42
40
  ShowMoreHeader,
43
41
  StyledTextField,
44
42
  Title,
45
- Trigger,
46
43
  Wallets,
47
44
  WalletsContainer,
48
45
  walletsListStyles,
@@ -76,7 +73,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
76
73
  const [showCustomDestination, setShowCustomDestination] = useState(
77
74
  !!customDestination
78
75
  );
79
- const customDestinationRef = useRef<HTMLDivElement | null>(null);
80
76
 
81
77
  const requiredWallets = getRequiredWallets(quote);
82
78
 
@@ -231,14 +227,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
231
227
  );
232
228
  }, [connectedWallets.length]);
233
229
 
234
- useLayoutEffect(() => {
235
- if (showCustomDestination && customDestinationRef.current) {
236
- setTimeout(() => {
237
- customDestinationRef?.current?.scrollIntoView({ behavior: 'smooth' });
238
- }, EXPANDABLE_TRANSITION_DURATION);
239
- }
240
- }, [showCustomDestination]);
241
-
242
230
  const modalContainer = document.getElementById(
243
231
  RANGO_SWAP_BOX_ID
244
232
  ) as HTMLDivElement;
@@ -394,10 +382,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
394
382
  {!isLastWallet && <Divider size={32} />}
395
383
  {isLastWallet && config?.customDestination && (
396
384
  <CustomDestination>
397
- <CollapsibleRoot
398
- ref={customDestinationRef}
399
- selected={showCustomDestination}
400
- open={showCustomDestination}
385
+ <CustomCollapsible
401
386
  onOpenChange={(checked) => {
402
387
  if (!checked) {
403
388
  resetCustomDestination();
@@ -423,11 +408,11 @@ export function ConfirmWalletsModal(props: PropTypes) {
423
408
  );
424
409
  }
425
410
  }
426
- }}>
427
- <Trigger
428
- onClick={() =>
429
- setShowCustomDestination((prevState) => !prevState)
430
- }>
411
+ }}
412
+ hasSelected
413
+ open={showCustomDestination}
414
+ triggerAnchor="top"
415
+ trigger={
431
416
  <CustomDestinationButton
432
417
  fullWidth
433
418
  variant="default"
@@ -447,21 +432,21 @@ export function ConfirmWalletsModal(props: PropTypes) {
447
432
  </Typography>
448
433
  </div>
449
434
  </CustomDestinationButton>
450
- </Trigger>
451
- <CollapsibleContent open={showCustomDestination}>
452
- <>
453
- <Divider size={4} />
454
- <StyledTextField
455
- autoFocus
456
- placeholder={i18n.t('Your destination address')}
457
- value={destination}
458
- onChange={(e) => {
459
- setDestination(e.target.value);
460
- }}
461
- />
462
- </>
463
- </CollapsibleContent>
464
- </CollapsibleRoot>
435
+ }
436
+ onClickTrigger={() =>
437
+ setShowCustomDestination((prev) => !prev)
438
+ }>
439
+ <Divider size={4} />
440
+ <StyledTextField
441
+ autoFocus
442
+ placeholder={i18n.t('Your destination address')}
443
+ value={destination}
444
+ onChange={(e) => {
445
+ setDestination(e.target.value);
446
+ }}
447
+ />
448
+ </CustomCollapsible>
449
+
465
450
  {isAddressMatched && (
466
451
  <div className={alarmsStyles()}>
467
452
  <Alert
@@ -0,0 +1,75 @@
1
+ import * as Collapsible from '@radix-ui/react-collapsible';
2
+ import { keyframes, styled } from '@rango-dev/ui';
3
+
4
+ export const EXPANDABLE_TRANSITION_DURATION = 300;
5
+
6
+ const slideDown = keyframes({
7
+ from: {
8
+ height: 0,
9
+ },
10
+ to: {
11
+ height: 'var(--radix-collapsible-content-height)',
12
+ },
13
+ });
14
+
15
+ const slideUp = keyframes({
16
+ from: {
17
+ height: 'var(--radix-collapsible-content-height)',
18
+ },
19
+ to: {
20
+ height: 0,
21
+ },
22
+ });
23
+
24
+ export const CollapsibleRoot = styled(Collapsible.Root, {
25
+ borderRadius: '$sm',
26
+ variants: {
27
+ selected: {
28
+ true: {
29
+ outlineWidth: 1,
30
+ outlineColor: '$secondary500',
31
+ outlineStyle: 'solid',
32
+ },
33
+ },
34
+ },
35
+ });
36
+
37
+ export const Trigger = styled(Collapsible.Trigger, {
38
+ padding: '$0',
39
+ border: 'none',
40
+ outline: 'none',
41
+ width: '100%',
42
+ backgroundColor: 'transparent',
43
+ fontFamily: 'inherit',
44
+ cursor: 'pointer',
45
+ });
46
+
47
+ export const CollapsibleContent = styled(Collapsible.Content, {
48
+ overflow: 'hidden',
49
+ variants: {
50
+ open: {
51
+ true: {
52
+ animation: `${slideDown} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
53
+ },
54
+ false: {
55
+ animation: `${slideUp} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
56
+ },
57
+ },
58
+ },
59
+ });
60
+
61
+ export const ExpandedIcon = styled('div', {
62
+ transition: `all ${EXPANDABLE_TRANSITION_DURATION}ms ease`,
63
+ display: 'flex',
64
+ alignItems: 'center',
65
+ variants: {
66
+ orientation: {
67
+ down: {
68
+ transform: 'rotate(0)',
69
+ },
70
+ up: {
71
+ transform: 'rotate(180deg)',
72
+ },
73
+ },
74
+ },
75
+ });
@@ -0,0 +1,55 @@
1
+ import type { PropTypes } from './CustomCollapsible.types';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ import React, { useLayoutEffect, useRef } from 'react';
5
+
6
+ import {
7
+ CollapsibleContent,
8
+ CollapsibleRoot,
9
+ EXPANDABLE_TRANSITION_DURATION,
10
+ Trigger,
11
+ } from './CustomCollapsible.styles';
12
+
13
+ export function CustomCollapsible(props: PropsWithChildren<PropTypes>) {
14
+ const {
15
+ open,
16
+ hasSelected,
17
+ onOpenChange,
18
+ children,
19
+ onClickTrigger,
20
+ trigger,
21
+ triggerAnchor,
22
+ } = props;
23
+ const ref = useRef<HTMLDivElement | null>(null);
24
+
25
+ useLayoutEffect(() => {
26
+ if (open && ref.current) {
27
+ setTimeout(() => {
28
+ ref?.current?.scrollIntoView({ behavior: 'smooth' });
29
+ }, EXPANDABLE_TRANSITION_DURATION);
30
+ }
31
+ }, [open]);
32
+
33
+ return (
34
+ <CollapsibleRoot
35
+ ref={ref}
36
+ className="collapsible_root"
37
+ selected={hasSelected && open}
38
+ open={open}
39
+ onOpenChange={onOpenChange}>
40
+ {triggerAnchor === 'top' && (
41
+ <Trigger className="collapsible_trigger" onClick={onClickTrigger}>
42
+ {trigger}
43
+ </Trigger>
44
+ )}
45
+ <CollapsibleContent className="collapsible_content" open={open}>
46
+ {children}
47
+ </CollapsibleContent>
48
+ {triggerAnchor === 'bottom' && (
49
+ <Trigger className="collapsible_trigger" onClick={onClickTrigger}>
50
+ {trigger}
51
+ </Trigger>
52
+ )}
53
+ </CollapsibleRoot>
54
+ );
55
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export type PropTypes = {
4
+ open: boolean;
5
+ hasSelected?: boolean;
6
+ onOpenChange?: (checked: boolean) => void;
7
+ onClickTrigger: () => void;
8
+ trigger: ReactNode;
9
+ triggerAnchor: 'top' | 'bottom';
10
+ };
@@ -1,7 +1,7 @@
1
1
  import * as Collapsible from '@radix-ui/react-collapsible';
2
2
  import { css, darkTheme, Image, styled, Typography } from '@rango-dev/ui';
3
3
 
4
- import { CollapsibleContent } from '../ConfirmWalletsModal/ConfirmWallets.styles';
4
+ import { CollapsibleContent } from '../CustomCollapsible/CustomCollapsible.styles';
5
5
 
6
6
  export const EXPANDABLE_QUOTE_TRANSITION_DURATION = 300;
7
7
 
@@ -114,6 +114,15 @@ export const summaryStyles = css({
114
114
  cursor: 'default',
115
115
  });
116
116
 
117
+ export const rowStyles = css({
118
+ display: 'flex',
119
+ flexDirection: 'row',
120
+ justifyContent: 'center',
121
+ alignItems: 'center',
122
+ '.blockchainImage': {
123
+ marginLeft: '-$8',
124
+ },
125
+ });
117
126
  export const basicInfoStyles = css({
118
127
  paddingTop: '$10',
119
128
  display: 'flex',
@@ -127,7 +136,7 @@ export const basicInfoStyles = css({
127
136
  },
128
137
  });
129
138
 
130
- export const Chains = styled(Collapsible.Trigger, {
139
+ export const Trigger = styled(Collapsible.Trigger, {
131
140
  display: 'flex',
132
141
  width: '100%',
133
142
  justifyContent: 'space-between',
@@ -171,17 +180,27 @@ export const Chains = styled(Collapsible.Trigger, {
171
180
  },
172
181
  },
173
182
  },
174
- '& div:nth-child(1)': { display: 'flex' },
183
+ '.blockchains_section': {
184
+ display: 'none',
185
+ },
186
+ '@xs': {
187
+ '.blockchains_section': {
188
+ display: 'block',
189
+ },
190
+ },
175
191
  });
176
192
 
177
- export const ChainImageContainer = styled('div', {
193
+ export const ImageContainer = styled('div', {
178
194
  width: '18px',
179
195
  height: '18px',
180
196
  borderRadius: '100%',
181
- border: '1.5px transparent solid',
182
197
  display: 'flex',
183
198
  justifyContent: 'center',
184
199
  alignItems: 'center',
200
+ border: '1.5px transparent solid',
201
+ img: {
202
+ borderRadius: '100%',
203
+ },
185
204
  variants: {
186
205
  state: {
187
206
  error: {
@@ -252,3 +271,23 @@ export const ContainerInfoOutput = styled('div', {
252
271
  display: 'flex',
253
272
  flexWrap: 'wrap',
254
273
  });
274
+
275
+ export const MoreStep = styled('div', {
276
+ width: '18px',
277
+ height: '18px',
278
+ borderRadius: '100%',
279
+ backgroundColor: '$background',
280
+ cursor: 'default',
281
+ display: 'flex',
282
+ justifyContent: 'center',
283
+ alignItems: 'center',
284
+ border: '1.5px transparent solid',
285
+ variants: {
286
+ state: {
287
+ error: {
288
+ borderColor: '$error500',
289
+ },
290
+ warning: { borderColor: '$warning500' },
291
+ },
292
+ },
293
+ });