@gitlab/ui 66.16.0 → 66.19.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 +21 -0
- package/dist/components/base/modal/modal.js +1 -1
- package/dist/components/experimental/duo/user_feedback/user_feedback.js +94 -0
- package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +121 -0
- package/dist/components/regions/empty_state/empty_state.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -0
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +14 -14
- package/src/components/base/modal/modal.scss +1 -3
- package/src/components/base/modal/modal.spec.js +2 -2
- package/src/components/base/modal/modal.vue +2 -2
- package/src/components/experimental/duo/user_feedback/user_feedback.md +40 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.spec.js +80 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.stories.js +48 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.vue +76 -0
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.spec.js +61 -0
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +124 -0
- package/src/components/regions/empty_state/empty_state.scss +3 -0
- package/src/components/regions/empty_state/empty_state.spec.js +11 -1
- package/src/components/regions/empty_state/empty_state.vue +60 -59
- package/src/index.js +1 -0
- package/src/scss/components.scss +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# [66.19.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.18.0...v66.19.0) (2023-09-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlDuoUserFeedback:** Added the component ([f9a6f93](https://gitlab.com/gitlab-org/gitlab-ui/commit/f9a6f93fe0b46ba5638d9ad711e062afb7898636))
|
|
7
|
+
|
|
8
|
+
# [66.18.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.17.0...v66.18.0) (2023-09-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlEmptyState:** Add line length limit ([7e03303](https://gitlab.com/gitlab-org/gitlab-ui/commit/7e03303da94d39c062c61fa6882cc94f1da928c4))
|
|
14
|
+
|
|
15
|
+
# [66.17.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.16.0...v66.17.0) (2023-09-27)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **Modal:** Use current styles and h2 for heading ([21abaf1](https://gitlab.com/gitlab-org/gitlab-ui/commit/21abaf1c5c64df650feb3702c14f3ad2f0022a65))
|
|
21
|
+
|
|
1
22
|
# [66.16.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.15.0...v66.16.0) (2023-09-27)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -169,7 +169,7 @@ var script = {
|
|
|
169
169
|
const __vue_script__ = script;
|
|
170
170
|
|
|
171
171
|
/* template */
|
|
172
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-modal',_vm._g(_vm._b({ref:"modal",attrs:{"id":_vm.modalId,"title-tag":_vm.titleTag,"size":_vm.size,"visible":_vm.visible,"aria-label":_vm.ariaLabel || _vm.title,"lazy":"","modal-class":['gl-modal', _vm.modalClass]},on:{"shown":_vm.setFocus,"ok":_vm.primary,"cancel":_vm.canceled,"change":function($event){return _vm.$emit('change', $event)}},scopedSlots:_vm._u([{key:"default",fn:function(){return [_vm._t("default")]},proxy:true},{key:"modal-header",fn:function(){return [_vm._t("modal-header",function(){return [_c('
|
|
172
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-modal',_vm._g(_vm._b({ref:"modal",attrs:{"id":_vm.modalId,"title-tag":_vm.titleTag,"size":_vm.size,"visible":_vm.visible,"aria-label":_vm.ariaLabel || _vm.title,"lazy":"","modal-class":['gl-modal', _vm.modalClass]},on:{"shown":_vm.setFocus,"ok":_vm.primary,"cancel":_vm.canceled,"change":function($event){return _vm.$emit('change', $event)}},scopedSlots:_vm._u([{key:"default",fn:function(){return [_vm._t("default")]},proxy:true},{key:"modal-header",fn:function(){return [_vm._t("modal-header",function(){return [_c('h2',{staticClass:"modal-title"},[_vm._t("modal-title",function(){return [_vm._v(_vm._s(_vm.title))]})],2)]}),_vm._v(" "),_c('close-button',{ref:"close-button",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.close}})]},proxy:true},(_vm.shouldRenderModalOk)?{key:"modal-ok",fn:function(){return [_vm._t("modal-ok")]},proxy:true}:null,(_vm.shouldRenderModalCancel)?{key:"modal-cancel",fn:function(){return [_vm._t("modal-cancel")]},proxy:true}:null,(_vm.shouldRenderModalFooter)?{key:"modal-footer",fn:function(){return [_vm._t("modal-footer",function(){return [(_vm.actionCancel)?_c('gl-button',_vm._b({staticClass:"js-modal-action-cancel",on:{"click":_vm.cancel}},'gl-button',_vm.buttonBinding(_vm.actionCancel, 'actionCancel'),false),[_vm._v("\n "+_vm._s(_vm.actionCancel.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({staticClass:"js-modal-action-secondary",on:{"click":_vm.secondary}},'gl-button',_vm.buttonBinding(_vm.actionSecondary, 'actionSecondary'),false),[_vm._v("\n "+_vm._s(_vm.actionSecondary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionPrimary)?_c('gl-button',_vm._b({staticClass:"js-modal-action-primary",on:{"click":_vm.ok}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e()]})]},proxy:true}:null],null,true)},'b-modal',_vm.$attrs,false),_vm.$listeners))};
|
|
173
173
|
var __vue_staticRenderFns__ = [];
|
|
174
174
|
|
|
175
175
|
/* style */
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { GlButton } from '../../../../index';
|
|
2
|
+
import FeedbackModal from './user_feedback_modal';
|
|
3
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
+
|
|
5
|
+
const i18n = {
|
|
6
|
+
FEEDBACK_LINK_TEXT: 'Give feedback to improve this answer.',
|
|
7
|
+
FEEDBACK_THANKS: 'Thank you for your feedback.'
|
|
8
|
+
};
|
|
9
|
+
var script = {
|
|
10
|
+
name: 'GlDuoUserFeedback',
|
|
11
|
+
components: {
|
|
12
|
+
GlButton,
|
|
13
|
+
FeedbackModal
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* The text to be displayed as the feedback link/button.
|
|
18
|
+
*/
|
|
19
|
+
feedbackLinkText: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
default: i18n.FEEDBACK_LINK_TEXT
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* The URL of a page to provide more explanations on the experiment. If provided, clicking
|
|
26
|
+
* the feedback link will open a new tab with the URL instead of showing the feedback modal.
|
|
27
|
+
*/
|
|
28
|
+
feedbackLinkUrl: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false,
|
|
31
|
+
default: ''
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
feedbackReceived: false
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
shouldRenderModal() {
|
|
41
|
+
return !this.feedbackReceived && !this.feedbackLinkUrl;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
notify(event) {
|
|
46
|
+
/**
|
|
47
|
+
* Notify listeners about the feedback form submission.
|
|
48
|
+
* @param {*} event An event, containing the feedback choices and the extended feedback text.
|
|
49
|
+
*/
|
|
50
|
+
this.$emit('feedback', event);
|
|
51
|
+
this.feedbackReceived = true;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
i18n
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/* script */
|
|
58
|
+
const __vue_script__ = script;
|
|
59
|
+
|
|
60
|
+
/* template */
|
|
61
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-pt-4"},[_c('div',[(!_vm.feedbackReceived)?_c('gl-button',{attrs:{"variant":"link","target":"_blank","href":_vm.feedbackLinkUrl},on:{"click":function($event){_vm.shouldRenderModal && _vm.$refs.feedbackModal.show();}}},[_vm._v(_vm._s(_vm.feedbackLinkText))]):_c('span',{staticClass:"gl-text-gray-500"},[_vm._v("\n "+_vm._s(_vm.$options.i18n.FEEDBACK_THANKS)+"\n ")])],1),_vm._v(" "),(_vm.shouldRenderModal)?_c('feedback-modal',{ref:"feedbackModal",on:{"feedback-submitted":_vm.notify}}):_vm._e()],1)};
|
|
62
|
+
var __vue_staticRenderFns__ = [];
|
|
63
|
+
|
|
64
|
+
/* style */
|
|
65
|
+
const __vue_inject_styles__ = undefined;
|
|
66
|
+
/* scoped */
|
|
67
|
+
const __vue_scope_id__ = undefined;
|
|
68
|
+
/* module identifier */
|
|
69
|
+
const __vue_module_identifier__ = undefined;
|
|
70
|
+
/* functional template */
|
|
71
|
+
const __vue_is_functional_template__ = false;
|
|
72
|
+
/* style inject */
|
|
73
|
+
|
|
74
|
+
/* style inject SSR */
|
|
75
|
+
|
|
76
|
+
/* style inject shadow dom */
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const __vue_component__ = __vue_normalize__(
|
|
81
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
82
|
+
__vue_inject_styles__,
|
|
83
|
+
__vue_script__,
|
|
84
|
+
__vue_scope_id__,
|
|
85
|
+
__vue_is_functional_template__,
|
|
86
|
+
__vue_module_identifier__,
|
|
87
|
+
false,
|
|
88
|
+
undefined,
|
|
89
|
+
undefined,
|
|
90
|
+
undefined
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export default __vue_component__;
|
|
94
|
+
export { i18n };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { GlModal, GlFormCheckboxGroup, GlFormGroup, GlFormTextarea } from '../../../../index';
|
|
2
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
|
+
|
|
4
|
+
const i18n = {
|
|
5
|
+
MODAL_TITLE: 'Give feedback on AI content',
|
|
6
|
+
MODAL_DESCRIPTION: 'To help improve the quality of the content, send your feedback to GitLab team members.',
|
|
7
|
+
MODAL_OPTIONS_LABEL: 'How was the AI content?',
|
|
8
|
+
MODAL_MORE_LABEL: 'More information',
|
|
9
|
+
MODAL_MORE_PLACEHOLDER: 'How could the content be improved?',
|
|
10
|
+
MODAL_FEEDBACK_OPTIONS: {
|
|
11
|
+
helpful: 'Helpful',
|
|
12
|
+
unhelpful: 'Unhelpful or irrelevant',
|
|
13
|
+
incorrect: 'Factually incorrect',
|
|
14
|
+
long: 'Too long',
|
|
15
|
+
abuse: 'Abusive or offensive',
|
|
16
|
+
other: 'Something else'
|
|
17
|
+
},
|
|
18
|
+
MODAL_ACTIONS: {
|
|
19
|
+
submit: 'Submit',
|
|
20
|
+
cancel: 'Cancel'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const feedbackOptions = [{
|
|
24
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.helpful,
|
|
25
|
+
value: 'helpful'
|
|
26
|
+
}, {
|
|
27
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.unhelpful,
|
|
28
|
+
value: 'unhelpful'
|
|
29
|
+
}, {
|
|
30
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.incorrect,
|
|
31
|
+
value: 'incorrect'
|
|
32
|
+
}, {
|
|
33
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.long,
|
|
34
|
+
value: 'long'
|
|
35
|
+
}, {
|
|
36
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.abuse,
|
|
37
|
+
value: 'abuse'
|
|
38
|
+
}, {
|
|
39
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.other,
|
|
40
|
+
value: 'other'
|
|
41
|
+
}];
|
|
42
|
+
var script = {
|
|
43
|
+
name: 'DuoChatFeedbackModal',
|
|
44
|
+
components: {
|
|
45
|
+
GlModal,
|
|
46
|
+
GlFormCheckboxGroup,
|
|
47
|
+
GlFormGroup,
|
|
48
|
+
GlFormTextarea
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
selectedFeedbackOptions: [],
|
|
53
|
+
extendedFeedback: ''
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
show() {
|
|
58
|
+
this.$refs.feedbackModal.show();
|
|
59
|
+
},
|
|
60
|
+
onFeedbackSubmit() {
|
|
61
|
+
if (this.selectedFeedbackOptions.length) {
|
|
62
|
+
this.$emit('feedback-submitted', {
|
|
63
|
+
feedbackChoices: this.selectedFeedbackOptions,
|
|
64
|
+
extendedTextFeedback: this.extendedFeedback
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
onFeedbackCanceled() {
|
|
69
|
+
this.$refs.feedbackModal.hide();
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
actions: {
|
|
73
|
+
primary: {
|
|
74
|
+
text: i18n.MODAL_ACTIONS.submit
|
|
75
|
+
},
|
|
76
|
+
cancel: {
|
|
77
|
+
text: i18n.MODAL_ACTIONS.cancel
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
feedbackOptions,
|
|
81
|
+
i18n
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/* script */
|
|
85
|
+
const __vue_script__ = script;
|
|
86
|
+
|
|
87
|
+
/* template */
|
|
88
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-modal',{ref:"feedbackModal",attrs:{"modal-id":"feedbackModal","title":_vm.$options.i18n.MODAL_TITLE,"action-primary":_vm.$options.actions.primary,"action-cancel":_vm.$options.actions.cancel,"visible":false,"size":"sm"},on:{"primary":_vm.onFeedbackSubmit,"canceled":_vm.onFeedbackCanceled}},[_c('p',[_vm._v(_vm._s(_vm.$options.i18n.MODAL_DESCRIPTION))]),_vm._v(" "),_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL_OPTIONS_LABEL,"optional":false,"data-testid":"feedback-options"}},[_c('gl-form-checkbox-group',{attrs:{"options":_vm.$options.feedbackOptions},model:{value:(_vm.selectedFeedbackOptions),callback:function ($$v) {_vm.selectedFeedbackOptions=$$v;},expression:"selectedFeedbackOptions"}})],1),_vm._v(" "),_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL_MORE_LABEL,"optional":""}},[_c('gl-form-textarea',{attrs:{"placeholder":_vm.$options.i18n.MODAL_MORE_PLACEHOLDER},model:{value:(_vm.extendedFeedback),callback:function ($$v) {_vm.extendedFeedback=$$v;},expression:"extendedFeedback"}})],1)],1)};
|
|
89
|
+
var __vue_staticRenderFns__ = [];
|
|
90
|
+
|
|
91
|
+
/* style */
|
|
92
|
+
const __vue_inject_styles__ = undefined;
|
|
93
|
+
/* scoped */
|
|
94
|
+
const __vue_scope_id__ = undefined;
|
|
95
|
+
/* module identifier */
|
|
96
|
+
const __vue_module_identifier__ = undefined;
|
|
97
|
+
/* functional template */
|
|
98
|
+
const __vue_is_functional_template__ = false;
|
|
99
|
+
/* style inject */
|
|
100
|
+
|
|
101
|
+
/* style inject SSR */
|
|
102
|
+
|
|
103
|
+
/* style inject shadow dom */
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
const __vue_component__ = __vue_normalize__(
|
|
108
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
109
|
+
__vue_inject_styles__,
|
|
110
|
+
__vue_script__,
|
|
111
|
+
__vue_scope_id__,
|
|
112
|
+
__vue_is_functional_template__,
|
|
113
|
+
__vue_module_identifier__,
|
|
114
|
+
false,
|
|
115
|
+
undefined,
|
|
116
|
+
undefined,
|
|
117
|
+
undefined
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
export default __vue_component__;
|
|
121
|
+
export { feedbackOptions, i18n };
|
|
@@ -107,7 +107,7 @@ var script = {
|
|
|
107
107
|
return Boolean(this.secondaryButtonLink && this.secondaryButtonText);
|
|
108
108
|
},
|
|
109
109
|
contentClasses() {
|
|
110
|
-
return [this.compact ? 'gl-flex-grow-1 gl-flex-basis-0 gl-px-4' : 'gl-
|
|
110
|
+
return [this.compact ? 'gl-flex-grow-1 gl-flex-basis-0 gl-px-4' : 'gl-m-auto gl-p-5', this.contentClass];
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
};
|
|
@@ -119,7 +119,7 @@ const __vue_script__ = script;
|
|
|
119
119
|
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"gl-display-flex",class:{
|
|
120
120
|
'gl-empty-state gl-text-center gl-flex-direction-column': !_vm.compact,
|
|
121
121
|
'gl-flex-direction-row': _vm.compact,
|
|
122
|
-
}},[_c('div',{class:{ 'gl-display-none gl-sm-display-block gl-px-4': _vm.compact, 'gl-max-w-full': !_vm.compact }},[(_vm.svgPath)?_c('
|
|
122
|
+
}},[_c('div',{class:{ 'gl-display-none gl-sm-display-block gl-px-4': _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":"","role":"img","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('h1',{staticClass:"gl-font-size-h-display gl-line-height-36 gl-mt-0 gl-mb-0",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-mt-4 gl-mb-0"},[_vm._t("description",function(){return [_vm._v("\n "+_vm._s(_vm.description)+"\n ")]})],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-flex-wrap gl-mt-5",class:{ 'gl-justify-content-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)])};
|
|
123
123
|
var __vue_staticRenderFns__ = [];
|
|
124
124
|
|
|
125
125
|
/* style */
|