@mysten/dapp-kit 0.3.0 → 0.5.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/CHANGELOG.md +12 -0
- package/README.md +4 -4
- package/dist/cjs/components/AccountDropdownMenu.d.ts +4 -0
- package/dist/cjs/components/AccountDropdownMenu.js +116 -42
- package/dist/cjs/components/AccountDropdownMenu.js.map +4 -4
- package/dist/cjs/components/ConnectButton.js +183 -110
- package/dist/cjs/components/ConnectButton.js.map +4 -4
- package/dist/cjs/components/SuiClientProvider.d.ts +4 -4
- package/dist/cjs/components/SuiClientProvider.js +1 -0
- package/dist/cjs/components/SuiClientProvider.js.map +2 -2
- package/dist/cjs/components/WalletProvider.js +1 -2
- package/dist/cjs/components/WalletProvider.js.map +2 -2
- package/dist/cjs/hooks/networkConfig.d.ts +10 -0
- package/dist/cjs/hooks/networkConfig.js +74 -0
- package/dist/cjs/hooks/networkConfig.js.map +7 -0
- package/dist/cjs/hooks/useResolveSuiNSNames.d.ts +107 -0
- package/dist/cjs/hooks/useResolveSuiNSNames.js +83 -0
- package/dist/cjs/hooks/useResolveSuiNSNames.js.map +7 -0
- package/dist/cjs/hooks/useSuiClient.js.map +2 -2
- package/dist/cjs/hooks/useSuiClientInfiniteQuery.js.map +2 -2
- package/dist/cjs/hooks/useSuiClientMutation.js.map +2 -2
- package/dist/cjs/hooks/useSuiClientQuery.js.map +2 -2
- package/dist/cjs/hooks/wallet/useSignAndExecuteTransactionBlock.js.map +2 -2
- package/dist/cjs/hooks/wallet/useUnsafeBurnerWallet.js.map +2 -2
- package/dist/cjs/index.css +127 -127
- package/dist/cjs/index.css.map +3 -3
- package/dist/cjs/index.d.ts +13 -10
- package/dist/cjs/index.js +594 -529
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/walletStore.js +1 -2
- package/dist/cjs/walletStore.js.map +2 -2
- package/dist/esm/components/AccountDropdownMenu.d.ts +4 -0
- package/dist/esm/components/AccountDropdownMenu.js +106 -32
- package/dist/esm/components/AccountDropdownMenu.js.map +4 -4
- package/dist/esm/components/ConnectButton.js +156 -83
- package/dist/esm/components/ConnectButton.js.map +4 -4
- package/dist/esm/components/SuiClientProvider.d.ts +4 -4
- package/dist/esm/components/SuiClientProvider.js +1 -0
- package/dist/esm/components/SuiClientProvider.js.map +2 -2
- package/dist/esm/components/WalletProvider.js +1 -2
- package/dist/esm/components/WalletProvider.js.map +2 -2
- package/dist/esm/hooks/networkConfig.d.ts +10 -0
- package/dist/esm/hooks/networkConfig.js +51 -0
- package/dist/esm/hooks/networkConfig.js.map +7 -0
- package/dist/esm/hooks/useResolveSuiNSNames.d.ts +107 -0
- package/dist/esm/hooks/useResolveSuiNSNames.js +60 -0
- package/dist/esm/hooks/useResolveSuiNSNames.js.map +7 -0
- package/dist/esm/hooks/useSuiClient.js.map +2 -2
- package/dist/esm/hooks/useSuiClientInfiniteQuery.js.map +2 -2
- package/dist/esm/hooks/useSuiClientMutation.js.map +2 -2
- package/dist/esm/hooks/useSuiClientQuery.js.map +2 -2
- package/dist/esm/hooks/wallet/useSignAndExecuteTransactionBlock.js.map +2 -2
- package/dist/esm/hooks/wallet/useUnsafeBurnerWallet.js.map +2 -2
- package/dist/esm/index.css +127 -127
- package/dist/esm/index.css.map +3 -3
- package/dist/esm/index.d.ts +13 -10
- package/dist/esm/index.js +609 -544
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/walletStore.js +1 -2
- package/dist/esm/walletStore.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/AccountDropdownMenu.tsx +31 -9
- package/src/components/SuiClientProvider.tsx +11 -2
- package/src/hooks/networkConfig.ts +45 -0
- package/src/hooks/useResolveSuiNSNames.ts +31 -0
- package/src/index.ts +13 -10
- package/src/walletStore.ts +3 -4
|
@@ -83,13 +83,70 @@ var import_utils = require("@mysten/sui.js/utils");
|
|
|
83
83
|
var DropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
84
84
|
var import_clsx3 = __toESM(require("clsx"));
|
|
85
85
|
|
|
86
|
+
// src/hooks/useSuiClientQuery.ts
|
|
87
|
+
var import_react_query = require("@tanstack/react-query");
|
|
88
|
+
|
|
89
|
+
// src/hooks/useSuiClient.ts
|
|
90
|
+
var import_react4 = require("react");
|
|
91
|
+
|
|
92
|
+
// src/components/SuiClientProvider.tsx
|
|
93
|
+
var import_client = require("@mysten/sui.js/client");
|
|
94
|
+
var import_react3 = require("react");
|
|
95
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
96
|
+
var SuiClientContext = (0, import_react3.createContext)(null);
|
|
97
|
+
var DEFAULT_NETWORKS = {
|
|
98
|
+
localnet: { url: (0, import_client.getFullnodeUrl)("localnet") }
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// src/hooks/useSuiClient.ts
|
|
102
|
+
function useSuiClientContext() {
|
|
103
|
+
const suiClient = (0, import_react4.useContext)(SuiClientContext);
|
|
104
|
+
if (!suiClient) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
"Could not find SuiClientContext. Ensure that you have set up the SuiClientProvider"
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return suiClient;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/hooks/useSuiClientQuery.ts
|
|
113
|
+
function useSuiClientQuery(...args) {
|
|
114
|
+
const [method, params, { queryKey = [], ...options } = {}] = args;
|
|
115
|
+
const suiContext = useSuiClientContext();
|
|
116
|
+
return (0, import_react_query.useQuery)({
|
|
117
|
+
...options,
|
|
118
|
+
queryKey: [suiContext.network, method, params, ...queryKey],
|
|
119
|
+
queryFn: async () => {
|
|
120
|
+
return await suiContext.client[method](params);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/hooks/useResolveSuiNSNames.ts
|
|
126
|
+
function useResolveSuiNSName(address, options) {
|
|
127
|
+
const { data, ...rest } = useSuiClientQuery(
|
|
128
|
+
"resolveNameServiceNames",
|
|
129
|
+
{
|
|
130
|
+
address,
|
|
131
|
+
limit: 1
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
refetchOnWindowFocus: false,
|
|
135
|
+
retry: false,
|
|
136
|
+
...options,
|
|
137
|
+
enabled: !!address && options?.enabled !== false
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
return { data: data?.data?.[0] ?? null, ...rest };
|
|
141
|
+
}
|
|
142
|
+
|
|
86
143
|
// src/hooks/wallet/useAccounts.ts
|
|
87
144
|
function useAccounts() {
|
|
88
145
|
return useWalletStore((state) => state.accounts);
|
|
89
146
|
}
|
|
90
147
|
|
|
91
148
|
// src/hooks/wallet/useDisconnectWallet.ts
|
|
92
|
-
var
|
|
149
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
93
150
|
|
|
94
151
|
// src/constants/walletMutationKeys.ts
|
|
95
152
|
var walletMutationKeys = {
|
|
@@ -125,7 +182,7 @@ function useDisconnectWallet({
|
|
|
125
182
|
} = {}) {
|
|
126
183
|
const currentWallet = useCurrentWallet();
|
|
127
184
|
const setWalletDisconnected = useWalletStore((state) => state.setWalletDisconnected);
|
|
128
|
-
return (0,
|
|
185
|
+
return (0, import_react_query2.useMutation)({
|
|
129
186
|
mutationKey: walletMutationKeys.disconnectWallet(mutationKey),
|
|
130
187
|
mutationFn: async () => {
|
|
131
188
|
if (!currentWallet) {
|
|
@@ -143,14 +200,14 @@ function useDisconnectWallet({
|
|
|
143
200
|
}
|
|
144
201
|
|
|
145
202
|
// src/hooks/wallet/useSwitchAccount.ts
|
|
146
|
-
var
|
|
203
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
147
204
|
function useSwitchAccount({
|
|
148
205
|
mutationKey,
|
|
149
206
|
...mutationOptions
|
|
150
207
|
} = {}) {
|
|
151
208
|
const currentWallet = useCurrentWallet();
|
|
152
209
|
const setAccountSwitched = useWalletStore((state) => state.setAccountSwitched);
|
|
153
|
-
return (0,
|
|
210
|
+
return (0, import_react_query3.useMutation)({
|
|
154
211
|
mutationKey: walletMutationKeys.switchAccount(mutationKey),
|
|
155
212
|
mutationFn: async ({ account }) => {
|
|
156
213
|
if (!currentWallet) {
|
|
@@ -178,9 +235,9 @@ var separator = "AccountDropdownMenu_separator__div2ql4";
|
|
|
178
235
|
var switchAccountMenuItem = "AccountDropdownMenu_switchAccountMenuItem__div2ql3";
|
|
179
236
|
|
|
180
237
|
// src/components/icons/CheckIcon.tsx
|
|
181
|
-
var
|
|
238
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
182
239
|
function CheckIcon(props) {
|
|
183
|
-
return /* @__PURE__ */ (0,
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
184
241
|
"path",
|
|
185
242
|
{
|
|
186
243
|
fill: "currentColor",
|
|
@@ -190,9 +247,9 @@ function CheckIcon(props) {
|
|
|
190
247
|
}
|
|
191
248
|
|
|
192
249
|
// src/components/icons/ChevronIcon.tsx
|
|
193
|
-
var
|
|
250
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
194
251
|
function ChevronIcon(props) {
|
|
195
|
-
return /* @__PURE__ */ (0,
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
196
253
|
"path",
|
|
197
254
|
{
|
|
198
255
|
stroke: "#A0B6C3",
|
|
@@ -206,7 +263,7 @@ function ChevronIcon(props) {
|
|
|
206
263
|
|
|
207
264
|
// src/components/styling/StyleMarker.tsx
|
|
208
265
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
209
|
-
var
|
|
266
|
+
var import_react5 = require("react");
|
|
210
267
|
|
|
211
268
|
// src/constants/styleDataAttribute.ts
|
|
212
269
|
var styleDataAttributeName = "data-dapp-kit";
|
|
@@ -215,25 +272,25 @@ var styleDataAttribute = { [styleDataAttributeName]: "" };
|
|
|
215
272
|
|
|
216
273
|
// src/components/styling/StyleMarker.tsx
|
|
217
274
|
var import_StyleMarker_css = __toESM(require_StyleMarker_css());
|
|
218
|
-
var
|
|
219
|
-
var StyleMarker = (0,
|
|
275
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
276
|
+
var StyleMarker = (0, import_react5.forwardRef)(({ children }, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_slot.Slot, { ref: forwardedRef, ...styleDataAttribute, children }));
|
|
220
277
|
StyleMarker.displayName = "StyleMarker";
|
|
221
278
|
|
|
222
279
|
// src/components/ui/Button.tsx
|
|
223
280
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
224
281
|
var import_clsx = __toESM(require("clsx"));
|
|
225
|
-
var
|
|
282
|
+
var import_react6 = require("react");
|
|
226
283
|
|
|
227
284
|
// src/components/ui/Button.css.ts
|
|
228
285
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
229
286
|
var buttonVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "Button_buttonVariants__x1s81q0", variantClassNames: { variant: { primary: "Button_buttonVariants_variant_primary__x1s81q1", outline: "Button_buttonVariants_variant_outline__x1s81q2" }, size: { md: "Button_buttonVariants_size_md__x1s81q3", lg: "Button_buttonVariants_size_lg__x1s81q4" } }, defaultVariants: { variant: "primary", size: "md" }, compoundVariants: [] });
|
|
230
287
|
|
|
231
288
|
// src/components/ui/Button.tsx
|
|
232
|
-
var
|
|
233
|
-
var Button = (0,
|
|
289
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
290
|
+
var Button = (0, import_react6.forwardRef)(
|
|
234
291
|
({ className, variant, size, asChild = false, ...props }, forwardedRef) => {
|
|
235
292
|
const Comp = asChild ? import_react_slot2.Slot : "button";
|
|
236
|
-
return /* @__PURE__ */ (0,
|
|
293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
237
294
|
Comp,
|
|
238
295
|
{
|
|
239
296
|
...props,
|
|
@@ -248,15 +305,15 @@ Button.displayName = "Button";
|
|
|
248
305
|
// src/components/ui/Text.tsx
|
|
249
306
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
250
307
|
var import_clsx2 = __toESM(require("clsx"));
|
|
251
|
-
var
|
|
308
|
+
var import_react7 = require("react");
|
|
252
309
|
|
|
253
310
|
// src/components/ui/Text.css.ts
|
|
254
311
|
var import_createRuntimeFn2 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
255
312
|
var textVariants = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "Text__2bv1ur0", variantClassNames: { size: { sm: "Text_textVariants_size_sm__2bv1ur1" }, weight: { normal: "Text_textVariants_weight_normal__2bv1ur2", medium: "Text_textVariants_weight_medium__2bv1ur3", bold: "Text_textVariants_weight_bold__2bv1ur4" }, color: { muted: "Text_textVariants_color_muted__2bv1ur5", danger: "Text_textVariants_color_danger__2bv1ur6" }, mono: { true: "Text_textVariants_mono_true__2bv1ur7" } }, defaultVariants: { size: "sm", weight: "normal" }, compoundVariants: [] });
|
|
256
313
|
|
|
257
314
|
// src/components/ui/Text.tsx
|
|
258
|
-
var
|
|
259
|
-
var Text = (0,
|
|
315
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
316
|
+
var Text = (0, import_react7.forwardRef)(
|
|
260
317
|
({
|
|
261
318
|
children,
|
|
262
319
|
className,
|
|
@@ -268,13 +325,13 @@ var Text = (0, import_react5.forwardRef)(
|
|
|
268
325
|
mono,
|
|
269
326
|
...textProps
|
|
270
327
|
}, forwardedRef) => {
|
|
271
|
-
return /* @__PURE__ */ (0,
|
|
328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
272
329
|
import_react_slot3.Slot,
|
|
273
330
|
{
|
|
274
331
|
...textProps,
|
|
275
332
|
ref: forwardedRef,
|
|
276
333
|
className: (0, import_clsx2.default)(textVariants({ size, weight, color, mono }), className),
|
|
277
|
-
children: asChild ? children : /* @__PURE__ */ (0,
|
|
334
|
+
children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Tag, { children })
|
|
278
335
|
}
|
|
279
336
|
);
|
|
280
337
|
}
|
|
@@ -282,31 +339,29 @@ var Text = (0, import_react5.forwardRef)(
|
|
|
282
339
|
Text.displayName = "Text";
|
|
283
340
|
|
|
284
341
|
// src/components/AccountDropdownMenu.tsx
|
|
285
|
-
var
|
|
342
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
286
343
|
function AccountDropdownMenu({ currentAccount }) {
|
|
287
344
|
const { mutate: disconnectWallet } = useDisconnectWallet();
|
|
288
|
-
const {
|
|
345
|
+
const { data: domain } = useResolveSuiNSName(
|
|
346
|
+
currentAccount.label ? null : currentAccount.address
|
|
347
|
+
);
|
|
289
348
|
const accounts = useAccounts();
|
|
290
|
-
return /* @__PURE__ */ (0,
|
|
291
|
-
/* @__PURE__ */ (0,
|
|
292
|
-
/* @__PURE__ */ (0,
|
|
293
|
-
/* @__PURE__ */ (0,
|
|
349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DropdownMenu.Root, { modal: false, children: [
|
|
350
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(StyleMarker, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { size: "lg", className: connectedAccount, children: [
|
|
351
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { mono: true, weight: "bold", children: currentAccount.label ?? domain ?? (0, import_utils.formatAddress)(currentAccount.address) }),
|
|
352
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronIcon, {})
|
|
294
353
|
] }) }) }),
|
|
295
|
-
/* @__PURE__ */ (0,
|
|
296
|
-
accounts.map((account) => /* @__PURE__ */ (0,
|
|
297
|
-
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(StyleMarker, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DropdownMenu.Content, { className: menuContent, children: [
|
|
355
|
+
accounts.map((account) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
356
|
+
AccountDropdownMenuItem,
|
|
298
357
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
children: [
|
|
302
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { mono: true, children: (0, import_utils.formatAddress)(account.address) }),
|
|
303
|
-
currentAccount.address === account.address ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckIcon, {}) : null
|
|
304
|
-
]
|
|
358
|
+
account,
|
|
359
|
+
active: currentAccount.address === account.address
|
|
305
360
|
},
|
|
306
361
|
account.address
|
|
307
362
|
)),
|
|
308
|
-
/* @__PURE__ */ (0,
|
|
309
|
-
/* @__PURE__ */ (0,
|
|
363
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenu.Separator, { className: separator }),
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
310
365
|
DropdownMenu.Item,
|
|
311
366
|
{
|
|
312
367
|
className: (0, import_clsx3.default)(menuItem),
|
|
@@ -317,20 +372,38 @@ function AccountDropdownMenu({ currentAccount }) {
|
|
|
317
372
|
] }) }) })
|
|
318
373
|
] });
|
|
319
374
|
}
|
|
375
|
+
function AccountDropdownMenuItem({
|
|
376
|
+
account,
|
|
377
|
+
active
|
|
378
|
+
}) {
|
|
379
|
+
const { mutate: switchAccount } = useSwitchAccount();
|
|
380
|
+
const { data: domain } = useResolveSuiNSName(account.label ? null : account.address);
|
|
381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
382
|
+
DropdownMenu.Item,
|
|
383
|
+
{
|
|
384
|
+
className: (0, import_clsx3.default)(menuItem, switchAccountMenuItem),
|
|
385
|
+
onSelect: () => switchAccount({ account }),
|
|
386
|
+
children: [
|
|
387
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { mono: true, children: account.label ?? domain ?? (0, import_utils.formatAddress)(account.address) }),
|
|
388
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CheckIcon, {}) : null
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
);
|
|
392
|
+
}
|
|
320
393
|
|
|
321
394
|
// src/components/connect-modal/ConnectModal.tsx
|
|
322
395
|
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
323
396
|
var import_clsx7 = __toESM(require("clsx"));
|
|
324
|
-
var
|
|
397
|
+
var import_react10 = require("react");
|
|
325
398
|
|
|
326
399
|
// src/hooks/wallet/useConnectWallet.ts
|
|
327
|
-
var
|
|
400
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
328
401
|
function useConnectWallet({
|
|
329
402
|
mutationKey,
|
|
330
403
|
...mutationOptions
|
|
331
404
|
} = {}) {
|
|
332
405
|
const setWalletConnected = useWalletStore((state) => state.setWalletConnected);
|
|
333
|
-
return (0,
|
|
406
|
+
return (0, import_react_query4.useMutation)({
|
|
334
407
|
mutationKey: walletMutationKeys.connectWallet(mutationKey),
|
|
335
408
|
mutationFn: async ({ wallet, accountAddress, ...standardConnectInput }) => {
|
|
336
409
|
const connectResult = await wallet.features["standard:connect"].connect(standardConnectInput);
|
|
@@ -356,9 +429,9 @@ function getSelectedAccount(connectedAccounts, accountAddress) {
|
|
|
356
429
|
}
|
|
357
430
|
|
|
358
431
|
// src/components/icons/BackIcon.tsx
|
|
359
|
-
var
|
|
432
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
360
433
|
function BackIcon(props) {
|
|
361
|
-
return /* @__PURE__ */ (0,
|
|
434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: 24, height: 24, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
362
435
|
"path",
|
|
363
436
|
{
|
|
364
437
|
d: "M7.57 12.262c0 .341.13.629.403.895l5.175 5.059c.204.205.45.307.751.307.609 0 1.101-.485 1.101-1.087 0-.293-.123-.574-.349-.8L10.14 12.27l4.511-4.375A1.13 1.13 0 0 0 15 7.087C15 6.485 14.508 6 13.9 6c-.295 0-.54.103-.752.308l-5.175 5.058c-.28.28-.404.56-.404.896Z",
|
|
@@ -368,9 +441,9 @@ function BackIcon(props) {
|
|
|
368
441
|
}
|
|
369
442
|
|
|
370
443
|
// src/components/icons/CloseIcon.tsx
|
|
371
|
-
var
|
|
444
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
372
445
|
function CloseIcon(props) {
|
|
373
|
-
return /* @__PURE__ */ (0,
|
|
446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: 10, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
374
447
|
"path",
|
|
375
448
|
{
|
|
376
449
|
d: "M9.708.292a.999.999 0 0 0-1.413 0l-3.289 3.29L1.717.291A.999.999 0 0 0 .305 1.705l3.289 3.289-3.29 3.289a.999.999 0 1 0 1.413 1.412l3.29-3.289 3.288 3.29a.999.999 0 0 0 1.413-1.413l-3.29-3.29 3.29-3.288a.999.999 0 0 0 0-1.413Z",
|
|
@@ -382,15 +455,15 @@ function CloseIcon(props) {
|
|
|
382
455
|
// src/components/ui/Heading.tsx
|
|
383
456
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
384
457
|
var import_clsx4 = __toESM(require("clsx"));
|
|
385
|
-
var
|
|
458
|
+
var import_react8 = require("react");
|
|
386
459
|
|
|
387
460
|
// src/components/ui/Heading.css.ts
|
|
388
461
|
var import_createRuntimeFn3 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
389
462
|
var headingVariants = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "Heading__1aa835k0", variantClassNames: { size: { sm: "Heading_headingVariants_size_sm__1aa835k1", md: "Heading_headingVariants_size_md__1aa835k2", lg: "Heading_headingVariants_size_lg__1aa835k3", xl: "Heading_headingVariants_size_xl__1aa835k4" }, weight: { normal: "Heading_headingVariants_weight_normal__1aa835k5", bold: "Heading_headingVariants_weight_bold__1aa835k6" }, truncate: { true: "Heading_headingVariants_truncate_true__1aa835k7" } }, defaultVariants: { size: "lg", weight: "bold" }, compoundVariants: [] });
|
|
390
463
|
|
|
391
464
|
// src/components/ui/Heading.tsx
|
|
392
|
-
var
|
|
393
|
-
var Heading = (0,
|
|
465
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
466
|
+
var Heading = (0, import_react8.forwardRef)(
|
|
394
467
|
({
|
|
395
468
|
children,
|
|
396
469
|
className,
|
|
@@ -401,13 +474,13 @@ var Heading = (0, import_react6.forwardRef)(
|
|
|
401
474
|
truncate,
|
|
402
475
|
...headingProps
|
|
403
476
|
}, forwardedRef) => {
|
|
404
|
-
return /* @__PURE__ */ (0,
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
405
478
|
import_react_slot4.Slot,
|
|
406
479
|
{
|
|
407
480
|
...headingProps,
|
|
408
481
|
ref: forwardedRef,
|
|
409
482
|
className: (0, import_clsx4.default)(headingVariants({ size, weight, truncate }), className),
|
|
410
|
-
children: asChild ? children : /* @__PURE__ */ (0,
|
|
483
|
+
children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Tag, { children })
|
|
411
484
|
}
|
|
412
485
|
);
|
|
413
486
|
}
|
|
@@ -417,17 +490,17 @@ Heading.displayName = "Heading";
|
|
|
417
490
|
// src/components/ui/IconButton.tsx
|
|
418
491
|
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
419
492
|
var import_clsx5 = __toESM(require("clsx"));
|
|
420
|
-
var
|
|
493
|
+
var import_react9 = require("react");
|
|
421
494
|
|
|
422
495
|
// src/components/ui/IconButton.css.ts
|
|
423
496
|
var container = "IconButton_container__s6n7bq0";
|
|
424
497
|
|
|
425
498
|
// src/components/ui/IconButton.tsx
|
|
426
|
-
var
|
|
427
|
-
var IconButton = (0,
|
|
499
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
500
|
+
var IconButton = (0, import_react9.forwardRef)(
|
|
428
501
|
({ className, asChild = false, ...props }, forwardedRef) => {
|
|
429
502
|
const Comp = asChild ? import_react_slot5.Slot : "button";
|
|
430
|
-
return /* @__PURE__ */ (0,
|
|
503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Comp, { ...props, className: (0, import_clsx5.default)(container, className), ref: forwardedRef });
|
|
431
504
|
}
|
|
432
505
|
);
|
|
433
506
|
IconButton.displayName = "Button";
|
|
@@ -453,14 +526,14 @@ var title2 = "ConnectionStatus_title__nckm2d2";
|
|
|
453
526
|
var walletIcon = "ConnectionStatus_walletIcon__nckm2d1";
|
|
454
527
|
|
|
455
528
|
// src/components/connect-modal/views/ConnectionStatus.tsx
|
|
456
|
-
var
|
|
529
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
457
530
|
function ConnectionStatus({
|
|
458
531
|
selectedWallet,
|
|
459
532
|
hadConnectionError,
|
|
460
533
|
onRetryConnection
|
|
461
534
|
}) {
|
|
462
|
-
return /* @__PURE__ */ (0,
|
|
463
|
-
/* @__PURE__ */ (0,
|
|
535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: container2, children: [
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
464
537
|
"img",
|
|
465
538
|
{
|
|
466
539
|
className: walletIcon,
|
|
@@ -468,12 +541,12 @@ function ConnectionStatus({
|
|
|
468
541
|
alt: `${selectedWallet.name} logo`
|
|
469
542
|
}
|
|
470
543
|
),
|
|
471
|
-
/* @__PURE__ */ (0,
|
|
544
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: title2, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Heading, { as: "h2", size: "xl", children: [
|
|
472
545
|
"Opening ",
|
|
473
546
|
selectedWallet.name
|
|
474
547
|
] }) }),
|
|
475
|
-
/* @__PURE__ */ (0,
|
|
476
|
-
hadConnectionError ? /* @__PURE__ */ (0,
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: connectionStatus, children: hadConnectionError ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "danger", children: "Connection failed" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { color: "muted", children: "Confirm connection in the wallet..." }) }),
|
|
549
|
+
hadConnectionError ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: retryButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { type: "button", variant: "outline", onClick: () => onRetryConnection(selectedWallet), children: "Retry Connection" }) }) : null
|
|
477
550
|
] });
|
|
478
551
|
}
|
|
479
552
|
|
|
@@ -481,11 +554,11 @@ function ConnectionStatus({
|
|
|
481
554
|
var container3 = "InfoSection_container__1wtioi70";
|
|
482
555
|
|
|
483
556
|
// src/components/connect-modal/InfoSection.tsx
|
|
484
|
-
var
|
|
557
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
485
558
|
function InfoSection({ title: title3, children }) {
|
|
486
|
-
return /* @__PURE__ */ (0,
|
|
487
|
-
/* @__PURE__ */ (0,
|
|
488
|
-
/* @__PURE__ */ (0,
|
|
559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: container3, children: [
|
|
560
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Heading, { as: "h3", size: "sm", weight: "normal", children: title3 }),
|
|
561
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { weight: "medium", color: "muted", children })
|
|
489
562
|
] });
|
|
490
563
|
}
|
|
491
564
|
|
|
@@ -495,15 +568,15 @@ var content2 = "GettingStarted_content__1fp07e11";
|
|
|
495
568
|
var installButtonContainer = "GettingStarted_installButtonContainer__1fp07e12";
|
|
496
569
|
|
|
497
570
|
// src/components/connect-modal/views/GettingStarted.tsx
|
|
498
|
-
var
|
|
571
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
499
572
|
function GettingStarted() {
|
|
500
|
-
return /* @__PURE__ */ (0,
|
|
501
|
-
/* @__PURE__ */ (0,
|
|
502
|
-
/* @__PURE__ */ (0,
|
|
503
|
-
/* @__PURE__ */ (0,
|
|
504
|
-
/* @__PURE__ */ (0,
|
|
505
|
-
/* @__PURE__ */ (0,
|
|
506
|
-
/* @__PURE__ */ (0,
|
|
573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: container4, children: [
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { as: "h2", children: "Get Started with Sui" }),
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: content2, children: [
|
|
576
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InfoSection, { title: "Install the Sui Wallet Extension", children: "We recommend pinning Sui Wallet to your taskbar for quicker access." }),
|
|
577
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InfoSection, { title: "Create or Import a Wallet", children: "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone." }),
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InfoSection, { title: "Refresh Your Browser", children: "Once you set up your wallet, refresh this window browser to load up the extension." }),
|
|
579
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: installButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { variant: "outline", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
507
580
|
"a",
|
|
508
581
|
{
|
|
509
582
|
href: "https://chrome.google.com/webstore/detail/sui-wallet/opcgpfmipidbgpenhmajoajpbobppdil",
|
|
@@ -521,13 +594,13 @@ var container5 = "WhatIsAWallet_container__1ktpkq90";
|
|
|
521
594
|
var content3 = "WhatIsAWallet_content__1ktpkq91";
|
|
522
595
|
|
|
523
596
|
// src/components/connect-modal/views/WhatIsAWallet.tsx
|
|
524
|
-
var
|
|
597
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
525
598
|
function WhatIsAWallet() {
|
|
526
|
-
return /* @__PURE__ */ (0,
|
|
527
|
-
/* @__PURE__ */ (0,
|
|
528
|
-
/* @__PURE__ */ (0,
|
|
529
|
-
/* @__PURE__ */ (0,
|
|
530
|
-
/* @__PURE__ */ (0,
|
|
599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: container5, children: [
|
|
600
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Heading, { as: "h2", children: "What is a Wallet" }),
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: content3, children: [
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(InfoSection, { title: "Easy Login", children: "No need to create new accounts and passwords for every website. Just connect your wallet and get going." }),
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(InfoSection, { title: "Store your Digital Assets", children: "Send, receive, store, and display your digital assets like NFTs & coins." })
|
|
531
604
|
] })
|
|
532
605
|
] });
|
|
533
606
|
}
|
|
@@ -538,11 +611,11 @@ function useWallets() {
|
|
|
538
611
|
}
|
|
539
612
|
|
|
540
613
|
// src/components/icons/SuiIcon.tsx
|
|
541
|
-
var
|
|
614
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
542
615
|
function SuiIcon(props) {
|
|
543
|
-
return /* @__PURE__ */ (0,
|
|
544
|
-
/* @__PURE__ */ (0,
|
|
545
|
-
/* @__PURE__ */ (0,
|
|
616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: 28, height: 28, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
617
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { width: 28, height: 28, rx: 6, fill: "#6FBCF0" }),
|
|
618
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
546
619
|
"path",
|
|
547
620
|
{
|
|
548
621
|
fillRule: "evenodd",
|
|
@@ -567,27 +640,27 @@ var walletIcon2 = "WalletListItem_walletIcon__1dqqtqs3";
|
|
|
567
640
|
var walletItem = "WalletListItem_walletItem__1dqqtqs1";
|
|
568
641
|
|
|
569
642
|
// src/components/connect-modal/wallet-list/WalletListItem.tsx
|
|
570
|
-
var
|
|
643
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
571
644
|
function WalletListItem({ name, icon, onClick, isSelected = false }) {
|
|
572
|
-
return /* @__PURE__ */ (0,
|
|
645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { className: container7, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
573
646
|
"button",
|
|
574
647
|
{
|
|
575
648
|
className: (0, import_clsx6.clsx)(walletItem, { [selectedWalletItem]: isSelected }),
|
|
576
649
|
type: "button",
|
|
577
650
|
onClick,
|
|
578
651
|
children: [
|
|
579
|
-
typeof icon === "string" ? /* @__PURE__ */ (0,
|
|
580
|
-
/* @__PURE__ */ (0,
|
|
652
|
+
typeof icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { className: walletIcon2, src: icon, alt: `${name} logo` }) : icon,
|
|
653
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Heading, { size: "md", truncate: true, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: name }) })
|
|
581
654
|
]
|
|
582
655
|
}
|
|
583
656
|
) });
|
|
584
657
|
}
|
|
585
658
|
|
|
586
659
|
// src/components/connect-modal/wallet-list/WalletList.tsx
|
|
587
|
-
var
|
|
660
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
588
661
|
function WalletList({ selectedWalletName, onPlaceholderClick, onSelect }) {
|
|
589
662
|
const wallets = useWallets();
|
|
590
|
-
return /* @__PURE__ */ (0,
|
|
663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: container6, children: wallets.length > 0 ? wallets.map((wallet) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
591
664
|
WalletListItem,
|
|
592
665
|
{
|
|
593
666
|
name: wallet.name,
|
|
@@ -596,11 +669,11 @@ function WalletList({ selectedWalletName, onPlaceholderClick, onSelect }) {
|
|
|
596
669
|
onClick: () => onSelect(wallet)
|
|
597
670
|
},
|
|
598
671
|
wallet.name
|
|
599
|
-
)) : /* @__PURE__ */ (0,
|
|
672
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
600
673
|
WalletListItem,
|
|
601
674
|
{
|
|
602
675
|
name: "Sui Wallet",
|
|
603
|
-
icon: /* @__PURE__ */ (0,
|
|
676
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SuiIcon, {}),
|
|
604
677
|
onClick: onPlaceholderClick,
|
|
605
678
|
isSelected: true
|
|
606
679
|
}
|
|
@@ -608,11 +681,11 @@ function WalletList({ selectedWalletName, onPlaceholderClick, onSelect }) {
|
|
|
608
681
|
}
|
|
609
682
|
|
|
610
683
|
// src/components/connect-modal/ConnectModal.tsx
|
|
611
|
-
var
|
|
684
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
612
685
|
function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
|
|
613
|
-
const [isModalOpen, setModalOpen] = (0,
|
|
614
|
-
const [currentView, setCurrentView] = (0,
|
|
615
|
-
const [selectedWallet, setSelectedWallet] = (0,
|
|
686
|
+
const [isModalOpen, setModalOpen] = (0, import_react10.useState)(open ?? defaultOpen);
|
|
687
|
+
const [currentView, setCurrentView] = (0, import_react10.useState)();
|
|
688
|
+
const [selectedWallet, setSelectedWallet] = (0, import_react10.useState)();
|
|
616
689
|
const { mutate, isError } = useConnectWallet();
|
|
617
690
|
const resetSelection = () => {
|
|
618
691
|
setSelectedWallet(void 0);
|
|
@@ -637,13 +710,13 @@ function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
|
|
|
637
710
|
let modalContent;
|
|
638
711
|
switch (currentView) {
|
|
639
712
|
case "what-is-a-wallet":
|
|
640
|
-
modalContent = /* @__PURE__ */ (0,
|
|
713
|
+
modalContent = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WhatIsAWallet, {});
|
|
641
714
|
break;
|
|
642
715
|
case "getting-started":
|
|
643
|
-
modalContent = /* @__PURE__ */ (0,
|
|
716
|
+
modalContent = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GettingStarted, {});
|
|
644
717
|
break;
|
|
645
718
|
case "connection-status":
|
|
646
|
-
modalContent = /* @__PURE__ */ (0,
|
|
719
|
+
modalContent = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
647
720
|
ConnectionStatus,
|
|
648
721
|
{
|
|
649
722
|
selectedWallet,
|
|
@@ -653,21 +726,21 @@ function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
|
|
|
653
726
|
);
|
|
654
727
|
break;
|
|
655
728
|
default:
|
|
656
|
-
modalContent = /* @__PURE__ */ (0,
|
|
729
|
+
modalContent = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WhatIsAWallet, {});
|
|
657
730
|
}
|
|
658
|
-
return /* @__PURE__ */ (0,
|
|
659
|
-
/* @__PURE__ */ (0,
|
|
660
|
-
/* @__PURE__ */ (0,
|
|
661
|
-
/* @__PURE__ */ (0,
|
|
731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Dialog.Root, { open: open ?? isModalOpen, onOpenChange: handleOpenChange, children: [
|
|
732
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StyleMarker, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Trigger, { asChild: true, children: trigger }) }),
|
|
733
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StyleMarker, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Overlay, { className: overlay, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Dialog.Content, { className: content, "aria-describedby": void 0, children: [
|
|
734
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
662
735
|
"div",
|
|
663
736
|
{
|
|
664
737
|
className: (0, import_clsx7.default)(walletListContainer, {
|
|
665
738
|
[walletListContainerWithViewSelected]: !!currentView
|
|
666
739
|
}),
|
|
667
740
|
children: [
|
|
668
|
-
/* @__PURE__ */ (0,
|
|
669
|
-
/* @__PURE__ */ (0,
|
|
670
|
-
/* @__PURE__ */ (0,
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: walletListContent, children: [
|
|
742
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Title, { className: title, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Heading, { as: "h2", children: "Connect a Wallet" }) }),
|
|
743
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
671
744
|
WalletList,
|
|
672
745
|
{
|
|
673
746
|
selectedWalletName: selectedWallet?.name,
|
|
@@ -681,7 +754,7 @@ function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
|
|
|
681
754
|
}
|
|
682
755
|
)
|
|
683
756
|
] }),
|
|
684
|
-
/* @__PURE__ */ (0,
|
|
757
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
685
758
|
"button",
|
|
686
759
|
{
|
|
687
760
|
className: whatIsAWalletButton,
|
|
@@ -693,30 +766,30 @@ function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
|
|
|
693
766
|
]
|
|
694
767
|
}
|
|
695
768
|
),
|
|
696
|
-
/* @__PURE__ */ (0,
|
|
769
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
697
770
|
"div",
|
|
698
771
|
{
|
|
699
772
|
className: (0, import_clsx7.default)(viewContainer, {
|
|
700
773
|
[selectedViewContainer]: !!currentView
|
|
701
774
|
}),
|
|
702
775
|
children: [
|
|
703
|
-
/* @__PURE__ */ (0,
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: backButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconButton, { type: "button", "aria-label": "Back", onClick: () => resetSelection(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BackIcon, {}) }) }),
|
|
704
777
|
modalContent
|
|
705
778
|
]
|
|
706
779
|
}
|
|
707
780
|
),
|
|
708
|
-
/* @__PURE__ */ (0,
|
|
781
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Close, { className: closeButtonContainer, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconButton, { type: "button", "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIcon, {}) }) })
|
|
709
782
|
] }) }) }) })
|
|
710
783
|
] });
|
|
711
784
|
}
|
|
712
785
|
|
|
713
786
|
// src/components/ConnectButton.tsx
|
|
714
|
-
var
|
|
787
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
715
788
|
function ConnectButton({
|
|
716
789
|
connectText = "Connect Wallet",
|
|
717
790
|
...buttonProps
|
|
718
791
|
}) {
|
|
719
792
|
const currentAccount = useCurrentAccount();
|
|
720
|
-
return currentAccount ? /* @__PURE__ */ (0,
|
|
793
|
+
return currentAccount ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AccountDropdownMenu, { currentAccount }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ConnectModal, { trigger: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { ...buttonProps, children: connectText }) });
|
|
721
794
|
}
|
|
722
795
|
//# sourceMappingURL=ConnectButton.js.map
|