@gitlab/ui 120.0.0 → 120.1.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.
@@ -45,7 +45,7 @@ var script = {
45
45
  const __vue_script__ = script;
46
46
 
47
47
  /* template */
48
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',_vm._g({key:_vm.spriteHref,attrs:{"data-testid":(_vm.name + "-illustration"),"aria-label":"","role":"presentation","width":_vm.illustrationSize,"height":_vm.illustrationSize}},_vm.$listeners),[_c('use',{attrs:{"href":_vm.spriteHref}})])};
48
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',_vm._g({key:_vm.spriteHref,attrs:{"data-testid":(_vm.name + "-illustration"),"role":"presentation","width":_vm.illustrationSize,"height":_vm.illustrationSize}},_vm.$listeners),[_c('use',{attrs:{"href":_vm.spriteHref}})])};
49
49
  var __vue_staticRenderFns__ = [];
50
50
 
51
51
  /* style */
@@ -1,10 +1,12 @@
1
1
  import GlButton from '../../base/button/button';
2
+ import GlIllustration from '../../base/illustration/illustration';
2
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
3
4
 
4
5
  var script = {
5
6
  name: 'GlEmptyState',
6
7
  components: {
7
- GlButton
8
+ GlButton,
9
+ GlIllustration
8
10
  },
9
11
  props: {
10
12
  /**
@@ -28,6 +30,14 @@ var script = {
28
30
  return value > 0 && value <= 6;
29
31
  }
30
32
  },
33
+ /**
34
+ * The illustration's name.
35
+ */
36
+ illustrationName: {
37
+ type: String,
38
+ required: false,
39
+ default: null
40
+ },
31
41
  /**
32
42
  * The illustration's URL.
33
43
  */
@@ -115,7 +125,7 @@ var script = {
115
125
  return this.shouldPreventImageReflow ? this.svgHeight : null;
116
126
  },
117
127
  shouldPreventImageReflow() {
118
- return Boolean(this.svgHeight);
128
+ return Boolean(this.svgHeight) && !this.illustrationName;
119
129
  },
120
130
  shouldRenderPrimaryButton() {
121
131
  return Boolean(this.primaryButtonLink && this.primaryButtonText);
@@ -136,7 +146,7 @@ const __vue_script__ = script;
136
146
  var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"gl-flex",class:{
137
147
  'gl-empty-state gl-flex-col gl-text-center': !_vm.compact,
138
148
  'gl-flex-row': _vm.compact,
139
- }},[_c('div',{class:{ 'gl-hidden gl-px-4 @sm:gl-block': _vm.compact, 'gl-max-w-full': !_vm.compact }},[(_vm.svgPath)?_c('img',{staticClass:"gl-max-w-full",class:{ 'gl-dark-invert-keep-hue': _vm.invertInDarkMode },attrs:{"src":_vm.svgPath,"alt":"","height":_vm.height}}):_vm._e()]),_vm._v(" "),_c('div',{staticClass:"gl-empty-state-content gl-mx-auto gl-my-0",class:_vm.contentClasses,attrs:{"data-testid":"gl-empty-state-content"}},[_vm._t("title",function(){return [_c(_vm.headerComponent,{tag:"component",staticClass:"gl-mb-0 gl-mt-0 gl-text-size-h-display gl-leading-36",class:_vm.compact ? 'h5' : 'h4'},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")])]}),_vm._v(" "),(_vm.description || _vm.$scopedSlots.description)?_c('p',{ref:"description",staticClass:"gl-mb-0 gl-mt-4 gl-text-subtle"},[_vm._t("description",function(){return [_vm._v("\n "+_vm._s(_vm.description)+"\n ")]})],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-mt-5 gl-flex gl-flex-wrap",class:{ 'gl-justify-center': !_vm.compact }},[_vm._t("actions",function(){return [(_vm.shouldRenderPrimaryButton)?_c('gl-button',{staticClass:"gl-mb-3",class:_vm.compact ? 'gl-mr-3' : 'gl-mx-2',attrs:{"variant":"confirm","href":_vm.primaryButtonLink}},[_vm._v(_vm._s(_vm.primaryButtonText))]):_vm._e(),_vm._v(" "),(_vm.shouldRenderSecondaryButton)?_c('gl-button',{staticClass:"gl-mb-3 gl-mr-3",class:{ '!gl-mx-2': !_vm.compact },attrs:{"href":_vm.secondaryButtonLink}},[_vm._v(_vm._s(_vm.secondaryButtonText)+"\n ")]):_vm._e()]})],2)],2)])};
149
+ }},[_c('div',{class:{ 'gl-hidden gl-px-4 @sm:gl-block': _vm.compact, 'gl-max-w-full': !_vm.compact }},[(_vm.illustrationName)?_c('gl-illustration',{attrs:{"name":_vm.illustrationName}}):(_vm.svgPath)?_c('img',{staticClass:"gl-max-w-full",class:{ 'gl-dark-invert-keep-hue': _vm.invertInDarkMode },attrs:{"src":_vm.svgPath,"alt":"","height":_vm.height}}):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"gl-empty-state-content gl-mx-auto gl-my-0",class:_vm.contentClasses,attrs:{"data-testid":"gl-empty-state-content"}},[_vm._t("title",function(){return [_c(_vm.headerComponent,{tag:"component",staticClass:"gl-mb-0 gl-mt-0 gl-text-size-h-display gl-leading-36",class:_vm.compact ? 'h5' : 'h4'},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")])]}),_vm._v(" "),(_vm.description || _vm.$scopedSlots.description)?_c('p',{ref:"description",staticClass:"gl-mb-0 gl-mt-4 gl-text-subtle"},[_vm._t("description",function(){return [_vm._v("\n "+_vm._s(_vm.description)+"\n ")]})],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-mt-5 gl-flex gl-flex-wrap",class:{ 'gl-justify-center': !_vm.compact }},[_vm._t("actions",function(){return [(_vm.shouldRenderPrimaryButton)?_c('gl-button',{staticClass:"gl-mb-3",class:_vm.compact ? 'gl-mr-3' : 'gl-mx-2',attrs:{"variant":"confirm","href":_vm.primaryButtonLink}},[_vm._v(_vm._s(_vm.primaryButtonText))]):_vm._e(),_vm._v(" "),(_vm.shouldRenderSecondaryButton)?_c('gl-button',{staticClass:"gl-mb-3 gl-mr-3",class:{ '!gl-mx-2': !_vm.compact },attrs:{"href":_vm.secondaryButtonLink}},[_vm._v(_vm._s(_vm.secondaryButtonText)+"\n ")]):_vm._e()]})],2)],2)])};
140
150
  var __vue_staticRenderFns__ = [];
141
151
 
142
152
  /* style */
@@ -40,7 +40,10 @@ const BVPopoverTemplate = /*#__PURE__*/extend({
40
40
  ref: 'arrow'
41
41
  }), isUndefinedOrNull($title) || $title === '' ? /* istanbul ignore next */h() : h('h3', {
42
42
  staticClass: 'popover-header',
43
- domProps: titleDomProps
43
+ domProps: titleDomProps,
44
+ attrs: {
45
+ role: 'presentation'
46
+ }
44
47
  }, [$title]), isUndefinedOrNull($content) || $content === '' ? /* istanbul ignore next */h() : h('div', {
45
48
  staticClass: 'popover-body',
46
49
  domProps: contentDomProps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "120.0.0",
3
+ "version": "120.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -45,7 +45,6 @@ export default {
45
45
  <svg
46
46
  :key="spriteHref"
47
47
  :data-testid="`${name}-illustration`"
48
- aria-label=""
49
48
  role="presentation"
50
49
  :width="illustrationSize"
51
50
  :height="illustrationSize"
@@ -1,10 +1,12 @@
1
1
  <script>
2
2
  import GlButton from '../../base/button/button.vue';
3
+ import GlIllustration from '../../base/illustration/illustration.vue';
3
4
 
4
5
  export default {
5
6
  name: 'GlEmptyState',
6
7
  components: {
7
8
  GlButton,
9
+ GlIllustration,
8
10
  },
9
11
  props: {
10
12
  /**
@@ -28,6 +30,14 @@ export default {
28
30
  return value > 0 && value <= 6;
29
31
  },
30
32
  },
33
+ /**
34
+ * The illustration's name.
35
+ */
36
+ illustrationName: {
37
+ type: String,
38
+ required: false,
39
+ default: null,
40
+ },
31
41
  /**
32
42
  * The illustration's URL.
33
43
  */
@@ -115,7 +125,7 @@ export default {
115
125
  return this.shouldPreventImageReflow ? this.svgHeight : null;
116
126
  },
117
127
  shouldPreventImageReflow() {
118
- return Boolean(this.svgHeight);
128
+ return Boolean(this.svgHeight) && !this.illustrationName;
119
129
  },
120
130
  shouldRenderPrimaryButton() {
121
131
  return Boolean(this.primaryButtonLink && this.primaryButtonText);
@@ -139,8 +149,9 @@ export default {
139
149
  }"
140
150
  >
141
151
  <div :class="{ 'gl-hidden gl-px-4 @sm:gl-block': compact, 'gl-max-w-full': !compact }">
152
+ <gl-illustration v-if="illustrationName" :name="illustrationName" />
142
153
  <img
143
- v-if="svgPath"
154
+ v-else-if="svgPath"
144
155
  :src="svgPath"
145
156
  alt=""
146
157
  :class="{ 'gl-dark-invert-keep-hue': invertInDarkMode }"
@@ -39,7 +39,15 @@ export const BVPopoverTemplate = /*#__PURE__*/ extend({
39
39
  }),
40
40
  isUndefinedOrNull($title) || $title === ''
41
41
  ? /* istanbul ignore next */ h()
42
- : h('h3', { staticClass: 'popover-header', domProps: titleDomProps }, [$title]),
42
+ : h(
43
+ 'h3',
44
+ {
45
+ staticClass: 'popover-header',
46
+ domProps: titleDomProps,
47
+ attrs: { role: 'presentation' }
48
+ },
49
+ [$title]
50
+ ),
43
51
  isUndefinedOrNull($content) || $content === ''
44
52
  ? /* istanbul ignore next */ h()
45
53
  : h('div', { staticClass: 'popover-body', domProps: contentDomProps }, [$content])