@gitlab/ui 71.8.0 → 71.8.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/CHANGELOG.md +8 -0
- package/dist/components/base/avatars_inline/avatars_inline.js +5 -11
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +2 -2
- package/src/components/base/avatars_inline/avatars_inline.scss +2 -8
- package/src/components/base/avatars_inline/avatars_inline.spec.js +0 -6
- package/src/components/base/avatars_inline/avatars_inline.vue +13 -13
package/dist/tokens/js/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "71.8.
|
|
3
|
+
"version": "71.8.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"babel-loader": "^8.0.5",
|
|
123
123
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
124
124
|
"bootstrap": "4.6.2",
|
|
125
|
-
"cypress": "13.6.
|
|
125
|
+
"cypress": "13.6.1",
|
|
126
126
|
"cypress-axe": "^1.4.0",
|
|
127
127
|
"cypress-real-events": "^1.11.0",
|
|
128
128
|
"dompurify": "^3.0.0",
|
|
@@ -3,15 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
&-child {
|
|
5
5
|
@include gl-display-inline-flex;
|
|
6
|
-
@include gl-mr-3;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&.collapsed {
|
|
10
|
-
@include gl-relative;
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
@include gl-
|
|
14
|
-
@include gl-mr-0;
|
|
7
|
+
&:not(:last-child) {
|
|
8
|
+
@include gl-mr-3;
|
|
15
9
|
}
|
|
16
10
|
}
|
|
17
11
|
|
|
@@ -33,12 +33,6 @@ describe('avatars inline', () => {
|
|
|
33
33
|
expect(wrapper.findAllComponents(Avatar).length).toBe(avatars.length);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
it('adds collapsed class selector when collapsed=true', () => {
|
|
37
|
-
buildWrapper({ avatars, maxVisible: 2, avatarSize: 24, collapsed: true });
|
|
38
|
-
|
|
39
|
-
expect(wrapper.classes()).toContain('collapsed');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
36
|
describe('when component is collapsed and maxVisible is the number of avatars', () => {
|
|
43
37
|
beforeEach(() => {
|
|
44
38
|
buildWrapper({ avatars, maxVisible: avatars.length, avatarSize: 24, collapsed: true });
|
|
@@ -55,12 +55,6 @@ export default {
|
|
|
55
55
|
visibleAvatars() {
|
|
56
56
|
return this.collapsed ? this.avatars.slice(0, this.maxVisible) : this.avatars;
|
|
57
57
|
},
|
|
58
|
-
containerSizeStyles() {
|
|
59
|
-
return {
|
|
60
|
-
width: `${this.avatarSize * this.visibleAvatars.length}px`,
|
|
61
|
-
height: `${this.avatarSize}px`,
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
58
|
badgeSize() {
|
|
65
59
|
return this.avatarSize === 24 ? 'md' : 'lg';
|
|
66
60
|
},
|
|
@@ -84,25 +78,31 @@ export default {
|
|
|
84
78
|
},
|
|
85
79
|
},
|
|
86
80
|
methods: {
|
|
87
|
-
|
|
81
|
+
calcAvatarStyles(avatarIndex) {
|
|
88
82
|
// According to pajamas, overlap is 25% of the avatar height
|
|
89
|
-
const
|
|
83
|
+
const overlap = this.avatarSize * 0.25;
|
|
84
|
+
|
|
85
|
+
const marginRight =
|
|
86
|
+
avatarIndex === this.maxVisible ||
|
|
87
|
+
avatarIndex === this.avatars.length - 1 ||
|
|
88
|
+
!this.collapsed
|
|
89
|
+
? undefined
|
|
90
|
+
: `-${overlap}px`;
|
|
90
91
|
|
|
91
92
|
return {
|
|
92
|
-
|
|
93
|
-
zIndex: this.maxVisible + (avatarIndex - 1),
|
|
93
|
+
marginRight,
|
|
94
94
|
};
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
98
|
</script>
|
|
99
99
|
<template>
|
|
100
|
-
<div
|
|
100
|
+
<div class="gl-avatars-inline">
|
|
101
101
|
<div
|
|
102
102
|
v-for="(avatar, index) in visibleAvatars"
|
|
103
103
|
:key="index"
|
|
104
104
|
class="gl-avatars-inline-child"
|
|
105
|
-
:style="
|
|
105
|
+
:style="calcAvatarStyles(index)"
|
|
106
106
|
>
|
|
107
107
|
<slot name="avatar" :avatar="avatar">
|
|
108
108
|
<gl-avatar v-bind="avatar" :size="avatarSize" />
|
|
@@ -111,7 +111,7 @@ export default {
|
|
|
111
111
|
<div
|
|
112
112
|
v-if="collapsed && collapsable"
|
|
113
113
|
class="gl-avatars-inline-child"
|
|
114
|
-
:style="
|
|
114
|
+
:style="calcAvatarStyles(visibleAvatars.length)"
|
|
115
115
|
>
|
|
116
116
|
<gl-tooltip v-if="badgeTooltipProp" :target="() => $refs.badge">
|
|
117
117
|
{{ badgeTooltipTitle }}
|