@gitlab/ui 92.3.1 → 92.4.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
+ # [92.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v92.3.1...v92.4.0) (2024-09-16)
2
+
3
+
4
+ ### Features
5
+
6
+ * **DuoWorkflowPanel:** Add Duo panel isExpanded prop ([5916cd1](https://gitlab.com/gitlab-org/gitlab-ui/commit/5916cd18ac361baab554b2b2a64cbdbb62cb59a6))
7
+
1
8
  ## [92.3.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v92.3.0...v92.3.1) (2024-09-13)
2
9
 
3
10
 
@@ -39,13 +39,16 @@ var script = {
39
39
  type: String,
40
40
  required: false,
41
41
  default: translate('GlDuoWorkflowPanel.collapseButtonTitle', 'Collapse')
42
+ },
43
+ /**
44
+ * Whether the panel is expanded or not
45
+ */
46
+ expanded: {
47
+ type: Boolean,
48
+ required: false,
49
+ default: true
42
50
  }
43
51
  },
44
- data() {
45
- return {
46
- expanded: true
47
- };
48
- },
49
52
  computed: {
50
53
  buttonIcon() {
51
54
  return this.expanded ? 'chevron-up' : 'chevron-down';
@@ -53,11 +56,6 @@ var script = {
53
56
  buttonTitle() {
54
57
  return this.expanded ? this.collapsePanelButtonTitle : this.expandPanelButtonTitle;
55
58
  }
56
- },
57
- methods: {
58
- toggleExpanded() {
59
- this.expanded = !this.expanded;
60
- }
61
59
  }
62
60
  };
63
61
 
@@ -65,7 +63,7 @@ var script = {
65
63
  const __vue_script__ = script;
66
64
 
67
65
  /* template */
68
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"gl-flex gl-flex-nowrap gl-items-center"},[(_vm.headerIcon)?_c('gl-icon',{staticClass:"gl-mr-3",attrs:{"name":_vm.headerIcon,"size":24}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-flex gl-flex-grow gl-items-baseline"},[_c('h2',{staticClass:"gl-mb-0"},[_vm._t("title")],2),_vm._v(" "),_c('small',{staticClass:"gl-ml-3"},[_vm._t("subtitle")],2)]),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],attrs:{"category":"tertiary","icon":_vm.buttonIcon,"title":_vm.buttonTitle,"aria-label":_vm.buttonTitle},on:{"click":_vm.toggleExpanded}})],1),_vm._v(" "),_c('gl-collapse',{attrs:{"visible":_vm.expanded}},[_c('div',{staticClass:"gl-ml-7 gl-mt-4 gl-flex-grow"},[_vm._t("content")],2)])],1)};
66
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"gl-flex gl-flex-nowrap gl-items-center"},[(_vm.headerIcon)?_c('gl-icon',{staticClass:"gl-mr-3",attrs:{"name":_vm.headerIcon,"size":24}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-flex gl-flex-grow gl-items-baseline"},[_c('h2',{staticClass:"gl-mb-0"},[_vm._t("title")],2),_vm._v(" "),_c('small',{staticClass:"gl-ml-3"},[_vm._t("subtitle")],2)]),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],attrs:{"category":"tertiary","icon":_vm.buttonIcon,"title":_vm.buttonTitle,"aria-label":_vm.buttonTitle},on:{"click":function($event){return _vm.$emit('toggle-panel')}}})],1),_vm._v(" "),_c('gl-collapse',{attrs:{"visible":_vm.expanded}},[_c('div',{staticClass:"gl-ml-7 gl-mt-4 gl-flex-grow"},[_vm._t("content")],2)])],1)};
69
67
  var __vue_staticRenderFns__ = [];
70
68
 
71
69
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "92.3.1",
3
+ "version": "92.4.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -113,8 +113,8 @@
113
113
  "@cypress/grep": "^4.0.1",
114
114
  "@gitlab/eslint-plugin": "20.2.1",
115
115
  "@gitlab/fonts": "^1.3.0",
116
- "@gitlab/stylelint-config": "6.2.1",
117
- "@gitlab/svgs": "3.114.0",
116
+ "@gitlab/stylelint-config": "6.2.2",
117
+ "@gitlab/svgs": "3.115.0",
118
118
  "@jest/test-sequencer": "^29.7.0",
119
119
  "@rollup/plugin-commonjs": "^11.1.0",
120
120
  "@rollup/plugin-node-resolve": "^7.1.3",
@@ -5,13 +5,17 @@ and WebUI.
5
5
 
6
6
  To use this component, import it and fill out the available slots:
7
7
 
8
- * `title`: the main title for the panel
9
- * `subtitle`: the small text adjacent to the title
10
- * `content`: the content of the panel, hidden away when the collapse is toggled
8
+ - `title`: the main title for the panel
9
+ - `subtitle`: the small text adjacent to the title
10
+ - `content`: the content of the panel, hidden away when the collapse is toggled
11
11
 
12
12
  Also provide an icon via the `headerIcon` prop. This icon is displayed adjacent
13
13
  to the title.
14
14
 
15
+ You can pass `expanded` prop set to `false` if you need a section to be
16
+ collapsed by default. You can also listen to `toggle-panel` event to know
17
+ when the expanded state changed.
18
+
15
19
  Translations for the title of the single button can be provided either via the
16
20
  props `expandButtonTitle` and `collapseTitleButton` or via the translation
17
21
  configuration:
@@ -34,9 +34,14 @@ export default {
34
34
  required: false,
35
35
  default: translate('GlDuoWorkflowPanel.collapseButtonTitle', 'Collapse'),
36
36
  },
37
- },
38
- data() {
39
- return { expanded: true };
37
+ /**
38
+ * Whether the panel is expanded or not
39
+ */
40
+ expanded: {
41
+ type: Boolean,
42
+ required: false,
43
+ default: true,
44
+ },
40
45
  },
41
46
  computed: {
42
47
  buttonIcon() {
@@ -46,11 +51,6 @@ export default {
46
51
  return this.expanded ? this.collapsePanelButtonTitle : this.expandPanelButtonTitle;
47
52
  },
48
53
  },
49
- methods: {
50
- toggleExpanded() {
51
- this.expanded = !this.expanded;
52
- },
53
- },
54
54
  };
55
55
  </script>
56
56
  <template>
@@ -74,7 +74,7 @@ export default {
74
74
  :icon="buttonIcon"
75
75
  :title="buttonTitle"
76
76
  :aria-label="buttonTitle"
77
- @click="toggleExpanded"
77
+ @click="$emit('toggle-panel')"
78
78
  />
79
79
  </div>
80
80
  <gl-collapse :visible="expanded">