@gitlab/ui 42.7.0 → 42.8.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [42.8.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v42.7.0...v42.8.0) (2022-06-22)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlAccordionItem:** expose header-class prop ([5f91275](https://gitlab.com/gitlab-org/gitlab-ui/commit/5f912753f027abd2036332ee583f518f7d369fdc))
7
+
1
8
  # [42.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v42.6.0...v42.7.0) (2022-06-22)
2
9
 
3
10
 
@@ -58,6 +58,15 @@ var script = {
58
58
  return value > 0 && value <= 6;
59
59
  }
60
60
 
61
+ },
62
+
63
+ /**
64
+ * Additional CSS class(es) to be applied to the header.
65
+ */
66
+ headerClass: {
67
+ type: [String, Object, Array],
68
+ required: false,
69
+ default: ''
61
70
  }
62
71
  },
63
72
 
@@ -103,7 +112,7 @@ var script = {
103
112
  const __vue_script__ = script;
104
113
 
105
114
  /* template */
106
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-accordion-item"},[_c(_vm.headerComponent,{tag:"component",staticClass:"gl-accordion-item-header"},[_c('gl-button',{directives:[{name:"gl-collapse-toggle",rawName:"v-gl-collapse-toggle",value:(_vm.accordionItemId),expression:"accordionItemId"}],attrs:{"variant":"link","button-text-classes":"gl-display-flex","icon":_vm.icon}},[_vm._v("\n "+_vm._s(_vm.buttonTitle)+"\n ")])],1),_vm._v(" "),_c('b-collapse',{staticClass:"gl-mt-3 gl-font-base",attrs:{"id":_vm.accordionItemId,"visible":_vm.isVisible,"accordion":_vm.accordion,"data-testid":("accordion-item-collapse-" + _vm.accordionItemId)},model:{value:(_vm.isVisible),callback:function ($$v) {_vm.isVisible=$$v;},expression:"isVisible"}},[_vm._t("default")],2)],1)};
115
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-accordion-item"},[_c(_vm.headerComponent,{tag:"component",staticClass:"gl-accordion-item-header",class:_vm.headerClass},[_c('gl-button',{directives:[{name:"gl-collapse-toggle",rawName:"v-gl-collapse-toggle",value:(_vm.accordionItemId),expression:"accordionItemId"}],attrs:{"variant":"link","button-text-classes":"gl-display-flex","icon":_vm.icon}},[_vm._v("\n "+_vm._s(_vm.buttonTitle)+"\n ")])],1),_vm._v(" "),_c('b-collapse',{staticClass:"gl-mt-3 gl-font-base",attrs:{"id":_vm.accordionItemId,"visible":_vm.isVisible,"accordion":_vm.accordion,"data-testid":("accordion-item-collapse-" + _vm.accordionItemId)},model:{value:(_vm.isVisible),callback:function ($$v) {_vm.isVisible=$$v;},expression:"isVisible"}},[_vm._t("default")],2)],1)};
107
116
  var __vue_staticRenderFns__ = [];
108
117
 
109
118
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "42.7.0",
3
+ "version": "42.8.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -105,7 +105,7 @@
105
105
  "bootstrap": "4.5.3",
106
106
  "cypress": "^6.6.0",
107
107
  "emoji-regex": "^10.0.0",
108
- "eslint": "8.17.0",
108
+ "eslint": "8.18.0",
109
109
  "eslint-import-resolver-jest": "3.0.2",
110
110
  "eslint-plugin-cypress": "2.12.1",
111
111
  "eslint-plugin-storybook": "0.5.12",
@@ -32,6 +32,7 @@ describe('GlAccordionItem', () => {
32
32
 
33
33
  const findButton = () => wrapper.findComponent(GlButton);
34
34
  const findCollapse = () => wrapper.findComponent(BCollapse);
35
+ const findHeader = () => wrapper.find('.gl-accordion-item-header');
35
36
 
36
37
  it('renders button text', () => {
37
38
  createComponent();
@@ -64,6 +65,15 @@ describe('GlAccordionItem', () => {
64
65
  expect(wrapper.find('h4.gl-accordion-item-header').exists()).toBeTruthy();
65
66
  });
66
67
 
68
+ it.each(['custom-header-class', ['custom-header-class'], { 'custom-header-class': true }])(
69
+ 'applies custom classes to the header',
70
+ (customClassProp) => {
71
+ createComponent({ headerClass: customClassProp }, { defaultHeaderLevel: 3 });
72
+
73
+ expect(findHeader().classes()).toContain('custom-header-class');
74
+ }
75
+ );
76
+
67
77
  it('renders slot text', () => {
68
78
  createComponent();
69
79
 
@@ -54,6 +54,14 @@ When set, it will ensure the accordion item is initially visible
54
54
  return value > 0 && value <= 6;
55
55
  },
56
56
  },
57
+ /**
58
+ * Additional CSS class(es) to be applied to the header.
59
+ */
60
+ headerClass: {
61
+ type: [String, Object, Array],
62
+ required: false,
63
+ default: '',
64
+ },
57
65
  },
58
66
  data() {
59
67
  return {
@@ -89,7 +97,7 @@ When set, it will ensure the accordion item is initially visible
89
97
 
90
98
  <template>
91
99
  <div class="gl-accordion-item">
92
- <component :is="headerComponent" class="gl-accordion-item-header">
100
+ <component :is="headerComponent" class="gl-accordion-item-header" :class="headerClass">
93
101
  <gl-button
94
102
  v-gl-collapse-toggle="accordionItemId"
95
103
  variant="link"