@rango-dev/widget-embedded 0.23.1-next.17 → 0.23.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 (27) hide show
  1. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -283
  2. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  3. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  4. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -1
  5. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
  6. package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
  7. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +3 -3
  10. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  11. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  12. package/dist/pages/SettingsPage.d.ts.map +1 -1
  13. package/dist/utils/ui.d.ts +5 -2
  14. package/dist/utils/ui.d.ts.map +1 -1
  15. package/package.json +2 -2
  16. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +5 -11
  17. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +7 -11
  18. package/src/components/ConfirmWalletsModal/WalletList.tsx +2 -2
  19. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +1 -1
  20. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +4 -4
  21. package/src/components/Quote/Quote.tsx +3 -3
  22. package/src/components/Quote/QuoteTrigger.tsx +4 -5
  23. package/src/components/Slippage/Slippage.tsx +11 -13
  24. package/src/pages/ConfirmSwapPage.tsx +7 -1
  25. package/src/pages/LiquiditySourcePage.tsx +3 -1
  26. package/src/pages/SettingsPage.tsx +0 -1
  27. package/src/utils/ui.ts +7 -5
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAmD5E,wBAAgB,eAAe,sBA4T9B"}
1
+ {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAmD5E,wBAAgB,eAAe,sBAkU9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"LiquiditySourcePage.d.ts","sourceRoot":"","sources":["../../src/pages/LiquiditySourcePage.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,UAAU,SAAS;IACjB,UAAU,EAAE,WAAW,GAAG,SAAS,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,UAAU,EAAE,EAAE,SAAS,qBA6H5D"}
1
+ {"version":3,"file":"LiquiditySourcePage.d.ts","sourceRoot":"","sources":["../../src/pages/LiquiditySourcePage.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,UAAU,SAAS;IACjB,UAAU,EAAE,WAAW,GAAG,SAAS,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,UAAU,EAAE,EAAE,SAAS,qBA+H5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../../src/pages/SettingsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,wBAAgB,YAAY,sBA+C3B"}
1
+ {"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../../src/pages/SettingsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,wBAAgB,YAAY,sBA8C3B"}
@@ -1,6 +1,6 @@
1
1
  import type { WidgetTheme } from '../types';
2
2
  import type { createTheme } from '@rango-dev/ui';
3
- import type React from 'react';
3
+ import React from 'react';
4
4
  interface CustomizedThemeValues {
5
5
  id: string;
6
6
  tokens: Parameters<typeof createTheme>[0];
@@ -10,6 +10,9 @@ interface CustomizedTheme {
10
10
  dark: undefined | CustomizedThemeValues;
11
11
  }
12
12
  export declare function customizedThemeTokens(colors: WidgetTheme['colors']): CustomizedTheme;
13
- export declare function joinList(list: React.JSX.Element[], divider: React.JSX.Element): React.JSX.Element[];
13
+ export declare function joinList(list: {
14
+ element: React.JSX.Element;
15
+ key: string;
16
+ }[], divider: React.JSX.Element): React.JSX.Element[];
14
17
  export {};
15
18
  //# sourceMappingURL=ui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,UAAU,qBAAqB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,SAAS,GAAG,qBAAqB,CAAC;IACzC,IAAI,EAAE,SAAS,GAAG,qBAAqB,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC5B,eAAe,CA6CjB;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,EACzB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,uBAe3B"}
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMjD,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,qBAAqB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,SAAS,GAAG,qBAAqB,CAAC;IACzC,IAAI,EAAE,SAAS,GAAG,qBAAqB,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC5B,eAAe,CA6CjB;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE;IAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,EACnD,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,uBAiB3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.23.1-next.17",
3
+ "version": "0.23.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.26.0",
26
26
  "@rango-dev/queue-manager-rango-preset": "^0.28.1-next.3",
27
27
  "@rango-dev/queue-manager-react": "^0.26.0",
28
- "@rango-dev/ui": "^0.29.1-next.13",
28
+ "@rango-dev/ui": "^0.29.1-next.14",
29
29
  "@rango-dev/wallets-react": "^0.14.1-next.1",
30
30
  "@rango-dev/wallets-shared": "^0.28.1-next.1",
31
31
  "bignumber.js": "^9.1.1",
@@ -1,11 +1,4 @@
1
- import {
2
- Button,
3
- css,
4
- darkTheme,
5
- IconButton,
6
- styled,
7
- TextField,
8
- } from '@rango-dev/ui';
1
+ import { css, darkTheme, IconButton, styled, TextField } from '@rango-dev/ui';
9
2
 
10
3
  export const Title = styled('div', {
11
4
  display: 'flex',
@@ -130,10 +123,11 @@ export const StyledTextField = styled(TextField, {
130
123
 
131
124
  export const Wallets = styled('div', { overflow: 'visible', width: '100%' });
132
125
 
133
- export const CustomDestinationButton = styled(Button, {
126
+ export const CustomDestinationButton = styled('div', {
134
127
  width: '100%',
135
- borderRadius: '$sm !important',
136
- padding: '$15 !important',
128
+ borderRadius: '$sm',
129
+ display: 'flex',
130
+ padding: '$15',
137
131
  justifyContent: 'space-between',
138
132
  alignItems: 'center',
139
133
  $$color: '$colors$neutral100',
@@ -417,17 +417,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
417
417
  open={showCustomDestination}
418
418
  triggerAnchor="top"
419
419
  trigger={
420
- <CustomDestinationButton
421
- fullWidth
422
- variant="default"
423
- suffix={
424
- <ExpandedIcon
425
- orientation={
426
- showCustomDestination ? 'up' : 'down'
427
- }>
428
- <ChevronDownIcon size={10} color="gray" />
429
- </ExpandedIcon>
430
- }>
420
+ <CustomDestinationButton>
431
421
  <div className="button__content">
432
422
  <WalletIcon size={18} color="info" />
433
423
  <Divider size={4} direction="horizontal" />
@@ -435,6 +425,12 @@ export function ConfirmWalletsModal(props: PropTypes) {
435
425
  {i18n.t('Send to a different address')}
436
426
  </Typography>
437
427
  </div>
428
+ <ExpandedIcon
429
+ orientation={
430
+ showCustomDestination ? 'up' : 'down'
431
+ }>
432
+ <ChevronDownIcon size={10} color="gray" />
433
+ </ExpandedIcon>
438
434
  </CustomDestinationButton>
439
435
  }
440
436
  onClickTrigger={() =>
@@ -198,7 +198,7 @@ export function WalletList(props: PropTypes) {
198
198
  )
199
199
  : undefined;
200
200
  return (
201
- <>
201
+ <React.Fragment key={`${wallet.title}_${blockchainDisplayName}`}>
202
202
  <WalletModal
203
203
  open={openWalletStateModal === wallet.type}
204
204
  onClose={handleCloseWalletModal}
@@ -302,7 +302,7 @@ export function WalletList(props: PropTypes) {
302
302
  disabled={!isActiveTab}
303
303
  {...wallet}
304
304
  />
305
- </>
305
+ </React.Fragment>
306
306
  );
307
307
  })}
308
308
  {shouldShowMoreWallets && (
@@ -1,5 +1,5 @@
1
1
  import { ListItem, styled } from '@rango-dev/ui';
2
2
 
3
- export const CustomeListItem = styled(ListItem, {
3
+ export const CustomListItem = styled(ListItem, {
4
4
  height: 61,
5
5
  });
@@ -3,16 +3,16 @@ import React from 'react';
3
3
 
4
4
  import { LiquiditySourceList } from '../SettingsContainer';
5
5
 
6
- import { CustomeListItem } from './LoadingLiquiditySourceList.styles';
6
+ import { CustomListItem } from './LoadingLiquiditySourceList.styles';
7
7
 
8
8
  const ITEM_SKELETON_COUNT = 30;
9
9
  export function LoadingLiquiditySourceList() {
10
10
  return (
11
11
  <LiquiditySourceList>
12
- {Array.from(Array(ITEM_SKELETON_COUNT), (e) => (
13
- <CustomeListItem
12
+ {Array.from(Array(ITEM_SKELETON_COUNT), (_, index) => (
13
+ <CustomListItem
14
14
  hasDivider
15
- key={e}
15
+ key={index}
16
16
  start={<Skeleton variant="circular" width={35} height={35} />}
17
17
  title={<Skeleton variant="text" size="large" width={90} />}
18
18
  end={<Checkbox checked={false} />}
@@ -329,10 +329,10 @@ export function Quote(props: QuoteProps) {
329
329
  {sortedQuoteTags.map((tag, index) => {
330
330
  const key = `${tag.value}_${index}`;
331
331
  return (
332
- <>
333
- <QuoteTag label={tag.label} key={key} value={tag.value} />
332
+ <React.Fragment key={key}>
333
+ <QuoteTag label={tag.label} value={tag.value} />
334
334
  <Divider size={4} direction="horizontal" />
335
- </>
335
+ </React.Fragment>
336
336
  );
337
337
  })}
338
338
  </TagContainer>
@@ -73,14 +73,14 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
73
73
  );
74
74
 
75
75
  return isMobile || isTablet ? (
76
- <>
76
+ <React.Fragment key={key}>
77
77
  <ImageComponent
78
78
  content={step.swapper.displayName}
79
79
  src={step.swapper.image}
80
80
  state={step.state}
81
81
  />
82
82
  {index !== numberOfSteps - 1 && <>{arrow}</>}
83
- </>
83
+ </React.Fragment>
84
84
  ) : (
85
85
  <React.Fragment key={key}>
86
86
  {numberOfSteps <= MAX_STEPS ||
@@ -148,12 +148,11 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
148
148
  </Typography>
149
149
  <Divider direction="horizontal" size={4} />
150
150
  {blockchains.map((blockchain, index) => (
151
- <>
151
+ <React.Fragment key={blockchain.displayName}>
152
152
  {blockchains.length <= MAX_BLOCKCHAINS ||
153
153
  (blockchains.length > MAX_BLOCKCHAINS &&
154
154
  index < MAX_BLOCKCHAINS - 1) ? (
155
155
  <ImageComponent
156
- key={blockchain.displayName}
157
156
  content={''}
158
157
  src={blockchain.image}
159
158
  open={false}
@@ -190,7 +189,7 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
190
189
  </Tooltip>
191
190
  )
192
191
  )}
193
- </>
192
+ </React.Fragment>
194
193
  ))}
195
194
 
196
195
  <Divider direction="horizontal" size={32} />
@@ -47,19 +47,17 @@ export function Slippage() {
47
47
  {SLIPPAGES.map((slippageItem, index) => {
48
48
  const key = `slippage-${index}`;
49
49
  return (
50
- <>
51
- <SlippageChip
52
- key={key}
53
- onClick={() => {
54
- if (customSlippage) {
55
- setCustomSlippage(null);
56
- }
57
- setSlippage(slippageItem);
58
- }}
59
- selected={!customSlippage && slippageItem === slippage}
60
- label={`${slippageItem.toString()}%`}
61
- />
62
- </>
50
+ <SlippageChip
51
+ key={key}
52
+ onClick={() => {
53
+ if (customSlippage) {
54
+ setCustomSlippage(null);
55
+ }
56
+ setSlippage(slippageItem);
57
+ }}
58
+ selected={!customSlippage && slippageItem === slippage}
59
+ label={`${slippageItem.toString()}%`}
60
+ />
63
61
  );
64
62
  })}
65
63
  <TextField
@@ -371,7 +371,13 @@ export function ConfirmSwapPage() {
371
371
  </div>
372
372
  <Divider size="12" />
373
373
 
374
- {joinList(alerts, <Divider size={10} />)}
374
+ {joinList(
375
+ alerts.map((alert, index) => ({
376
+ element: alert,
377
+ key: `alert-${index}`,
378
+ })),
379
+ <Divider size={10} />
380
+ )}
375
381
  {alerts.length > 0 ? <Divider size={10} /> : null}
376
382
 
377
383
  <QuoteInfo
@@ -136,11 +136,13 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
136
136
  fetchStatus === 'success' && (
137
137
  <LiquiditySourceList disabled={campaignMode}>
138
138
  {filteredList.map((sourceItem) => {
139
+ const { groupTitle, ...otherProps } = sourceItem;
140
+
139
141
  return (
140
142
  <React.Fragment key={sourceItem.id}>
141
143
  <ListItemButton
142
144
  style={{ height: '61px' }}
143
- {...sourceItem}
145
+ {...otherProps}
144
146
  selected={false}
145
147
  hasDivider
146
148
  />
@@ -32,7 +32,6 @@ export function SettingsPage() {
32
32
  updateCampaignMode('liquiditySources', undefined);
33
33
  }
34
34
  };
35
-
36
35
  return (
37
36
  <Layout
38
37
  header={{
package/src/utils/ui.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /* eslint-disable @typescript-eslint/no-magic-numbers */
2
2
  import type { WidgetTheme } from '../types';
3
3
  import type { createTheme } from '@rango-dev/ui';
4
- import type React from 'react';
5
4
 
6
5
  import {
7
6
  theme as baseThemeTokens,
8
7
  darkColors as defaultDarkColors,
9
8
  } from '@rango-dev/ui';
9
+ import React from 'react';
10
10
 
11
11
  import { generateColors } from '../utils/colors';
12
12
  import { toHash } from '../utils/hash';
@@ -73,18 +73,20 @@ export function customizedThemeTokens(
73
73
  }
74
74
 
75
75
  export function joinList(
76
- list: React.JSX.Element[],
76
+ list: { element: React.JSX.Element; key: string }[],
77
77
  divider: React.JSX.Element
78
78
  ) {
79
79
  if (list.length <= 1) {
80
- return list;
80
+ return list.map(({ element, key }) => React.cloneElement(element, { key }));
81
81
  }
82
82
 
83
83
  const output: React.JSX.Element[] = [];
84
84
  list.forEach((item, index) => {
85
- output.push(item);
85
+ const { element, key } = item;
86
+ output.push(React.cloneElement(element, { key }));
86
87
  if (index < list.length - 1) {
87
- output.push(divider);
88
+ const key = `divider-${index}`;
89
+ output.push(React.cloneElement(divider, { key }));
88
90
  }
89
91
  });
90
92