@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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 11 Dec 2023 02:30:00 GMT
3
+ * Generated on Mon, 11 Dec 2023 17:09:36 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 11 Dec 2023 02:30:00 GMT
3
+ * Generated on Mon, 11 Dec 2023 17:09:36 GMT
4
4
  */
5
5
 
6
6
  :root.gl-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 11 Dec 2023 02:30:00 GMT
3
+ * Generated on Mon, 11 Dec 2023 17:09:36 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#133a03";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 11 Dec 2023 02:30:00 GMT
3
+ * Generated on Mon, 11 Dec 2023 17:09:36 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 11 Dec 2023 02:30:00 GMT
3
+ // Generated on Mon, 11 Dec 2023 17:09:36 GMT
4
4
 
5
5
  $red-950: #fff4f3;
6
6
  $red-900: #fcf1ef;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 11 Dec 2023 02:30:00 GMT
3
+ // Generated on Mon, 11 Dec 2023 17:09:36 GMT
4
4
 
5
5
  $gl-line-height-52: 3.25rem;
6
6
  $gl-line-height-44: 2.75rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "71.8.0",
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.0",
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
- .gl-avatars-inline-child {
13
- @include gl-absolute;
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
- calcAvatarPosition(avatarIndex) {
81
+ calcAvatarStyles(avatarIndex) {
88
82
  // According to pajamas, overlap is 25% of the avatar height
89
- const overlapDistance = this.avatarSize * 0.75;
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
- left: `${overlapDistance * avatarIndex}px`,
93
- zIndex: this.maxVisible + (avatarIndex - 1),
93
+ marginRight,
94
94
  };
95
95
  },
96
96
  },
97
97
  };
98
98
  </script>
99
99
  <template>
100
- <div :class="['gl-avatars-inline', { collapsed: collapsed }]" :style="containerSizeStyles">
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="calcAvatarPosition(index)"
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="calcAvatarPosition(visibleAvatars.length)"
114
+ :style="calcAvatarStyles(visibleAvatars.length)"
115
115
  >
116
116
  <gl-tooltip v-if="badgeTooltipProp" :target="() => $refs.badge">
117
117
  {{ badgeTooltipTitle }}