@rango-dev/ui 0.27.1-next.2 → 0.27.1-next.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TokenList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TokenList/TokenList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAGD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;CACxB;AACD;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,qBAyEzC"}
1
+ {"version":3,"file":"TokenList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TokenList/TokenList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAGD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;CACxB;AACD;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,qBAkDzC"}
@@ -1,5 +1,3 @@
1
- import type { PropTypes } from './VirtualizedList.types';
2
- import type { PropsWithChildren } from 'react';
3
- import React from 'react';
4
- export declare function VirtualizedList(props: PropsWithChildren<PropTypes>): React.JSX.Element;
1
+ import { GroupedVirtuoso as GroupedVirtualizedList, Virtuoso as VirtualizedList } from 'react-virtuoso';
2
+ export { VirtualizedList, GroupedVirtualizedList };
5
3
  //# sourceMappingURL=VirtualizedList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/VirtualizedList/VirtualizedList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAsClE"}
1
+ {"version":3,"file":"VirtualizedList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/VirtualizedList/VirtualizedList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,IAAI,sBAAsB,EACzC,QAAQ,IAAI,eAAe,EAC5B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- export { VirtualizedList } from './VirtualizedList';
1
+ export { VirtualizedList, GroupedVirtualizedList } from './VirtualizedList';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/VirtualizedList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/VirtualizedList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.27.1-next.2",
3
+ "version": "0.27.1-next.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -45,9 +45,6 @@
45
45
  "@svgr/cli": "^8.0.1",
46
46
  "@types/react": "^18.0.25",
47
47
  "@types/react-dom": "^18.0.8",
48
- "@types/react-virtualized-auto-sizer": "^1.0.1",
49
- "@types/react-window": "^1.8.5",
50
- "@types/react-window-infinite-loader": "^1.0.6",
51
48
  "babel-loader": "^9.1.0",
52
49
  "husky": "^8.0.2",
53
50
  "react": "^18.2.0",
@@ -69,9 +66,7 @@
69
66
  "@stitches/react": "^1.2.8",
70
67
  "rango-sdk": "^0.1.44",
71
68
  "rango-types": "^0.1.57",
72
- "react-virtualized-auto-sizer": "^1.0.7",
73
- "react-window": "^1.8.8",
74
- "react-window-infinite-loader": "^1.0.8",
69
+ "react-virtuoso": "^4.6.2",
75
70
  "rgb-hex": "^4.0.1"
76
71
  },
77
72
  "publishConfig": {
@@ -1,10 +1,9 @@
1
1
  /* eslint-disable @typescript-eslint/no-magic-numbers */
2
2
  import type { Asset, Token } from 'rango-sdk';
3
- import type { CommonProps } from 'react-window';
4
3
 
5
- import React, { forwardRef, useEffect, useState } from 'react';
4
+ import React, { useEffect, useState } from 'react';
6
5
 
7
- import { VirtualizedList } from '../VirtualizedList/VirtualizedList';
6
+ import { VirtualizedList } from '../VirtualizedList';
8
7
 
9
8
  import { TokenItem } from './TokenItem';
10
9
 
@@ -64,40 +63,17 @@ export function TokenList(props: PropTypes) {
64
63
  setHasNextPage(list.length > tokens.length);
65
64
  }, [tokens.length]);
66
65
 
67
- // eslint-disable-next-line react/display-name
68
- const innerElementType: React.FC<CommonProps> = forwardRef(
69
- // eslint-disable-next-line destructuring/in-params, react/prop-types
70
- ({ style, ...rest }, ref) => {
71
- return (
72
- <div
73
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
- ref={ref as any}
75
- style={{
76
- ...style,
77
- // eslint-disable-next-line react/prop-types
78
- height: `${parseFloat(style?.height as string) + 8 * 2}px`,
79
- }}
80
- {...rest}
81
- />
82
- );
83
- }
84
- );
85
-
86
66
  return (
87
67
  <VirtualizedList
88
- Item={({ index, style }) => (
68
+ itemContent={(index) => (
89
69
  <TokenItem
90
70
  token={tokens[index]}
91
- style={style}
92
71
  onClick={changeSelected}
93
72
  selected={isSelected(tokens[index])}
94
73
  />
95
74
  )}
96
- hasNextPage={hasNextPage}
97
- itemCount={tokens.length}
98
- loadNextPage={loadNextPage}
99
- innerElementType={innerElementType}
100
- size={56}
75
+ totalCount={tokens.length}
76
+ endReached={hasNextPage ? loadNextPage : undefined}
101
77
  />
102
78
  );
103
79
  }
@@ -1,48 +1,6 @@
1
- import type { PropTypes } from './VirtualizedList.types';
2
- import type { CSSProperties } from '@stitches/react';
3
- import type { PropsWithChildren } from 'react';
1
+ import {
2
+ GroupedVirtuoso as GroupedVirtualizedList,
3
+ Virtuoso as VirtualizedList,
4
+ } from 'react-virtuoso';
4
5
 
5
- import React from 'react';
6
- import AutoSizer from 'react-virtualized-auto-sizer';
7
- import { VariableSizeList as List } from 'react-window';
8
- import InfiniteLoader from 'react-window-infinite-loader';
9
-
10
- export function VirtualizedList(props: PropsWithChildren<PropTypes>) {
11
- // TODO: react/prop-types problem
12
- // eslint-disable-next-line react/prop-types
13
- const { itemCount, hasNextPage, loadNextPage, Item, innerElementType, size } =
14
- props;
15
-
16
- const isItemLoaded = (index: number) => !hasNextPage || index < itemCount;
17
-
18
- return (
19
- <AutoSizer>
20
- {({ width, height }: { width: number; height: number }) => (
21
- <InfiniteLoader
22
- isItemLoaded={isItemLoaded}
23
- itemCount={hasNextPage ? itemCount + 1 : itemCount}
24
- loadMoreItems={loadNextPage}
25
- threshold={1}>
26
- {({ onItemsRendered, ref }) => {
27
- return (
28
- <List
29
- innerElementType={innerElementType}
30
- ref={ref}
31
- itemSize={() => size}
32
- itemCount={itemCount}
33
- height={height || 0}
34
- width={width || 0}
35
- onItemsRendered={onItemsRendered}>
36
- {({ index, style }) =>
37
- isItemLoaded(index) ? (
38
- <Item index={index} style={style as CSSProperties} />
39
- ) : null
40
- }
41
- </List>
42
- );
43
- }}
44
- </InfiniteLoader>
45
- )}
46
- </AutoSizer>
47
- );
48
- }
6
+ export { VirtualizedList, GroupedVirtualizedList };
@@ -1 +1 @@
1
- export { VirtualizedList } from './VirtualizedList';
1
+ export { VirtualizedList, GroupedVirtualizedList } from './VirtualizedList';
@@ -1,16 +0,0 @@
1
- /// <reference types="react" />
2
- import type { CSSProperties } from '@stitches/react';
3
- import type { ReactElementType } from 'react-window';
4
- export type VirtualizedListItem = ({ index, style, }: {
5
- index: number;
6
- style: CSSProperties | undefined;
7
- }) => JSX.Element | null;
8
- export type PropTypes = {
9
- itemCount: number;
10
- hasNextPage: boolean;
11
- loadNextPage: () => void;
12
- Item: VirtualizedListItem;
13
- innerElementType: ReactElementType | undefined;
14
- size: number;
15
- };
16
- //# sourceMappingURL=VirtualizedList.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VirtualizedList.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/VirtualizedList/VirtualizedList.types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,CAAC,EACjC,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;CAClC,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;AAEzB,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC/C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -1,19 +0,0 @@
1
- import type { CSSProperties } from '@stitches/react';
2
- import type { ReactElementType } from 'react-window';
3
-
4
- export type VirtualizedListItem = ({
5
- index,
6
- style,
7
- }: {
8
- index: number;
9
- style: CSSProperties | undefined;
10
- }) => JSX.Element | null;
11
-
12
- export type PropTypes = {
13
- itemCount: number;
14
- hasNextPage: boolean;
15
- loadNextPage: () => void;
16
- Item: VirtualizedListItem;
17
- innerElementType: ReactElementType | undefined;
18
- size: number;
19
- };