@gitlab/ui 67.5.1 → 68.0.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,25 @@
1
+ # [68.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.5.2...v68.0.0) (2023-11-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlExperimentBadge:** support 'beta' type ([927f830](https://gitlab.com/gitlab-org/gitlab-ui/commit/927f8302be7bcf471650228b25ee526332b2ff16))
7
+
8
+
9
+ ### BREAKING CHANGES
10
+
11
+ * **GlExperimentBadge:** To extend the capabilities of the
12
+ badge, now it suports not only experiments, but
13
+ also allows to move features to beta state
14
+ using the same component
15
+
16
+ ## [67.5.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.5.1...v67.5.2) (2023-11-06)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **css:** chart legend display issue in dark mode ([ce60a9f](https://gitlab.com/gitlab-org/gitlab-ui/commit/ce60a9f8e921c51c5a33c4fea2f3adad20772b43))
22
+
1
23
  ## [67.5.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.5.0...v67.5.1) (2023-11-03)
2
24
 
3
25
 
@@ -8,6 +8,7 @@ import GlFormTextarea from '../../../base/form/form_textarea/form_textarea';
8
8
  import GlForm from '../../../base/form/form';
9
9
  import GlFormText from '../../../base/form/form_text/form_text';
10
10
  import GlExperimentBadge from '../../experiment_badge/experiment_badge';
11
+ import { badgeTypes, badgeTypeValidator } from '../../experiment_badge/constants';
11
12
  import { SafeHtmlDirective } from '../../../../directives/safe_html/safe_html';
12
13
  import GlDuoChatLoader from './components/duo_chat_loader/duo_chat_loader';
13
14
  import GlDuoChatPredefinedPrompts from './components/duo_chat_predefined_prompts/duo_chat_predefined_prompts';
@@ -97,13 +98,22 @@ var script = {
97
98
  default: () => i18n.CHAT_DEFAULT_PREDEFINED_PROMPTS
98
99
  },
99
100
  /**
100
- * URL to the experiment help page. This is passed down to the `GlExperimentBadge` component. Refer that component for more information.
101
+ * URL to the experiment/beta help page. This is passed down to the `GlExperimentBadge` component. Refer that component for more information.
101
102
  */
102
- experimentHelpPageUrl: {
103
+ badgeHelpPageUrl: {
103
104
  type: String,
104
105
  required: false,
105
106
  default: ''
106
107
  },
108
+ /**
109
+ * The type of the badge. This is passed down to the `GlExperimentBadge` component. Refer that component for more information.
110
+ */
111
+ badgeType: {
112
+ type: String,
113
+ required: false,
114
+ default: badgeTypes[0],
115
+ validator: badgeTypeValidator
116
+ },
107
117
  /**
108
118
  * The current tool's name to display in the loading message while waiting for a response from AI. Refer the `GlDuoChatLoader` component for more information.
109
119
  */
@@ -215,7 +225,7 @@ var script = {
215
225
  const __vue_script__ = script;
216
226
 
217
227
  /* template */
218
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isHidden)?_c('aside',{ref:"drawer",staticClass:"markdown-code-block gl-drawer gl-drawer-default gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat",attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('header',{staticClass:"gl-drawer-header gl-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0"},[_c('div',{staticClass:"drawer-title gl-display-flex gl-justify-content-start gl-align-items-center gl-p-5"},[_c('h3',{staticClass:"gl-my-0 gl-font-size-h2"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),_c('gl-experiment-badge',{attrs:{"experiment-help-page-url":_vm.experimentHelpPageUrl,"container-id":"chat-component"}}),_vm._v(" "),_c('gl-button',{staticClass:"gl-p-0! gl-ml-auto",attrs:{"category":"tertiary","variant":"default","icon":"close","size":"small","data-testid":"chat-close-button","aria-label":_vm.$options.i18n.CHAT_CLOSE_LABEL},on:{"click":_vm.hideChat}})],1),_vm._v(" "),_c('gl-alert',{staticClass:"gl-text-center gl-border-t gl-p-4 gl-text-gray-700 gl-bg-gray-50 legal-warning gl-max-w-full",attrs:{"dismissible":false,"variant":"tip","show-icon":false,"role":"alert","data-testid":"chat-legal-warning"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_GENERATED_BY_AI))]),_vm._v(" "),_vm._t("subheader")],2),_vm._v(" "),_c('div',{staticClass:"gl-drawer-body gl-display-flex gl-flex-direction-column"},[_vm._t("hero"),_vm._v(" "),(_vm.error)?_c('gl-alert',{key:"error",staticClass:"gl-mb-0 gl-pl-9!",attrs:{"dismissible":false,"variant":"danger","role":"alert","data-testid":"chat-error"}},[_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(_vm.error),expression:"error"}]})]):_vm._e(),_vm._v(" "),_c('section',{staticClass:"gl-display-flex gl-flex-direction-column gl-justify-content-end gl-flex-grow-1 gl-border-b-0 gl-bg-gray-10"},[_c('transition-group',{staticClass:"gl-display-flex gl-flex-direction-column gl-justify-content-end",class:[
228
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isHidden)?_c('aside',{ref:"drawer",staticClass:"markdown-code-block gl-drawer gl-drawer-default gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat",attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('header',{staticClass:"gl-drawer-header gl-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0"},[_c('div',{staticClass:"drawer-title gl-display-flex gl-justify-content-start gl-align-items-center gl-p-5"},[_c('h3',{staticClass:"gl-my-0 gl-font-size-h2"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),_c('gl-experiment-badge',{attrs:{"help-page-url":_vm.badgeHelpPageUrl,"type":_vm.badgeType,"container-id":"chat-component"}}),_vm._v(" "),_c('gl-button',{staticClass:"gl-p-0! gl-ml-auto",attrs:{"category":"tertiary","variant":"default","icon":"close","size":"small","data-testid":"chat-close-button","aria-label":_vm.$options.i18n.CHAT_CLOSE_LABEL},on:{"click":_vm.hideChat}})],1),_vm._v(" "),_c('gl-alert',{staticClass:"gl-text-center gl-border-t gl-p-4 gl-text-gray-700 gl-bg-gray-50 legal-warning gl-max-w-full",attrs:{"dismissible":false,"variant":"tip","show-icon":false,"role":"alert","data-testid":"chat-legal-warning"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_GENERATED_BY_AI))]),_vm._v(" "),_vm._t("subheader")],2),_vm._v(" "),_c('div',{staticClass:"gl-drawer-body gl-display-flex gl-flex-direction-column"},[_vm._t("hero"),_vm._v(" "),(_vm.error)?_c('gl-alert',{key:"error",staticClass:"gl-mb-0 gl-pl-9!",attrs:{"dismissible":false,"variant":"danger","role":"alert","data-testid":"chat-error"}},[_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(_vm.error),expression:"error"}]})]):_vm._e(),_vm._v(" "),_c('section',{staticClass:"gl-display-flex gl-flex-direction-column gl-justify-content-end gl-flex-grow-1 gl-border-b-0 gl-bg-gray-10"},[_c('transition-group',{staticClass:"gl-display-flex gl-flex-direction-column gl-justify-content-end",class:[
219
229
  {
220
230
  'gl-h-full': !_vm.hasMessages,
221
231
  'gl-h-auto': _vm.hasMessages,
@@ -0,0 +1,4 @@
1
+ const badgeTypes = ['experiment', 'beta'];
2
+ const badgeTypeValidator = value => badgeTypes.includes(value);
3
+
4
+ export { badgeTypeValidator, badgeTypes };
@@ -3,17 +3,25 @@ import GlBadge from '../../base/badge/badge';
3
3
  import GlLink from '../../base/link/link';
4
4
  import GlPopover from '../../base/popover/popover';
5
5
  import GlSprintf from '../../utilities/sprintf/sprintf';
6
+ import { badgeTypes, badgeTypeValidator } from './constants';
6
7
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
7
8
 
8
9
  const i18n = {
9
- EXPERIMENT_BADGE: 'Experiment',
10
- EXPERIMENT_POPOVER_TITLE: "What's an Experiment?",
11
- EXPERIMENT_POPOVER_CONTENT: "An %{linkStart}Experiment%{linkEnd} is a feature that's in the process of being developed. It's not production-ready. We encourage users to try Experimental features and provide feedback. An Experiment: %{bullets}",
12
- EXPERIMENT_POPOVER_BULLETS: ['May be unstable', 'Has no support and might not be documented', 'Can be removed at any time']
10
+ experiment: {
11
+ BADGE: 'Experiment',
12
+ POPOVER_TITLE: "What's an Experiment?",
13
+ POPOVER_CONTENT: "An %{linkStart}Experiment%{linkEnd} is a feature that's in the process of being developed. It's not production-ready. We encourage users to try Experimental features and provide feedback. An Experiment: %{bullets}",
14
+ POPOVER_BULLETS: ['May be unstable', 'Has no support and might not be documented', 'Can be removed at any time']
15
+ },
16
+ beta: {
17
+ BADGE: 'Beta',
18
+ POPOVER_TITLE: "What's a Beta?",
19
+ POPOVER_CONTENT: "A %{linkStart}Beta%{linkEnd} feature is not production-ready, but is unlikely to change drastically before it's released. We encourage users to try Beta features and provide feedback.\nA Beta feature: %{bullets}",
20
+ POPOVER_BULLETS: ['May be unstable', 'Should not cause data loss', 'Is supported by a commercially reasonable effort', 'Is complete or near completion']
21
+ }
13
22
  };
14
23
  var script = {
15
24
  name: 'GlExperimentBadge',
16
- i18n,
17
25
  components: {
18
26
  GlBadge,
19
27
  GlPopover,
@@ -24,7 +32,7 @@ var script = {
24
32
  /**
25
33
  * The URL of a page to provide more explanations on the experiment.
26
34
  */
27
- experimentHelpPageUrl: {
35
+ helpPageUrl: {
28
36
  type: String,
29
37
  required: false,
30
38
  default: ''
@@ -36,6 +44,20 @@ var script = {
36
44
  type: String,
37
45
  required: false,
38
46
  default: 'bottom'
47
+ },
48
+ /**
49
+ * The type of the badge.
50
+ */
51
+ type: {
52
+ type: String,
53
+ required: false,
54
+ default: badgeTypes[0],
55
+ validator: badgeTypeValidator
56
+ }
57
+ },
58
+ computed: {
59
+ activeType() {
60
+ return i18n[this.type];
39
61
  }
40
62
  },
41
63
  created() {
@@ -47,9 +69,9 @@ var script = {
47
69
  const __vue_script__ = script;
48
70
 
49
71
  /* template */
50
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-badge',{staticClass:"gl-mx-4 gl-hover-cursor-pointer",attrs:{"id":_vm.triggerId,"variant":"neutral","size":"md"}},[_c('span',[_vm._v(_vm._s(_vm.$options.i18n.EXPERIMENT_BADGE))]),_vm._v(" "),_c('gl-popover',{attrs:{"triggers":"click","show-close-button":"","placement":_vm.popoverPlacement,"target":_vm.triggerId,"css-classes":['gl-z-index-9999!'],"title":_vm.$options.i18n.EXPERIMENT_POPOVER_TITLE}},[_c('gl-sprintf',{attrs:{"message":_vm.$options.i18n.EXPERIMENT_POPOVER_CONTENT},scopedSlots:_vm._u([{key:"link",fn:function(ref){
72
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-badge',{staticClass:"gl-mx-4 gl-hover-cursor-pointer",attrs:{"id":_vm.triggerId,"variant":"neutral","size":"md"}},[_c('span',[_vm._v(_vm._s(_vm.activeType.BADGE))]),_vm._v(" "),_c('gl-popover',{attrs:{"triggers":"click","show-close-button":"","placement":_vm.popoverPlacement,"target":_vm.triggerId,"css-classes":['gl-z-index-9999!'],"title":_vm.activeType.POPOVER_TITLE}},[_c('gl-sprintf',{attrs:{"message":_vm.activeType.POPOVER_CONTENT},scopedSlots:_vm._u([{key:"link",fn:function(ref){
51
73
  var content = ref.content;
52
- return [(_vm.experimentHelpPageUrl)?_c('gl-link',{staticClass:"gl-font-sm!",attrs:{"href":_vm.experimentHelpPageUrl,"target":"_blank"}},[_vm._v("\n "+_vm._s(content)+"\n ")]):_c('span',[_vm._v(_vm._s(content))])]}},{key:"bullets",fn:function(){return [_c('ul',{staticClass:"gl-mb-0 gl-pl-5"},_vm._l((_vm.$options.i18n.EXPERIMENT_POPOVER_BULLETS),function(item,i){return _c('li',{key:("li-" + i)},[_vm._v("\n "+_vm._s(item)+"\n ")])}),0)]},proxy:true}])})],1)],1)};
74
+ return [(_vm.helpPageUrl)?_c('gl-link',{staticClass:"gl-font-sm!",attrs:{"href":_vm.helpPageUrl,"target":"_blank"}},[_vm._v("\n "+_vm._s(content)+"\n ")]):_c('span',[_vm._v(_vm._s(content))])]}},{key:"bullets",fn:function(){return [_c('ul',{staticClass:"gl-mb-0 gl-pl-5"},_vm._l((_vm.activeType.POPOVER_BULLETS),function(item,i){return _c('li',{key:("li-" + i)},[_vm._v("\n "+_vm._s(item)+"\n ")])}),0)]},proxy:true}])})],1)],1)};
53
75
  var __vue_staticRenderFns__ = [];
54
76
 
55
77
  /* style */