@gitlab/ui 64.13.0 → 64.13.2
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/new_dropdowns/base_dropdown/base_dropdown.js +5 -3
- package/dist/utils/constants.js +6 -1
- package/package.json +14 -14
- package/scss_to_js/scss_variables.js +0 -4
- package/scss_to_js/scss_variables.json +0 -20
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +21 -5
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +5 -2
- package/src/scss/variables.scss +6 -11
- package/src/utils/constants.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [64.13.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.13.1...v64.13.2) (2023-06-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **dropdowns:** replace flip middleware with autoPlacement ([23b44e8](https://gitlab.com/gitlab-org/gitlab-ui/commit/23b44e8a0c96aaa2a462e28d2f2f9cb2ab855431))
|
|
7
|
+
|
|
8
|
+
## [64.13.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.13.0...v64.13.1) (2023-06-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **css:** Allow overriding gray-a variables ([04cc50e](https://gitlab.com/gitlab-org/gitlab-ui/commit/04cc50e4cb742f42029ea2ad7882d05991afc74d))
|
|
14
|
+
|
|
1
15
|
# [64.13.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.12.0...v64.13.0) (2023-06-19)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import uniqueId from 'lodash/uniqueId';
|
|
2
|
-
import { offset,
|
|
3
|
-
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
2
|
+
import { offset, autoPlacement, size, autoUpdate, computePosition } from '@floating-ui/dom';
|
|
3
|
+
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements, dropdownAllowedAutoPlacements } from '../../../../utils/constants';
|
|
4
4
|
import { POSITION_ABSOLUTE, POSITION_FIXED, GL_DROPDOWN_CONTENTS_CLASS, GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, ENTER, SPACE, ARROW_DOWN, GL_DROPDOWN_FOCUS_CONTENT } from '../constants';
|
|
5
5
|
import { isElementFocusable, isElementTabbable, logWarning } from '../../../../utils/utils';
|
|
6
6
|
import GlButton from '../../button/button';
|
|
@@ -219,7 +219,9 @@ var script = {
|
|
|
219
219
|
return {
|
|
220
220
|
placement: dropdownPlacements[this.placement],
|
|
221
221
|
strategy: this.positioningStrategy,
|
|
222
|
-
middleware: [offset(this.offset),
|
|
222
|
+
middleware: [offset(this.offset), autoPlacement({
|
|
223
|
+
allowedPlacements: dropdownAllowedAutoPlacements[this.placement]
|
|
224
|
+
}), size({
|
|
223
225
|
apply: _ref => {
|
|
224
226
|
var _this$nonScrollableCo;
|
|
225
227
|
let {
|
package/dist/utils/constants.js
CHANGED
|
@@ -109,6 +109,11 @@ const dropdownPlacements = {
|
|
|
109
109
|
center: 'bottom',
|
|
110
110
|
right: 'bottom-end'
|
|
111
111
|
};
|
|
112
|
+
const dropdownAllowedAutoPlacements = {
|
|
113
|
+
left: [dropdownPlacements.left, 'top-start'],
|
|
114
|
+
center: [dropdownPlacements.center, 'top'],
|
|
115
|
+
right: [dropdownPlacements.right, 'top-end']
|
|
116
|
+
};
|
|
112
117
|
const buttonSizeOptions = {
|
|
113
118
|
small: 'sm',
|
|
114
119
|
medium: 'md'
|
|
@@ -257,4 +262,4 @@ const loadingIconSizes = {
|
|
|
257
262
|
'xl (64x64)': 'xl'
|
|
258
263
|
};
|
|
259
264
|
|
|
260
|
-
export { COMMA, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonVariantOptions, colorThemes, columnOptions, datepickerSizeOptionsMap, defaultDateFormat, drawerVariants, dropdownPlacements, dropdownVariantOptions, focusableTags, formInputSizes, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions, labelSizeOptions, loadingIconSizes, maxZIndex, modalButtonDefaults, modalSizeOptions, popoverPlacements, resizeDebounceTime, tabsButtonDefaults, targetOptions, toggleLabelPosition, tokenVariants, tooltipActionEvents, tooltipDelay, tooltipPlacements, triggerVariantOptions, truncateOptions, variantCssColorMap, variantOptions, variantOptionsWithNoDefault, viewModeOptions };
|
|
265
|
+
export { COMMA, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonVariantOptions, colorThemes, columnOptions, datepickerSizeOptionsMap, defaultDateFormat, drawerVariants, dropdownAllowedAutoPlacements, dropdownPlacements, dropdownVariantOptions, focusableTags, formInputSizes, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions, labelSizeOptions, loadingIconSizes, maxZIndex, modalButtonDefaults, modalSizeOptions, popoverPlacements, resizeDebounceTime, tabsButtonDefaults, targetOptions, toggleLabelPosition, tokenVariants, tooltipActionEvents, tooltipDelay, tooltipPlacements, triggerVariantOptions, truncateOptions, variantCssColorMap, variantOptions, variantOptionsWithNoDefault, viewModeOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "64.13.
|
|
3
|
+
"version": "64.13.2",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -94,18 +94,18 @@
|
|
|
94
94
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
95
95
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
96
96
|
"@rollup/plugin-replace": "^2.3.2",
|
|
97
|
-
"@storybook/addon-a11y": "7.0.
|
|
98
|
-
"@storybook/addon-docs": "7.0.
|
|
99
|
-
"@storybook/addon-essentials": "7.0.
|
|
100
|
-
"@storybook/addon-storyshots": "7.0.
|
|
101
|
-
"@storybook/addon-storyshots-puppeteer": "7.0.
|
|
102
|
-
"@storybook/addon-viewport": "7.0.
|
|
103
|
-
"@storybook/builder-webpack5": "7.0.
|
|
104
|
-
"@storybook/theming": "7.0.
|
|
105
|
-
"@storybook/vue": "7.0.
|
|
106
|
-
"@storybook/vue-webpack5": "7.0.
|
|
107
|
-
"@storybook/vue3": "7.0.
|
|
108
|
-
"@storybook/vue3-webpack5": "7.0.
|
|
97
|
+
"@storybook/addon-a11y": "7.0.22",
|
|
98
|
+
"@storybook/addon-docs": "7.0.22",
|
|
99
|
+
"@storybook/addon-essentials": "7.0.22",
|
|
100
|
+
"@storybook/addon-storyshots": "7.0.22",
|
|
101
|
+
"@storybook/addon-storyshots-puppeteer": "7.0.22",
|
|
102
|
+
"@storybook/addon-viewport": "7.0.22",
|
|
103
|
+
"@storybook/builder-webpack5": "7.0.22",
|
|
104
|
+
"@storybook/theming": "7.0.22",
|
|
105
|
+
"@storybook/vue": "7.0.22",
|
|
106
|
+
"@storybook/vue-webpack5": "7.0.22",
|
|
107
|
+
"@storybook/vue3": "7.0.22",
|
|
108
|
+
"@storybook/vue3-webpack5": "7.0.22",
|
|
109
109
|
"@vue/compat": "^3.2.40",
|
|
110
110
|
"@vue/compiler-sfc": "^3.2.40",
|
|
111
111
|
"@vue/test-utils": "1.3.0",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"sass-loader": "^10.2.0",
|
|
154
154
|
"sass-true": "^6.1.0",
|
|
155
155
|
"start-server-and-test": "^1.10.6",
|
|
156
|
-
"storybook": "7.0.
|
|
156
|
+
"storybook": "7.0.22",
|
|
157
157
|
"storybook-dark-mode": "3.0.0",
|
|
158
158
|
"stylelint": "14.9.1",
|
|
159
159
|
"stylelint-config-prettier": "^9.0.5",
|
|
@@ -238,10 +238,6 @@ export const dataVizOrange700 = '#92430a'
|
|
|
238
238
|
export const dataVizOrange800 = '#6f3500'
|
|
239
239
|
export const dataVizOrange900 = '#5e2f05'
|
|
240
240
|
export const dataVizOrange950 = '#4b2707'
|
|
241
|
-
export const darkenNormalFactor = '7%'
|
|
242
|
-
export const darkenDarkFactor = '10%'
|
|
243
|
-
export const darkenBorderFactor = '5%'
|
|
244
|
-
export const darkenBorderDashedFactor = '25%'
|
|
245
241
|
export const tGrayA02 = 'rgba(31, 30, 36, 0.02)'
|
|
246
242
|
export const tGrayA04 = 'rgba(31, 30, 36, 0.04)'
|
|
247
243
|
export const tGrayA06 = 'rgba(31, 30, 36, 0.06)'
|
|
@@ -1227,26 +1227,6 @@
|
|
|
1227
1227
|
"value": "#4b2707",
|
|
1228
1228
|
"compiledValue": "#4b2707"
|
|
1229
1229
|
},
|
|
1230
|
-
{
|
|
1231
|
-
"name": "$darken-normal-factor",
|
|
1232
|
-
"value": "7%",
|
|
1233
|
-
"compiledValue": "7%"
|
|
1234
|
-
},
|
|
1235
|
-
{
|
|
1236
|
-
"name": "$darken-dark-factor",
|
|
1237
|
-
"value": "10%",
|
|
1238
|
-
"compiledValue": "10%"
|
|
1239
|
-
},
|
|
1240
|
-
{
|
|
1241
|
-
"name": "$darken-border-factor",
|
|
1242
|
-
"value": "5%",
|
|
1243
|
-
"compiledValue": "5%"
|
|
1244
|
-
},
|
|
1245
|
-
{
|
|
1246
|
-
"name": "$darken-border-dashed-factor",
|
|
1247
|
-
"value": "25%",
|
|
1248
|
-
"compiledValue": "25%"
|
|
1249
|
-
},
|
|
1250
1230
|
{
|
|
1251
1231
|
"name": "$t-gray-a-02",
|
|
1252
1232
|
"value": "rgba($gray-950, 0.02)",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
2
|
import { nextTick } from 'vue';
|
|
3
|
-
import { computePosition, autoUpdate, offset } from '@floating-ui/dom';
|
|
3
|
+
import { computePosition, autoUpdate, offset, autoPlacement } from '@floating-ui/dom';
|
|
4
4
|
import {
|
|
5
5
|
ARROW_DOWN,
|
|
6
6
|
GL_DROPDOWN_FOCUS_CONTENT,
|
|
@@ -15,6 +15,7 @@ import GlBaseDropdown from './base_dropdown.vue';
|
|
|
15
15
|
jest.mock('@floating-ui/dom');
|
|
16
16
|
const mockStopAutoUpdate = jest.fn();
|
|
17
17
|
offset.mockImplementation((options) => options);
|
|
18
|
+
autoPlacement.mockImplementation((options) => options);
|
|
18
19
|
|
|
19
20
|
const DEFAULT_BTN_TOGGLE_CLASSES = [
|
|
20
21
|
'btn',
|
|
@@ -104,7 +105,12 @@ describe('base dropdown', () => {
|
|
|
104
105
|
{
|
|
105
106
|
placement: 'bottom-start',
|
|
106
107
|
strategy: 'absolute',
|
|
107
|
-
middleware: [
|
|
108
|
+
middleware: [
|
|
109
|
+
offset({ mainAxis: DEFAULT_OFFSET }),
|
|
110
|
+
autoPlacement({
|
|
111
|
+
allowedPlacements: ['bottom-start', 'top-start'],
|
|
112
|
+
}),
|
|
113
|
+
],
|
|
108
114
|
}
|
|
109
115
|
);
|
|
110
116
|
});
|
|
@@ -119,7 +125,12 @@ describe('base dropdown', () => {
|
|
|
119
125
|
{
|
|
120
126
|
placement: 'bottom',
|
|
121
127
|
strategy: 'absolute',
|
|
122
|
-
middleware: [
|
|
128
|
+
middleware: [
|
|
129
|
+
offset({ mainAxis: DEFAULT_OFFSET }),
|
|
130
|
+
autoPlacement({
|
|
131
|
+
allowedPlacements: ['bottom', 'top'],
|
|
132
|
+
}),
|
|
133
|
+
],
|
|
123
134
|
}
|
|
124
135
|
);
|
|
125
136
|
});
|
|
@@ -134,7 +145,12 @@ describe('base dropdown', () => {
|
|
|
134
145
|
{
|
|
135
146
|
placement: 'bottom-end',
|
|
136
147
|
strategy: 'absolute',
|
|
137
|
-
middleware: [
|
|
148
|
+
middleware: [
|
|
149
|
+
offset({ mainAxis: DEFAULT_OFFSET }),
|
|
150
|
+
autoPlacement({
|
|
151
|
+
allowedPlacements: ['bottom-end', 'top-end'],
|
|
152
|
+
}),
|
|
153
|
+
],
|
|
138
154
|
}
|
|
139
155
|
);
|
|
140
156
|
});
|
|
@@ -153,7 +169,7 @@ describe('base dropdown', () => {
|
|
|
153
169
|
{
|
|
154
170
|
placement: 'bottom-end',
|
|
155
171
|
strategy: 'absolute',
|
|
156
|
-
middleware: [offset(customOffset)],
|
|
172
|
+
middleware: [offset(customOffset), autoPlacement(expect.any(Object))],
|
|
157
173
|
}
|
|
158
174
|
);
|
|
159
175
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import uniqueId from 'lodash/uniqueId';
|
|
3
|
-
import { computePosition, autoUpdate, offset, size,
|
|
3
|
+
import { computePosition, autoUpdate, offset, size, autoPlacement } from '@floating-ui/dom';
|
|
4
4
|
import {
|
|
5
5
|
buttonCategoryOptions,
|
|
6
6
|
buttonSizeOptions,
|
|
7
7
|
dropdownPlacements,
|
|
8
|
+
dropdownAllowedAutoPlacements,
|
|
8
9
|
dropdownVariantOptions,
|
|
9
10
|
} from '../../../../utils/constants';
|
|
10
11
|
import {
|
|
@@ -235,7 +236,9 @@ export default {
|
|
|
235
236
|
strategy: this.positioningStrategy,
|
|
236
237
|
middleware: [
|
|
237
238
|
offset(this.offset),
|
|
238
|
-
|
|
239
|
+
autoPlacement({
|
|
240
|
+
allowedPlacements: dropdownAllowedAutoPlacements[this.placement],
|
|
241
|
+
}),
|
|
239
242
|
size({
|
|
240
243
|
apply: ({ availableHeight, elements }) => {
|
|
241
244
|
const contentsEl = elements.floating.querySelector(`.${GL_DROPDOWN_CONTENTS_CLASS}`);
|
package/src/scss/variables.scss
CHANGED
|
@@ -303,17 +303,12 @@ $data-viz-orange-800: #6f3500;
|
|
|
303
303
|
$data-viz-orange-900: #5e2f05;
|
|
304
304
|
$data-viz-orange-950: #4b2707;
|
|
305
305
|
|
|
306
|
-
$
|
|
307
|
-
$
|
|
308
|
-
$
|
|
309
|
-
$
|
|
310
|
-
|
|
311
|
-
$t-gray-a-
|
|
312
|
-
$t-gray-a-04: rgba($gray-950, 0.04);
|
|
313
|
-
$t-gray-a-06: rgba($gray-950, 0.06);
|
|
314
|
-
$t-gray-a-08: rgba($gray-950, 0.08);
|
|
315
|
-
$t-gray-a-16: rgba($gray-950, 0.16);
|
|
316
|
-
$t-gray-a-24: rgba($gray-950, 0.24);
|
|
306
|
+
$t-gray-a-02: rgba($gray-950, 0.02) !default;
|
|
307
|
+
$t-gray-a-04: rgba($gray-950, 0.04) !default;
|
|
308
|
+
$t-gray-a-06: rgba($gray-950, 0.06) !default;
|
|
309
|
+
$t-gray-a-08: rgba($gray-950, 0.08) !default;
|
|
310
|
+
$t-gray-a-16: rgba($gray-950, 0.16) !default;
|
|
311
|
+
$t-gray-a-24: rgba($gray-950, 0.24) !default;
|
|
317
312
|
|
|
318
313
|
// Text
|
|
319
314
|
$gl-text-color: $gray-900 !default;
|
package/src/utils/constants.js
CHANGED
|
@@ -128,6 +128,12 @@ export const dropdownPlacements = {
|
|
|
128
128
|
right: 'bottom-end',
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
+
export const dropdownAllowedAutoPlacements = {
|
|
132
|
+
left: [dropdownPlacements.left, 'top-start'],
|
|
133
|
+
center: [dropdownPlacements.center, 'top'],
|
|
134
|
+
right: [dropdownPlacements.right, 'top-end'],
|
|
135
|
+
};
|
|
136
|
+
|
|
131
137
|
export const buttonSizeOptions = {
|
|
132
138
|
small: 'sm',
|
|
133
139
|
medium: 'md',
|