@mezo-org/passport 0.15.1-dev.5 → 0.15.1-dev.6

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 (115) hide show
  1. package/dist/src/assets/DefaultAvatar.d.ts +5 -0
  2. package/dist/src/assets/DefaultAvatar.d.ts.map +1 -0
  3. package/dist/src/assets/DefaultAvatar.js +21 -0
  4. package/dist/src/assets/DefaultAvatar.js.map +1 -0
  5. package/dist/src/components/Dropdown/ConnectedTrigger.d.ts +8 -0
  6. package/dist/src/components/Dropdown/ConnectedTrigger.d.ts.map +1 -0
  7. package/dist/src/components/Dropdown/ConnectedTrigger.js +39 -0
  8. package/dist/src/components/Dropdown/ConnectedTrigger.js.map +1 -0
  9. package/dist/src/components/Dropdown/Content.d.ts +8 -0
  10. package/dist/src/components/Dropdown/Content.d.ts.map +1 -0
  11. package/dist/src/components/Dropdown/Content.js +27 -0
  12. package/dist/src/components/Dropdown/Content.js.map +1 -0
  13. package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts +7 -0
  14. package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts.map +1 -0
  15. package/dist/src/components/Dropdown/DisconnectedTrigger.js +13 -0
  16. package/dist/src/components/Dropdown/DisconnectedTrigger.js.map +1 -0
  17. package/dist/src/components/Dropdown/Dropdown.d.ts +23 -0
  18. package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -0
  19. package/dist/src/components/Dropdown/Dropdown.js +45 -0
  20. package/dist/src/components/Dropdown/Dropdown.js.map +1 -0
  21. package/dist/src/components/Dropdown/ListingItem.d.ts +14 -0
  22. package/dist/src/components/Dropdown/ListingItem.d.ts.map +1 -0
  23. package/dist/src/components/Dropdown/ListingItem.js +42 -0
  24. package/dist/src/components/Dropdown/ListingItem.js.map +1 -0
  25. package/dist/src/components/Dropdown/NestedViewLayout.d.ts +8 -0
  26. package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +1 -0
  27. package/dist/src/components/Dropdown/NestedViewLayout.js +32 -0
  28. package/dist/src/components/Dropdown/NestedViewLayout.js.map +1 -0
  29. package/dist/src/components/Dropdown/Receive/Receive.d.ts +4 -0
  30. package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +1 -0
  31. package/dist/src/components/Dropdown/Receive/Receive.js +64 -0
  32. package/dist/src/components/Dropdown/Receive/Receive.js.map +1 -0
  33. package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +4 -0
  34. package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +1 -0
  35. package/dist/src/components/Dropdown/Root/AccountAddressActions.js +49 -0
  36. package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +1 -0
  37. package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +6 -0
  38. package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +1 -0
  39. package/dist/src/components/Dropdown/Root/AccountBalance.js +32 -0
  40. package/dist/src/components/Dropdown/Root/AccountBalance.js.map +1 -0
  41. package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts +6 -0
  42. package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts.map +1 -0
  43. package/dist/src/components/Dropdown/Root/AccountBtcListing.js +28 -0
  44. package/dist/src/components/Dropdown/Root/AccountBtcListing.js.map +1 -0
  45. package/dist/src/components/Dropdown/Root/AccountError.d.ts +8 -0
  46. package/dist/src/components/Dropdown/Root/AccountError.d.ts.map +1 -0
  47. package/dist/src/components/Dropdown/Root/AccountError.js +17 -0
  48. package/dist/src/components/Dropdown/Root/AccountError.js.map +1 -0
  49. package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts +4 -0
  50. package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts.map +1 -0
  51. package/dist/src/components/Dropdown/Root/AccountMusdListing.js +21 -0
  52. package/dist/src/components/Dropdown/Root/AccountMusdListing.js.map +1 -0
  53. package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +8 -0
  54. package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +1 -0
  55. package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +43 -0
  56. package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +1 -0
  57. package/dist/src/components/Dropdown/Root/Root.d.ts +8 -0
  58. package/dist/src/components/Dropdown/Root/Root.d.ts.map +1 -0
  59. package/dist/src/components/Dropdown/Root/Root.js +45 -0
  60. package/dist/src/components/Dropdown/Root/Root.js.map +1 -0
  61. package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +4 -0
  62. package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +1 -0
  63. package/dist/src/components/Dropdown/Root/WalletAddress.js +66 -0
  64. package/dist/src/components/Dropdown/Root/WalletAddress.js.map +1 -0
  65. package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +6 -0
  66. package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +1 -0
  67. package/dist/src/components/Dropdown/Root/WelcomeBlock.js +88 -0
  68. package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +1 -0
  69. package/dist/src/components/Dropdown/SlotNumber.d.ts +19 -0
  70. package/dist/src/components/Dropdown/SlotNumber.d.ts.map +1 -0
  71. package/dist/src/components/Dropdown/SlotNumber.js +67 -0
  72. package/dist/src/components/Dropdown/SlotNumber.js.map +1 -0
  73. package/dist/src/components/Dropdown/TestnetTopBanner.d.ts +3 -0
  74. package/dist/src/components/Dropdown/TestnetTopBanner.d.ts.map +1 -0
  75. package/dist/src/components/Dropdown/TestnetTopBanner.js +14 -0
  76. package/dist/src/components/Dropdown/TestnetTopBanner.js.map +1 -0
  77. package/dist/src/components/Dropdown/index.d.ts +3 -0
  78. package/dist/src/components/Dropdown/index.d.ts.map +1 -0
  79. package/dist/src/components/Dropdown/index.js +2 -0
  80. package/dist/src/components/Dropdown/index.js.map +1 -0
  81. package/dist/src/components/index.d.ts +2 -0
  82. package/dist/src/components/index.d.ts.map +1 -0
  83. package/dist/src/components/index.js +2 -0
  84. package/dist/src/components/index.js.map +1 -0
  85. package/dist/src/hooks/useAuthenticateWithWallet.d.ts +11 -11
  86. package/dist/src/hooks/useSignInWithWallet.d.ts +11 -11
  87. package/dist/src/hooks/useSignUpWithWallet.d.ts +11 -11
  88. package/dist/src/index.d.ts +1 -0
  89. package/dist/src/index.d.ts.map +1 -1
  90. package/dist/src/index.js +1 -0
  91. package/dist/src/index.js.map +1 -1
  92. package/package.json +2 -1
  93. package/src/assets/DefaultAvatar.tsx +74 -0
  94. package/src/components/Dropdown/ConnectedTrigger.tsx +76 -0
  95. package/src/components/Dropdown/Content.tsx +53 -0
  96. package/src/components/Dropdown/DisconnectedTrigger.tsx +36 -0
  97. package/src/components/Dropdown/Dropdown.tsx +100 -0
  98. package/src/components/Dropdown/ListingItem.tsx +176 -0
  99. package/src/components/Dropdown/NestedViewLayout.tsx +87 -0
  100. package/src/components/Dropdown/README.md +41 -0
  101. package/src/components/Dropdown/Receive/Receive.tsx +144 -0
  102. package/src/components/Dropdown/Root/AccountAddressActions.tsx +99 -0
  103. package/src/components/Dropdown/Root/AccountBalance.tsx +69 -0
  104. package/src/components/Dropdown/Root/AccountBtcListing.tsx +53 -0
  105. package/src/components/Dropdown/Root/AccountError.tsx +34 -0
  106. package/src/components/Dropdown/Root/AccountMusdListing.tsx +45 -0
  107. package/src/components/Dropdown/Root/AccountOtherAssets.tsx +85 -0
  108. package/src/components/Dropdown/Root/Root.tsx +77 -0
  109. package/src/components/Dropdown/Root/WalletAddress.tsx +123 -0
  110. package/src/components/Dropdown/Root/WelcomeBlock.tsx +173 -0
  111. package/src/components/Dropdown/SlotNumber.tsx +131 -0
  112. package/src/components/Dropdown/TestnetTopBanner.tsx +32 -0
  113. package/src/components/Dropdown/index.ts +2 -0
  114. package/src/components/index.ts +1 -0
  115. package/src/index.ts +1 -0
@@ -15,11 +15,11 @@ declare function useAuthenticateWithWallet(shouldCreateAccount?: boolean, mutati
15
15
  failureReason: Error | null;
16
16
  isPaused: boolean;
17
17
  submittedAt: number;
18
- authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
19
- authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
18
+ authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
19
+ authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
20
20
  } | {
21
21
  data: undefined;
22
- variables: number | void;
22
+ variables: number | void | undefined;
23
23
  error: null;
24
24
  isError: false;
25
25
  isIdle: false;
@@ -32,12 +32,12 @@ declare function useAuthenticateWithWallet(shouldCreateAccount?: boolean, mutati
32
32
  failureReason: Error | null;
33
33
  isPaused: boolean;
34
34
  submittedAt: number;
35
- authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
36
- authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
35
+ authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
36
+ authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
37
37
  } | {
38
38
  data: undefined;
39
39
  error: Error;
40
- variables: number | void;
40
+ variables: number | void | undefined;
41
41
  isError: true;
42
42
  isIdle: false;
43
43
  isPending: false;
@@ -49,12 +49,12 @@ declare function useAuthenticateWithWallet(shouldCreateAccount?: boolean, mutati
49
49
  failureReason: Error | null;
50
50
  isPaused: boolean;
51
51
  submittedAt: number;
52
- authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
53
- authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
52
+ authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
53
+ authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
54
54
  } | {
55
55
  data: Session;
56
56
  error: null;
57
- variables: number | void;
57
+ variables: number | void | undefined;
58
58
  isError: false;
59
59
  isIdle: false;
60
60
  isPending: false;
@@ -66,8 +66,8 @@ declare function useAuthenticateWithWallet(shouldCreateAccount?: boolean, mutati
66
66
  failureReason: Error | null;
67
67
  isPaused: boolean;
68
68
  submittedAt: number;
69
- authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
70
- authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
69
+ authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
70
+ authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
71
71
  };
72
72
  export { useAuthenticateWithWallet };
73
73
  //# sourceMappingURL=useAuthenticateWithWallet.d.ts.map
@@ -15,11 +15,11 @@ declare function useSignInWithWallet(mutationOptions?: Omit<MutationOptions<Sess
15
15
  failureReason: Error | null;
16
16
  isPaused: boolean;
17
17
  submittedAt: number;
18
- signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
19
- signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
18
+ signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
19
+ signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
20
20
  } | {
21
21
  data: undefined;
22
- variables: number | void;
22
+ variables: number | void | undefined;
23
23
  error: null;
24
24
  isError: false;
25
25
  isIdle: false;
@@ -32,12 +32,12 @@ declare function useSignInWithWallet(mutationOptions?: Omit<MutationOptions<Sess
32
32
  failureReason: Error | null;
33
33
  isPaused: boolean;
34
34
  submittedAt: number;
35
- signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
36
- signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
35
+ signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
36
+ signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
37
37
  } | {
38
38
  data: undefined;
39
39
  error: Error;
40
- variables: number | void;
40
+ variables: number | void | undefined;
41
41
  isError: true;
42
42
  isIdle: false;
43
43
  isPending: false;
@@ -49,12 +49,12 @@ declare function useSignInWithWallet(mutationOptions?: Omit<MutationOptions<Sess
49
49
  failureReason: Error | null;
50
50
  isPaused: boolean;
51
51
  submittedAt: number;
52
- signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
53
- signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
52
+ signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
53
+ signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
54
54
  } | {
55
55
  data: Session;
56
56
  error: null;
57
- variables: number | void;
57
+ variables: number | void | undefined;
58
58
  isError: false;
59
59
  isIdle: false;
60
60
  isPending: false;
@@ -66,8 +66,8 @@ declare function useSignInWithWallet(mutationOptions?: Omit<MutationOptions<Sess
66
66
  failureReason: Error | null;
67
67
  isPaused: boolean;
68
68
  submittedAt: number;
69
- signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
70
- signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
69
+ signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
70
+ signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
71
71
  };
72
72
  export { useSignInWithWallet };
73
73
  //# sourceMappingURL=useSignInWithWallet.d.ts.map
@@ -15,11 +15,11 @@ declare function useSignUpWithWallet(mutationOptions?: Omit<MutationOptions<Sess
15
15
  failureReason: Error | null;
16
16
  isPaused: boolean;
17
17
  submittedAt: number;
18
- signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
19
- signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
18
+ signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
19
+ signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
20
20
  } | {
21
21
  data: undefined;
22
- variables: number | void;
22
+ variables: number | void | undefined;
23
23
  error: null;
24
24
  isError: false;
25
25
  isIdle: false;
@@ -32,12 +32,12 @@ declare function useSignUpWithWallet(mutationOptions?: Omit<MutationOptions<Sess
32
32
  failureReason: Error | null;
33
33
  isPaused: boolean;
34
34
  submittedAt: number;
35
- signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
36
- signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
35
+ signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
36
+ signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
37
37
  } | {
38
38
  data: undefined;
39
39
  error: Error;
40
- variables: number | void;
40
+ variables: number | void | undefined;
41
41
  isError: true;
42
42
  isIdle: false;
43
43
  isPending: false;
@@ -49,12 +49,12 @@ declare function useSignUpWithWallet(mutationOptions?: Omit<MutationOptions<Sess
49
49
  failureReason: Error | null;
50
50
  isPaused: boolean;
51
51
  submittedAt: number;
52
- signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
53
- signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
52
+ signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
53
+ signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
54
54
  } | {
55
55
  data: Session;
56
56
  error: null;
57
- variables: number | void;
57
+ variables: number | void | undefined;
58
58
  isError: false;
59
59
  isIdle: false;
60
60
  isPending: false;
@@ -66,8 +66,8 @@ declare function useSignUpWithWallet(mutationOptions?: Omit<MutationOptions<Sess
66
66
  failureReason: Error | null;
67
67
  isPaused: boolean;
68
68
  submittedAt: number;
69
- signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void, unknown>;
70
- signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void, unknown>;
69
+ signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, number | void | undefined, unknown>;
70
+ signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, number | void | undefined, unknown>;
71
71
  };
72
72
  export { useSignUpWithWallet };
73
73
  //# sourceMappingURL=useSignUpWithWallet.d.ts.map
@@ -1,3 +1,4 @@
1
+ export * from "./components";
1
2
  export { defaultConfig, unisatWalletMezoMainnet, unisatWalletMezoTestnet, okxWalletMezoMainnet, okxWalletMezoTestnet, xverseWalletMezoMainnet, xverseWalletMezoTestnet, getDefaultWallets, getConfig, } from "./config";
2
3
  export * from "./constants";
3
4
  export * from "./hooks";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
package/dist/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./components";
1
2
  export { defaultConfig, unisatWalletMezoMainnet, unisatWalletMezoTestnet, okxWalletMezoMainnet, okxWalletMezoTestnet, xverseWalletMezoMainnet, xverseWalletMezoTestnet, getDefaultWallets, getConfig, } from "./config";
2
3
  export * from "./constants";
3
4
  export * from "./hooks";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezo-org/passport",
3
- "version": "0.15.1-dev.5",
3
+ "version": "0.15.1-dev.6",
4
4
  "main": "dist/src/index.js",
5
5
  "license": "GPL-3.0-only",
6
6
  "scripts": {
@@ -37,6 +37,7 @@
37
37
  "typescript": "^5.4.3"
38
38
  },
39
39
  "dependencies": {
40
+ "@mezo-org/mezo-clay": "0.1.0-dev.37",
40
41
  "@mezo-org/mezod-contracts": "^1.0.0",
41
42
  "@mezo-org/musd-contracts": "^1.0.1",
42
43
  "@mezo-org/orangekit": "1.0.0-beta.40-dev.28",
@@ -0,0 +1,74 @@
1
+ import { Block, BlockProps } from "@mezo-org/mezo-clay"
2
+ import React, { SVGProps } from "react"
3
+
4
+ function DefaultAvatar(props: SVGProps<SVGSVGElement>) {
5
+ return (
6
+ <svg viewBox="0 0 214 214" fill="none" {...props}>
7
+ <rect y="-0.478027" width="166.379" height="81.7091" fill="#FF004D" />
8
+ <rect x="166" y="-0.478027" width="48" height="82" fill="black" />
9
+ <rect
10
+ x="166.379"
11
+ y="81.231"
12
+ width="24.1044"
13
+ height="132.291"
14
+ fill="#DFFF80"
15
+ />
16
+ <rect
17
+ x="118.758"
18
+ y="81.231"
19
+ width="24.1044"
20
+ height="132.291"
21
+ fill="#FF5500"
22
+ />
23
+ <rect
24
+ x="71.1372"
25
+ y="81.231"
26
+ width="24.1044"
27
+ height="132.291"
28
+ fill="#5A59A7"
29
+ />
30
+ <rect
31
+ x="23.5166"
32
+ y="81.231"
33
+ width="24.1044"
34
+ height="132.291"
35
+ fill="#47B5FF"
36
+ />
37
+ <rect y="81.231" width="23.5165" height="132.291" fill="#A3C238" />
38
+ <rect
39
+ x="190.483"
40
+ y="81.231"
41
+ width="23.5165"
42
+ height="132.291"
43
+ fill="#6E6E70"
44
+ />
45
+ <rect
46
+ x="142.863"
47
+ y="81.231"
48
+ width="23.5165"
49
+ height="132.291"
50
+ fill="#0A3C01"
51
+ />
52
+ <rect
53
+ x="95.2417"
54
+ y="81.231"
55
+ width="23.5165"
56
+ height="132.291"
57
+ fill="#F2A91F"
58
+ />
59
+ <rect
60
+ x="47.6211"
61
+ y="81.231"
62
+ width="23.5165"
63
+ height="132.291"
64
+ fill="#6B3D01"
65
+ />
66
+ </svg>
67
+ )
68
+ }
69
+
70
+ function DefaultAvatarComponent(props: BlockProps) {
71
+ return <Block as={DefaultAvatar} {...props} />
72
+ }
73
+
74
+ export default DefaultAvatarComponent
@@ -0,0 +1,76 @@
1
+ import { Block, Button, ButtonProps, useStyletron } from "@mezo-org/mezo-clay"
2
+ import React, { forwardRef, ReactNode, useMemo } from "react"
3
+
4
+ type ConnectedTriggerProps = Omit<ButtonProps, "children" | "size"> & {
5
+ avatar: ReactNode
6
+ size?: "medium" | "large"
7
+ }
8
+
9
+ const ConnectedTrigger = forwardRef<HTMLButtonElement, ConnectedTriggerProps>(
10
+ (props, ref) => {
11
+ const { onClick, avatar, size = "medium", ...restProps } = props
12
+
13
+ const [, theme] = useStyletron()
14
+
15
+ const avatarSize = useMemo(() => {
16
+ const sizeMap = {
17
+ medium: theme.sizing.scale950,
18
+ large: theme.sizing.scale1400,
19
+ }
20
+
21
+ return sizeMap[size]
22
+ }, [theme, size])
23
+
24
+ const buttonPadding = useMemo(() => {
25
+ const paddingMap = {
26
+ medium: theme.sizing.scale0,
27
+ large: theme.sizing.scale100,
28
+ }
29
+
30
+ return paddingMap[size]
31
+ }, [theme, size])
32
+
33
+ return (
34
+ <Button
35
+ overrides={{
36
+ BaseButton: {
37
+ props: { ref, ...restProps },
38
+ style: {
39
+ borderRadius: "100%",
40
+ overflow: "hidden",
41
+ padding: buttonPadding,
42
+ },
43
+ },
44
+ }}
45
+ onClick={onClick}
46
+ >
47
+ {typeof avatar === "string" ? (
48
+ <Block
49
+ width={avatarSize}
50
+ height={avatarSize}
51
+ as="img"
52
+ src={avatar}
53
+ alt=""
54
+ />
55
+ ) : (
56
+ <Block
57
+ width={avatarSize}
58
+ height={avatarSize}
59
+ overrides={{
60
+ Block: {
61
+ style: {
62
+ borderRadius: "100%",
63
+ overflow: "hidden",
64
+ },
65
+ },
66
+ }}
67
+ >
68
+ {avatar}
69
+ </Block>
70
+ )}
71
+ </Button>
72
+ )
73
+ },
74
+ )
75
+
76
+ export default ConnectedTrigger
@@ -0,0 +1,53 @@
1
+ import { Block, useStyletron } from "@mezo-org/mezo-clay"
2
+ import React, { useEffect } from "react"
3
+ import useDropdownStore, { DropdownView } from "../../stores/dropdownStore"
4
+ import Root from "./Root/Root"
5
+ import Receive from "./Receive/Receive"
6
+ import TestnetTopBanner from "./TestnetTopBanner"
7
+
8
+ type ContentProps = {
9
+ onSignOut?: () => void
10
+ onOtherAssetsClick?: () => void
11
+ }
12
+
13
+ function Content(props: ContentProps) {
14
+ const { onSignOut, onOtherAssetsClick } = props
15
+
16
+ const [_, theme] = useStyletron()
17
+
18
+ const currentView = useDropdownStore((state) => state.view)
19
+ const setView = useDropdownStore((state) => state.setView)
20
+
21
+ useEffect(
22
+ () => () => {
23
+ setView(DropdownView.ROOT)
24
+ },
25
+ [setView],
26
+ )
27
+
28
+ return (
29
+ <Block
30
+ display="inline-flex"
31
+ flexDirection="column"
32
+ backgroundColor={theme.colors.backgroundPrimary}
33
+ width="100%"
34
+ overrides={{
35
+ Block: {
36
+ style: {
37
+ boxSizing: "border-box",
38
+ },
39
+ },
40
+ }}
41
+ >
42
+ <TestnetTopBanner />
43
+
44
+ {currentView === DropdownView.ROOT && (
45
+ <Root onSignOut={onSignOut} onOtherAssetsClick={onOtherAssetsClick} />
46
+ )}
47
+
48
+ {currentView === DropdownView.RECEIVE && <Receive />}
49
+ </Block>
50
+ )
51
+ }
52
+
53
+ export default Content
@@ -0,0 +1,36 @@
1
+ import { Button, ButtonProps, LogIn01, useStyletron } from "@mezo-org/mezo-clay"
2
+ import React, { forwardRef } from "react"
3
+
4
+ type DisconnectedTriggerProps = Omit<ButtonProps, "children"> & {
5
+ children: string
6
+ }
7
+
8
+ const DisconnectedTrigger = forwardRef<
9
+ HTMLButtonElement,
10
+ DisconnectedTriggerProps
11
+ >((props, ref) => {
12
+ const { onClick, children, ...restProps } = props
13
+
14
+ const [, theme] = useStyletron()
15
+
16
+ return (
17
+ <Button
18
+ startEnhancer={
19
+ <LogIn01 color="currentColor" size={theme.sizing.scale600} />
20
+ }
21
+ overrides={{
22
+ Root: {
23
+ props: { ref },
24
+ },
25
+ }}
26
+ size="small"
27
+ shape="pill"
28
+ onClick={onClick}
29
+ {...restProps}
30
+ >
31
+ {children}
32
+ </Button>
33
+ )
34
+ })
35
+
36
+ export default DisconnectedTrigger
@@ -0,0 +1,100 @@
1
+ import {
2
+ ButtonProps,
3
+ StatefulPopover,
4
+ StatefulPopoverProps,
5
+ useStyletron,
6
+ } from "@mezo-org/mezo-clay"
7
+ import { useConnectModal } from "@rainbow-me/rainbowkit"
8
+ import React from "react"
9
+ import DefaultAvatar from "../../assets/DefaultAvatar"
10
+ import ConnectedTrigger from "./ConnectedTrigger"
11
+ import Content from "./Content"
12
+ import DisconnectedTrigger from "./DisconnectedTrigger"
13
+ import { useWalletAccount } from "../../hooks/useWalletAccount"
14
+ import { useWatchTransferEventsForAllTokens } from "../../hooks/useWatchTransferEvents"
15
+
16
+ export type DropdownProps = {
17
+ /** The callback to be called when the user clicks the sign-out button */
18
+ onSignOut?: () => void
19
+ /** The callback to be called when the user clicks the button in sign-in state */
20
+ onSignIn?: () => void
21
+ /** The props to be passed to the trigger button */
22
+ triggerProps?: {
23
+ signedIn?: Omit<ButtonProps, "onClick" | "size"> & {
24
+ size: "medium" | "large"
25
+ }
26
+ signedOut?: Omit<ButtonProps, "onClick">
27
+ }
28
+ onOtherAssetsClick?: () => void
29
+ } & Omit<StatefulPopoverProps, "children" | "content">
30
+
31
+ /**
32
+ * Passport Dropdown component that displays user's wallet and assets information.
33
+ * @param {DropdownProps} props - Component props.
34
+ * @returns {JSX.Element}
35
+ */
36
+ export function Dropdown(props: DropdownProps) {
37
+ const {
38
+ placement = "bottomRight",
39
+ animateOutTime = 120,
40
+ onSignIn,
41
+ onSignOut,
42
+ overrides,
43
+ triggerProps,
44
+ onOtherAssetsClick,
45
+ ...restProps
46
+ } = props
47
+
48
+ const [, theme] = useStyletron()
49
+
50
+ const walletAccount = useWalletAccount()
51
+
52
+ useWatchTransferEventsForAllTokens()
53
+
54
+ const { openConnectModal } = useConnectModal()
55
+
56
+ if (!walletAccount?.isConnected) {
57
+ return (
58
+ <DisconnectedTrigger
59
+ // If connect wallet flow is not provided it fallbacks to RainbowKit's
60
+ // connect modal
61
+ onClick={onSignIn || openConnectModal}
62
+ {...triggerProps?.signedOut}
63
+ >
64
+ Sign in
65
+ </DisconnectedTrigger>
66
+ )
67
+ }
68
+
69
+ return (
70
+ <StatefulPopover
71
+ content={
72
+ <Content
73
+ onSignOut={onSignOut}
74
+ onOtherAssetsClick={onOtherAssetsClick}
75
+ />
76
+ }
77
+ placement={placement}
78
+ animateOutTime={animateOutTime}
79
+ overrides={{
80
+ ...overrides,
81
+ Body: {
82
+ ...overrides?.Body,
83
+ style: {
84
+ width: "402px",
85
+ borderRadius: theme.borders.radius500,
86
+ boxShadow: theme.lighting.shadow500,
87
+ overflow: "hidden",
88
+ ...overrides?.Body?.style,
89
+ },
90
+ },
91
+ }}
92
+ {...restProps}
93
+ >
94
+ <ConnectedTrigger
95
+ avatar={<DefaultAvatar />}
96
+ {...triggerProps?.signedIn}
97
+ />
98
+ </StatefulPopover>
99
+ )
100
+ }