@gitlab/ui 72.6.0 → 72.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 +19 -0
- package/README.md +2 -14
- package/dist/components/base/dropdown/dropdown.js +2 -6
- package/dist/components/base/filtered_search/filtered_search_term.js +2 -0
- package/dist/components/base/filtered_search/filtered_search_token.js +3 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +4 -1
- package/dist/components/base/new_dropdowns/disclosure/utils.js +5 -1
- package/dist/components/base/new_dropdowns/listbox/utils.js +6 -0
- package/dist/components/base/sorting/sorting.js +1 -0
- package/dist/components/charts/column/column.js +1 -1
- package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +2 -0
- package/dist/components/experimental/duo/chat/duo_chat.js +2 -0
- package/dist/components/regions/empty_state/empty_state.js +1 -1
- package/dist/components/utilities/sprintf/sprintf.js +3 -1
- 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/dist/utils/is_slot_empty.js +4 -0
- package/dist/utils/number_utils.js +1 -1
- package/dist/utils/utils.js +1 -1
- package/package.json +14 -12
- package/src/components/base/accordion/accordion_item.stories.js +1 -1
- package/src/components/base/alert/alert.stories.js +4 -12
- package/src/components/base/badge/badge.stories.js +2 -6
- package/src/components/base/broadcast_message/broadcast_message.stories.js +2 -3
- package/src/components/base/drawer/drawer.spec.js +1 -0
- package/src/components/base/dropdown/dropdown.vue +2 -6
- package/src/components/base/filtered_search/filtered_search.spec.js +11 -0
- package/src/components/base/filtered_search/filtered_search_term.vue +1 -0
- package/src/components/base/filtered_search/filtered_search_token.vue +1 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +3 -1
- package/src/components/base/form/form_fields/form_fields.spec.js +1 -0
- package/src/components/base/icon/icon.stories.js +1 -1
- package/src/components/base/new_dropdowns/disclosure/utils.js +2 -0
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +2 -0
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +5 -3
- package/src/components/base/new_dropdowns/listbox/utils.js +3 -0
- package/src/components/base/popover/popover.stories.js +1 -3
- package/src/components/base/sorting/sorting.vue +1 -0
- package/src/components/base/tabs/tabs/tabs.stories.js +1 -3
- package/src/components/base/token_selector/token_selector.stories.js +1 -1
- package/src/components/charts/area/area.stories.js +1 -3
- package/src/components/charts/chart/chart.stories.js +1 -3
- package/src/components/charts/column/__snapshots__/column_chart.spec.js.snap +1 -1
- package/src/components/charts/column/column.stories.js +18 -3
- package/src/components/charts/column/column.vue +16 -1
- package/src/components/charts/column/column_chart.spec.js +106 -20
- package/src/components/charts/line/line.stories.js +1 -3
- package/src/components/charts/sparkline/sparkline.stories.js +2 -2
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +1 -0
- package/src/components/experimental/duo/chat/duo_chat.vue +1 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.stories.js +1 -1
- package/src/components/experimental/experiment_badge/experiment_badge.stories.js +1 -1
- package/src/components/regions/empty_state/empty_state.vue +0 -1
- package/src/components/utilities/animated_number/animated_number.stories.js +1 -0
- package/src/components/utilities/intersection_observer/intersection_observer.spec.js +1 -0
- package/src/components/utilities/intersection_observer/intersection_observer.stories.js +1 -1
- package/src/components/utilities/intersperse/intersperse.spec.js +1 -0
- package/src/components/utilities/sprintf/sprintf.stories.js +4 -4
- package/src/components/utilities/sprintf/sprintf.vue +1 -0
- package/src/components/utilities/truncate/truncate.stories.js +1 -1
- package/src/components/utilities/truncate_text/truncate_text.stories.js +1 -1
- package/src/directives/hover_load/hover_load.stories.js +1 -1
- package/src/directives/outside/outside.stories.js +1 -3
- package/src/directives/resize_observer/resize_observer.stories.js +1 -1
- package/src/directives/safe_html/safe_html.stories.js +1 -1
- package/src/directives/safe_link/safe_link.stories.js +1 -1
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/sizing.scss +4 -0
- package/src/utils/is_slot_empty.js +3 -0
- package/src/utils/number_utils.js +1 -1
- package/src/utils/utils.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [72.8.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.7.0...v72.8.0) (2024-01-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlColumnChart:** allow customising chart tooltip ([ed6ee9e](https://gitlab.com/gitlab-org/gitlab-ui/commit/ed6ee9e3139cba2793d90d955c39c41f6ab2b5af))
|
|
7
|
+
|
|
8
|
+
# [72.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.6.0...v72.7.0) (2024-01-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **GlEmptyState:** remove incorrect role from img ([9e5d86f](https://gitlab.com/gitlab-org/gitlab-ui/commit/9e5d86f9c9cbeaae2f7c179f56dbbbab633890e1))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **css:** adds gl-max-w-12 utility class ([58254e6](https://gitlab.com/gitlab-org/gitlab-ui/commit/58254e6458e2efc8e0f9c74a80bc9d90396b5404))
|
|
19
|
+
|
|
1
20
|
# [72.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.5.2...v72.6.0) (2024-01-11)
|
|
2
21
|
|
|
3
22
|
|
package/README.md
CHANGED
|
@@ -98,20 +98,8 @@ jest run them.
|
|
|
98
98
|
|
|
99
99
|
### Visual regression tests
|
|
100
100
|
|
|
101
|
-
GitLab UI uses visual snapshot tests to prevent introducing
|
|
102
|
-
layout changes on components.
|
|
103
|
-
[storyshots](https://github.com/storybookjs/storybook/tree/master/addons/storyshots/storyshots-core),
|
|
104
|
-
a storybook addon. Read the project documentation to understand how visual snapshots work.
|
|
105
|
-
|
|
106
|
-
There is a visual snapshot of every component’s storybook story. To run the tests, use the
|
|
107
|
-
`yarn test:visual` command. This command runs on the CI environment and will fail if the component
|
|
108
|
-
visual appearance changes.
|
|
109
|
-
|
|
110
|
-
#### Updating visual snapshot baseline images
|
|
111
|
-
|
|
112
|
-
In some occasions, the changes in a component’s appearance are justified. In those cases, we have to
|
|
113
|
-
update the baseline images to match the new look. See our
|
|
114
|
-
[visual testing documentation](doc/contributing/visual_testing.md) for how to do that.
|
|
101
|
+
GitLab UI uses visual snapshot tests to prevent introducing regressions with CSS and
|
|
102
|
+
layout changes on components. Read more on this in the [visual testing documentation](doc/contributing/visual_testing.md).
|
|
115
103
|
|
|
116
104
|
#### GitLab visual regression tests
|
|
117
105
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
2
|
import { BDropdown } from 'bootstrap-vue/esm/index.js';
|
|
3
|
-
import { selectAll
|
|
3
|
+
import { selectAll } from 'bootstrap-vue/esm/utils/dom';
|
|
4
4
|
import merge from 'lodash/merge';
|
|
5
5
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions } from '../../../utils/constants';
|
|
6
|
+
import { filterVisible } from '../../../utils/utils';
|
|
6
7
|
import { ButtonMixin } from '../../mixins/button_mixin';
|
|
7
8
|
import GlButton from '../button/button';
|
|
8
9
|
import GlIcon from '../icon/icon';
|
|
@@ -11,11 +12,6 @@ import GlDropdownDivider from './dropdown_divider';
|
|
|
11
12
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
12
13
|
|
|
13
14
|
//
|
|
14
|
-
|
|
15
|
-
// Return an Array of visible items
|
|
16
|
-
function filterVisible(els) {
|
|
17
|
-
return (els || []).filter(isVisible);
|
|
18
|
-
}
|
|
19
15
|
const Selector = {
|
|
20
16
|
ITEM_SELECTOR: '.dropdown-item:not(.disabled):not([disabled]),.form-control:not(.disabled):not([disabled])'
|
|
21
17
|
};
|
|
@@ -109,7 +109,9 @@ var script = {
|
|
|
109
109
|
return hasData || this.isSegmentActive(SEGMENT_DATA);
|
|
110
110
|
},
|
|
111
111
|
availableTokensWithSelf() {
|
|
112
|
-
return [this.config, ...this.availableTokens.filter(token => token !== this.config)].map(
|
|
112
|
+
return [this.config, ...this.availableTokens.filter(token => token !== this.config)].map(
|
|
113
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
114
|
+
tokenToOption);
|
|
113
115
|
},
|
|
114
116
|
operatorDescription() {
|
|
115
117
|
const operator = this.operators.find(op => op.value === this.tokenValue.operator);
|
|
@@ -28,7 +28,9 @@ const isVue3Fragment = vnode => {
|
|
|
28
28
|
const isVNodeEmpty = vnode => {
|
|
29
29
|
if (isVue3Fragment(vnode)) {
|
|
30
30
|
// vnode.children might be an array or single node in edge cases
|
|
31
|
-
return Array.isArray(vnode.children) ?
|
|
31
|
+
return Array.isArray(vnode.children) ?
|
|
32
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
33
|
+
vnode.children.every(isVNodeEmpty) : isVNodeEmpty(vnode.children);
|
|
32
34
|
}
|
|
33
35
|
if (isVue3Comment(vnode)) {
|
|
34
36
|
return true;
|
|
@@ -40,6 +42,7 @@ const isSlotNotEmpty = slot => {
|
|
|
40
42
|
return false;
|
|
41
43
|
}
|
|
42
44
|
const vnodes = typeof slot === 'function' ? slot() : slot;
|
|
45
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
43
46
|
return !(Array.isArray(vnodes) ? vnodes.every(isVNodeEmpty) : isVNodeEmpty(vnodes));
|
|
44
47
|
};
|
|
45
48
|
var script = {
|
|
@@ -6,7 +6,11 @@ const itemValidator = item => {
|
|
|
6
6
|
return (item === null || item === void 0 ? void 0 : (_item$text = item.text) === null || _item$text === void 0 ? void 0 : _item$text.length) > 0 && !Array.isArray(item === null || item === void 0 ? void 0 : item.items);
|
|
7
7
|
};
|
|
8
8
|
const isItem = item => Boolean(item) && itemValidator(item);
|
|
9
|
-
const isGroup = group => Boolean(group) && Array.isArray(group.items) && Boolean(group.items.length) &&
|
|
9
|
+
const isGroup = group => Boolean(group) && Array.isArray(group.items) && Boolean(group.items.length) &&
|
|
10
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
11
|
+
group.items.every(isItem);
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
10
14
|
const itemsValidator = items => items.every(isItem) || items.every(isGroup);
|
|
11
15
|
const isListItem = tag => ['gl-disclosure-dropdown-group', 'gl-disclosure-dropdown-item', 'li'].includes(tag);
|
|
12
16
|
const isValidSlotTagVue2 = vNode => {
|
|
@@ -2,6 +2,8 @@ import isNumber from 'lodash/isNumber';
|
|
|
2
2
|
import isString from 'lodash/isString';
|
|
3
3
|
|
|
4
4
|
const isOption = item => Boolean(item) && (isString(item.value) || isNumber(item.value));
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
5
7
|
const isGroup = function () {
|
|
6
8
|
let {
|
|
7
9
|
options
|
|
@@ -10,6 +12,8 @@ const isGroup = function () {
|
|
|
10
12
|
};
|
|
11
13
|
const hasNoDuplicates = array => array.length === new Set(array).size;
|
|
12
14
|
const flattenedOptions = items => items.flatMap(item => isOption(item) ? item : item.options);
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
13
17
|
const isAllOptionsOrAllGroups = items => items.every(isOption) || items.every(isGroup);
|
|
14
18
|
const hasUniqueValues = items => hasNoDuplicates(flattenedOptions(items).map(_ref => {
|
|
15
19
|
let {
|
|
@@ -17,6 +21,8 @@ const hasUniqueValues = items => hasNoDuplicates(flattenedOptions(items).map(_re
|
|
|
17
21
|
} = _ref;
|
|
18
22
|
return value;
|
|
19
23
|
}));
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
20
26
|
const hasUniqueGroups = items => hasNoDuplicates(items.filter(isGroup).map(_ref2 => {
|
|
21
27
|
let {
|
|
22
28
|
text
|
|
@@ -191,7 +191,7 @@ const __vue_script__ = script;
|
|
|
191
191
|
/* template */
|
|
192
192
|
var __vue_render__ = function () {
|
|
193
193
|
var _obj;
|
|
194
|
-
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":true}}):_vm._e()],1)};
|
|
194
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":true},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-title'])?{key:"title",fn:function(scope){return [_vm._t("tooltip-title",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-content'])?{key:"default",fn:function(scope){return [_vm._t("tooltip-content",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)}):_vm._e()],1)};
|
|
195
195
|
var __vue_staticRenderFns__ = [];
|
|
196
196
|
|
|
197
197
|
/* style */
|
|
@@ -5,6 +5,8 @@ const i18n = {
|
|
|
5
5
|
CONVERSATION_NEW_CHAT: 'New chat'
|
|
6
6
|
};
|
|
7
7
|
const isMessage = item => Boolean(item) && (item === null || item === void 0 ? void 0 : item.role);
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
8
10
|
const itemsValidator = items => items.every(isMessage);
|
|
9
11
|
var script = {
|
|
10
12
|
name: 'GlDuoChatConversation',
|
|
@@ -48,6 +48,8 @@ const slashCommands = [{
|
|
|
48
48
|
description: 'Explain the selected snippet.'
|
|
49
49
|
}];
|
|
50
50
|
const isMessage = item => Boolean(item) && (item === null || item === void 0 ? void 0 : item.role);
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
51
53
|
const itemsValidator = items => items.every(isMessage);
|
|
52
54
|
var script = {
|
|
53
55
|
name: 'GlDuoChat',
|
|
@@ -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('img',{staticClass:"gl-max-w-full",class:{ 'gl-dark-invert-keep-hue': _vm.invertInDarkMode },attrs:{"src":_vm.svgPath,"alt":"","
|
|
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":"","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 */
|
|
@@ -63,7 +63,9 @@ var script = {
|
|
|
63
63
|
type: Object,
|
|
64
64
|
required: false,
|
|
65
65
|
default: undefined,
|
|
66
|
-
validator: value => Object.values(value).every(
|
|
66
|
+
validator: value => Object.values(value).every(
|
|
67
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
68
|
+
tagPair => Array.isArray(tagPair) && tagPair.length === 2 && tagPair.every(isString))
|
|
67
69
|
}
|
|
68
70
|
},
|
|
69
71
|
/**
|
package/dist/tokens/js/tokens.js
CHANGED