@gitlab/ui 41.2.0 → 41.5.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "41.2.0",
3
+ "version": "41.5.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -83,7 +83,7 @@
83
83
  "@babel/preset-env": "^7.10.2",
84
84
  "@gitlab/eslint-plugin": "12.3.0",
85
85
  "@gitlab/stylelint-config": "4.0.0",
86
- "@gitlab/svgs": "2.15.0",
86
+ "@gitlab/svgs": "2.16.0",
87
87
  "@rollup/plugin-commonjs": "^11.1.0",
88
88
  "@rollup/plugin-node-resolve": "^7.1.3",
89
89
  "@rollup/plugin-replace": "^2.3.2",
@@ -49,6 +49,15 @@ describe('avatar labeled', () => {
49
49
  expect(wrapper.find('[data-testid="user-meta"]').exists()).toBe(true);
50
50
  });
51
51
 
52
+ it('displays `default` slot', () => {
53
+ buildWrapper(
54
+ { label, subLabel },
55
+ { default: '<span data-testid="default-slot">Foo Bar</span>' }
56
+ );
57
+
58
+ expect(wrapper.find('[data-testid="default-slot"]').exists()).toBe(true);
59
+ });
60
+
52
61
  describe('with label links', () => {
53
62
  beforeEach(() => {
54
63
  buildWrapper({ label, subLabel, labelLink: 'http://label', subLabelLink: 'http://subLabel' });
@@ -1,5 +1,5 @@
1
1
  import Vue from 'vue';
2
- import { GlAvatarLabeled, GlBadge } from '../../../index';
2
+ import { GlAvatarLabeled, GlBadge, GlButton } from '../../../index';
3
3
  import { GlTooltipDirective } from '../../../directives/tooltip';
4
4
  import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
5
5
  import avatarPath from '../../../../static/img/avatar.png';
@@ -90,6 +90,25 @@ export const WithBadges = (args, { argTypes }) => ({
90
90
  });
91
91
  WithBadges.args = generateProps();
92
92
 
93
+ export const WithDefaultSlot = (args, { argTypes }) => ({
94
+ components: { GlAvatarLabeled, GlButton },
95
+ props: Object.keys(argTypes),
96
+ template: `
97
+ <gl-avatar-labeled
98
+ :shape="shape"
99
+ :size="size"
100
+ :src="src"
101
+ :label="label"
102
+ :sub-label="subLabel"
103
+ >
104
+ <template>
105
+ <gl-button class="gl-mt-3 gl-align-self-start" size="small">Follow</gl-button>
106
+ </template>
107
+ </gl-avatar-labeled>
108
+ `,
109
+ });
110
+ WithDefaultSlot.args = generateProps({ size: 64 });
111
+
93
112
  export default {
94
113
  title: 'base/avatar/labeled',
95
114
  component: GlAvatarLabeled,
@@ -56,6 +56,8 @@ export default {
56
56
  <span class="gl-avatar-labeled-sublabel">{{ subLabel }}</span>
57
57
  </gl-link>
58
58
  <span v-else class="gl-avatar-labeled-sublabel">{{ subLabel }}</span>
59
+ <!-- @slot Add additional information below the avatar label. -->
60
+ <slot></slot>
59
61
  </div>
60
62
  </div>
61
63
  </template>
@@ -2997,6 +2997,18 @@
2997
2997
  display: grid !important;
2998
2998
  }
2999
2999
 
3000
+ .gl-md-display-table-cell {
3001
+ @include gl-media-breakpoint-up(md) {
3002
+ display: table-cell;
3003
+ }
3004
+ }
3005
+
3006
+ .gl-md-display-table-cell\! {
3007
+ @include gl-media-breakpoint-up(md) {
3008
+ display: table-cell !important;
3009
+ }
3010
+ }
3011
+
3000
3012
  .gl-lg-display-table-cell {
3001
3013
  @include gl-media-breakpoint-up(lg) {
3002
3014
  display: table-cell;
@@ -5722,6 +5734,12 @@
5722
5734
  .gl-ml-3\! {
5723
5735
  margin-left: $gl-spacing-scale-3 !important;
5724
5736
  }
5737
+ .gl-ml-n3 {
5738
+ margin-left: -$gl-spacing-scale-3;
5739
+ }
5740
+ .gl-ml-n3\! {
5741
+ margin-left: -$gl-spacing-scale-3 !important;
5742
+ }
5725
5743
  .gl-ml-4 {
5726
5744
  margin-left: $gl-spacing-scale-4;
5727
5745
  }
@@ -187,6 +187,12 @@
187
187
  display: grid;
188
188
  }
189
189
 
190
+ @mixin gl-md-display-table-cell {
191
+ @include gl-media-breakpoint-up(md) {
192
+ @include gl-display-table-cell;
193
+ }
194
+ }
195
+
190
196
  @mixin gl-lg-display-table-cell {
191
197
  @include gl-media-breakpoint-up(lg) {
192
198
  @include gl-display-table-cell;
@@ -552,6 +552,10 @@
552
552
  margin-left: $gl-spacing-scale-3;
553
553
  }
554
554
 
555
+ @mixin gl-ml-n3 {
556
+ margin-left: -$gl-spacing-scale-3;
557
+ }
558
+
555
559
  @mixin gl-ml-4 {
556
560
  margin-left: $gl-spacing-scale-4;
557
561
  }