@arcblock/did-connect-react 3.1.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.
- package/LICENSE +13 -0
- package/README.md +134 -0
- package/lib/Address/index.js +4 -0
- package/lib/Avatar/index.js +4 -0
- package/lib/Button/index.js +17 -0
- package/lib/Connect/assets/locale.js +143 -0
- package/lib/Connect/assets/login-bg.png +0 -0
- package/lib/Connect/assets/login-slogan.js +9 -0
- package/lib/Connect/components/action-button.js +26 -0
- package/lib/Connect/components/app-tips.js +132 -0
- package/lib/Connect/components/auto-height.js +31 -0
- package/lib/Connect/components/back-button.js +24 -0
- package/lib/Connect/components/connect-status.js +263 -0
- package/lib/Connect/components/did-connect-title.js +126 -0
- package/lib/Connect/components/download-tips.js +52 -0
- package/lib/Connect/components/loading.js +26 -0
- package/lib/Connect/components/login-item/connect-choose-list.js +249 -0
- package/lib/Connect/components/login-item/login-method-item.js +129 -0
- package/lib/Connect/components/login-item/mobile-login-item.js +114 -0
- package/lib/Connect/components/login-item/passkey-login-item.js +44 -0
- package/lib/Connect/components/login-item/web-login-item.js +97 -0
- package/lib/Connect/components/mask-overlay.js +34 -0
- package/lib/Connect/components/refresh-overlay.js +57 -0
- package/lib/Connect/components/switch-app.js +70 -0
- package/lib/Connect/contexts/state.js +142 -0
- package/lib/Connect/fullpage.js +5 -0
- package/lib/Connect/hooks/auth-url.js +23 -0
- package/lib/Connect/hooks/method-list.js +46 -0
- package/lib/Connect/hooks/page-show.js +17 -0
- package/lib/Connect/hooks/security.js +27 -0
- package/lib/Connect/hooks/token.js +305 -0
- package/lib/Connect/hooks/use-apps.js +19 -0
- package/lib/Connect/hooks/use-quick-connect.js +97 -0
- package/lib/Connect/index.js +498 -0
- package/lib/Connect/landing-page.js +5 -0
- package/lib/Connect/plugins/email/index.js +62 -0
- package/lib/Connect/plugins/email/list-item.js +28 -0
- package/lib/Connect/plugins/email/placeholder.js +283 -0
- package/lib/Connect/plugins/index.js +4 -0
- package/lib/Connect/use-connect.js +164 -0
- package/lib/Connect/with-blocklet.js +15 -0
- package/lib/Connect/with-bridge-call.js +108 -0
- package/lib/Federated/context.js +61 -0
- package/lib/Federated/index.js +7 -0
- package/lib/Logo/index.js +4 -0
- package/lib/OAuth/context.js +234 -0
- package/lib/OAuth/guest.svg.js +5 -0
- package/lib/OAuth/index.js +7 -0
- package/lib/OAuth/passport-switcher.js +114 -0
- package/lib/Passkey/actions.js +165 -0
- package/lib/Passkey/constants.js +4 -0
- package/lib/Passkey/context.js +266 -0
- package/lib/Passkey/dialog.js +277 -0
- package/lib/Passkey/icon.js +13 -0
- package/lib/Passkey/index.js +9 -0
- package/lib/Service/index.js +62 -0
- package/lib/Session/assets/did-spaces-guide-cover.svg.js +135 -0
- package/lib/Session/assets/did-spaces-guide-icon.svg.js +9 -0
- package/lib/Session/context.js +5 -0
- package/lib/Session/did-spaces-guide.js +136 -0
- package/lib/Session/hooks/use-federated.js +64 -0
- package/lib/Session/hooks/use-mobile.js +8 -0
- package/lib/Session/hooks/use-protected-routes.js +11 -0
- package/lib/Session/hooks/use-session-token.js +169 -0
- package/lib/Session/hooks/use-verify.js +45 -0
- package/lib/Session/index.js +896 -0
- package/lib/Session/libs/constants.js +15 -0
- package/lib/Session/libs/did-spaces.js +10 -0
- package/lib/Session/libs/federated.js +42 -0
- package/lib/Session/libs/index.js +15 -0
- package/lib/Session/libs/locales.js +161 -0
- package/lib/Session/libs/login-mobile.js +55 -0
- package/lib/Session/window-focus-aware.js +17 -0
- package/lib/SessionManager/index.js +4 -0
- package/lib/Storage/engine/cookie.js +21 -0
- package/lib/Storage/engine/local-storage.js +36 -0
- package/lib/Storage/index.js +23 -0
- package/lib/User/index.js +6 -0
- package/lib/User/use-did.js +59 -0
- package/lib/User/wrap-did.js +13 -0
- package/lib/WebWalletSWKeeper/index.js +5 -0
- package/lib/constant.js +22 -0
- package/lib/error.js +8 -0
- package/lib/hooks/use-locale.js +7 -0
- package/lib/index.js +33 -0
- package/lib/locales/en.js +17 -0
- package/lib/locales/index.js +10 -0
- package/lib/locales/zh.js +17 -0
- package/lib/package.json.js +7 -0
- package/lib/types.d.ts +355 -0
- package/lib/utils.js +214 -0
- package/package.json +84 -0
- package/src/Address/index.jsx +2 -0
- package/src/Avatar/index.jsx +2 -0
- package/src/Button/Button.stories.jsx +7 -0
- package/src/Button/index.jsx +21 -0
- package/src/Connect/Connect.stories.jsx +34 -0
- package/src/Connect/assets/locale.js +145 -0
- package/src/Connect/assets/login-bg.png +0 -0
- package/src/Connect/assets/login-slogan.js +7 -0
- package/src/Connect/components/action-button.jsx +22 -0
- package/src/Connect/components/app-tips.jsx +156 -0
- package/src/Connect/components/auto-height.jsx +38 -0
- package/src/Connect/components/back-button.jsx +23 -0
- package/src/Connect/components/connect-status.jsx +259 -0
- package/src/Connect/components/did-connect-title.jsx +106 -0
- package/src/Connect/components/download-tips.jsx +55 -0
- package/src/Connect/components/loading.jsx +25 -0
- package/src/Connect/components/login-item/connect-choose-list.jsx +304 -0
- package/src/Connect/components/login-item/login-method-item.jsx +118 -0
- package/src/Connect/components/login-item/mobile-login-item.jsx +179 -0
- package/src/Connect/components/login-item/passkey-login-item.jsx +52 -0
- package/src/Connect/components/login-item/web-login-item.jsx +149 -0
- package/src/Connect/components/mask-overlay.jsx +32 -0
- package/src/Connect/components/refresh-overlay.jsx +52 -0
- package/src/Connect/components/switch-app.jsx +69 -0
- package/src/Connect/contexts/state.jsx +219 -0
- package/src/Connect/fullpage.jsx +3 -0
- package/src/Connect/hooks/auth-url.js +31 -0
- package/src/Connect/hooks/method-list.js +121 -0
- package/src/Connect/hooks/page-show.js +24 -0
- package/src/Connect/hooks/security.js +40 -0
- package/src/Connect/hooks/token.js +639 -0
- package/src/Connect/hooks/use-apps.js +69 -0
- package/src/Connect/hooks/use-quick-connect.js +130 -0
- package/src/Connect/index.jsx +600 -0
- package/src/Connect/landing-page.jsx +3 -0
- package/src/Connect/plugins/email/index.jsx +82 -0
- package/src/Connect/plugins/email/list-item.jsx +31 -0
- package/src/Connect/plugins/email/placeholder.jsx +365 -0
- package/src/Connect/plugins/index.js +2 -0
- package/src/Connect/use-connect.jsx +321 -0
- package/src/Connect/with-blocklet.jsx +26 -0
- package/src/Connect/with-bridge-call.jsx +138 -0
- package/src/Federated/context.jsx +93 -0
- package/src/Federated/index.jsx +1 -0
- package/src/Logo/index.jsx +2 -0
- package/src/OAuth/context.jsx +346 -0
- package/src/OAuth/guest.svg +20 -0
- package/src/OAuth/index.jsx +1 -0
- package/src/OAuth/passport-switcher.jsx +133 -0
- package/src/Passkey/actions.jsx +212 -0
- package/src/Passkey/constants.js +2 -0
- package/src/Passkey/context.jsx +381 -0
- package/src/Passkey/dialog.jsx +391 -0
- package/src/Passkey/icon.jsx +10 -0
- package/src/Passkey/index.jsx +2 -0
- package/src/Service/index.jsx +96 -0
- package/src/Session/assets/did-spaces-guide-cover.svg +128 -0
- package/src/Session/assets/did-spaces-guide-icon.svg +7 -0
- package/src/Session/context.jsx +7 -0
- package/src/Session/did-spaces-guide.jsx +173 -0
- package/src/Session/hooks/use-federated.js +88 -0
- package/src/Session/hooks/use-mobile.jsx +6 -0
- package/src/Session/hooks/use-protected-routes.js +16 -0
- package/src/Session/hooks/use-session-token.js +365 -0
- package/src/Session/hooks/use-verify.jsx +76 -0
- package/src/Session/index.jsx +1687 -0
- package/src/Session/libs/constants.js +14 -0
- package/src/Session/libs/did-spaces.js +38 -0
- package/src/Session/libs/federated.js +79 -0
- package/src/Session/libs/index.js +5 -0
- package/src/Session/libs/locales.js +160 -0
- package/src/Session/libs/login-mobile.js +80 -0
- package/src/Session/window-focus-aware.jsx +28 -0
- package/src/SessionManager/index.jsx +2 -0
- package/src/Storage/engine/cookie.js +23 -0
- package/src/Storage/engine/local-storage.js +55 -0
- package/src/Storage/index.js +25 -0
- package/src/User/index.js +4 -0
- package/src/User/use-did.js +80 -0
- package/src/User/wrap-did.jsx +18 -0
- package/src/WebWalletSWKeeper/index.jsx +3 -0
- package/src/constant.js +26 -0
- package/src/error.js +6 -0
- package/src/hooks/use-locale.jsx +6 -0
- package/src/index.js +43 -0
- package/src/locales/en.jsx +15 -0
- package/src/locales/index.jsx +13 -0
- package/src/locales/zh.jsx +15 -0
- package/src/types.d.ts +355 -0
- package/src/utils.js +395 -0
- package/vite.config.mjs +29 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as v } from "react";
|
|
3
|
+
import o from "prop-types";
|
|
4
|
+
import { useTheme as I, Box as n, Typography as y, Tooltip as q } from "@mui/material";
|
|
5
|
+
import { Icon as B } from "@iconify/react";
|
|
6
|
+
import j from "@iconify-icons/material-symbols/close-rounded";
|
|
7
|
+
import A from "@iconify-icons/material-symbols/hourglass-empty-rounded";
|
|
8
|
+
import E from "@iconify-icons/material-symbols/rule-settings-rounded";
|
|
9
|
+
import L from "@arcblock/ux/lib/LoadingMask";
|
|
10
|
+
import M from "@arcblock/ux/lib/Success";
|
|
11
|
+
import g from "lodash/noop";
|
|
12
|
+
import { useMemoizedFn as N } from "ahooks";
|
|
13
|
+
import { translate as O } from "@arcblock/ux/lib/Locale/util";
|
|
14
|
+
import P from "@arcblock/ux/lib/DIDConnect/provider-icon";
|
|
15
|
+
import { LOGIN_PROVIDER as F } from "@arcblock/ux/lib/Util/constant";
|
|
16
|
+
import H from "../assets/locale.js";
|
|
17
|
+
import k from "./action-button.js";
|
|
18
|
+
import f from "./back-button.js";
|
|
19
|
+
function a({ icon: t = null, title: l = "", color: s = "", description: i = "", extraContent: x = null, actions: h = null }) {
|
|
20
|
+
const { palette: c } = I(), m = s || c.grey[700];
|
|
21
|
+
return /* @__PURE__ */ p(
|
|
22
|
+
n,
|
|
23
|
+
{
|
|
24
|
+
sx: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
gap: 1.5
|
|
30
|
+
},
|
|
31
|
+
children: [
|
|
32
|
+
v(t) ? t : /* @__PURE__ */ e(
|
|
33
|
+
n,
|
|
34
|
+
{
|
|
35
|
+
sx: {
|
|
36
|
+
backgroundColor: m,
|
|
37
|
+
borderRadius: "100%",
|
|
38
|
+
fontSize: 0
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ e(
|
|
41
|
+
B,
|
|
42
|
+
{
|
|
43
|
+
icon: t,
|
|
44
|
+
fontSize: 52,
|
|
45
|
+
style: {
|
|
46
|
+
transform: "scale(0.7)",
|
|
47
|
+
color: c.primary.contrastText
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ p(n, { sx: { textAlign: "center" }, children: [
|
|
54
|
+
/* @__PURE__ */ e(
|
|
55
|
+
y,
|
|
56
|
+
{
|
|
57
|
+
variant: "h6",
|
|
58
|
+
sx: {
|
|
59
|
+
fontWeight: 500,
|
|
60
|
+
color: m
|
|
61
|
+
},
|
|
62
|
+
children: l
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ e(q, { title: i, placement: "top", children: /* @__PURE__ */ e(
|
|
66
|
+
y,
|
|
67
|
+
{
|
|
68
|
+
variant: "body2",
|
|
69
|
+
sx: {
|
|
70
|
+
color: "text.secondary",
|
|
71
|
+
overflow: "hidden",
|
|
72
|
+
display: "-webkit-box",
|
|
73
|
+
"-webkit-box-orient": "vertical",
|
|
74
|
+
"-webkit-line-clamp": "3",
|
|
75
|
+
whiteSpace: "pre-wrap",
|
|
76
|
+
wordBreak: "break-word"
|
|
77
|
+
},
|
|
78
|
+
children: i
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] }),
|
|
82
|
+
x,
|
|
83
|
+
/* @__PURE__ */ e(n, { children: h })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
a.propTypes = {
|
|
89
|
+
icon: o.any,
|
|
90
|
+
title: o.string,
|
|
91
|
+
color: o.string,
|
|
92
|
+
description: o.string,
|
|
93
|
+
extraContent: o.node,
|
|
94
|
+
actions: o.node
|
|
95
|
+
};
|
|
96
|
+
function b({ title: t = "", mfaCode: l = 0 }) {
|
|
97
|
+
return /* @__PURE__ */ p(
|
|
98
|
+
n,
|
|
99
|
+
{
|
|
100
|
+
className: "status-mfa",
|
|
101
|
+
sx: {
|
|
102
|
+
display: "flex",
|
|
103
|
+
flexDirection: "column",
|
|
104
|
+
justifyContent: "center",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
border: "1px solid",
|
|
107
|
+
borderColor: "grey.200",
|
|
108
|
+
borderRadius: 1,
|
|
109
|
+
maxWidth: "360px",
|
|
110
|
+
backgroundColor: "transparent",
|
|
111
|
+
p: 1
|
|
112
|
+
},
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ e(
|
|
115
|
+
n,
|
|
116
|
+
{
|
|
117
|
+
className: "status-mfa-tip",
|
|
118
|
+
sx: {
|
|
119
|
+
textAlign: "center",
|
|
120
|
+
textWrap: "balance"
|
|
121
|
+
},
|
|
122
|
+
children: t
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ e(
|
|
126
|
+
y,
|
|
127
|
+
{
|
|
128
|
+
className: "status-mfa-code",
|
|
129
|
+
sx: {
|
|
130
|
+
mt: 1,
|
|
131
|
+
lineHeight: 1,
|
|
132
|
+
fontSize: "36px",
|
|
133
|
+
fontWeight: 700,
|
|
134
|
+
letterSpacing: 1
|
|
135
|
+
},
|
|
136
|
+
children: l
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
b.propTypes = {
|
|
144
|
+
title: o.string,
|
|
145
|
+
mfaCode: o.number
|
|
146
|
+
};
|
|
147
|
+
function V({
|
|
148
|
+
status: t = "",
|
|
149
|
+
nextWorkflow: l = "",
|
|
150
|
+
mfaCode: s = 0,
|
|
151
|
+
onCancel: i = g,
|
|
152
|
+
onRetry: x = g,
|
|
153
|
+
onClose: h = g,
|
|
154
|
+
messages: c,
|
|
155
|
+
locale: m = "en",
|
|
156
|
+
isFullScreen: w = !1,
|
|
157
|
+
loadingIcon: S = null,
|
|
158
|
+
chooseMethod: T = "DID Wallet",
|
|
159
|
+
hideRetry: D = !1,
|
|
160
|
+
hideBack: u = !1,
|
|
161
|
+
...C
|
|
162
|
+
}) {
|
|
163
|
+
const r = N((W, z = {}) => O(H, W, m, "en", z)), { palette: R } = I(), d = /* @__PURE__ */ e(k, { sx: { color: "text.secondary" }, onClick: h, children: r("close") });
|
|
164
|
+
return /* @__PURE__ */ p(
|
|
165
|
+
n,
|
|
166
|
+
{
|
|
167
|
+
...C,
|
|
168
|
+
sx: {
|
|
169
|
+
p: 2,
|
|
170
|
+
minHeight: 200,
|
|
171
|
+
...C.sx
|
|
172
|
+
},
|
|
173
|
+
children: [
|
|
174
|
+
t === "scanned" && !l && /* @__PURE__ */ e(
|
|
175
|
+
a,
|
|
176
|
+
{
|
|
177
|
+
icon: /* @__PURE__ */ e(L, { size: 52, borderRadius: 12, children: S || /* @__PURE__ */ e(P, { provider: F.DID_WALLET, width: "100%", height: "100%" }) }),
|
|
178
|
+
title: r("requestConnect"),
|
|
179
|
+
description: r("continueInWallet", { method: T }),
|
|
180
|
+
extraContent: s > 0 && /* @__PURE__ */ e(b, { mfaCode: s, title: r("mfaCode") }),
|
|
181
|
+
actions: u ? d : /* @__PURE__ */ e(f, { onClick: i })
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
t === "scanned" && !!l && /* @__PURE__ */ e(
|
|
185
|
+
a,
|
|
186
|
+
{
|
|
187
|
+
color: R.secondary.main,
|
|
188
|
+
icon: A,
|
|
189
|
+
title: r("wait"),
|
|
190
|
+
description: r("waiting"),
|
|
191
|
+
extraContent: s > 0 && /* @__PURE__ */ e(b, { mfaCode: s, title: r("mfaCode") }),
|
|
192
|
+
actions: u ? d : /* @__PURE__ */ e(f, { onClick: i })
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
t === "succeed" && /* @__PURE__ */ e(
|
|
196
|
+
a,
|
|
197
|
+
{
|
|
198
|
+
color: "success.light",
|
|
199
|
+
icon: /* @__PURE__ */ e(M, { size: 52, borderWidth: 3 }),
|
|
200
|
+
title: r("success"),
|
|
201
|
+
description: c.success,
|
|
202
|
+
actions: w ? null : d
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
t === "error" && /* @__PURE__ */ e(
|
|
206
|
+
a,
|
|
207
|
+
{
|
|
208
|
+
color: R.error.main,
|
|
209
|
+
icon: j,
|
|
210
|
+
title: r("failed"),
|
|
211
|
+
description: c.error || r("error"),
|
|
212
|
+
actions: /* @__PURE__ */ p(n, { sx: { display: "flex", gap: 1 }, children: [
|
|
213
|
+
u ? d : /* @__PURE__ */ e(f, { onClick: i }),
|
|
214
|
+
D ? null : /* @__PURE__ */ e(
|
|
215
|
+
k,
|
|
216
|
+
{
|
|
217
|
+
onClick: x,
|
|
218
|
+
sx: {
|
|
219
|
+
color: "primary.main",
|
|
220
|
+
borderColor: "primary.light"
|
|
221
|
+
},
|
|
222
|
+
children: r("retry")
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] })
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
t === "busy" && /* @__PURE__ */ e(
|
|
229
|
+
a,
|
|
230
|
+
{
|
|
231
|
+
color: "warning.main",
|
|
232
|
+
icon: E,
|
|
233
|
+
title: r("busyTitle"),
|
|
234
|
+
description: c.error || r("busyDesc"),
|
|
235
|
+
actions: u ? d : /* @__PURE__ */ e(f, { onClick: i })
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
V.propTypes = {
|
|
243
|
+
status: o.string,
|
|
244
|
+
nextWorkflow: o.string,
|
|
245
|
+
mfaCode: o.number,
|
|
246
|
+
onCancel: o.func,
|
|
247
|
+
onRetry: o.func,
|
|
248
|
+
onClose: o.func,
|
|
249
|
+
messages: o.shape({
|
|
250
|
+
confirm: o.string.isRequired,
|
|
251
|
+
success: o.any.isRequired,
|
|
252
|
+
error: o.any.isRequired
|
|
253
|
+
}).isRequired,
|
|
254
|
+
locale: o.oneOf(["en", "zh"]),
|
|
255
|
+
isFullScreen: o.bool,
|
|
256
|
+
loadingIcon: o.any,
|
|
257
|
+
chooseMethod: o.string,
|
|
258
|
+
hideRetry: o.bool,
|
|
259
|
+
hideBack: o.bool
|
|
260
|
+
};
|
|
261
|
+
export {
|
|
262
|
+
V as default
|
|
263
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d } from "react";
|
|
3
|
+
import { Icon as r } from "@iconify/react";
|
|
4
|
+
import { Box as n, Typography as l, Tooltip as x } from "@mui/material";
|
|
5
|
+
import y from "@iconify-icons/material-symbols/info-outline-rounded";
|
|
6
|
+
import u from "@iconify-icons/material-symbols/swap-horiz-rounded";
|
|
7
|
+
import t from "prop-types";
|
|
8
|
+
import h from "./switch-app.js";
|
|
9
|
+
function g({ title: p, description: s, extraContent: e = null, disableSwitchApp: a = !1 }) {
|
|
10
|
+
const [c, f] = d(!1);
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
|
+
n,
|
|
13
|
+
{
|
|
14
|
+
sx: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
gap: 0.5
|
|
18
|
+
},
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ i(
|
|
21
|
+
l,
|
|
22
|
+
{
|
|
23
|
+
component: "h1",
|
|
24
|
+
variant: "h4",
|
|
25
|
+
sx: {
|
|
26
|
+
color: "text.primary",
|
|
27
|
+
fontWeight: 700,
|
|
28
|
+
fontFamily: "Lexend",
|
|
29
|
+
display: "flex",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
gap: 0.5
|
|
32
|
+
},
|
|
33
|
+
onClick: (m) => {
|
|
34
|
+
a || m.detail > 2 && f(!0);
|
|
35
|
+
},
|
|
36
|
+
children: [
|
|
37
|
+
p,
|
|
38
|
+
/* @__PURE__ */ o(
|
|
39
|
+
h,
|
|
40
|
+
{
|
|
41
|
+
sx: {
|
|
42
|
+
fontSize: 0,
|
|
43
|
+
display: c ? "block" : "none"
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ o(
|
|
46
|
+
r,
|
|
47
|
+
{
|
|
48
|
+
icon: u,
|
|
49
|
+
style: {
|
|
50
|
+
fontSize: "14px"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ i(
|
|
60
|
+
l,
|
|
61
|
+
{
|
|
62
|
+
variant: "body2",
|
|
63
|
+
sx: {
|
|
64
|
+
color: "text.secondary",
|
|
65
|
+
fontFamily: "Lexend"
|
|
66
|
+
},
|
|
67
|
+
children: [
|
|
68
|
+
s,
|
|
69
|
+
e ? /* @__PURE__ */ o(
|
|
70
|
+
x,
|
|
71
|
+
{
|
|
72
|
+
title: e,
|
|
73
|
+
arrow: !0,
|
|
74
|
+
slotProps: {
|
|
75
|
+
tooltip: {
|
|
76
|
+
sx: {
|
|
77
|
+
"&>.MuiTypography-root": {
|
|
78
|
+
color: "primary.contrastText",
|
|
79
|
+
fontFamily: "Lexend"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
popper: {
|
|
84
|
+
modifiers: [
|
|
85
|
+
{
|
|
86
|
+
name: "offset",
|
|
87
|
+
options: {
|
|
88
|
+
offset: [0, -8]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
children: /* @__PURE__ */ o(
|
|
95
|
+
n,
|
|
96
|
+
{
|
|
97
|
+
component: r,
|
|
98
|
+
icon: y,
|
|
99
|
+
sx: {
|
|
100
|
+
fontSize: 14,
|
|
101
|
+
display: "inline-block",
|
|
102
|
+
verticalAlign: "middle",
|
|
103
|
+
ml: 0.5,
|
|
104
|
+
cursor: "pointer",
|
|
105
|
+
transform: "translateY(-1px)"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
) : null
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
g.propTypes = {
|
|
119
|
+
title: t.string.isRequired,
|
|
120
|
+
description: t.string.isRequired,
|
|
121
|
+
extraContent: t.any,
|
|
122
|
+
disableSwitchApp: t.bool
|
|
123
|
+
};
|
|
124
|
+
export {
|
|
125
|
+
g as default
|
|
126
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as l, Box as a } from "@mui/material";
|
|
3
|
+
import { useCreation as p } from "ahooks";
|
|
4
|
+
import { mergeSx as s } from "@arcblock/ux/lib/Util/style";
|
|
5
|
+
import { useStateContext as d } from "../contexts/state.js";
|
|
6
|
+
function x({ ...o }) {
|
|
7
|
+
const { t: r, locale: t } = d(), n = p(() => ["zh", "en"].includes ? `https://www.didwallet.io/${t}` : "https://www.didwallet.io/en", [t]), i = r("downloadTips");
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
l,
|
|
10
|
+
{
|
|
11
|
+
title: i,
|
|
12
|
+
arrow: !0,
|
|
13
|
+
placement: "top",
|
|
14
|
+
slotProps: {
|
|
15
|
+
popper: {
|
|
16
|
+
modifiers: [
|
|
17
|
+
{
|
|
18
|
+
name: "offset",
|
|
19
|
+
options: {
|
|
20
|
+
offset: [0, -8]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
children: /* @__PURE__ */ e(
|
|
27
|
+
a,
|
|
28
|
+
{
|
|
29
|
+
component: "a",
|
|
30
|
+
href: n,
|
|
31
|
+
target: "_blank",
|
|
32
|
+
rel: "noopener",
|
|
33
|
+
...o,
|
|
34
|
+
sx: s(
|
|
35
|
+
{
|
|
36
|
+
color: "primary.main",
|
|
37
|
+
textDecoration: "none",
|
|
38
|
+
"&:hover": {
|
|
39
|
+
textDecoration: "dashed underline"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
o?.sx
|
|
43
|
+
),
|
|
44
|
+
children: "DID Wallet"
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
x as default
|
|
52
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Box as n, CircularProgress as t } from "@mui/material";
|
|
3
|
+
import i from "prop-types";
|
|
4
|
+
function s({ size: r = 92.5, loadingSize: o = 30 }) {
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
|
+
n,
|
|
7
|
+
{
|
|
8
|
+
sx: {
|
|
9
|
+
height: "100%",
|
|
10
|
+
minWidth: r,
|
|
11
|
+
minHeight: r,
|
|
12
|
+
display: "flex",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
alignItems: "center"
|
|
15
|
+
},
|
|
16
|
+
children: /* @__PURE__ */ e(t, { size: o, sx: { color: "secondary.main" } })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
s.propTypes = {
|
|
21
|
+
size: i.number,
|
|
22
|
+
loadingSize: i.number
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
s as default
|
|
26
|
+
};
|