@matchain/matchid-sdk-react 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +148 -24
- package/dist/index.d.mts +12 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.js +402 -264
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +408 -270
- package/dist/index.mjs.map +1 -1
- package/example/src/components/Login/index.tsx +11 -3
- package/example/src/config/index.ts +2 -1
- package/example/src/pages/User.tsx +3 -2
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -32,9 +32,17 @@ body {
|
|
|
32
32
|
--matchid-login-method-round: var(--matchid-round);
|
|
33
33
|
--matchid-login-method-color: var(--matchid-text-color);
|
|
34
34
|
|
|
35
|
+
--matchid-login-other-color:var(--matchid-gray-600);
|
|
36
|
+
|
|
37
|
+
--matchid-login-recommend-wallet-color:var(--matchid-black);
|
|
38
|
+
--matchid-login-recommend-wallet-hover-color:var(--matchid-white);
|
|
39
|
+
--matchid-login-recommend-wallet-hover-bg:var(--matchid-highlight-orange);
|
|
40
|
+
|
|
41
|
+
|
|
35
42
|
--matchid-login-panel-divide-color: var(--matchid-line);
|
|
36
43
|
--matchid-login-panel-title-color: var(--matchid-text-color);
|
|
37
44
|
--matchid-login-panel-subtitle-color: var(--matchid-gray-600);
|
|
45
|
+
|
|
38
46
|
/**overlay component**/
|
|
39
47
|
--matchid-overlay-index: 9999;
|
|
40
48
|
/**modal component**/
|
|
@@ -111,38 +119,154 @@ body {
|
|
|
111
119
|
justify-content: center;
|
|
112
120
|
align-items: center;
|
|
113
121
|
flex-direction: column;
|
|
114
|
-
gap:
|
|
115
|
-
|
|
122
|
+
gap: 64px;
|
|
123
|
+
.matchid-login-recommend-list{
|
|
124
|
+
width: 100%;
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
align-items: center;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
gap: 16px;
|
|
130
|
+
.matchid-login-recommend-method {
|
|
131
|
+
width: 100%;
|
|
132
|
+
position: relative;
|
|
133
|
+
display: flex;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
align-items: center;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
border-radius: var(--matchid-login-method-round, 12px);
|
|
138
|
+
border: 1px solid var(--matchid-login-method-border-color, #E3E3E3);
|
|
139
|
+
&:hover {
|
|
140
|
+
border-color: var(--matchid-login-method-hover-border-color, #FC802D);
|
|
141
|
+
}
|
|
142
|
+
.matchid-login-recommend-method-item{
|
|
116
143
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
144
|
+
display: flex;
|
|
145
|
+
justify-content: space-between;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: 16px;
|
|
148
|
+
height: 72px;
|
|
149
|
+
width: 100%;
|
|
150
|
+
padding: 16px;
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
color: var(--matchid-login-method-color, #000000);
|
|
153
|
+
|
|
154
|
+
.matchid-login-recommend-method-content {
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: flex-start;
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: 8px;
|
|
159
|
+
}
|
|
160
|
+
.matchid-login-recommend-method-arrow{
|
|
161
|
+
transition: all 0.3s;
|
|
162
|
+
&.matchid-login-recommend-method-arrow-active{
|
|
163
|
+
transform: rotate(180deg);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
.matchid-login-recommend-method-popover{
|
|
168
|
+
display: none;
|
|
169
|
+
width: 100%;
|
|
170
|
+
padding:0 16px 16px;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
&.matchid-login-recommend-method-popover-active{
|
|
173
|
+
display: flex;
|
|
174
|
+
}
|
|
175
|
+
.matchid-login-recommend-wallet-divider{
|
|
176
|
+
height: 1px;
|
|
177
|
+
width: 100%;
|
|
178
|
+
background: var(--matchid-line);
|
|
179
|
+
}
|
|
180
|
+
.matchid-login-recommend-wallet-list{
|
|
181
|
+
margin-top:16px;
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
gap:8px;
|
|
185
|
+
width: 100%;
|
|
186
|
+
.matchid-login-recommend-wallet-item{
|
|
187
|
+
display: flex;
|
|
188
|
+
justify-content: space-between;
|
|
189
|
+
align-items: center;
|
|
190
|
+
gap: 16px;
|
|
191
|
+
height:56px;
|
|
192
|
+
border-radius: 8px;
|
|
193
|
+
font-size: 16px;
|
|
194
|
+
font-weight: 600;
|
|
195
|
+
|
|
196
|
+
color: var(--matchid-login-recommend-wallet-color, #000000);
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
padding:0 16px;
|
|
199
|
+
.matchid-login-recommend-wallet-item-content{
|
|
200
|
+
display: flex;
|
|
201
|
+
justify-content: space-between;
|
|
202
|
+
align-items: center;
|
|
203
|
+
gap:8px;
|
|
204
|
+
.matchid-login-recommend-wallet-item-hover-icon{
|
|
205
|
+
display: none;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
&:hover{
|
|
209
|
+
background: var(--matchid-login-recommend-wallet-hover-bg, #FC802D);
|
|
210
|
+
color: var(--matchid-login-recommend-wallet-hover-color, #FFF);
|
|
211
|
+
--matchid-arrow-color:var(--matchid-login-recommend-wallet-hover-color, #FFF);
|
|
212
|
+
.matchid-login-recommend-wallet-item-hover-icon{
|
|
213
|
+
display: block;
|
|
214
|
+
}
|
|
215
|
+
.matchid-login-recommend-wallet-item-icon{
|
|
216
|
+
display: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
130
223
|
|
|
131
|
-
|
|
132
|
-
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
.matchid-login-other {
|
|
227
|
+
width: 100%;
|
|
228
|
+
gap:16px;
|
|
229
|
+
display: flex;
|
|
230
|
+
flex-direction: column;
|
|
231
|
+
.matchid-login-other-text{
|
|
232
|
+
text-align: center;
|
|
233
|
+
font-size: 14px;
|
|
234
|
+
color: var(--matchid-login-other-color, #6E6E6E);
|
|
235
|
+
font-weight: 400;
|
|
236
|
+
}
|
|
237
|
+
.matchid-login-method-box{
|
|
238
|
+
display: grid;
|
|
239
|
+
padding:16px;
|
|
240
|
+
gap: 32px 16px;
|
|
241
|
+
grid-template-columns: repeat(5, 1fr);
|
|
242
|
+
@media screen and (max-width: 300px) {
|
|
243
|
+
grid-template-columns: repeat(4, 1fr);
|
|
244
|
+
}
|
|
245
|
+
.matchid-login-method-item{
|
|
246
|
+
cursor: pointer;
|
|
247
|
+
display: flex;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
align-items: center;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
133
253
|
}
|
|
134
254
|
|
|
135
|
-
|
|
136
|
-
display: flex;
|
|
137
|
-
justify-content: flex-start;
|
|
138
|
-
align-items: center;
|
|
139
|
-
gap: 8px;
|
|
140
|
-
}
|
|
255
|
+
|
|
141
256
|
|
|
142
257
|
.matchid-login-panel {
|
|
143
258
|
display: flex;
|
|
144
259
|
flex-direction: column;
|
|
145
260
|
gap: 24px;
|
|
261
|
+
.matchid-login-panel-box{
|
|
262
|
+
max-height: 500px;
|
|
263
|
+
overflow-y: auto;
|
|
264
|
+
&::-webkit-scrollbar {
|
|
265
|
+
width: 8px;
|
|
266
|
+
background-color: #D3D3D3;
|
|
267
|
+
border-radius: 4px;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
146
270
|
}
|
|
147
271
|
|
|
148
272
|
.matchid-login-panel-divide {
|
|
@@ -632,4 +756,4 @@ body {
|
|
|
632
756
|
}
|
|
633
757
|
}
|
|
634
758
|
|
|
635
|
-
}
|
|
759
|
+
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import react__default, { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
1
|
+
import React$1, { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
3
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
3
|
import * as viem from 'viem';
|
|
5
4
|
import { SignableMessage, Hex, TransactionSerializable, Account } from 'viem';
|
|
@@ -8,6 +7,8 @@ import { UseQueryOptions } from '@tanstack/react-query/src/types';
|
|
|
8
7
|
|
|
9
8
|
type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' |'telegram' | 'linkedin' | 'facebook'
|
|
10
9
|
type LoginMethodType = 'evm' | 'sol' | 'email' | ISocialLoginMethod
|
|
10
|
+
type OtherLoginMethodType ='email' | ISocialLoginMethod
|
|
11
|
+
type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod
|
|
11
12
|
type IEnvConfigType = {
|
|
12
13
|
endpoints: {
|
|
13
14
|
back: string;
|
|
@@ -70,8 +71,9 @@ type InputProps = {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
type LoginBoxProps = {
|
|
73
|
-
methods?:
|
|
74
|
+
methods?: OtherLoginMethodType[],
|
|
74
75
|
inModal?: boolean
|
|
76
|
+
recommendMethods?: RecommendLoginMethodType[]
|
|
75
77
|
}
|
|
76
78
|
type LoginPanelProps = {
|
|
77
79
|
header?: React.ReactNode
|
|
@@ -162,7 +164,7 @@ type MatchContextType = {
|
|
|
162
164
|
}) => Promise<void>;
|
|
163
165
|
theme: "light" | "dark";
|
|
164
166
|
} & Partial<IEnvConfigType>;
|
|
165
|
-
declare const MatchProvider:
|
|
167
|
+
declare const MatchProvider: React$1.FC<{
|
|
166
168
|
children: ReactNode;
|
|
167
169
|
appid: string;
|
|
168
170
|
events?: IMatchEvents;
|
|
@@ -189,18 +191,17 @@ declare function ModalWithHeader({ children, onBack, onClose, title, showBorder,
|
|
|
189
191
|
|
|
190
192
|
declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
191
193
|
|
|
192
|
-
declare function LoginBox({ methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
194
|
+
declare function LoginBox({ recommendMethods, methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
193
195
|
|
|
194
|
-
declare function LoginButton({ loginRender, methods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
196
|
+
declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
195
197
|
loginRender?: ReactNode;
|
|
196
|
-
methods?:
|
|
198
|
+
methods?: OtherLoginMethodType[];
|
|
199
|
+
recommendMethods?: RecommendLoginMethodType[];
|
|
197
200
|
onLoginClick?: () => void;
|
|
198
201
|
popoverPosition?: PopoverPositionType;
|
|
199
|
-
popoverType
|
|
202
|
+
popoverType?: PopoverTypeType;
|
|
200
203
|
popoverGap?: number | string;
|
|
201
|
-
}): react_jsx_runtime.JSX.Element
|
|
202
|
-
loginRender: string | number | true | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal;
|
|
203
|
-
};
|
|
204
|
+
}): react_jsx_runtime.JSX.Element;
|
|
204
205
|
|
|
205
206
|
declare function LoginPanel({ header, onClose, ...props }: LoginPanelProps): react_jsx_runtime.JSX.Element;
|
|
206
207
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import react__default, { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
1
|
+
import React$1, { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
3
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
3
|
import * as viem from 'viem';
|
|
5
4
|
import { SignableMessage, Hex, TransactionSerializable, Account } from 'viem';
|
|
@@ -8,6 +7,8 @@ import { UseQueryOptions } from '@tanstack/react-query/src/types';
|
|
|
8
7
|
|
|
9
8
|
type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' |'telegram' | 'linkedin' | 'facebook'
|
|
10
9
|
type LoginMethodType = 'evm' | 'sol' | 'email' | ISocialLoginMethod
|
|
10
|
+
type OtherLoginMethodType ='email' | ISocialLoginMethod
|
|
11
|
+
type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod
|
|
11
12
|
type IEnvConfigType = {
|
|
12
13
|
endpoints: {
|
|
13
14
|
back: string;
|
|
@@ -70,8 +71,9 @@ type InputProps = {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
type LoginBoxProps = {
|
|
73
|
-
methods?:
|
|
74
|
+
methods?: OtherLoginMethodType[],
|
|
74
75
|
inModal?: boolean
|
|
76
|
+
recommendMethods?: RecommendLoginMethodType[]
|
|
75
77
|
}
|
|
76
78
|
type LoginPanelProps = {
|
|
77
79
|
header?: React.ReactNode
|
|
@@ -162,7 +164,7 @@ type MatchContextType = {
|
|
|
162
164
|
}) => Promise<void>;
|
|
163
165
|
theme: "light" | "dark";
|
|
164
166
|
} & Partial<IEnvConfigType>;
|
|
165
|
-
declare const MatchProvider:
|
|
167
|
+
declare const MatchProvider: React$1.FC<{
|
|
166
168
|
children: ReactNode;
|
|
167
169
|
appid: string;
|
|
168
170
|
events?: IMatchEvents;
|
|
@@ -189,18 +191,17 @@ declare function ModalWithHeader({ children, onBack, onClose, title, showBorder,
|
|
|
189
191
|
|
|
190
192
|
declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
191
193
|
|
|
192
|
-
declare function LoginBox({ methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
194
|
+
declare function LoginBox({ recommendMethods, methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
193
195
|
|
|
194
|
-
declare function LoginButton({ loginRender, methods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
196
|
+
declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
195
197
|
loginRender?: ReactNode;
|
|
196
|
-
methods?:
|
|
198
|
+
methods?: OtherLoginMethodType[];
|
|
199
|
+
recommendMethods?: RecommendLoginMethodType[];
|
|
197
200
|
onLoginClick?: () => void;
|
|
198
201
|
popoverPosition?: PopoverPositionType;
|
|
199
|
-
popoverType
|
|
202
|
+
popoverType?: PopoverTypeType;
|
|
200
203
|
popoverGap?: number | string;
|
|
201
|
-
}): react_jsx_runtime.JSX.Element
|
|
202
|
-
loginRender: string | number | true | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal;
|
|
203
|
-
};
|
|
204
|
+
}): react_jsx_runtime.JSX.Element;
|
|
204
205
|
|
|
205
206
|
declare function LoginPanel({ header, onClose, ...props }: LoginPanelProps): react_jsx_runtime.JSX.Element;
|
|
206
207
|
|