@dynamic-labs/sdk-react-core 4.0.0-alpha.20 → 4.0.0-alpha.22

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 (30) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +11 -11
  5. package/src/lib/components/Button/Button.cjs +2 -2
  6. package/src/lib/components/Button/Button.d.ts +2 -1
  7. package/src/lib/components/Button/Button.js +2 -2
  8. package/src/lib/components/CopyButton/CopyButton.cjs +5 -5
  9. package/src/lib/components/CopyButton/CopyButton.js +7 -7
  10. package/src/lib/components/NetworkPicker/NetworkPicker.cjs +1 -1
  11. package/src/lib/components/NetworkPicker/NetworkPicker.js +1 -1
  12. package/src/lib/components/Tooltip/Tooltip.cjs +38 -6
  13. package/src/lib/components/Tooltip/Tooltip.d.ts +16 -1
  14. package/src/lib/components/Tooltip/Tooltip.js +38 -6
  15. package/src/lib/components/index.d.ts +1 -0
  16. package/src/lib/locale/en/translation.cjs +31 -1
  17. package/src/lib/locale/en/translation.d.ts +31 -1
  18. package/src/lib/locale/en/translation.js +31 -1
  19. package/src/lib/shared/assets/eye-outline.cjs +54 -0
  20. package/src/lib/shared/assets/eye-outline.js +30 -0
  21. package/src/lib/shared/assets/index.d.ts +1 -0
  22. package/src/lib/styles/index.shadow.cjs +1 -1
  23. package/src/lib/styles/index.shadow.js +1 -1
  24. package/src/lib/utils/hooks/useHover/useHover.types.d.ts +1 -4
  25. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +20 -11
  26. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +20 -11
  27. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.cjs +99 -0
  28. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.d.ts +12 -0
  29. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.js +95 -0
  30. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/index.d.ts +1 -0
@@ -1,8 +1,5 @@
1
1
  export type MouseEventHandlers = {
2
- onMouseDown: () => void;
3
- onMouseEnter: () => void;
4
- onMouseLeave: () => void;
5
- onMouseUp: () => void;
2
+ [key: string]: VoidFunction;
6
3
  };
7
4
  type HoverHookArgs = {
8
5
  initialValue?: boolean;
@@ -19,6 +19,10 @@ var logger = require('../../../../shared/logger.cjs');
19
19
  require('@dynamic-labs/iconic');
20
20
  require('../../../../context/ViewContext/ViewContext.cjs');
21
21
  var chevronDown = require('../../../../shared/assets/chevron-down.cjs');
22
+ var copy = require('../../../../shared/assets/copy.cjs');
23
+ var eyeOutline = require('../../../../shared/assets/eye-outline.cjs');
24
+ var key = require('../../../../shared/assets/key.cjs');
25
+ var walletV2 = require('../../../../shared/assets/wallet-v2.cjs');
22
26
  require('@dynamic-labs/wallet-book');
23
27
  require('../../../../utils/constants/colors.cjs');
24
28
  require('../../../../utils/constants/values.cjs');
@@ -95,17 +99,20 @@ require('../../../../components/Popper/Popper/Popper.cjs');
95
99
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
96
100
  require('qrcode');
97
101
  var isMultiAssetSupportedNetwork = require('../../../../utils/functions/isMultiAssetSupportedNetwork/isMultiAssetSupportedNetwork.cjs');
102
+ var WalletDetailsCard = require('../WalletDetailsCard/WalletDetailsCard.cjs');
98
103
  var ActiveBitcoinWalletAddresses = require('./ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs');
99
104
  var ActiveWalletAddress = require('./ActiveWalletAddress/ActiveWalletAddress.cjs');
100
105
  var TokenBalanceList = require('./TokenBalanceList/TokenBalanceList.cjs');
101
106
 
102
107
  const ICON_SIZE = 28;
108
+ const DROPDOWN_ICON_SIZE = 16;
103
109
  const ActiveWalletInformation = ({ isLoading = false, }) => {
104
110
  var _a, _b, _c, _d, _e;
105
111
  const { t } = reactI18next.useTranslation();
106
112
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
107
113
  const [balanceIsExpanded, setBalanceIsExpanded] = React.useState(false);
108
114
  const [hasShadow, setHasShadow] = React.useState(false);
115
+ const [detailsCardOpen, setDetailsCardOpen] = React.useState(false);
109
116
  const contentRef = React.useRef(null);
110
117
  const { primaryWallet, network, projectSettings, user, authMode, showFiat, multiAsset, } = useInternalDynamicContext.useInternalDynamicContext();
111
118
  const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
@@ -130,30 +137,32 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
130
137
  ((_e = (_d = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _d === void 0 ? void 0 : _d.key) === null || _e === void 0 ? void 0 : _e.startsWith('coinbasempc'))));
131
138
  const options = [
132
139
  {
133
- Icon: null,
140
+ Icon: jsxRuntime.jsx(copy.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE }),
134
141
  callback: () => (nameService === null || nameService === void 0 ? void 0 : nameService.name) && navigator.clipboard.writeText(nameService === null || nameService === void 0 ? void 0 : nameService.name),
135
142
  hide: !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
136
- text: 'Copy ENS',
143
+ text: t('dyn_active_wallet_info.options.copy_ens'),
137
144
  },
138
145
  {
139
- Icon: null,
140
- callback: () => address && navigator.clipboard.writeText(address),
146
+ Icon: (jsxRuntime.jsx(eyeOutline.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
147
+ callback: () => {
148
+ setDetailsCardOpen(true);
149
+ },
141
150
  hide: !address,
142
- text: 'Copy wallet address',
151
+ text: t('dyn_active_wallet_info.options.view_address'),
143
152
  },
144
153
  {
145
- Icon: null,
154
+ Icon: (jsxRuntime.jsx(walletV2.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
146
155
  callback: () => setDynamicWidgetView('settings'),
147
156
  endSlot: showAlert() ? jsxRuntime.jsx(StatusDot.StatusDot, { variant: 'yellow' }) : undefined,
148
157
  hide: !isEmbeddedWallet,
149
- text: 'Wallet settings',
158
+ text: t('dyn_active_wallet_info.options.settings'),
150
159
  },
151
160
  {
152
- Icon: null,
161
+ Icon: (jsxRuntime.jsx(key.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
153
162
  callback: exportKeysOption ||
154
163
  (() => logger.logger.info('No option to export private keys')),
155
164
  hide: !exportKeysOption,
156
- text: 'Export private keys',
165
+ text: t('dyn_active_wallet_info.options.export'),
157
166
  },
158
167
  ];
159
168
  const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
@@ -189,7 +198,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
189
198
  if (!isLoadingTokenBalances) {
190
199
  setBalanceIsExpanded(!balanceIsExpanded);
191
200
  }
192
- }, className: 'balance-header', children: [jsxRuntime.jsxs("div", { className: 'balance-header__title', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', style: { marginRight: '8px' }, children: "Balance:" }), showFiat ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: totalValue === 0 || totalValue >= 0.01
201
+ }, className: 'balance-header', children: [jsxRuntime.jsxs("div", { className: 'balance-header__title', children: [jsxRuntime.jsxs(Typography.Typography, { color: 'secondary', variant: 'body_small', style: { marginRight: '8px' }, children: [t('dyn_active_wallet_info.balance'), ":"] }), showFiat ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: totalValue === 0 || totalValue >= 0.01
193
202
  ? currencyFormatter.format(parseFloat(totalValue.toFixed(2)))
194
203
  : '<$0.01' })) : (primaryWalletNativeBalance())] }), jsxRuntime.jsx("div", { className: balanceIsExpanded ? 'balance-header__chevron' : '', children: jsxRuntime.jsx(chevronDown.ReactComponent, {}) })] }) }), jsxRuntime.jsx(AccordionItem.AccordionItem, { isOpen: balanceIsExpanded, className: `multi-asset-balance-container__accordion ${'multi-asset-balance-container__accordion' +
195
204
  (balanceIsExpanded ? '--expanded' : '--collapsed')}`, handleScroll: handleScroll, ref: contentRef, children: jsxRuntime.jsx(TokenBalanceList.TokenBalanceList, { tokenBalances: filteredTokenBalances }) })] }));
@@ -198,7 +207,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
198
207
  }
199
208
  return (jsxRuntime.jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information__header', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar__name-service', children: jsxRuntime.jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsxRuntime.jsx("div", { className: 'active-wallet-information__wallet-img', children: jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: ICON_SIZE }) })) }), jsxRuntime.jsxs("div", { className: 'active-wallet-information__details', children: [jsxRuntime.jsx("div", { className: classNames.classNames('active-wallet-information__addresses-container', {
200
209
  'active-wallet-information__addresses-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
201
- }), children: activeWalletAddress() }), !shouldHideNetwork && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true, isLoading: isLoading }))] })] }), showTestnetAlert && (jsxRuntime.jsx(Alert.Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), showMultiAsset ? (jsxRuntime.jsx("div", { className: 'multi-asset-balance-container', children: multiAssetHeader() })) : (jsxRuntime.jsxs("div", { className: 'balance-container', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: "Balance" }), primaryWalletNativeBalance()] }))] }));
210
+ }), children: activeWalletAddress() }), address && (jsxRuntime.jsx(WalletDetailsCard.WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true, isLoading: isLoading }))] })] }), showTestnetAlert && (jsxRuntime.jsx(Alert.Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), showMultiAsset ? (jsxRuntime.jsx("div", { className: 'multi-asset-balance-container', children: multiAssetHeader() })) : (jsxRuntime.jsxs("div", { className: 'balance-container', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_active_wallet_info.balance') }), primaryWalletNativeBalance()] }))] }));
202
211
  };
203
212
 
204
213
  exports.ActiveWalletInformation = ActiveWalletInformation;
@@ -15,6 +15,10 @@ import { logger } from '../../../../shared/logger.js';
15
15
  import '@dynamic-labs/iconic';
16
16
  import '../../../../context/ViewContext/ViewContext.js';
17
17
  import { ReactComponent as SvgChevronDown } from '../../../../shared/assets/chevron-down.js';
18
+ import { ReactComponent as SvgCopy } from '../../../../shared/assets/copy.js';
19
+ import { ReactComponent as SvgEyeOutline } from '../../../../shared/assets/eye-outline.js';
20
+ import { ReactComponent as SvgKey } from '../../../../shared/assets/key.js';
21
+ import { ReactComponent as SvgWalletV2 } from '../../../../shared/assets/wallet-v2.js';
18
22
  import '@dynamic-labs/wallet-book';
19
23
  import '../../../../utils/constants/colors.js';
20
24
  import '../../../../utils/constants/values.js';
@@ -91,17 +95,20 @@ import '../../../../components/Popper/Popper/Popper.js';
91
95
  import '../../../../components/Popper/PopperContext/PopperContext.js';
92
96
  import 'qrcode';
93
97
  import { isMultiAssetSupportedNetwork } from '../../../../utils/functions/isMultiAssetSupportedNetwork/isMultiAssetSupportedNetwork.js';
98
+ import { WalletDetailsCard } from '../WalletDetailsCard/WalletDetailsCard.js';
94
99
  import { ActiveBitcoinWalletAddresses } from './ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js';
95
100
  import { ActiveWalletAddress } from './ActiveWalletAddress/ActiveWalletAddress.js';
96
101
  import { TokenBalanceList } from './TokenBalanceList/TokenBalanceList.js';
97
102
 
98
103
  const ICON_SIZE = 28;
104
+ const DROPDOWN_ICON_SIZE = 16;
99
105
  const ActiveWalletInformation = ({ isLoading = false, }) => {
100
106
  var _a, _b, _c, _d, _e;
101
107
  const { t } = useTranslation();
102
108
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
103
109
  const [balanceIsExpanded, setBalanceIsExpanded] = useState(false);
104
110
  const [hasShadow, setHasShadow] = useState(false);
111
+ const [detailsCardOpen, setDetailsCardOpen] = useState(false);
105
112
  const contentRef = useRef(null);
106
113
  const { primaryWallet, network, projectSettings, user, authMode, showFiat, multiAsset, } = useInternalDynamicContext();
107
114
  const { setDynamicWidgetView } = useWidgetContext();
@@ -126,30 +133,32 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
126
133
  ((_e = (_d = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _d === void 0 ? void 0 : _d.key) === null || _e === void 0 ? void 0 : _e.startsWith('coinbasempc'))));
127
134
  const options = [
128
135
  {
129
- Icon: null,
136
+ Icon: jsx(SvgCopy, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE }),
130
137
  callback: () => (nameService === null || nameService === void 0 ? void 0 : nameService.name) && navigator.clipboard.writeText(nameService === null || nameService === void 0 ? void 0 : nameService.name),
131
138
  hide: !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
132
- text: 'Copy ENS',
139
+ text: t('dyn_active_wallet_info.options.copy_ens'),
133
140
  },
134
141
  {
135
- Icon: null,
136
- callback: () => address && navigator.clipboard.writeText(address),
142
+ Icon: (jsx(SvgEyeOutline, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
143
+ callback: () => {
144
+ setDetailsCardOpen(true);
145
+ },
137
146
  hide: !address,
138
- text: 'Copy wallet address',
147
+ text: t('dyn_active_wallet_info.options.view_address'),
139
148
  },
140
149
  {
141
- Icon: null,
150
+ Icon: (jsx(SvgWalletV2, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
142
151
  callback: () => setDynamicWidgetView('settings'),
143
152
  endSlot: showAlert() ? jsx(StatusDot, { variant: 'yellow' }) : undefined,
144
153
  hide: !isEmbeddedWallet,
145
- text: 'Wallet settings',
154
+ text: t('dyn_active_wallet_info.options.settings'),
146
155
  },
147
156
  {
148
- Icon: null,
157
+ Icon: (jsx(SvgKey, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
149
158
  callback: exportKeysOption ||
150
159
  (() => logger.info('No option to export private keys')),
151
160
  hide: !exportKeysOption,
152
- text: 'Export private keys',
161
+ text: t('dyn_active_wallet_info.options.export'),
153
162
  },
154
163
  ];
155
164
  const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
@@ -185,7 +194,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
185
194
  if (!isLoadingTokenBalances) {
186
195
  setBalanceIsExpanded(!balanceIsExpanded);
187
196
  }
188
- }, className: 'balance-header', children: [jsxs("div", { className: 'balance-header__title', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', style: { marginRight: '8px' }, children: "Balance:" }), showFiat ? (jsx(Typography, { variant: 'body_normal', color: 'primary', children: totalValue === 0 || totalValue >= 0.01
197
+ }, className: 'balance-header', children: [jsxs("div", { className: 'balance-header__title', children: [jsxs(Typography, { color: 'secondary', variant: 'body_small', style: { marginRight: '8px' }, children: [t('dyn_active_wallet_info.balance'), ":"] }), showFiat ? (jsx(Typography, { variant: 'body_normal', color: 'primary', children: totalValue === 0 || totalValue >= 0.01
189
198
  ? currencyFormatter.format(parseFloat(totalValue.toFixed(2)))
190
199
  : '<$0.01' })) : (primaryWalletNativeBalance())] }), jsx("div", { className: balanceIsExpanded ? 'balance-header__chevron' : '', children: jsx(SvgChevronDown, {}) })] }) }), jsx(AccordionItem, { isOpen: balanceIsExpanded, className: `multi-asset-balance-container__accordion ${'multi-asset-balance-container__accordion' +
191
200
  (balanceIsExpanded ? '--expanded' : '--collapsed')}`, handleScroll: handleScroll, ref: contentRef, children: jsx(TokenBalanceList, { tokenBalances: filteredTokenBalances }) })] }));
@@ -194,7 +203,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
194
203
  }
195
204
  return (jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information__header', children: [jsx("div", { className: 'active-wallet-information__avatar', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("div", { className: 'active-wallet-information__avatar__name-service', children: jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsx("div", { className: 'active-wallet-information__wallet-img', children: jsx(AuthProviderIcon, { iconSize: ICON_SIZE }) })) }), jsxs("div", { className: 'active-wallet-information__details', children: [jsx("div", { className: classNames('active-wallet-information__addresses-container', {
196
205
  'active-wallet-information__addresses-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
197
- }), children: activeWalletAddress() }), !shouldHideNetwork && (jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true, isLoading: isLoading }))] })] }), showTestnetAlert && (jsx(Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), showMultiAsset ? (jsx("div", { className: 'multi-asset-balance-container', children: multiAssetHeader() })) : (jsxs("div", { className: 'balance-container', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: "Balance" }), primaryWalletNativeBalance()] }))] }));
206
+ }), children: activeWalletAddress() }), address && (jsx(WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true, isLoading: isLoading }))] })] }), showTestnetAlert && (jsx(Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), showMultiAsset ? (jsx("div", { className: 'multi-asset-balance-container', children: multiAssetHeader() })) : (jsxs("div", { className: 'balance-container', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_active_wallet_info.balance') }), primaryWalletNativeBalance()] }))] }));
198
207
  };
199
208
 
200
209
  export { ActiveWalletInformation };
@@ -0,0 +1,99 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var reactI18next = require('react-i18next');
8
+ require('../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
9
+ require('../../../../components/Alert/Alert.cjs');
10
+ require('react');
11
+ require('../../../../events/dynamicEvents.cjs');
12
+ require('../../../../../../_virtual/_tslib.cjs');
13
+ require('@dynamic-labs/utils');
14
+ require('../../../../context/DynamicContext/DynamicContext.cjs');
15
+ require('@dynamic-labs/sdk-api-core');
16
+ require('../../../../shared/logger.cjs');
17
+ require('@dynamic-labs/iconic');
18
+ require('@dynamic-labs/wallet-connector-core');
19
+ require('../../../../context/ViewContext/ViewContext.cjs');
20
+ var close = require('../../../../shared/assets/close.cjs');
21
+ var copy = require('../../../../shared/assets/copy.cjs');
22
+ require('@dynamic-labs/wallet-book');
23
+ require('../../../../utils/constants/colors.cjs');
24
+ require('../../../../utils/constants/values.cjs');
25
+ require('../../../../store/state/loadingAndLifecycle.cjs');
26
+ require('../../../../shared/consts/index.cjs');
27
+ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
28
+ require('../../../../context/ErrorContext/ErrorContext.cjs');
29
+ require('@dynamic-labs/multi-wallet');
30
+ require('react-international-phone');
31
+ require('../../../../config/ApiEndpoint.cjs');
32
+ require('../../../../store/state/user/user.cjs');
33
+ require('../../../../locale/locale.cjs');
34
+ require('../../../../store/state/projectSettings/projectSettings.cjs');
35
+ require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
36
+ require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
37
+ require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
38
+ require('../../../../context/VerificationContext/VerificationContext.cjs');
39
+ require('react-dom');
40
+ require('../../../../context/WalletContext/WalletContext.cjs');
41
+ require('../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
42
+ require('../../../../context/ThemeContext/ThemeContext.cjs');
43
+ require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
44
+ require('@dynamic-labs/types');
45
+ require('../../../../context/LoadingContext/LoadingContext.cjs');
46
+ require('yup');
47
+ require('../../../../context/MockContext/MockContext.cjs');
48
+ require('../../../../views/CollectUserDataView/useFields.cjs');
49
+ require('../../../../context/FieldsStateContext/FieldsStateContext.cjs');
50
+ require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
51
+ require('@dynamic-labs/rpc-providers');
52
+ require('../../../../store/state/environmentId.cjs');
53
+ require('../../../../store/state/walletConnectorOptions.cjs');
54
+ var Typography = require('../../../../components/Typography/Typography.cjs');
55
+ require('../../../../context/FooterAnimationContext/index.cjs');
56
+ var OverlayCard = require('../../../../components/OverlayCard/OverlayCard.cjs');
57
+ require('../../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
58
+ require('../../../../components/ShadowDOM/ShadowDOM.cjs');
59
+ require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
60
+ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
61
+ require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
62
+ require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
63
+ require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
64
+ require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
65
+ require('react-focus-lock');
66
+ var Icon = require('../../../../components/Icon/Icon.cjs');
67
+ require('../../context/DynamicWidgetContext.cjs');
68
+ var IconButton = require('../../../../components/IconButton/IconButton.cjs');
69
+ require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
70
+ require('formik');
71
+ var ModalHeader = require('../../../../components/ModalHeader/ModalHeader.cjs');
72
+ require('../../../../store/state/sendBalances.cjs');
73
+ require('../../../../components/Input/Input.cjs');
74
+ require('../../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
75
+ require('../../../../context/PasskeyContext/PasskeyContext.cjs');
76
+ require('../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
77
+ require('../../../../../index.cjs');
78
+ require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
79
+ require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
80
+ require('@hcaptcha/react-hcaptcha');
81
+ require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
82
+ require('../../../../store/state/tokenBalances.cjs');
83
+ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
84
+ var CopyButton = require('../../../../components/CopyButton/CopyButton.cjs');
85
+ require('../../../../components/InlineWidget/InlineWidget.cjs');
86
+ require('../../../../components/IsBrowser/IsBrowser.cjs');
87
+ require('../../../../components/Popper/Popper/Popper.cjs');
88
+ require('../../../../components/Popper/PopperContext/PopperContext.cjs');
89
+ require('qrcode');
90
+
91
+ /** Component for wallet detail overlays */
92
+ const WalletDetailsCard = ({ address, open, onClose, }) => {
93
+ const { t } = reactI18next.useTranslation();
94
+ const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: onClose, type: 'button', id: 'close-button', "data-testid": 'close-button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
95
+ const copyIcon = (jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-secondary', children: jsxRuntime.jsx(copy.ReactComponent, {}) }));
96
+ return (jsxRuntime.jsxs(OverlayCard.OverlayCard, { isOpen: open, onClickOverlay: onClose, children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', variant: 'body_normal', children: t('dyn_wallet_details_card.header') }) }), jsxRuntime.jsxs("div", { className: 'wallet-details-card__body', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', children: t('dyn_wallet_details_card.address') }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })] }));
97
+ };
98
+
99
+ exports.WalletDetailsCard = WalletDetailsCard;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ type WalletDetailsCardProps = {
3
+ /** String representation of a wallet address */
4
+ address: string;
5
+ /** Whether the overview should be open or closed */
6
+ open: boolean;
7
+ /** Callback when the overlay is closed */
8
+ onClose: VoidFunction;
9
+ };
10
+ /** Component for wallet detail overlays */
11
+ export declare const WalletDetailsCard: ({ address, open, onClose, }: WalletDetailsCardProps) => JSX.Element;
12
+ export {};
@@ -0,0 +1,95 @@
1
+ 'use client'
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { useTranslation } from 'react-i18next';
4
+ import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
5
+ import '../../../../components/Alert/Alert.js';
6
+ import 'react';
7
+ import '../../../../events/dynamicEvents.js';
8
+ import '../../../../../../_virtual/_tslib.js';
9
+ import '@dynamic-labs/utils';
10
+ import '../../../../context/DynamicContext/DynamicContext.js';
11
+ import '@dynamic-labs/sdk-api-core';
12
+ import '../../../../shared/logger.js';
13
+ import '@dynamic-labs/iconic';
14
+ import '@dynamic-labs/wallet-connector-core';
15
+ import '../../../../context/ViewContext/ViewContext.js';
16
+ import { ReactComponent as SvgClose } from '../../../../shared/assets/close.js';
17
+ import { ReactComponent as SvgCopy } from '../../../../shared/assets/copy.js';
18
+ import '@dynamic-labs/wallet-book';
19
+ import '../../../../utils/constants/colors.js';
20
+ import '../../../../utils/constants/values.js';
21
+ import '../../../../store/state/loadingAndLifecycle.js';
22
+ import '../../../../shared/consts/index.js';
23
+ import '../../../../context/CaptchaContext/CaptchaContext.js';
24
+ import '../../../../context/ErrorContext/ErrorContext.js';
25
+ import '@dynamic-labs/multi-wallet';
26
+ import 'react-international-phone';
27
+ import '../../../../config/ApiEndpoint.js';
28
+ import '../../../../store/state/user/user.js';
29
+ import '../../../../locale/locale.js';
30
+ import '../../../../store/state/projectSettings/projectSettings.js';
31
+ import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
32
+ import '../../../../context/AccountExistsContext/AccountExistsContext.js';
33
+ import '../../../../context/UserWalletsContext/UserWalletsContext.js';
34
+ import '../../../../context/VerificationContext/VerificationContext.js';
35
+ import 'react-dom';
36
+ import '../../../../context/WalletContext/WalletContext.js';
37
+ import '../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
38
+ import '../../../../context/ThemeContext/ThemeContext.js';
39
+ import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
40
+ import '@dynamic-labs/types';
41
+ import '../../../../context/LoadingContext/LoadingContext.js';
42
+ import 'yup';
43
+ import '../../../../context/MockContext/MockContext.js';
44
+ import '../../../../views/CollectUserDataView/useFields.js';
45
+ import '../../../../context/FieldsStateContext/FieldsStateContext.js';
46
+ import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
47
+ import '@dynamic-labs/rpc-providers';
48
+ import '../../../../store/state/environmentId.js';
49
+ import '../../../../store/state/walletConnectorOptions.js';
50
+ import { Typography } from '../../../../components/Typography/Typography.js';
51
+ import '../../../../context/FooterAnimationContext/index.js';
52
+ import { OverlayCard } from '../../../../components/OverlayCard/OverlayCard.js';
53
+ import '../../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
54
+ import '../../../../components/ShadowDOM/ShadowDOM.js';
55
+ import '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
56
+ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
57
+ import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
58
+ import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
59
+ import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
60
+ import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
61
+ import 'react-focus-lock';
62
+ import { Icon } from '../../../../components/Icon/Icon.js';
63
+ import '../../context/DynamicWidgetContext.js';
64
+ import { IconButton } from '../../../../components/IconButton/IconButton.js';
65
+ import '../../../../components/MenuList/Dropdown/Dropdown.js';
66
+ import 'formik';
67
+ import { ModalHeader } from '../../../../components/ModalHeader/ModalHeader.js';
68
+ import '../../../../store/state/sendBalances.js';
69
+ import '../../../../components/Input/Input.js';
70
+ import '../../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
71
+ import '../../../../context/PasskeyContext/PasskeyContext.js';
72
+ import '../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
73
+ import '../../../../../index.js';
74
+ import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
75
+ import '../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
76
+ import '@hcaptcha/react-hcaptcha';
77
+ import '../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
78
+ import '../../../../store/state/tokenBalances.js';
79
+ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
80
+ import { CopyButton } from '../../../../components/CopyButton/CopyButton.js';
81
+ import '../../../../components/InlineWidget/InlineWidget.js';
82
+ import '../../../../components/IsBrowser/IsBrowser.js';
83
+ import '../../../../components/Popper/Popper/Popper.js';
84
+ import '../../../../components/Popper/PopperContext/PopperContext.js';
85
+ import 'qrcode';
86
+
87
+ /** Component for wallet detail overlays */
88
+ const WalletDetailsCard = ({ address, open, onClose, }) => {
89
+ const { t } = useTranslation();
90
+ const closeButton = (jsx(IconButton, { onClick: onClose, type: 'button', id: 'close-button', "data-testid": 'close-button', children: jsx(SvgClose, {}) }));
91
+ const copyIcon = (jsx(Icon, { size: 'small', color: 'text-secondary', children: jsx(SvgCopy, {}) }));
92
+ return (jsxs(OverlayCard, { isOpen: open, onClickOverlay: onClose, children: [jsx(ModalHeader, { trailing: closeButton, children: jsx(Typography, { color: 'primary', weight: 'medium', variant: 'body_normal', children: t('dyn_wallet_details_card.header') }) }), jsxs("div", { className: 'wallet-details-card__body', children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', children: t('dyn_wallet_details_card.address') }), jsx(Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsx(CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })] }));
93
+ };
94
+
95
+ export { WalletDetailsCard };
@@ -0,0 +1 @@
1
+ export * from './WalletDetailsCard';