@rango-dev/widget-embedded 0.12.1-next.26 → 0.12.1-next.28

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 (64) hide show
  1. package/dist/Widget.d.ts.map +1 -1
  2. package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -1
  3. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -1
  4. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +4 -2
  5. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  6. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  7. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  8. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +4 -2
  9. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
  10. package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
  11. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  12. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +4 -4
  15. package/dist/pages/Home.d.ts.map +1 -1
  16. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  17. package/dist/pages/SettingsPage.d.ts.map +1 -1
  18. package/dist/pages/WalletsPage.d.ts.map +1 -1
  19. package/dist/utils/numbers.d.ts +3 -1
  20. package/dist/utils/numbers.d.ts.map +1 -1
  21. package/package.json +2 -2
  22. package/src/Widget.tsx +4 -0
  23. package/src/components/BlockchainList/BlockchainList.helpers.ts +1 -1
  24. package/src/components/BlockchainsSection/BlockchainsSection.tsx +7 -2
  25. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +5 -3
  26. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +13 -1
  27. package/src/components/ConfirmWalletsModal/WalletList.tsx +25 -13
  28. package/src/components/Layout/Layout.styles.ts +3 -0
  29. package/src/components/Slippage/SlippageTooltipContent.tsx +1 -1
  30. package/src/components/SwapDetails/SwapDetails.styles.ts +1 -2
  31. package/src/components/SwapDetails/SwapDetails.tsx +7 -15
  32. package/src/pages/ConfirmSwapPage.tsx +4 -4
  33. package/src/pages/Home.tsx +5 -1
  34. package/src/pages/SelectBlockchainPage.tsx +7 -3
  35. package/src/pages/SettingsPage.tsx +24 -3
  36. package/src/pages/WalletsPage.tsx +9 -5
  37. package/src/utils/numbers.ts +3 -2
  38. package/dist/components/BlockchainsChip/BlockchainsChip.d.ts +0 -5
  39. package/dist/components/BlockchainsChip/BlockchainsChip.d.ts.map +0 -1
  40. package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts +0 -156
  41. package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +0 -1
  42. package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts +0 -6
  43. package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +0 -1
  44. package/dist/components/BlockchainsChip/index.d.ts +0 -2
  45. package/dist/components/BlockchainsChip/index.d.ts.map +0 -1
  46. package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts +0 -4
  47. package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +0 -1
  48. package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +0 -4
  49. package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +0 -1
  50. package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +0 -460
  51. package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +0 -1
  52. package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts +0 -12
  53. package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts.map +0 -1
  54. package/dist/components/SelectableCategoryList/index.d.ts +0 -2
  55. package/dist/components/SelectableCategoryList/index.d.ts.map +0 -1
  56. package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +0 -42
  57. package/src/components/BlockchainsChip/BlockchainsChip.tsx +0 -15
  58. package/src/components/BlockchainsChip/BlockchainsChip.types.ts +0 -4
  59. package/src/components/BlockchainsChip/index.ts +0 -1
  60. package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +0 -20
  61. package/src/components/SelectableCategoryList/SelectableCategoryList.styles.ts +0 -21
  62. package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +0 -79
  63. package/src/components/SelectableCategoryList/SelectableCategoryList.types.ts +0 -12
  64. package/src/components/SelectableCategoryList/index.ts +0 -1
@@ -1,42 +0,0 @@
1
- import { darkTheme, styled } from '@rango-dev/ui';
2
-
3
- export const Chip = styled('button', {
4
- padding: '$10',
5
- borderRadius: '$sm',
6
- $$color: '$colors$neutral100',
7
- [`.${darkTheme} &`]: {
8
- $$color: '$colors$neutral300',
9
- },
10
- backgroundColor: '$$color',
11
- display: 'flex',
12
- flexDirection: 'column',
13
- justifyContent: 'center',
14
- alignItems: 'center',
15
- cursor: 'pointer',
16
- border: 0,
17
- '.image-container': {
18
- borderRadius: '$xm',
19
- overflow: 'hidden',
20
- },
21
- '&:hover': {
22
- $$color: '$colors$info100',
23
- [`.${darkTheme} &`]: {
24
- $$color: '$colors$neutral100',
25
- },
26
- backgroundColor: '$$color',
27
- },
28
- '&:focus-visible': {
29
- outline: 0,
30
- $$color: '$colors$info100',
31
- [`.${darkTheme} &`]: {
32
- $$color: '$colors$info700',
33
- },
34
- backgroundColor: '$$color',
35
- },
36
- variants: {
37
- selected: {
38
- true: { outline: '1px solid $secondary500' },
39
- false: { outline: 0 },
40
- },
41
- },
42
- });
@@ -1,15 +0,0 @@
1
- import type { PropTypes } from './BlockchainsChip.types';
2
- import type { PropsWithChildren } from 'react';
3
-
4
- import React from 'react';
5
-
6
- import { Chip } from './BlockchainsChip.styles';
7
-
8
- export function BlockchainsChip(props: PropsWithChildren<PropTypes>) {
9
- const { children, selected, onClick } = props;
10
- return (
11
- <Chip selected={selected} onClick={onClick}>
12
- {children}
13
- </Chip>
14
- );
15
- }
@@ -1,4 +0,0 @@
1
- export interface PropTypes {
2
- selected?: boolean;
3
- onClick?: React.MouseEventHandler<HTMLButtonElement>;
4
- }
@@ -1 +0,0 @@
1
- export { BlockchainsChip } from './BlockchainsChip';
@@ -1,20 +0,0 @@
1
- import { type BlockchainMeta } from 'rango-sdk';
2
-
3
- import { filterByType } from '../BlockchainList/BlockchainList.helpers';
4
-
5
- import { BlockchainCategories } from './SelectableCategoryList.types';
6
-
7
- const blockchainslogo = {
8
- [BlockchainCategories.EVM]: ['ETH', 'BSC', 'POLYGON'],
9
- [BlockchainCategories.COSMOS]: ['COSMOS', 'OSMOSIS', 'JUNO'],
10
- [BlockchainCategories.UTXO]: ['BTC', 'LTC', 'BCH'],
11
- [BlockchainCategories.OTHER]: ['STARKNET', 'TRON', 'SOLANA'],
12
- };
13
-
14
- export const generateBlockchainsLogo = (
15
- list: BlockchainMeta[],
16
- type: Exclude<BlockchainCategories, 'ALL'>
17
- ) =>
18
- list
19
- .filter((item) => filterByType(item, type))
20
- .filter((item) => blockchainslogo[type].includes(item.name));
@@ -1,21 +0,0 @@
1
- import { styled } from '@rango-dev/ui';
2
-
3
- export const Container = styled('div', {
4
- display: 'grid',
5
- gap: '$10',
6
- gridTemplateColumns: 'auto 1fr 1fr 1fr 1fr',
7
- });
8
-
9
- export const ImageContent = styled('div', {
10
- display: 'flex',
11
- position: 'relative',
12
- alignItems: 'center',
13
- justifyContent: 'center',
14
- paddingTop: '$10',
15
- });
16
- export const FirstImage = styled('img', {
17
- position: 'absolute',
18
- top: -2,
19
- width: 15,
20
- height: 15,
21
- });
@@ -1,79 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-magic-numbers */
2
- import type { PropTypes } from './SelectableCategoryList.types';
3
-
4
- import { i18n } from '@lingui/core';
5
- import { Divider, Image, Skeleton, Typography } from '@rango-dev/ui';
6
- import React from 'react';
7
-
8
- import { useMetaStore } from '../../store/meta';
9
- import { BlockchainsChip } from '../BlockchainsChip';
10
-
11
- import { generateBlockchainsLogo } from './SelectableCategoryList.helpers';
12
- import {
13
- Container,
14
- FirstImage,
15
- ImageContent,
16
- } from './SelectableCategoryList.styles';
17
- import { BlockchainCategories } from './SelectableCategoryList.types';
18
-
19
- export function SelectableCategoryList(props: PropTypes) {
20
- const { setCategory, category } = props;
21
- const blockchains = useMetaStore.use.meta().blockchains;
22
- const loadingStatus = useMetaStore.use.loadingStatus();
23
- const categories = Object.keys(
24
- BlockchainCategories
25
- ) as BlockchainCategories[];
26
- return (
27
- <Container>
28
- {loadingStatus === 'loading' &&
29
- Array.from(Array(5), (_, index) => (
30
- <Skeleton
31
- key={index}
32
- variant="rounded"
33
- height={70}
34
- width={index === 0 ? 45 : 65}
35
- />
36
- ))}
37
- {loadingStatus === 'success' &&
38
- categories.map((blockchainCategory) => (
39
- <BlockchainsChip
40
- selected={category === blockchainCategory}
41
- key={blockchainCategory}
42
- onClick={() => setCategory(blockchainCategory)}>
43
- {blockchainCategory !== BlockchainCategories.ALL && (
44
- <>
45
- <ImageContent>
46
- {generateBlockchainsLogo(blockchains, blockchainCategory).map(
47
- (blockchain, index) =>
48
- index === 0 ? (
49
- <FirstImage
50
- key={`image-${blockchain.name}-${blockchain.chainId}`}
51
- src={blockchain.logo}
52
- />
53
- ) : (
54
- <Image
55
- key={`image-${blockchain.name}-${blockchain.chainId}`}
56
- src={blockchain.logo}
57
- size={15}
58
- />
59
- )
60
- )}
61
- </ImageContent>
62
- <Divider size={12} />
63
- </>
64
- )}
65
- <Typography
66
- size="xsmall"
67
- variant="body"
68
- color={
69
- blockchainCategory === BlockchainCategories.ALL
70
- ? 'secondary500'
71
- : undefined
72
- }>
73
- {i18n.t(BlockchainCategories[blockchainCategory])}
74
- </Typography>
75
- </BlockchainsChip>
76
- ))}
77
- </Container>
78
- );
79
- }
@@ -1,12 +0,0 @@
1
- export interface PropTypes {
2
- setCategory: (type: string) => void;
3
- category: string;
4
- }
5
-
6
- export enum BlockchainCategories {
7
- ALL = 'ALL',
8
- EVM = 'EVM',
9
- COSMOS = 'COSMOS',
10
- UTXO = 'UTXO',
11
- OTHER = 'OTHER',
12
- }
@@ -1 +0,0 @@
1
- export { SelectableCategoryList } from './SelectableCategoryList';