@rango-dev/widget-embedded 0.23.1-next.16 → 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 (45) 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/Quote.d.ts.map +1 -1
  7. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  8. package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
  9. package/dist/components/Quotes/SelectStrategy.d.ts.map +1 -1
  10. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  11. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  12. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/index.js.map +3 -3
  15. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  16. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  17. package/dist/pages/SettingsPage.d.ts.map +1 -1
  18. package/dist/types/config.d.ts +3 -3
  19. package/dist/types/config.d.ts.map +1 -1
  20. package/dist/utils/colors.d.ts +5 -3
  21. package/dist/utils/colors.d.ts.map +1 -1
  22. package/dist/utils/ui.d.ts +5 -2
  23. package/dist/utils/ui.d.ts.map +1 -1
  24. package/package.json +3 -3
  25. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +5 -11
  26. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +7 -11
  27. package/src/components/ConfirmWalletsModal/WalletList.tsx +2 -2
  28. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +1 -1
  29. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +4 -4
  30. package/src/components/Quote/Quote.styles.ts +13 -14
  31. package/src/components/Quote/Quote.tsx +4 -3
  32. package/src/components/Quote/QuoteTrigger.tsx +4 -5
  33. package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +1 -1
  34. package/src/components/Quotes/SelectStrategy.tsx +3 -11
  35. package/src/components/Slippage/Slippage.tsx +11 -13
  36. package/src/components/TokenList/TokenList.tsx +9 -8
  37. package/src/hooks/useSwapInput.ts +3 -2
  38. package/src/pages/ConfirmSwapPage.tsx +7 -3
  39. package/src/pages/LiquiditySourcePage.tsx +3 -1
  40. package/src/pages/SettingsPage.tsx +0 -1
  41. package/src/store/slices/config.ts +2 -2
  42. package/src/store/slices/data.ts +4 -4
  43. package/src/types/config.ts +3 -3
  44. package/src/utils/colors.ts +106 -75
  45. 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,sBA8T9B"}
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"}
@@ -159,8 +159,8 @@ export type Features = Partial<Record<'theme' | 'language' | 'connectWalletButto
159
159
  * that defines the various properties of the theme, such as colors, fonts, and others.
160
160
  * @property {boolean} externalWallets
161
161
  * If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
162
- * @property {boolean} enableNewLiquiditySources - The `enableNewLiquiditySources` property is a boolean value that when you
163
- * set it to true, whenever a new liquidity source is added, it will be added to your list as well.
162
+ * @property {boolean} excludeLiquiditySources - The `excludeLiquiditySources` property is a boolean value that when you
163
+ * set it to true, the list of liquidity sources provided in `liquiditySources` will be excluded; otherwise, they will be included.
164
164
  * @property {Features} features - An optional object for configuring the visibility or enablement of various features.
165
165
  * Keys include:
166
166
  * - 'notification': Visibility state for the notification icon.
@@ -190,7 +190,7 @@ export type WidgetConfig = {
190
190
  language?: Language;
191
191
  theme?: WidgetTheme;
192
192
  externalWallets?: boolean;
193
- enableNewLiquiditySources?: boolean;
193
+ excludeLiquiditySources?: boolean;
194
194
  features?: Features;
195
195
  variant?: WidgetVariant;
196
196
  };
@@ -1 +1 @@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MAAM,CAAC,mBAAmB,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,EAAE,CAAC,EAAE,wBAAwB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,UAAU,GAAG,iBAAiB,CAAC,EAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import type { WidgetColors } from '../types';
2
- export declare const colorShade: (col: string, amt: number) => string;
3
- export declare const generateRangeColors: (name: string, color: string) => {
4
- [x: string]: string;
2
+ export declare function generateShades(baseColor: string, prefix: string, reverse?: boolean): {
3
+ [key: string]: string;
5
4
  };
5
+ export declare function generateShade(baseColor: string, decrementAmount: number): string;
6
+ export declare function convertToRGB(baseColor: string): number[];
7
+ export declare function isBright(baseColor: string): boolean;
6
8
  export declare const generateColors: (mainColors: {
7
9
  [x: string]: string;
8
10
  }, reverseNeutralRange: boolean, colors?: WidgetColors) => {
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,UAAU,CAAC;AAE/D,eAAO,MAAM,UAAU,QAAS,MAAM,OAAO,MAAM,WAyBlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,MAAM,SAAS,MAAM;;CAmC9D,CAAC;AACF,eAAO,MAAM,cAAc;;wBAEJ,OAAO,WACnB,YAAY;;CAyCtB,CAAC"}
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,UAAU,CAAC;AAE/D,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,OAAO,GAChB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAyC3B;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GACtB,MAAM,CAKR;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBxD;AAcD,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,WAezC;AAED,eAAO,MAAM,cAAc;;wBAEJ,OAAO,WACnB,YAAY;;CA2BtB,CAAC"}
@@ -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.16",
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.11",
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",
@@ -48,4 +48,4 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  }
51
- }
51
+ }
@@ -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} />}
@@ -55,19 +55,6 @@ export const QuoteContainer = styled(Collapsible.Root, {
55
55
  backgroundColor: '$$color',
56
56
  },
57
57
  },
58
- {
59
- listItem: true,
60
- selected: false,
61
- css: {
62
- cursor: 'pointer',
63
- '&:hover': {
64
- backgroundColor: '$neutral300',
65
- [`.${darkTheme} &`]: {
66
- backgroundColor: '$neutral400',
67
- },
68
- },
69
- },
70
- },
71
58
  ],
72
59
  });
73
60
 
@@ -107,6 +94,18 @@ export const SummaryContainer = styled('div', {
107
94
  },
108
95
  backgroundColor: '$$color',
109
96
  '&:hover': {
97
+ '& .quote_container': {
98
+ '& button': {
99
+ backgroundColor: '$neutral500',
100
+ [`.${darkTheme} &`]: {
101
+ backgroundColor: '$neutral200',
102
+ },
103
+ },
104
+ backgroundColor: '$neutral500',
105
+ [`.${darkTheme} &`]: {
106
+ backgroundColor: '$neutral200',
107
+ },
108
+ },
110
109
  backgroundColor: '$neutral300',
111
110
  [`.${darkTheme} &`]: {
112
111
  backgroundColor: '$neutral400',
@@ -376,6 +375,6 @@ export const Line = styled('div', {
376
375
  borderTopColor: '$neutral',
377
376
  margin: '$5 0',
378
377
  [`.${darkTheme} &`]: {
379
- borderTopColor: '$neutral400',
378
+ borderTopColor: '$neutral800',
380
379
  },
381
380
  });
@@ -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>
@@ -438,6 +438,7 @@ export function Quote(props: QuoteProps) {
438
438
  selected={selected}
439
439
  listItem={type === 'list-item'}
440
440
  open={expanded}
441
+ className="quote_container"
441
442
  onOpenChange={setExpanded}>
442
443
  <QuoteTrigger
443
444
  type={type}
@@ -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} />
@@ -27,7 +27,7 @@ export const Steps = styled('div', {
27
27
  });
28
28
 
29
29
  export const StepSeparator = styled('div', {
30
- borderLeft: '1px dashed black',
30
+ borderLeft: '1px dashed $foreground',
31
31
  minHeight: ' 0',
32
32
  margin: '0px 11.5px',
33
33
  alignSelf: 'stretch',
@@ -1,5 +1,3 @@
1
- import type { PreferenceType } from 'rango-sdk';
2
-
3
1
  import { Select } from '@rango-dev/ui';
4
2
  import React from 'react';
5
3
 
@@ -16,17 +14,11 @@ export function SelectStrategy(props: { container: HTMLElement }) {
16
14
  <Select
17
15
  container={props.container}
18
16
  options={ROUTE_STRATEGY}
19
- value={
20
- ROUTE_STRATEGY.find(
21
- (strategy) => strategy.value === sortStrategy
22
- ) as {
23
- value: PreferenceType;
24
- label: string;
25
- }
26
- }
17
+ value={sortStrategy}
27
18
  handleItemClick={(item) => {
28
- updateQuotePartialState('sortStrategy', item.value as PreferenceType);
19
+ updateQuotePartialState('sortStrategy', item.value);
29
20
  }}
21
+ variant="filled"
30
22
  />
31
23
  </SelectContainer>
32
24
  );
@@ -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
@@ -19,7 +19,7 @@ import React, { useEffect, useState } from 'react';
19
19
 
20
20
  import { useAppStore } from '../../store/AppStore';
21
21
  import { useWalletsStore } from '../../store/wallets';
22
- import { generateRangeColors } from '../../utils/colors';
22
+ import { generateShade, isBright } from '../../utils/colors';
23
23
  import { formatBalance } from '../../utils/wallets';
24
24
 
25
25
  import { LoadingTokenList } from './LoadingTokenList';
@@ -133,23 +133,24 @@ export function TokenList(props: PropTypes) {
133
133
  const blockchain = blockchains.find(
134
134
  (blockchain) => blockchain.name === token.blockchain
135
135
  );
136
- const color = generateRangeColors(
137
- token.symbol,
138
- blockchain?.color || ''
136
+ const lightShade = generateShade(
137
+ blockchain?.color || '',
138
+ isBright(blockchain?.color || '') ? 5 : 125
139
139
  );
140
+ const darkShade = generateShade(blockchain?.color || '', -100);
140
141
 
141
142
  const customCssForTag = {
142
- $$color: color[`${token.symbol}100`],
143
+ $$color: lightShade,
143
144
  [`.${darkTheme} &`]: {
144
- $$color: color[`${token.symbol}900`],
145
+ $$color: darkShade,
145
146
  },
146
147
  backgroundColor: '$$color',
147
148
  };
148
149
 
149
150
  const customCssForTagTitle = {
150
- $$color: color[`${token.symbol}700`],
151
+ $$color: darkShade,
151
152
  [`.${darkTheme} &`]: {
152
- $$color: color[`${token.symbol}100`],
153
+ $$color: lightShade,
153
154
  },
154
155
  color: '$$color',
155
156
  };
@@ -46,7 +46,8 @@ export function useSwapInput({
46
46
  refetchQuote,
47
47
  }: UseSwapInputProps): UseSwapInput {
48
48
  const { fetch: fetchQuote, cancelFetch } = useFetchAllQuotes();
49
- const { enableNewLiquiditySources, features } = useAppStore().config;
49
+ const { excludeLiquiditySources: configExcludeLiquiditySources, features } =
50
+ useAppStore().config;
50
51
  const connectedWallets = useWalletsStore.use.connectedWallets();
51
52
 
52
53
  const tokens = useAppStore().tokens();
@@ -223,7 +224,7 @@ export function useSwapInput({
223
224
  toToken?.blockchain,
224
225
  shouldSkipRequest,
225
226
  liquiditySources?.length,
226
- enableNewLiquiditySources,
227
+ configExcludeLiquiditySources,
227
228
  disabledLiquiditySources.length,
228
229
  userSlippage,
229
230
  affiliateRef,
@@ -371,15 +371,19 @@ 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
378
384
  quote={selectedQuote}
379
385
  type="swap-preview"
380
386
  expanded={true}
381
- selected
382
- tagHidden
383
387
  error={confirmSwapResult.error}
384
388
  loading={fetchingConfirmationQuote}
385
389
  warning={confirmSwapResult.warnings?.quote ?? null}
@@ -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={{
@@ -6,7 +6,7 @@ export const DEFAULT_CONFIG: WidgetConfig = {
6
6
  apiKey: '',
7
7
  title: undefined,
8
8
  multiWallets: true,
9
- enableNewLiquiditySources: true,
9
+ excludeLiquiditySources: true,
10
10
  customDestination: true,
11
11
  };
12
12
 
@@ -72,7 +72,7 @@ export const createConfigSlice: StateCreatorWithInitialData<
72
72
  const { config, campaignMode } = get();
73
73
  return campaignMode.liquiditySources?.length
74
74
  ? false
75
- : !!config.enableNewLiquiditySources;
75
+ : !!config.excludeLiquiditySources;
76
76
  },
77
77
  isInCampaignMode: () => {
78
78
  const { campaignMode } = get();
@@ -177,12 +177,12 @@ export const createDataSlice: StateCreator<
177
177
  const liquiditySources =
178
178
  campaignModeLiquiditySource ?? config.liquiditySources;
179
179
 
180
- const enableNewLiquiditySources = campaignModeLiquiditySource
180
+ const excludeLiquiditySources = campaignModeLiquiditySource
181
181
  ? false
182
- : config.enableNewLiquiditySources;
182
+ : config.excludeLiquiditySources;
183
183
 
184
184
  /*
185
- * If the enableNewLiquiditySources flag is set to true, we return all swappers that are not included in the config.
185
+ * If the excludeLiquiditySources flag is set to true, we return all swappers that are not included in the config.
186
186
  * Otherwise, we return all swappers that are included in the config.
187
187
  */
188
188
  const swappers = get()._swappers.filter((swapper) => {
@@ -191,7 +191,7 @@ export const createDataSlice: StateCreator<
191
191
  );
192
192
 
193
193
  const shouldExcludeLiquiditySources =
194
- enableNewLiquiditySources ||
194
+ excludeLiquiditySources ||
195
195
  !liquiditySources ||
196
196
  liquiditySources.length === 0;
197
197
 
@@ -171,8 +171,8 @@ export type Features = Partial<
171
171
  * that defines the various properties of the theme, such as colors, fonts, and others.
172
172
  * @property {boolean} externalWallets
173
173
  * If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
174
- * @property {boolean} enableNewLiquiditySources - The `enableNewLiquiditySources` property is a boolean value that when you
175
- * set it to true, whenever a new liquidity source is added, it will be added to your list as well.
174
+ * @property {boolean} excludeLiquiditySources - The `excludeLiquiditySources` property is a boolean value that when you
175
+ * set it to true, the list of liquidity sources provided in `liquiditySources` will be excluded; otherwise, they will be included.
176
176
  * @property {Features} features - An optional object for configuring the visibility or enablement of various features.
177
177
  * Keys include:
178
178
  * - 'notification': Visibility state for the notification icon.
@@ -203,7 +203,7 @@ export type WidgetConfig = {
203
203
  language?: Language;
204
204
  theme?: WidgetTheme;
205
205
  externalWallets?: boolean;
206
- enableNewLiquiditySources?: boolean;
206
+ excludeLiquiditySources?: boolean;
207
207
  features?: Features;
208
208
  variant?: WidgetVariant;
209
209
  };