@mysten/dapp-kit-core 1.3.0 → 1.3.2
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 +25 -0
- package/docs/actions/connect-wallet.md +6 -5
- package/docs/actions/disconnect-wallet.md +12 -10
- package/docs/actions/sign-and-execute-transaction.md +16 -15
- package/docs/actions/sign-personal-message.md +10 -9
- package/docs/actions/sign-transaction.md +9 -8
- package/docs/actions/switch-account.md +8 -7
- package/docs/actions/switch-network.md +7 -6
- package/docs/dapp-kit-instance.md +22 -22
- package/docs/getting-started/create-dapp.md +13 -13
- package/docs/getting-started/next-js.md +14 -13
- package/docs/getting-started/react.md +29 -27
- package/docs/getting-started/vue.md +20 -15
- package/docs/index.md +10 -10
- package/docs/llms-index.md +30 -31
- package/docs/react/components/connect-button.md +4 -4
- package/docs/react/components/connect-modal.md +4 -4
- package/docs/react/components/index.md +3 -3
- package/docs/react/dapp-kit-provider.md +7 -7
- package/docs/react/hooks/index.md +5 -4
- package/docs/react/hooks/use-current-account.md +4 -4
- package/docs/react/hooks/use-current-client.md +7 -7
- package/docs/react/hooks/use-current-network.md +4 -4
- package/docs/react/hooks/use-current-wallet.md +4 -4
- package/docs/react/hooks/use-dapp-kit.md +6 -6
- package/docs/react/hooks/use-wallet-connection.md +4 -4
- package/docs/react/hooks/use-wallets.md +4 -4
- package/docs/state.md +18 -17
- package/docs/theming.md +32 -32
- package/docs/web-components/connect-button.md +13 -11
- package/docs/web-components/connect-modal.md +18 -17
- package/package.json +8 -9
- package/src/web/dapp-kit-connect-button.stories.ts +0 -107
- package/src/web/dapp-kit-connect-modal.stories.ts +0 -62
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
5
|
-
import { html } from 'lit';
|
|
6
|
-
import type { DAppKitConnectModal } from './dapp-kit-connect-modal.js';
|
|
7
|
-
import { createDAppKit } from '../core/index.js';
|
|
8
|
-
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
9
|
-
|
|
10
|
-
const GRPC_URLS = {
|
|
11
|
-
testnet: 'https://fullnode.testnet.sui.io:443',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const dAppKit = createDAppKit({
|
|
15
|
-
networks: ['testnet'],
|
|
16
|
-
createClient(network) {
|
|
17
|
-
return new SuiGrpcClient({ network, baseUrl: GRPC_URLS[network] });
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const meta = {
|
|
22
|
-
title: 'Connect Modal',
|
|
23
|
-
component: 'mysten-dapp-kit-connect-modal',
|
|
24
|
-
render: (args) => html`
|
|
25
|
-
<mysten-dapp-kit-connect-modal
|
|
26
|
-
?open="${args['open']}"
|
|
27
|
-
.sortFn=${args['sortFn']}
|
|
28
|
-
.filterFn=${args['filterFn']}
|
|
29
|
-
.instance=${dAppKit}
|
|
30
|
-
></mysten-dapp-kit-connect-modal>
|
|
31
|
-
`,
|
|
32
|
-
tags: ['autodocs'],
|
|
33
|
-
} satisfies Meta;
|
|
34
|
-
|
|
35
|
-
export default meta;
|
|
36
|
-
|
|
37
|
-
export const Default: StoryObj<DAppKitConnectModal> = {
|
|
38
|
-
args: {
|
|
39
|
-
open: true,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const WithRandomSort: StoryObj<DAppKitConnectModal> = {
|
|
44
|
-
args: {
|
|
45
|
-
open: true,
|
|
46
|
-
sortFn: () => 0.5 - Math.random(),
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const WithRandomFilter: StoryObj<DAppKitConnectModal> = {
|
|
51
|
-
args: {
|
|
52
|
-
open: true,
|
|
53
|
-
filterFn: () => Math.random() > 0.5,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const NoDetectedWallets: StoryObj<DAppKitConnectModal> = {
|
|
58
|
-
args: {
|
|
59
|
-
open: true,
|
|
60
|
-
filterFn: () => false,
|
|
61
|
-
},
|
|
62
|
-
};
|