@gitlab/ui 78.11.0 → 78.13.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 +14 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +9 -3
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +1 -1
- package/dist/components/base/new_dropdowns/listbox/listbox.js +1 -1
- package/dist/components/base/sorting/sorting.js +1 -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/utils/constants.js +17 -6
- package/package.json +1 -1
- package/src/components/base/breadcrumb/breadcrumb.vue +0 -1
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +11 -2
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.spec.js +6 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +1 -1
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +6 -0
- package/src/components/base/new_dropdowns/listbox/listbox.vue +1 -1
- package/src/components/base/sorting/sorting.vue +1 -1
- package/src/utils/constants.js +17 -13
- package/tailwind.defaults.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [78.13.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.12.0...v78.13.0) (2024-04-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **tailwind:** add data-viz colors to the preset ([9b31bd0](https://gitlab.com/gitlab-org/gitlab-ui/commit/9b31bd063e8284921048729ed4f130dcf312de82))
|
|
7
|
+
|
|
8
|
+
# [78.12.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.11.0...v78.12.0) (2024-04-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlBaseDropdown:** Migrates "placement" values to match floating-ui placements ([a9f37b6](https://gitlab.com/gitlab-org/gitlab-ui/commit/a9f37b6bcca96a3c0cc8ab22f7664d4b2bfbe613))
|
|
14
|
+
|
|
1
15
|
# [78.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.10.1...v78.11.0) (2024-04-10)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -166,7 +166,7 @@ var script = {
|
|
|
166
166
|
const __vue_script__ = script;
|
|
167
167
|
|
|
168
168
|
/* template */
|
|
169
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nav',{staticClass:"gl-breadcrumbs",style:(_vm.breadcrumbStyle),attrs:{"aria-label":_vm.ariaLabel}},[_c('b-breadcrumb',_vm._g(_vm._b({staticClass:"gl-breadcrumb-list"},'b-breadcrumb',_vm.$attrs,false),_vm.$listeners),[(_vm.hasCollapsible)?_c('li',{staticClass:"gl-breadcrumb-item"},[_c('gl-disclosure-dropdown',{staticStyle:{"height":"16px"},attrs:{"items":_vm.overflowingItems,"toggle-text":_vm.showMoreLabel,"fluid-width":"","text-sr-only":"","no-caret":"","icon":"ellipsis_h","size":"small"
|
|
169
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nav',{staticClass:"gl-breadcrumbs",style:(_vm.breadcrumbStyle),attrs:{"aria-label":_vm.ariaLabel}},[_c('b-breadcrumb',_vm._g(_vm._b({staticClass:"gl-breadcrumb-list"},'b-breadcrumb',_vm.$attrs,false),_vm.$listeners),[(_vm.hasCollapsible)?_c('li',{staticClass:"gl-breadcrumb-item"},[_c('gl-disclosure-dropdown',{staticStyle:{"height":"16px"},attrs:{"items":_vm.overflowingItems,"toggle-text":_vm.showMoreLabel,"fluid-width":"","text-sr-only":"","no-caret":"","icon":"ellipsis_h","size":"small"}})],1):_vm._e(),_vm._v(" "),_vm._l((_vm.fittingItems),function(item,index){return _c('gl-breadcrumb-item',{ref:"breadcrumbs",refInFor:true,style:(_vm.itemStyle),attrs:{"text":item.text,"href":item.href,"to":item.to,"aria-current":_vm.getAriaCurrentAttr(index)}},[(item.avatarPath)?_c('gl-avatar',{staticClass:"gl-breadcrumb-avatar-tile gl-border gl-mr-2 gl-rounded-base!",attrs:{"src":item.avatarPath,"size":16,"aria-hidden":"true","shape":"rect","data-testid":"avatar"}}):_vm._e(),_c('span',[_vm._v(_vm._s(item.text))])],1)})],2)],1)};
|
|
170
170
|
var __vue_staticRenderFns__ = [];
|
|
171
171
|
|
|
172
172
|
/* style */
|
|
@@ -2,7 +2,7 @@ import uniqueId from 'lodash/uniqueId';
|
|
|
2
2
|
import { offset, autoPlacement, size, autoUpdate, computePosition } from '@floating-ui/dom';
|
|
3
3
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements, dropdownAllowedAutoPlacements } from '../../../../utils/constants';
|
|
4
4
|
import { POSITION_ABSOLUTE, POSITION_FIXED, GL_DROPDOWN_CONTENTS_CLASS, GL_DROPDOWN_BEFORE_CLOSE, GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, ENTER, SPACE, ARROW_DOWN, GL_DROPDOWN_FOCUS_CONTENT } from '../constants';
|
|
5
|
-
import { isElementFocusable, isElementTabbable
|
|
5
|
+
import { logWarning, isElementFocusable, isElementTabbable } from '../../../../utils/utils';
|
|
6
6
|
import GlButton from '../../button/button';
|
|
7
7
|
import GlIcon from '../../icon/icon';
|
|
8
8
|
import { OutsideDirective } from '../../../../directives/outside/outside';
|
|
@@ -82,8 +82,14 @@ var script = {
|
|
|
82
82
|
placement: {
|
|
83
83
|
type: String,
|
|
84
84
|
required: false,
|
|
85
|
-
default: '
|
|
86
|
-
validator: value =>
|
|
85
|
+
default: 'bottom-start',
|
|
86
|
+
validator: value => {
|
|
87
|
+
if (['left', 'center', 'right'].includes(value)) {
|
|
88
|
+
logWarning(`GlDisclosureDropdown/GlCollapsibleListbox: "${value}" placement is deprecated.
|
|
89
|
+
Use ${dropdownPlacements[value]} instead.`);
|
|
90
|
+
}
|
|
91
|
+
return Object.keys(dropdownPlacements).includes(value);
|
|
92
|
+
}
|
|
87
93
|
},
|
|
88
94
|
// ARIA props
|
|
89
95
|
ariaHaspopup: {
|
|
@@ -136,7 +136,7 @@ var script = {
|
|
|
136
136
|
const __vue_script__ = script;
|
|
137
137
|
|
|
138
138
|
/* template */
|
|
139
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button-group',{staticClass:"gl-sorting"},[_c('gl-collapsible-listbox',{class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.dropdownToggleClass,"placement":"
|
|
139
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button-group',{staticClass:"gl-sorting"},[_c('gl-collapsible-listbox',{class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.dropdownToggleClass,"placement":"bottom-end","block":_vm.block},on:{"select":_vm.onSortByChanged}}),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],class:['sorting-direction-button', _vm.sortDirectionToggleClass],attrs:{"title":_vm.sortDirectionText,"icon":_vm.localSortDirection,"aria-label":_vm.sortDirectionText},on:{"click":_vm.toggleSortDirection}})],1)};
|
|
140
140
|
var __vue_staticRenderFns__ = [];
|
|
141
141
|
|
|
142
142
|
/* style */
|
package/dist/tokens/js/tokens.js
CHANGED
package/dist/utils/constants.js
CHANGED
|
@@ -122,16 +122,27 @@ const dropdownVariantOptions = {
|
|
|
122
122
|
};
|
|
123
123
|
const dropdownPlacements = {
|
|
124
124
|
'right-start': 'right-start',
|
|
125
|
+
'bottom-start': 'bottom-start',
|
|
126
|
+
'bottom-end': 'bottom-end',
|
|
127
|
+
bottom: 'bottom',
|
|
125
128
|
left: 'bottom-start',
|
|
129
|
+
// deprecated, should be replaced with "bottom-start"
|
|
126
130
|
center: 'bottom',
|
|
127
|
-
|
|
131
|
+
// deprecated, should be replaced with "bottom"
|
|
132
|
+
right: 'bottom-end' // deprecated, should be replaced with "bottom-end"
|
|
128
133
|
};
|
|
129
|
-
const
|
|
134
|
+
const dropdownHorizontalCornerPlacement = ['right-start', 'right-end', 'left-start', 'left-end'];
|
|
135
|
+
const dropdownVerticalCornerPlacement = ['bottom-start', 'top-start', 'bottom-end', 'top-end'];
|
|
130
136
|
const dropdownAllowedAutoPlacements = {
|
|
131
|
-
'right-start':
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
'right-start': dropdownHorizontalCornerPlacement,
|
|
138
|
+
'bottom-start': dropdownVerticalCornerPlacement,
|
|
139
|
+
'bottom-end': dropdownVerticalCornerPlacement,
|
|
140
|
+
bottom: ['bottom', 'top'],
|
|
141
|
+
left: dropdownVerticalCornerPlacement,
|
|
142
|
+
// deprecated, should be replaced with "bottom-start"
|
|
143
|
+
center: ['bottom', 'top'],
|
|
144
|
+
// deprecated, should be replaced with "bottom"
|
|
145
|
+
right: dropdownVerticalCornerPlacement // deprecated, should be replaced with "bottom-end"
|
|
135
146
|
};
|
|
136
147
|
const buttonSizeOptions = {
|
|
137
148
|
small: 'sm',
|
package/package.json
CHANGED
|
@@ -99,8 +99,17 @@ export default {
|
|
|
99
99
|
placement: {
|
|
100
100
|
type: String,
|
|
101
101
|
required: false,
|
|
102
|
-
default: '
|
|
103
|
-
validator: (value) =>
|
|
102
|
+
default: 'bottom-start',
|
|
103
|
+
validator: (value) => {
|
|
104
|
+
if (['left', 'center', 'right'].includes(value)) {
|
|
105
|
+
logWarning(
|
|
106
|
+
`GlDisclosureDropdown/GlCollapsibleListbox: "${value}" placement is deprecated.
|
|
107
|
+
Use ${dropdownPlacements[value]} instead.`
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return Object.keys(dropdownPlacements).includes(value);
|
|
112
|
+
},
|
|
104
113
|
},
|
|
105
114
|
// ARIA props
|
|
106
115
|
ariaHaspopup: {
|
|
@@ -71,6 +71,12 @@ describe('GlDisclosureDropdown', () => {
|
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
+
it('passes custom placement to the base dropdown', () => {
|
|
75
|
+
buildWrapper({ placement: 'bottom-end' });
|
|
76
|
+
|
|
77
|
+
expect(findBaseDropdown().props('placement')).toEqual('bottom-end');
|
|
78
|
+
});
|
|
79
|
+
|
|
74
80
|
describe('custom toggle id', () => {
|
|
75
81
|
it('should pass toggle id to the base dropdown', () => {
|
|
76
82
|
const toggleId = 'custom-toggle';
|
|
@@ -68,6 +68,12 @@ describe('GlCollapsibleListbox', () => {
|
|
|
68
68
|
expect(findBaseDropdown().props('offset')).toEqual(dropdownOffset);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
it('passes custom placement to the base dropdown', () => {
|
|
72
|
+
buildWrapper({ placement: 'bottom-end' });
|
|
73
|
+
|
|
74
|
+
expect(findBaseDropdown().props('placement')).toEqual('bottom-end');
|
|
75
|
+
});
|
|
76
|
+
|
|
71
77
|
describe('toggle text', () => {
|
|
72
78
|
describe.each`
|
|
73
79
|
toggleText | multiple | selected | expectedToggleText
|
package/src/utils/constants.js
CHANGED
|
@@ -147,23 +147,27 @@ export const dropdownVariantOptions = {
|
|
|
147
147
|
|
|
148
148
|
export const dropdownPlacements = {
|
|
149
149
|
'right-start': 'right-start',
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
'bottom-start': 'bottom-start',
|
|
151
|
+
'bottom-end': 'bottom-end',
|
|
152
|
+
bottom: 'bottom',
|
|
153
|
+
|
|
154
|
+
left: 'bottom-start', // deprecated, should be replaced with "bottom-start"
|
|
155
|
+
center: 'bottom', // deprecated, should be replaced with "bottom"
|
|
156
|
+
right: 'bottom-end', // deprecated, should be replaced with "bottom-end"
|
|
153
157
|
};
|
|
154
158
|
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
'top-start',
|
|
158
|
-
dropdownPlacements.right,
|
|
159
|
-
'top-end',
|
|
160
|
-
];
|
|
159
|
+
const dropdownHorizontalCornerPlacement = ['right-start', 'right-end', 'left-start', 'left-end'];
|
|
160
|
+
const dropdownVerticalCornerPlacement = ['bottom-start', 'top-start', 'bottom-end', 'top-end'];
|
|
161
161
|
|
|
162
162
|
export const dropdownAllowedAutoPlacements = {
|
|
163
|
-
'right-start':
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
'right-start': dropdownHorizontalCornerPlacement,
|
|
164
|
+
'bottom-start': dropdownVerticalCornerPlacement,
|
|
165
|
+
'bottom-end': dropdownVerticalCornerPlacement,
|
|
166
|
+
bottom: ['bottom', 'top'],
|
|
167
|
+
|
|
168
|
+
left: dropdownVerticalCornerPlacement, // deprecated, should be replaced with "bottom-start"
|
|
169
|
+
center: ['bottom', 'top'], // deprecated, should be replaced with "bottom"
|
|
170
|
+
right: dropdownVerticalCornerPlacement, // deprecated, should be replaced with "bottom-end"
|
|
167
171
|
};
|
|
168
172
|
|
|
169
173
|
export const buttonSizeOptions = {
|
package/tailwind.defaults.js
CHANGED
|
@@ -19,6 +19,13 @@ const themeColors = Object.entries(COMPILED_TOKENS.theme).reduce((acc, [, scales
|
|
|
19
19
|
return acc;
|
|
20
20
|
}, {});
|
|
21
21
|
|
|
22
|
+
const dataVizColors = Object.entries(COMPILED_TOKENS['data-viz']).reduce((acc, [, scales]) => {
|
|
23
|
+
Object.entries(scales).forEach(([, token]) => {
|
|
24
|
+
acc[token.path.join('-')] = cssCustomPropertyWithValue(token);
|
|
25
|
+
});
|
|
26
|
+
return acc;
|
|
27
|
+
}, {});
|
|
28
|
+
|
|
22
29
|
const textColors = Object.entries(COMPILED_TOKENS.text).reduce((acc, [scale, token]) => {
|
|
23
30
|
acc[scale] = cssCustomPropertyWithValue(token);
|
|
24
31
|
return acc;
|
|
@@ -29,6 +36,7 @@ const colors = {
|
|
|
29
36
|
black: cssCustomPropertyWithValue(COMPILED_TOKENS.black),
|
|
30
37
|
...baseColors,
|
|
31
38
|
...themeColors,
|
|
39
|
+
...dataVizColors,
|
|
32
40
|
};
|
|
33
41
|
|
|
34
42
|
const gridSize = 0.5; // rem
|