@dynamic-labs/sdk-react-core 2.0.0-alpha.2 → 2.0.0-alpha.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.
- package/CHANGELOG.md +7 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/context/DynamicContext/types/index.d.ts +2 -2
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.cjs +12 -13
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.js +12 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-02-13)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* allow any icon to be used in wallet list tabs ([#4678](https://github.com/dynamic-labs/DynamicAuth/issues/4678)) ([eb03603](https://github.com/dynamic-labs/DynamicAuth/commit/eb036031725a91cb28c144b3bdcb5b20b3314038))
|
|
8
|
+
|
|
2
9
|
## [2.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-13)
|
|
3
10
|
|
|
4
11
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
"react-focus-lock": "2.9.2",
|
|
17
17
|
"react-i18next": "^13.2.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
|
-
"@dynamic-labs/ethereum": "2.0.0-alpha.
|
|
20
|
-
"@dynamic-labs/iconic": "2.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "2.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "2.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "2.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/types": "2.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/utils": "2.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/viem-utils": "2.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/wallet-book": "2.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.
|
|
19
|
+
"@dynamic-labs/ethereum": "2.0.0-alpha.3",
|
|
20
|
+
"@dynamic-labs/iconic": "2.0.0-alpha.3",
|
|
21
|
+
"@dynamic-labs/logger": "2.0.0-alpha.3",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.0.0-alpha.3",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "2.0.0-alpha.3",
|
|
24
|
+
"@dynamic-labs/types": "2.0.0-alpha.3",
|
|
25
|
+
"@dynamic-labs/utils": "2.0.0-alpha.3",
|
|
26
|
+
"@dynamic-labs/viem-utils": "2.0.0-alpha.3",
|
|
27
|
+
"@dynamic-labs/wallet-book": "2.0.0-alpha.3",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.3",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from 'react';
|
|
1
|
+
import { Dispatch, MutableRefObject, ReactElement, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
import { DynamicJwt, NameServiceData, ProjectSettings, SdkView } from '@dynamic-labs/sdk-api';
|
|
3
3
|
import { NetworkConfigurationMap, SocialProviderFilter, WalletUiUtils } from '@dynamic-labs/types';
|
|
4
4
|
import { Chain, FetchPublicAddressOpts, WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
@@ -18,7 +18,7 @@ export type WalletsFilter = (options: WalletOption[]) => WalletOption[];
|
|
|
18
18
|
export type WalletListViewTabItem = {
|
|
19
19
|
label: {
|
|
20
20
|
text?: string;
|
|
21
|
-
icon?: string;
|
|
21
|
+
icon?: string | ReactElement;
|
|
22
22
|
};
|
|
23
23
|
walletsFilter?: WalletsFilter;
|
|
24
24
|
recommendedWallets?: RecommendedWallet[];
|
|
@@ -3,25 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var Icon = require('../../../components/Icon/Icon.cjs');
|
|
7
|
+
var classNames = require('../../../utils/functions/classNames/classNames.cjs');
|
|
8
|
+
require('react');
|
|
9
|
+
require('../../../events/dynamicEvents.cjs');
|
|
10
|
+
require('../../../../../_virtual/_tslib.cjs');
|
|
11
|
+
require('@dynamic-labs/utils');
|
|
12
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
6
13
|
require('@dynamic-labs/sdk-api');
|
|
7
14
|
require('../../../shared/logger.cjs');
|
|
8
|
-
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
9
16
|
require('@dynamic-labs/wallet-connector-core');
|
|
17
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
10
18
|
require('@dynamic-labs/wallet-book');
|
|
11
19
|
require('../../../utils/constants/colors.cjs');
|
|
12
20
|
require('../../../utils/constants/values.cjs');
|
|
13
21
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
14
22
|
require('viem');
|
|
15
|
-
require('react');
|
|
16
|
-
require('@dynamic-labs/utils');
|
|
17
|
-
require('@dynamic-labs/iconic');
|
|
18
|
-
require('../../../context/ViewContext/ViewContext.cjs');
|
|
19
23
|
require('../../../shared/consts/index.cjs');
|
|
20
|
-
var Icon = require('../../../components/Icon/Icon.cjs');
|
|
21
|
-
var classNames = require('../../../utils/functions/classNames/classNames.cjs');
|
|
22
|
-
require('../../../events/dynamicEvents.cjs');
|
|
23
|
-
require('../../../../../_virtual/_tslib.cjs');
|
|
24
|
-
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
25
24
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
26
25
|
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
27
26
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -76,13 +75,13 @@ const WalletListGridTabs = ({ items, onSelect, value, }) => (jsxRuntime.jsx("div
|
|
|
76
75
|
const selected = value === index;
|
|
77
76
|
const { icon, text } = item.label;
|
|
78
77
|
const key = `${text}-${icon}`;
|
|
79
|
-
const
|
|
78
|
+
const TabIcon = typeof icon === 'string' ? jsxRuntime.jsx("img", { src: icon, alt: text }) : icon;
|
|
80
79
|
return (jsxRuntime.jsxs("button", { type: 'button', className: classNames.classNames('wallet-list-grid-tabs__button', {
|
|
81
80
|
'wallet-list-grid-tabs__button--selected': selected,
|
|
82
81
|
'wallet-list-grid-tabs__button--text': Boolean(text),
|
|
83
|
-
}), tabIndex: -1, "aria-label": text
|
|
82
|
+
}), tabIndex: -1, "aria-label": text, onClick: () => onSelect(index), children: [TabIcon && (jsxRuntime.jsx(Icon.Icon, { size: 'small', className: classNames.classNames({
|
|
84
83
|
'wallet-list-grid-tabs__icon--selected': !selected,
|
|
85
|
-
}), children:
|
|
84
|
+
}), children: TabIcon })), text && (jsxRuntime.jsx(Typography.Typography, { as: 'span', variant: 'body_small', weight: selected ? 'bold' : 'medium', color: selected ? 'primary' : 'secondary', children: text }))] }, key));
|
|
86
85
|
}) }));
|
|
87
86
|
|
|
88
87
|
exports.WalletListGridTabs = WalletListGridTabs;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../../../components/Icon/Icon.js';
|
|
3
|
+
import { classNames } from '../../../utils/functions/classNames/classNames.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../../../events/dynamicEvents.js';
|
|
6
|
+
import '../../../../../_virtual/_tslib.js';
|
|
7
|
+
import '@dynamic-labs/utils';
|
|
8
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
2
9
|
import '@dynamic-labs/sdk-api';
|
|
3
10
|
import '../../../shared/logger.js';
|
|
4
|
-
import
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
5
12
|
import '@dynamic-labs/wallet-connector-core';
|
|
13
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
6
14
|
import '@dynamic-labs/wallet-book';
|
|
7
15
|
import '../../../utils/constants/colors.js';
|
|
8
16
|
import '../../../utils/constants/values.js';
|
|
9
17
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
10
18
|
import 'viem';
|
|
11
|
-
import 'react';
|
|
12
|
-
import '@dynamic-labs/utils';
|
|
13
|
-
import '@dynamic-labs/iconic';
|
|
14
|
-
import '../../../context/ViewContext/ViewContext.js';
|
|
15
19
|
import '../../../shared/consts/index.js';
|
|
16
|
-
import { Icon } from '../../../components/Icon/Icon.js';
|
|
17
|
-
import { classNames } from '../../../utils/functions/classNames/classNames.js';
|
|
18
|
-
import '../../../events/dynamicEvents.js';
|
|
19
|
-
import '../../../../../_virtual/_tslib.js';
|
|
20
|
-
import '../../../context/DynamicContext/DynamicContext.js';
|
|
21
20
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
22
21
|
import '../../../context/ErrorContext/ErrorContext.js';
|
|
23
22
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -72,13 +71,13 @@ const WalletListGridTabs = ({ items, onSelect, value, }) => (jsx("div", { classN
|
|
|
72
71
|
const selected = value === index;
|
|
73
72
|
const { icon, text } = item.label;
|
|
74
73
|
const key = `${text}-${icon}`;
|
|
75
|
-
const
|
|
74
|
+
const TabIcon = typeof icon === 'string' ? jsx("img", { src: icon, alt: text }) : icon;
|
|
76
75
|
return (jsxs("button", { type: 'button', className: classNames('wallet-list-grid-tabs__button', {
|
|
77
76
|
'wallet-list-grid-tabs__button--selected': selected,
|
|
78
77
|
'wallet-list-grid-tabs__button--text': Boolean(text),
|
|
79
|
-
}), tabIndex: -1, "aria-label": text
|
|
78
|
+
}), tabIndex: -1, "aria-label": text, onClick: () => onSelect(index), children: [TabIcon && (jsx(Icon, { size: 'small', className: classNames({
|
|
80
79
|
'wallet-list-grid-tabs__icon--selected': !selected,
|
|
81
|
-
}), children:
|
|
80
|
+
}), children: TabIcon })), text && (jsx(Typography, { as: 'span', variant: 'body_small', weight: selected ? 'bold' : 'medium', color: selected ? 'primary' : 'secondary', children: text }))] }, key));
|
|
82
81
|
}) }));
|
|
83
82
|
|
|
84
83
|
export { WalletListGridTabs };
|