@gitlab/ui 78.14.1 → 78.15.1
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/keyset_pagination/keyset_pagination.js +6 -5
- package/dist/components/base/label/label.js +7 -14
- package/dist/index.css +1 -1
- package/dist/index.css.map +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 +1 -5
- package/package.json +3 -3
- package/src/components/base/keyset_pagination/keyset_pagination.stories.js +2 -2
- package/src/components/base/keyset_pagination/keyset_pagination.vue +6 -5
- package/src/components/base/label/label.md +0 -1
- package/src/components/base/label/label.scss +14 -23
- package/src/components/base/label/label.spec.js +1 -2
- package/src/components/base/label/label.stories.js +1 -8
- package/src/components/base/label/label.vue +12 -17
- package/src/utils/constants.js +0 -5
- package/translations.json +3 -0
package/dist/tokens/js/tokens.js
CHANGED
package/dist/utils/constants.js
CHANGED
|
@@ -64,10 +64,6 @@ const variantCssColorMap = {
|
|
|
64
64
|
danger: 'gl-text-red-500'
|
|
65
65
|
};
|
|
66
66
|
const targetOptions = ['_self', '_blank', '_parent', '_top', null];
|
|
67
|
-
const labelSizeOptions = {
|
|
68
|
-
default: null,
|
|
69
|
-
sm: 'sm'
|
|
70
|
-
};
|
|
71
67
|
const viewModeOptions = {
|
|
72
68
|
dark: 'dark',
|
|
73
69
|
light: 'light'
|
|
@@ -298,4 +294,4 @@ const loadingIconVariants = {
|
|
|
298
294
|
dots: 'dots'
|
|
299
295
|
};
|
|
300
296
|
|
|
301
|
-
export { COMMA, CONTRAST_LEVELS, HEX_REGEX, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonVariantOptions, colorThemes, columnOptions, datepickerWidthOptionsMap, defaultDateFormat, drawerVariants, dropdownAllowedAutoPlacements, dropdownPlacements, dropdownVariantOptions, focusableTags, formInputWidths, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions,
|
|
297
|
+
export { COMMA, CONTRAST_LEVELS, HEX_REGEX, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonVariantOptions, colorThemes, columnOptions, datepickerWidthOptionsMap, defaultDateFormat, drawerVariants, dropdownAllowedAutoPlacements, dropdownPlacements, dropdownVariantOptions, focusableTags, formInputWidths, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions, loadingIconSizes, loadingIconVariants, 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": "78.
|
|
3
|
+
"version": "78.15.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@gitlab/eslint-plugin": "19.5.0",
|
|
103
103
|
"@gitlab/fonts": "^1.3.0",
|
|
104
104
|
"@gitlab/stylelint-config": "6.1.0",
|
|
105
|
-
"@gitlab/svgs": "3.
|
|
105
|
+
"@gitlab/svgs": "3.97.0",
|
|
106
106
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
107
107
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
108
108
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"babel-jest": "29.0.1",
|
|
132
132
|
"babel-loader": "^8.0.5",
|
|
133
133
|
"bootstrap": "4.6.2",
|
|
134
|
-
"cypress": "13.7.
|
|
134
|
+
"cypress": "13.7.3",
|
|
135
135
|
"cypress-axe": "^1.4.0",
|
|
136
136
|
"cypress-real-events": "^1.11.0",
|
|
137
137
|
"dompurify": "^3.0.0",
|
|
@@ -6,8 +6,8 @@ const generateProps = ({
|
|
|
6
6
|
hasNextPage = true,
|
|
7
7
|
startCursor = 'eyJpZCI6IjE3NTg1ODciLCJyZWxlYXNlZF9hdCI6IjIwMjAtMDgtMjAgMTQ6NDc6MDguNTQ1MjE1MDAwIFVUQyJ9',
|
|
8
8
|
endCursor = 'eyJpZCI6IjEyNjcxNzkiLCJyZWxlYXNlZF9hdCI6IjIwMjAtMDItMTkgMjE6MDA6MDUuODU5NTQ2MDAwIFVUQyJ9',
|
|
9
|
-
prevText
|
|
10
|
-
nextText
|
|
9
|
+
prevText,
|
|
10
|
+
nextText,
|
|
11
11
|
prevButtonLink = '',
|
|
12
12
|
nextButtonLink = '',
|
|
13
13
|
disabled = false,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import GlButton from '../button/button.vue';
|
|
3
3
|
import GlButtonGroup from '../button_group/button_group.vue';
|
|
4
4
|
import GlIcon from '../icon/icon.vue';
|
|
5
|
+
import { translate } from '../../../utils/i18n';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
name: 'GlKeysetPagination',
|
|
@@ -53,12 +54,12 @@ export default {
|
|
|
53
54
|
},
|
|
54
55
|
/**
|
|
55
56
|
* The text that will be rendered inside the "Prev" button.
|
|
56
|
-
* It
|
|
57
|
+
* It's important to provide this parameter since the default text is not translatable.
|
|
57
58
|
*/
|
|
58
59
|
prevText: {
|
|
59
60
|
type: String,
|
|
60
61
|
required: false,
|
|
61
|
-
default: 'Prev',
|
|
62
|
+
default: () => translate('GlKeysetPagination.prevText', 'Prev'),
|
|
62
63
|
},
|
|
63
64
|
/**
|
|
64
65
|
* A link that will be used as the "Prev" button\'s "href" attribute.
|
|
@@ -76,16 +77,16 @@ export default {
|
|
|
76
77
|
navigationLabel: {
|
|
77
78
|
type: String,
|
|
78
79
|
required: false,
|
|
79
|
-
default: 'Pagination',
|
|
80
|
+
default: () => translate('GlKeysetPagination.navigationLabel', 'Pagination'),
|
|
80
81
|
},
|
|
81
82
|
/**
|
|
82
83
|
* The text that will be rendered inside the "Next" button.
|
|
83
|
-
* It
|
|
84
|
+
* It's important to provide this parameter since the default text is not translatable.
|
|
84
85
|
*/
|
|
85
86
|
nextText: {
|
|
86
87
|
type: String,
|
|
87
88
|
required: false,
|
|
88
|
-
default: 'Next',
|
|
89
|
+
default: () => translate('GlKeysetPagination.nextText', 'Next'),
|
|
89
90
|
},
|
|
90
91
|
/**
|
|
91
92
|
* A link that will be used as the "Next" button\'s "href" attribute.
|
|
@@ -16,7 +16,7 @@ $label-close-button: '.gl-label-close.gl-button';
|
|
|
16
16
|
background-color: var(--label-background-color);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
&:focus
|
|
19
|
+
&:has(*:first-child:focus) {
|
|
20
20
|
@include gl-focus($color: var(--label-background-color, $white), $important: true);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -30,7 +30,8 @@ $label-close-button: '.gl-label-close.gl-button';
|
|
|
30
30
|
@include gl-max-w-full;
|
|
31
31
|
|
|
32
32
|
&:focus,
|
|
33
|
-
&:hover
|
|
33
|
+
&:hover,
|
|
34
|
+
&:focus:active {
|
|
34
35
|
@include gl-reset-color;
|
|
35
36
|
@include gl-shadow-none;
|
|
36
37
|
@include gl-outline-none;
|
|
@@ -40,16 +41,18 @@ $label-close-button: '.gl-label-close.gl-button';
|
|
|
40
41
|
.gl-label-text,
|
|
41
42
|
.gl-label-text-scoped {
|
|
42
43
|
@include gl-display-block;
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
padding-block: $gl-spacing-scale-1;
|
|
45
|
+
padding-inline: calc(#{$gl-spacing-scale-3} - 2px);
|
|
45
46
|
@include str-truncated($label-max-width);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
> #{$label-close-button} {
|
|
49
50
|
@include gl-border-0;
|
|
50
51
|
@include gl-display-flex;
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
width: px-to-rem(14px);
|
|
53
|
+
height: px-to-rem(14px);
|
|
54
|
+
margin-left: calc(#{-$gl-spacing-scale-1} - 1px);
|
|
55
|
+
margin-right: calc(#{$gl-spacing-scale-2} - 1px);
|
|
53
56
|
@include gl-p-0;
|
|
54
57
|
@include gl-rounded-full;
|
|
55
58
|
@include gl-shadow-none;
|
|
@@ -72,7 +75,7 @@ $label-close-button: '.gl-label-close.gl-button';
|
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
.gl-icon {
|
|
75
|
-
|
|
78
|
+
vertical-align: -1px;
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
}
|
|
@@ -146,6 +149,8 @@ $label-close-button: '.gl-label-close.gl-button';
|
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
#{$label-close-button} {
|
|
152
|
+
margin-left: calc(#{-$gl-spacing-scale-2} - 2px);
|
|
153
|
+
|
|
149
154
|
&:focus,
|
|
150
155
|
&:hover {
|
|
151
156
|
.gl-icon {
|
|
@@ -155,27 +160,13 @@ $label-close-button: '.gl-label-close.gl-button';
|
|
|
155
160
|
}
|
|
156
161
|
|
|
157
162
|
.gl-label-text {
|
|
158
|
-
@include gl-pr-2;
|
|
159
163
|
background-color: var(--label-background-color);
|
|
160
164
|
}
|
|
161
165
|
|
|
162
166
|
.gl-label-text-scoped {
|
|
163
167
|
@include gl-text-gray-950;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.gl-label-sm {
|
|
170
|
-
.gl-label-text,
|
|
171
|
-
.gl-label-text-scoped {
|
|
172
|
-
@include gl-py-0;
|
|
173
|
-
@include gl-line-height-normal;
|
|
174
|
-
@include gl-font-sm;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
#{$label-close-button} {
|
|
178
|
-
@include gl-mr-1;
|
|
168
|
+
padding-inline-start: calc($gl-spacing-scale-3 - 4px);
|
|
169
|
+
padding-inline-end: $gl-spacing-scale-3;
|
|
179
170
|
}
|
|
180
171
|
}
|
|
181
172
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
-
import CloseButton from '../../shared_components/close_button/close_button.vue';
|
|
3
2
|
import GlLink from '../link/link.vue';
|
|
4
3
|
import GlTooltip from '../tooltip/tooltip.vue';
|
|
5
4
|
import Label from './label.vue';
|
|
@@ -41,7 +40,7 @@ describe('Label component', () => {
|
|
|
41
40
|
const findSubTitle = () => wrapper.find('.gl-label-text-scoped');
|
|
42
41
|
const findTooltip = () => wrapper.findComponent(GlTooltip);
|
|
43
42
|
const findTooltipText = () => findTooltip().text();
|
|
44
|
-
const findCloseButton = () => wrapper.
|
|
43
|
+
const findCloseButton = () => wrapper.find('.gl-label-close');
|
|
45
44
|
|
|
46
45
|
describe('basic label', () => {
|
|
47
46
|
it('renders the label title', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tooltipPlacements } from '../../../utils/constants';
|
|
2
2
|
import GlLabel from './label.vue';
|
|
3
3
|
import readme from './label.md';
|
|
4
4
|
|
|
@@ -6,7 +6,6 @@ const template = `
|
|
|
6
6
|
<div class="gl-display-flex">
|
|
7
7
|
<gl-label
|
|
8
8
|
:background-color="backgroundColor"
|
|
9
|
-
:size="size"
|
|
10
9
|
:title="title"
|
|
11
10
|
:description="description"
|
|
12
11
|
:tooltip-placement="tooltipPlacement"
|
|
@@ -25,7 +24,6 @@ const Template = (args, { argTypes }) => ({
|
|
|
25
24
|
|
|
26
25
|
const generateProps = ({
|
|
27
26
|
title = 'Label title',
|
|
28
|
-
size = labelSizeOptions.default,
|
|
29
27
|
tooltipPlacement = tooltipPlacements.top,
|
|
30
28
|
scoped = false,
|
|
31
29
|
description = '',
|
|
@@ -37,7 +35,6 @@ const generateProps = ({
|
|
|
37
35
|
backgroundColor,
|
|
38
36
|
title,
|
|
39
37
|
description,
|
|
40
|
-
size,
|
|
41
38
|
tooltipPlacement,
|
|
42
39
|
target,
|
|
43
40
|
scoped,
|
|
@@ -71,10 +68,6 @@ export default {
|
|
|
71
68
|
backgroundColor: {
|
|
72
69
|
control: 'color',
|
|
73
70
|
},
|
|
74
|
-
size: {
|
|
75
|
-
options: labelSizeOptions,
|
|
76
|
-
control: 'select',
|
|
77
|
-
},
|
|
78
71
|
tooltipPlacement: {
|
|
79
72
|
options: tooltipPlacements,
|
|
80
73
|
control: 'select',
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
<script>
|
|
3
3
|
import { labelColorOptions } from '../../../utils/constants';
|
|
4
4
|
import { colorFromBackground } from '../../../utils/utils';
|
|
5
|
-
import
|
|
5
|
+
import GlButton from '../button/button.vue';
|
|
6
|
+
import GlIcon from '../icon/icon.vue';
|
|
6
7
|
import GlLink from '../link/link.vue';
|
|
7
8
|
import GlTooltip from '../tooltip/tooltip.vue';
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
name: 'GlLabel',
|
|
11
12
|
components: {
|
|
13
|
+
GlButton,
|
|
14
|
+
GlIcon,
|
|
12
15
|
GlLink,
|
|
13
16
|
GlTooltip,
|
|
14
|
-
CloseButton,
|
|
15
17
|
},
|
|
16
18
|
props: {
|
|
17
19
|
backgroundColor: {
|
|
@@ -29,11 +31,6 @@ export default {
|
|
|
29
31
|
required: false,
|
|
30
32
|
default: '',
|
|
31
33
|
},
|
|
32
|
-
size: {
|
|
33
|
-
type: String,
|
|
34
|
-
required: false,
|
|
35
|
-
default: '',
|
|
36
|
-
},
|
|
37
34
|
tooltipPlacement: {
|
|
38
35
|
type: String,
|
|
39
36
|
required: false,
|
|
@@ -69,7 +66,6 @@ export default {
|
|
|
69
66
|
cssClasses() {
|
|
70
67
|
const textColorVariant = colorFromBackground(this.backgroundColor);
|
|
71
68
|
return {
|
|
72
|
-
'gl-label-sm': this.size === 'sm',
|
|
73
69
|
'gl-label-scoped': this.scoped,
|
|
74
70
|
'gl-label-text-dark': textColorVariant === labelColorOptions.dark,
|
|
75
71
|
'gl-label-text-light': textColorVariant === labelColorOptions.light,
|
|
@@ -78,9 +74,7 @@ export default {
|
|
|
78
74
|
cssVariables() {
|
|
79
75
|
return {
|
|
80
76
|
'--label-background-color': this.backgroundColor,
|
|
81
|
-
'--label-inset-border': `inset 0 0 0 ${this.
|
|
82
|
-
this.backgroundColor
|
|
83
|
-
}`,
|
|
77
|
+
'--label-inset-border': `inset 0 0 0 2px ${this.backgroundColor}`,
|
|
84
78
|
};
|
|
85
79
|
},
|
|
86
80
|
scopedKey() {
|
|
@@ -89,9 +83,6 @@ export default {
|
|
|
89
83
|
scopedValue() {
|
|
90
84
|
return this.title.slice(this.splitScopedLabelIndex + 2);
|
|
91
85
|
},
|
|
92
|
-
closeIconSize() {
|
|
93
|
-
return this.size === 'sm' ? 12 : 16;
|
|
94
|
-
},
|
|
95
86
|
labelComponent() {
|
|
96
87
|
return this.target ? GlLink : 'span';
|
|
97
88
|
},
|
|
@@ -143,14 +134,18 @@ export default {
|
|
|
143
134
|
{{ scopedValue }}
|
|
144
135
|
</span>
|
|
145
136
|
</component>
|
|
146
|
-
<
|
|
137
|
+
<gl-button
|
|
147
138
|
v-if="showCloseButton"
|
|
148
139
|
class="gl-label-close gl-p-0!"
|
|
149
|
-
|
|
140
|
+
category="tertiary"
|
|
141
|
+
size="small"
|
|
150
142
|
variant="reset"
|
|
143
|
+
aria-label="Remove label"
|
|
151
144
|
:disabled="disabled"
|
|
152
145
|
@click="onClose"
|
|
153
|
-
|
|
146
|
+
>
|
|
147
|
+
<gl-icon name="close-xs" :size="12" />
|
|
148
|
+
</gl-button>
|
|
154
149
|
<gl-tooltip
|
|
155
150
|
v-if="description"
|
|
156
151
|
:target="() => tooltipTarget"
|
package/src/utils/constants.js
CHANGED
|
@@ -78,11 +78,6 @@ export const variantCssColorMap = {
|
|
|
78
78
|
|
|
79
79
|
export const targetOptions = ['_self', '_blank', '_parent', '_top', null];
|
|
80
80
|
|
|
81
|
-
export const labelSizeOptions = {
|
|
82
|
-
default: null,
|
|
83
|
-
sm: 'sm',
|
|
84
|
-
};
|
|
85
|
-
|
|
86
81
|
export const viewModeOptions = {
|
|
87
82
|
dark: 'dark',
|
|
88
83
|
light: 'light',
|
package/translations.json
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"GlSorting.sortDescending": "Sort direction: descending",
|
|
5
5
|
"GlSearchBoxByType.clearButtonTitle": "Clear",
|
|
6
6
|
"GlSearchBoxByType.input.placeholder": "Search",
|
|
7
|
+
"GlKeysetPagination.prevText": "Prev",
|
|
8
|
+
"GlKeysetPagination.navigationLabel": "Pagination",
|
|
9
|
+
"GlKeysetPagination.nextText": "Next",
|
|
7
10
|
"GlBreadcrumb.showMoreLabel": "Show more breadcrumbs",
|
|
8
11
|
"GlCollapsibleListbox.srOnlyResultsLabel": "Results count"
|
|
9
12
|
}
|