@matchain/matchid-sdk-react 0.1.28 → 0.1.30

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 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,159 @@ body {
111
119
  justify-content: center;
112
120
  align-items: center;
113
121
  flex-direction: column;
114
- gap: 16px;
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
- .matchid-login-method {
118
- display: flex;
119
- justify-content: space-between;
120
- align-items: center;
121
- gap: 16px;
122
- height: 72px;
123
- width: 100%;
124
- padding: 16px;
125
- cursor: pointer;
126
- color: var(--matchid-login-method-color, #000000);
127
- border-radius: var(--matchid-login-method-round, 12px);
128
- border: 1px solid var(--matchid-login-method-border-color, #E3E3E3);
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
- .matchid-login-method:hover {
132
- border-color: var(--matchid-login-method-hover-border-color, #FC802D);
133
- }
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
+
243
+ @media screen and (max-width: 400px) {
244
+ grid-template-columns: repeat(4, 1fr);
245
+ }
134
246
 
135
- .matchid-login-method-content {
136
- display: flex;
137
- justify-content: flex-start;
138
- align-items: center;
139
- gap: 8px;
247
+ @media screen and (max-width: 350px) {
248
+ grid-template-columns: repeat(3, 1fr);
249
+ }
250
+ .matchid-login-method-item{
251
+ cursor: pointer;
252
+ display: flex;
253
+ justify-content: center;
254
+ align-items: center;
255
+ }
256
+ }
257
+ }
140
258
  }
141
259
 
260
+
261
+
142
262
  .matchid-login-panel {
143
263
  display: flex;
144
264
  flex-direction: column;
145
265
  gap: 24px;
266
+ .matchid-login-panel-box{
267
+ max-height: 500px;
268
+ overflow-y: auto;
269
+ &::-webkit-scrollbar {
270
+ width: 8px;
271
+ background-color: #D3D3D3;
272
+ border-radius: 4px;
273
+ }
274
+ }
146
275
  }
147
276
 
148
277
  .matchid-login-panel-divide {
@@ -234,12 +363,14 @@ body {
234
363
  width: 100%;
235
364
  height: 72px;
236
365
  padding-left: 24px;
366
+ padding-right: 24px;
237
367
  border-radius: 12px;
238
368
  border: 1px solid var(--matchid-input-border-color);
239
369
  display: flex;
240
370
  align-items: center;
241
371
  justify-content: space-between;
242
372
  background: var(--matchid-input-bg);
373
+ gap:24px;
243
374
  }
244
375
 
245
376
  .matchid-input-box:active, .matchid-input-box:focus, .matchid-input-box:focus-within {
@@ -250,8 +381,9 @@ body {
250
381
  .matchid-input-delete-icon {
251
382
  opacity: 0;
252
383
  cursor: pointer;
253
- margin-left: 24px;
254
- margin-right: 24px;
384
+ width: 20px;
385
+ flex-shrink: 1;
386
+
255
387
  }
256
388
 
257
389
  .matchid-input-box:focus-within .matchid-input-delete-icon {
@@ -260,8 +392,10 @@ body {
260
392
 
261
393
  .matchid-input-eye-icon {
262
394
  cursor: pointer;
263
- margin-left: 24px;
264
- margin-right: 24px;
395
+ display: flex;
396
+ align-items: center;
397
+ width: 20px;
398
+ flex-shrink: 1;
265
399
  }
266
400
 
267
401
  .matchid-input-box.matchid-input-has-content {
@@ -276,7 +410,7 @@ body {
276
410
  font-size: 18px;
277
411
  font-weight: 600;
278
412
  background: none;
279
- margin-right: 24px;
413
+ min-width: 0;
280
414
  }
281
415
 
282
416
  .matchid-input-field::placeholder {
@@ -632,4 +766,4 @@ body {
632
766
  }
633
767
  }
634
768
 
635
- }
769
+ }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import * as react from 'react';
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?: LoginMethodType[],
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: react__default.FC<{
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?: LoginMethodType[];
198
+ methods?: OtherLoginMethodType[];
199
+ recommendMethods?: RecommendLoginMethodType[];
197
200
  onLoginClick?: () => void;
198
201
  popoverPosition?: PopoverPositionType;
199
- popoverType: PopoverTypeType;
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 * as react from 'react';
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?: LoginMethodType[],
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: react__default.FC<{
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?: LoginMethodType[];
198
+ methods?: OtherLoginMethodType[];
199
+ recommendMethods?: RecommendLoginMethodType[];
197
200
  onLoginClick?: () => void;
198
201
  popoverPosition?: PopoverPositionType;
199
- popoverType: PopoverTypeType;
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