@dynamic-labs/sdk-react-core 1.0.0-alpha.5 → 1.0.0-alpha.7

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 (85) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +10 -10
  5. package/src/index.cjs +4 -2
  6. package/src/index.d.ts +1 -1
  7. package/src/index.js +2 -1
  8. package/src/lib/Main.cjs +18 -21
  9. package/src/lib/Main.js +18 -21
  10. package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +84 -5
  11. package/src/lib/components/NeedHelpSection/NeedHelpSection.js +85 -6
  12. package/src/lib/components/NetworkPicker/NetworkPicker.cjs +8 -6
  13. package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -1
  14. package/src/lib/components/NetworkPicker/NetworkPicker.js +8 -6
  15. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
  16. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +1 -1
  17. package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs +2 -17
  18. package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.d.ts +2 -2
  19. package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js +2 -17
  20. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
  21. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
  22. package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -4
  23. package/src/lib/context/DynamicContext/DynamicContext.js +1 -4
  24. package/src/lib/context/DynamicContext/types/index.d.ts +0 -1
  25. package/src/lib/data/api.cjs +2 -1
  26. package/src/lib/data/api.js +2 -1
  27. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +9 -11
  28. package/src/lib/layout/DynamicAuthLayout/Header/header.js +10 -12
  29. package/src/lib/locale/en/translation.cjs +7 -3
  30. package/src/lib/locale/en/translation.d.ts +6 -2
  31. package/src/lib/locale/en/translation.js +7 -3
  32. package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +1 -1
  33. package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +1 -1
  34. package/src/lib/styles/index.shadow.cjs +1 -1
  35. package/src/lib/styles/index.shadow.js +1 -1
  36. package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.cjs +1 -1
  37. package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.js +1 -1
  38. package/src/lib/utils/hooks/index.d.ts +1 -0
  39. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +1 -6
  40. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +1 -6
  41. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +3 -0
  42. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +3 -0
  43. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +7 -8
  44. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +7 -8
  45. package/src/lib/utils/hooks/useEventListener/useEventListener.cjs +2 -1
  46. package/src/lib/utils/hooks/useEventListener/useEventListener.js +2 -1
  47. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +9 -5
  48. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +0 -1
  49. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +10 -6
  50. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +20 -21
  51. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +1 -2
  52. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +20 -21
  53. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +32 -9
  54. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.d.ts +0 -1
  55. package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +33 -10
  56. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
  57. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
  58. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +6 -3
  59. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +6 -3
  60. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +1 -1
  61. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +1 -1
  62. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +1 -1
  63. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +1 -1
  64. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +1 -1
  65. package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +1 -1
  66. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +7 -6
  67. package/src/lib/views/SendBalanceView/SendBalanceView.js +7 -6
  68. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +16 -3
  69. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +16 -3
  70. package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +3 -0
  71. package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +4 -1
  72. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +3 -3
  73. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +3 -3
  74. package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -2
  75. package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -2
  76. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -2
  77. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -2
  78. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +1 -2
  79. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +1 -2
  80. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -3
  81. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -3
  82. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
  83. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
  84. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +16 -6
  85. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +16 -6
@@ -60,10 +60,10 @@ require('../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
60
60
  var CopyButton = require('../../../../components/CopyButton/CopyButton.cjs');
61
61
  require('../../../../components/InlineWidget/InlineWidget.cjs');
62
62
  require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
63
+ var TextButton = require('../../../../components/TextButton/TextButton.cjs');
63
64
  require('../../../../components/Popper/Popper/Popper.cjs');
64
65
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
65
66
  require('react-focus-lock');
66
- var TextButton = require('../../../../components/TextButton/TextButton.cjs');
67
67
 
68
68
  const QrCodeModalView = ({ walletId }) => {
69
69
  var _a, _b;
@@ -56,10 +56,10 @@ import '../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
56
56
  import { CopyButton } from '../../../../components/CopyButton/CopyButton.js';
57
57
  import '../../../../components/InlineWidget/InlineWidget.js';
58
58
  import '../../../../components/MenuList/Dropdown/Dropdown.js';
59
+ import { TextButton } from '../../../../components/TextButton/TextButton.js';
59
60
  import '../../../../components/Popper/Popper/Popper.js';
60
61
  import '../../../../components/Popper/PopperContext/PopperContext.js';
61
62
  import 'react-focus-lock';
62
- import { TextButton } from '../../../../components/TextButton/TextButton.js';
63
63
 
64
64
  const QrCodeModalView = ({ walletId }) => {
65
65
  var _a, _b;
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
6
7
  var reactI18next = require('react-i18next');
7
8
  var iconic = require('@dynamic-labs/iconic');
8
- require('react');
9
+ var classNames = require('../../../../../utils/functions/classNames/classNames.cjs');
9
10
  require('@dynamic-labs/utils');
10
11
  require('@dynamic-labs/sdk-api');
11
12
  require('../../../../../config/ApiEndpoint.cjs');
@@ -71,6 +72,7 @@ const mapPasskeyProviderToIcon = {
71
72
  };
72
73
  const PasskeyCard = ({ passkey }) => {
73
74
  const { t } = reactI18next.useTranslation();
75
+ const [showTooltip, setShowTooltip] = React.useState(false);
74
76
  const { value: timeSinceValue, unit: timeSinceUnit } = getTimeSince.getTimeSince(passkey.createdAt);
75
77
  const PasskeyProviderIcon = () => {
76
78
  if (!passkey.userAgent)
@@ -88,11 +90,19 @@ const PasskeyCard = ({ passkey }) => {
88
90
  return null;
89
91
  return t(`dyn_manage_passkeys.passkey_providers.${provider}`);
90
92
  };
91
- return (jsxRuntime.jsxs("div", { className: 'passkey-card', children: [jsxRuntime.jsxs("div", { className: 'passkey-card__info', children: [jsxRuntime.jsx("div", { className: 'passkey-card__info__icon', children: jsxRuntime.jsx(PasskeyProviderIcon, {}) }), jsxRuntime.jsxs("div", { className: 'passkey-card__info__text', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: shortenEmail.shortenEmail(passkey.alias, {
92
- breakpoint: 12,
93
- cutEnd: 4,
94
- cutStart: 4,
95
- }) }), getPasskeyProviderName() && (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_manage_passkeys.passkey_from'), " ", getPasskeyProviderName()] }))] })] }), jsxRuntime.jsx("div", { className: 'passkey-card__date', children: jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_time_since.created'), ' ', `${timeSinceValue} ${timeSinceUnit} ${t('dyn_time_since.ago')}`] }) })] }));
93
+ const handleShowTooltip = () => {
94
+ setShowTooltip(true);
95
+ setTimeout(() => {
96
+ setShowTooltip(false);
97
+ }, 2000);
98
+ };
99
+ return (jsxRuntime.jsxs("div", { className: 'passkey-card', children: [jsxRuntime.jsxs("div", { className: 'passkey-card__info', children: [jsxRuntime.jsx("div", { className: 'passkey-card__info__icon', "data-testId": 'provider-icon', children: jsxRuntime.jsx(PasskeyProviderIcon, {}) }), jsxRuntime.jsxs("div", { className: 'passkey-card__info__text', children: [jsxRuntime.jsxs(Typography.Typography, { "data-testid": 'passkey-alias', variant: 'body_normal', color: 'primary', title: passkey.alias, onClick: handleShowTooltip, children: [shortenEmail.shortenEmail(passkey.alias, {
100
+ breakpoint: 12,
101
+ cutEnd: 4,
102
+ cutStart: 4,
103
+ }), jsxRuntime.jsx("p", { className: classNames.classNames('passkey-card__info__tooltip', {
104
+ 'passkey-card__info__tooltip--visible': showTooltip,
105
+ }), children: passkey.alias })] }), getPasskeyProviderName() && (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_manage_passkeys.passkey_from'), " ", getPasskeyProviderName()] }))] })] }), jsxRuntime.jsx("div", { className: 'passkey-card__date', children: jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_time_since.created'), ' ', `${timeSinceValue} ${timeSinceUnit} ${t('dyn_time_since.ago')}`] }) })] }));
96
106
  };
97
107
 
98
108
  exports.PasskeyCard = PasskeyCard;
@@ -1,7 +1,8 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
4
  import { AndroidIcon, BraveIcon, ChromeIcon, EdgeIcon, FirefoxIcon, AppleIcon, OperaIcon, SafariIcon } from '@dynamic-labs/iconic';
4
- import 'react';
5
+ import { classNames } from '../../../../../utils/functions/classNames/classNames.js';
5
6
  import '@dynamic-labs/utils';
6
7
  import '@dynamic-labs/sdk-api';
7
8
  import '../../../../../config/ApiEndpoint.js';
@@ -67,6 +68,7 @@ const mapPasskeyProviderToIcon = {
67
68
  };
68
69
  const PasskeyCard = ({ passkey }) => {
69
70
  const { t } = useTranslation();
71
+ const [showTooltip, setShowTooltip] = useState(false);
70
72
  const { value: timeSinceValue, unit: timeSinceUnit } = getTimeSince(passkey.createdAt);
71
73
  const PasskeyProviderIcon = () => {
72
74
  if (!passkey.userAgent)
@@ -84,11 +86,19 @@ const PasskeyCard = ({ passkey }) => {
84
86
  return null;
85
87
  return t(`dyn_manage_passkeys.passkey_providers.${provider}`);
86
88
  };
87
- return (jsxs("div", { className: 'passkey-card', children: [jsxs("div", { className: 'passkey-card__info', children: [jsx("div", { className: 'passkey-card__info__icon', children: jsx(PasskeyProviderIcon, {}) }), jsxs("div", { className: 'passkey-card__info__text', children: [jsx(Typography, { variant: 'body_normal', color: 'primary', children: shortenEmail(passkey.alias, {
88
- breakpoint: 12,
89
- cutEnd: 4,
90
- cutStart: 4,
91
- }) }), getPasskeyProviderName() && (jsxs(Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_manage_passkeys.passkey_from'), " ", getPasskeyProviderName()] }))] })] }), jsx("div", { className: 'passkey-card__date', children: jsxs(Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_time_since.created'), ' ', `${timeSinceValue} ${timeSinceUnit} ${t('dyn_time_since.ago')}`] }) })] }));
89
+ const handleShowTooltip = () => {
90
+ setShowTooltip(true);
91
+ setTimeout(() => {
92
+ setShowTooltip(false);
93
+ }, 2000);
94
+ };
95
+ return (jsxs("div", { className: 'passkey-card', children: [jsxs("div", { className: 'passkey-card__info', children: [jsx("div", { className: 'passkey-card__info__icon', "data-testId": 'provider-icon', children: jsx(PasskeyProviderIcon, {}) }), jsxs("div", { className: 'passkey-card__info__text', children: [jsxs(Typography, { "data-testid": 'passkey-alias', variant: 'body_normal', color: 'primary', title: passkey.alias, onClick: handleShowTooltip, children: [shortenEmail(passkey.alias, {
96
+ breakpoint: 12,
97
+ cutEnd: 4,
98
+ cutStart: 4,
99
+ }), jsx("p", { className: classNames('passkey-card__info__tooltip', {
100
+ 'passkey-card__info__tooltip--visible': showTooltip,
101
+ }), children: passkey.alias })] }), getPasskeyProviderName() && (jsxs(Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_manage_passkeys.passkey_from'), " ", getPasskeyProviderName()] }))] })] }), jsx("div", { className: 'passkey-card__date', children: jsxs(Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_time_since.created'), ' ', `${timeSinceValue} ${timeSinceUnit} ${t('dyn_time_since.ago')}`] }) })] }));
92
102
  };
93
103
 
94
104
  export { PasskeyCard };