@gitlab/ui 67.5.2 → 68.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.
- package/CHANGELOG.md +27 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +4 -1
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +4 -3
- package/dist/components/experimental/duo/chat/duo_chat.js +13 -3
- package/dist/components/experimental/experiment_badge/constants.js +4 -0
- package/dist/components/experimental/experiment_badge/experiment_badge.js +30 -8
- 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/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +3 -2
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +4 -1
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.spec.js +40 -3
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +7 -2
- package/src/components/experimental/duo/chat/duo_chat.spec.js +16 -3
- package/src/components/experimental/duo/chat/duo_chat.stories.js +10 -5
- package/src/components/experimental/duo/chat/duo_chat.vue +14 -3
- package/src/components/experimental/experiment_badge/constants.js +2 -0
- package/src/components/experimental/experiment_badge/experiment_badge.spec.js +27 -16
- package/src/components/experimental/experiment_badge/experiment_badge.stories.js +7 -4
- package/src/components/experimental/experiment_badge/experiment_badge.vue +44 -21
- package/src/scss/utilities.scss +10 -0
- package/src/scss/utility-mixins/spacing.scss +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
# [68.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v68.0.0...v68.1.0) (2023-11-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlDisclosureDropdown:** nested dropdown click closes a parent one ([896ca20](https://gitlab.com/gitlab-org/gitlab-ui/commit/896ca202424d1f5adcca352101c8cd56d007a4df))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **css:** Add gl-sm-pr-4 utility ([a763496](https://gitlab.com/gitlab-org/gitlab-ui/commit/a7634968fe7a2771796df73d74dd1a9f8ece0012))
|
|
12
|
+
|
|
13
|
+
# [68.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.5.2...v68.0.0) (2023-11-07)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **GlExperimentBadge:** support 'beta' type ([927f830](https://gitlab.com/gitlab-org/gitlab-ui/commit/927f8302be7bcf471650228b25ee526332b2ff16))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### BREAKING CHANGES
|
|
22
|
+
|
|
23
|
+
* **GlExperimentBadge:** To extend the capabilities of the
|
|
24
|
+
badge, now it suports not only experiments, but
|
|
25
|
+
also allows to move features to beta state
|
|
26
|
+
using the same component
|
|
27
|
+
|
|
1
28
|
## [67.5.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.5.1...v67.5.2) (2023-11-06)
|
|
2
29
|
|
|
3
30
|
|
|
@@ -9,8 +9,10 @@ import { OutsideDirective } from '../../../../directives/outside/outside';
|
|
|
9
9
|
import { DEFAULT_OFFSET, FIXED_WIDTH_CLASS } from './constants';
|
|
10
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
11
|
|
|
12
|
+
const BASE_DROPDOWN_CLASS = 'gl-new-dropdown';
|
|
12
13
|
var script = {
|
|
13
14
|
name: 'BaseDropdown',
|
|
15
|
+
BASE_DROPDOWN_CLASS,
|
|
14
16
|
components: {
|
|
15
17
|
GlButton,
|
|
16
18
|
GlIcon
|
|
@@ -406,7 +408,7 @@ var script = {
|
|
|
406
408
|
const __vue_script__ = script;
|
|
407
409
|
|
|
408
410
|
/* template */
|
|
409
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"outside",rawName:"v-outside",value:(_vm.close),expression:"close"}],
|
|
411
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"outside",rawName:"v-outside",value:(_vm.close),expression:"close"}],class:[_vm.$options.BASE_DROPDOWN_CLASS, { 'gl-display-block!': _vm.block }]},[_c(_vm.toggleComponent,_vm._g(_vm._b({ref:"toggle",tag:"component",attrs:{"id":_vm.toggleId,"data-testid":"base-dropdown-toggle"}},'component',_vm.toggleAttributes,false),_vm.toggleListeners),[_vm._t("toggle",function(){return [_c('span',{staticClass:"gl-new-dropdown-button-text",class:{ 'gl-sr-only': _vm.textSrOnly }},[_vm._v("\n "+_vm._s(_vm.toggleText)+"\n ")]),_vm._v(" "),(!_vm.noCaret)?_c('gl-icon',{staticClass:"gl-button-icon gl-new-dropdown-chevron",attrs:{"name":"chevron-down"}}):_vm._e()]})],2),_vm._v(" "),_c('div',{ref:"content",staticClass:"gl-new-dropdown-panel",class:_vm.panelClasses,attrs:{"id":_vm.baseDropdownId,"data-testid":"base-dropdown-menu"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.closeAndFocus.apply(null, arguments)}}},[_c('div',{staticClass:"gl-new-dropdown-inner"},[_vm._t("default")],2)])],1)};
|
|
410
412
|
var __vue_staticRenderFns__ = [];
|
|
411
413
|
|
|
412
414
|
/* style */
|
|
@@ -439,3 +441,4 @@ var __vue_staticRenderFns__ = [];
|
|
|
439
441
|
);
|
|
440
442
|
|
|
441
443
|
export default __vue_component__;
|
|
444
|
+
export { BASE_DROPDOWN_CLASS };
|
|
@@ -3,13 +3,14 @@ import uniqueId from 'lodash/uniqueId';
|
|
|
3
3
|
import { stopEvent, filterVisible } from '../../../../utils/utils';
|
|
4
4
|
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_BEFORE_CLOSE, GL_DROPDOWN_FOCUS_CONTENT, POSITION_ABSOLUTE, POSITION_FIXED, HOME, END, ARROW_UP, ARROW_DOWN, ENTER, SPACE, GL_DROPDOWN_CONTENTS_CLASS } from '../constants';
|
|
5
5
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
6
|
-
import GlBaseDropdown from '../base_dropdown/base_dropdown';
|
|
6
|
+
import GlBaseDropdown, { BASE_DROPDOWN_CLASS } from '../base_dropdown/base_dropdown';
|
|
7
7
|
import GlDisclosureDropdownItem, { ITEM_CLASS } from './disclosure_dropdown_item';
|
|
8
8
|
import GlDisclosureDropdownGroup from './disclosure_dropdown_group';
|
|
9
9
|
import { itemsValidator, hasOnlyListItems, isItem } from './utils';
|
|
10
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
11
|
|
|
12
12
|
//
|
|
13
|
+
const DROPDOWN_SELECTOR = `.${BASE_DROPDOWN_CLASS}`;
|
|
13
14
|
const ITEM_SELECTOR = `.${ITEM_CLASS}`;
|
|
14
15
|
var script = {
|
|
15
16
|
name: 'GlDisclosureDropdown',
|
|
@@ -317,7 +318,7 @@ var script = {
|
|
|
317
318
|
this.$emit('action', action);
|
|
318
319
|
},
|
|
319
320
|
handleAutoClose(e) {
|
|
320
|
-
if (this.autoClose && e.target.closest(ITEM_SELECTOR)) {
|
|
321
|
+
if (this.autoClose && e.target.closest(ITEM_SELECTOR) && e.target.closest(DROPDOWN_SELECTOR) === this.$refs.baseDropdown.$el) {
|
|
321
322
|
this.closeAndFocus();
|
|
322
323
|
}
|
|
323
324
|
},
|
|
@@ -366,4 +367,4 @@ var __vue_staticRenderFns__ = [];
|
|
|
366
367
|
);
|
|
367
368
|
|
|
368
369
|
export default __vue_component__;
|
|
369
|
-
export { ITEM_SELECTOR };
|
|
370
|
+
export { DROPDOWN_SELECTOR, ITEM_SELECTOR };
|
|
@@ -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
|
-
|
|
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:{"
|
|
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,
|
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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
|
|
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.
|
|
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 */
|
package/dist/tokens/js/tokens.js
CHANGED