@1001-digital/components.evm 1.3.0 → 1.3.1
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/package.json +2 -2
- package/src/components/EvmSidebarProfile.vue +66 -0
- package/src/index.ts +2 -0
- package/src/types.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1001-digital/components.evm",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@1001-digital/components": "^1.5.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@1001-digital/dweb-fetch": "^0.1.
|
|
24
|
+
"@1001-digital/dweb-fetch": "^0.1.6",
|
|
25
25
|
"@1001-digital/wagmi-in-app-wallet": "^0.1.0",
|
|
26
26
|
"@types/qrcode": "^1.5.6",
|
|
27
27
|
"qrcode": "^1.5.4"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="evm-sidebar-profile">
|
|
3
|
+
<EvmConnectDialog
|
|
4
|
+
v-if="!isConnected"
|
|
5
|
+
className="block"
|
|
6
|
+
/>
|
|
7
|
+
<EvmProfile
|
|
8
|
+
v-else
|
|
9
|
+
class-name="sidebar-profile-trigger"
|
|
10
|
+
@disconnected="$emit('disconnected')"
|
|
11
|
+
>
|
|
12
|
+
<template #default="{ address, display, ensName }">
|
|
13
|
+
<slot
|
|
14
|
+
:address="address"
|
|
15
|
+
:display="display"
|
|
16
|
+
:ens-name="ensName"
|
|
17
|
+
>
|
|
18
|
+
<EvmAvatar :address="address" />
|
|
19
|
+
<span class="sidebar-profile-name">{{ display }}</span>
|
|
20
|
+
</slot>
|
|
21
|
+
</template>
|
|
22
|
+
<template
|
|
23
|
+
v-if="$slots.actions"
|
|
24
|
+
#actions
|
|
25
|
+
>
|
|
26
|
+
<slot name="actions" />
|
|
27
|
+
</template>
|
|
28
|
+
</EvmProfile>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import { useConnection } from '@wagmi/vue'
|
|
34
|
+
import EvmAvatar from './EvmAvatar.vue'
|
|
35
|
+
import EvmProfile from './EvmProfile.vue'
|
|
36
|
+
import type { EvmSidebarProfileEmits } from '../types'
|
|
37
|
+
|
|
38
|
+
defineEmits<EvmSidebarProfileEmits>()
|
|
39
|
+
|
|
40
|
+
const { isConnected } = useConnection()
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style scoped>
|
|
44
|
+
.evm-sidebar-profile {
|
|
45
|
+
margin-block-start: auto;
|
|
46
|
+
border-block-start: var(--border);
|
|
47
|
+
padding: var(--spacer-sm);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:deep(.sidebar-profile-trigger) {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: var(--spacer-sm);
|
|
54
|
+
inline-size: 100%;
|
|
55
|
+
padding: var(--spacer-sm);
|
|
56
|
+
border-radius: var(--radius);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.sidebar-profile-name {
|
|
60
|
+
font-size: var(--font-sm);
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
</style>
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type {
|
|
|
11
11
|
EvmConnectDialogEmits,
|
|
12
12
|
EvmProfileProps,
|
|
13
13
|
EvmProfileEmits,
|
|
14
|
+
EvmSidebarProfileEmits,
|
|
14
15
|
EvmSwitchNetworkProps,
|
|
15
16
|
EvmSwitchNetworkEmits,
|
|
16
17
|
EvmConnectorQRProps,
|
|
@@ -80,6 +81,7 @@ export { default as EvmConnect } from './components/EvmConnect.vue'
|
|
|
80
81
|
export { default as EvmConnectDialog } from './components/EvmConnectDialog.vue'
|
|
81
82
|
export { default as EvmConnectionStatus } from './components/EvmConnectionStatus.vue'
|
|
82
83
|
export { default as EvmProfile } from './components/EvmProfile.vue'
|
|
84
|
+
export { default as EvmSidebarProfile } from './components/EvmSidebarProfile.vue'
|
|
83
85
|
export { default as EvmSwitchNetwork } from './components/EvmSwitchNetwork.vue'
|
|
84
86
|
export { default as EvmConnectorQR } from './components/EvmConnectorQR.vue'
|
|
85
87
|
export { default as EvmMetaMaskQR } from './components/EvmMetaMaskQR.vue'
|
package/src/types.ts
CHANGED
|
@@ -136,6 +136,11 @@ export interface EvmSiweEmits {
|
|
|
136
136
|
error: [error: string]
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
// EvmSidebarProfile
|
|
140
|
+
export interface EvmSidebarProfileEmits {
|
|
141
|
+
disconnected: []
|
|
142
|
+
}
|
|
143
|
+
|
|
139
144
|
// EvmSiweDialog
|
|
140
145
|
export interface EvmSiweDialogProps extends EvmSiweProps {
|
|
141
146
|
className?: string
|