@everchron/ec-shards 7.4.1 → 7.4.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/dist/ec-shards.common.js +146 -135
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +146 -135
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +1 -1
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/avatar.vue +18 -1
- package/src/stories/avatar/avatar.stories.js +15 -10
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="avatar" :style="[style, customStyle]" :class="partyClass" :role="image ? 'img' : 'none'" :aria-label="name">
|
|
3
3
|
<span v-if="!this.image">{{ userInitial }}</span>
|
|
4
|
+
<ecs-sticker v-if="relevantBadge" type="badge" />
|
|
4
5
|
</div>
|
|
5
6
|
</template>
|
|
6
7
|
|
|
7
8
|
<script>
|
|
9
|
+
import EcsSticker from '../sticker/sticker.vue'
|
|
10
|
+
|
|
8
11
|
export default {
|
|
9
12
|
name: 'avatar',
|
|
13
|
+
components: {
|
|
14
|
+
EcsSticker
|
|
15
|
+
},
|
|
10
16
|
props: {
|
|
11
17
|
/** In some situations, an avatar should also reflect the party side (witness profiles, entities). To add a badge with a party color to the avatar, set the `party` attribute to one of the available options: */
|
|
12
18
|
party: {
|
|
@@ -14,6 +20,11 @@ export default {
|
|
|
14
20
|
validator: v => ['client', 'opposition', 'court', 'joint', 'other', null].includes(v),
|
|
15
21
|
default: null
|
|
16
22
|
},
|
|
23
|
+
/** Determines if the relevant profile badge is shown on top of the avatar. */
|
|
24
|
+
relevantBadge: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
17
28
|
/** The full name of the User, eg. "Franklyn Meerkat" */
|
|
18
29
|
name: {
|
|
19
30
|
type: String,
|
|
@@ -92,7 +103,7 @@ export default {
|
|
|
92
103
|
const style = {
|
|
93
104
|
width: `${this.size}px`,
|
|
94
105
|
height: `${this.size}px`,
|
|
95
|
-
borderRadius: this.rounded ? '50%' : '
|
|
106
|
+
borderRadius: this.rounded ? '50%' : '4px'
|
|
96
107
|
}
|
|
97
108
|
const imgBackgroundAndFontStyle = {
|
|
98
109
|
background: `transparent url(${this.image}) no-repeat center center/cover`
|
|
@@ -169,6 +180,12 @@ export default {
|
|
|
169
180
|
font-weight: 700;
|
|
170
181
|
color: rgba(#000, .2);
|
|
171
182
|
|
|
183
|
+
.ecs-sticker{
|
|
184
|
+
position: absolute;
|
|
185
|
+
bottom: -6px;
|
|
186
|
+
right: -6px;
|
|
187
|
+
}
|
|
188
|
+
|
|
172
189
|
&-party{
|
|
173
190
|
&:before{
|
|
174
191
|
content: "";
|
|
@@ -9,31 +9,36 @@ export const avatars = () => ({
|
|
|
9
9
|
components: { EcsAvatar },
|
|
10
10
|
template: `<main>
|
|
11
11
|
<ecs-avatar name="Ivo Mynttinen" :size="36" />
|
|
12
|
-
<ecs-avatar name="Ivo Mynttinen" image="https://i.
|
|
12
|
+
<ecs-avatar name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" />
|
|
13
13
|
</main>`,
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
export const sizes = () => ({
|
|
17
17
|
components: { EcsAvatar },
|
|
18
18
|
template: `<main>
|
|
19
|
-
<ecs-avatar name="Ivo Mynttinen" image="https://i.
|
|
20
|
-
<ecs-avatar name="Ivo Mynttinen" image="https://i.
|
|
21
|
-
<ecs-avatar name="Ivo Mynttinen" image="https://i.
|
|
19
|
+
<ecs-avatar name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="24" />
|
|
20
|
+
<ecs-avatar name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" />
|
|
21
|
+
<ecs-avatar name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="54" />
|
|
22
22
|
</main>`,
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export const rounded = () => ({
|
|
26
26
|
components: { EcsAvatar },
|
|
27
|
-
template: `<ecs-avatar name="Ivo Mynttinen" image="https://i.
|
|
27
|
+
template: `<ecs-avatar name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" rounded />`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const relevantBadge = () => ({
|
|
31
|
+
components: { EcsAvatar },
|
|
32
|
+
template: `<ecs-avatar name="Ivo Mynttinen" relevant-badge image="https://i.imgur.com/p0yxbdh.jpg" :size="36" :rounded="false" />`,
|
|
28
33
|
});
|
|
29
34
|
|
|
30
35
|
export const partyBadges = () => ({
|
|
31
36
|
components: { EcsAvatar },
|
|
32
37
|
template: `<main>
|
|
33
|
-
<ecs-avatar party="client" name="Ivo Mynttinen" image="https://i.
|
|
34
|
-
<ecs-avatar party="opposition" name="Ivo Mynttinen" image="https://i.
|
|
35
|
-
<ecs-avatar party="joint" name="Ivo Mynttinen" image="https://i.
|
|
36
|
-
<ecs-avatar party="other" name="Ivo Mynttinen" image="https://i.
|
|
37
|
-
<ecs-avatar party="court" name="Ivo Mynttinen" image="https://i.
|
|
38
|
+
<ecs-avatar party="client" name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" />
|
|
39
|
+
<ecs-avatar party="opposition" name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" />
|
|
40
|
+
<ecs-avatar party="joint" name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" />
|
|
41
|
+
<ecs-avatar party="other" name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" />
|
|
42
|
+
<ecs-avatar party="court" name="Ivo Mynttinen" image="https://i.imgur.com/p0yxbdh.jpg" :size="36" />
|
|
38
43
|
</main>`,
|
|
39
44
|
});
|