@gitlab/ui 43.16.0 → 43.17.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/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +4 -4
- package/src/components/base/button/button.spec.js +1 -1
- package/src/components/base/datepicker/datepicker.spec.js +1 -1
- package/src/components/base/dropdown/dropdown.spec.js +1 -1
- package/src/components/base/form/form_checkbox/form_checkbox.scss +1 -1
- package/src/components/base/form/form_checkbox/form_checkbox.stories.js +20 -8
- package/src/components/base/form/form_radio/form_radio.stories.js +30 -17
- package/src/components/base/link/link.spec.js +1 -1
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +1 -1
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +4 -4
- package/src/components/base/new_dropdowns/listbox/listbox_item.spec.js +2 -2
- package/src/components/charts/area/area.spec.js +3 -3
- package/src/components/charts/line/line.spec.js +3 -3
- package/src/directives/outside/outside.spec.js +1 -1
- package/src/scss/utilities.scss +10 -0
- package/src/scss/utility-mixins/spacing.scss +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.17.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -112,9 +112,9 @@
|
|
|
112
112
|
"glob": "^7.2.0",
|
|
113
113
|
"identity-obj-proxy": "^3.0.0",
|
|
114
114
|
"inquirer-select-directory": "^1.2.0",
|
|
115
|
-
"jest": "^29.0.
|
|
116
|
-
"jest-circus": "29.0.
|
|
117
|
-
"jest-environment-jsdom": "29.0.
|
|
115
|
+
"jest": "^29.0.3",
|
|
116
|
+
"jest-circus": "29.0.3",
|
|
117
|
+
"jest-environment-jsdom": "29.0.3",
|
|
118
118
|
"jest-serializer-vue": "^2.0.2",
|
|
119
119
|
"markdownlint-cli": "^0.29.0",
|
|
120
120
|
"mockdate": "^2.0.5",
|
|
@@ -174,7 +174,7 @@ describe('button component', () => {
|
|
|
174
174
|
|
|
175
175
|
// GlSafeLinkDirective is actually responsible to handle the unsafe URLs
|
|
176
176
|
// and GlButton uses this directive to make all the links secure by default
|
|
177
|
-
it('should set href to blank
|
|
177
|
+
it('should set href to blank', () => {
|
|
178
178
|
buildWrapper({
|
|
179
179
|
propsData: {
|
|
180
180
|
href: unsafeUrl,
|
|
@@ -35,7 +35,7 @@ describe('datepicker component', () => {
|
|
|
35
35
|
jest.setSystemTime(currentDate.getTime());
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
it("does not set default date when 'value' and 'defaultDate' props aren't set
|
|
38
|
+
it("does not set default date when 'value' and 'defaultDate' props aren't set", () => {
|
|
39
39
|
mountWithOptions();
|
|
40
40
|
|
|
41
41
|
expect(Pikaday).toHaveBeenCalled();
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
.custom-control-input:checked:disabled ~ .custom-control-label,
|
|
137
|
-
.custom-control-input:indeterminate:disabled ~ .custom-control-label {
|
|
137
|
+
.custom-control-input[type='checkbox']:indeterminate:disabled ~ .custom-control-label {
|
|
138
138
|
&::before {
|
|
139
139
|
@include gl-bg-gray-100;
|
|
140
140
|
@include gl-border-gray-100;
|
|
@@ -6,22 +6,34 @@ const components = {
|
|
|
6
6
|
GlFormCheckboxGroup,
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
const data = () => ({
|
|
10
|
+
selected: ['checked-option', 'checked-disabled-option'],
|
|
11
|
+
indeterminate: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
9
14
|
const template = `
|
|
10
|
-
|
|
15
|
+
<div>
|
|
16
|
+
<gl-form-checkbox-group v-model="selected">
|
|
17
|
+
<gl-form-checkbox value="option">Option</gl-form-checkbox>
|
|
18
|
+
<gl-form-checkbox value="slot-option">
|
|
19
|
+
Slot option
|
|
20
|
+
<template #help> With help text </template>
|
|
21
|
+
</gl-form-checkbox>
|
|
22
|
+
<gl-form-checkbox value="checked-option">Checked option</gl-form-checkbox>
|
|
23
|
+
<gl-form-checkbox value="checked-disabled-option" :disabled="true">Checked disabled option</gl-form-checkbox>
|
|
24
|
+
<gl-form-checkbox value="disabled-option" :disabled="true">Disabled option</gl-form-checkbox>
|
|
11
25
|
<template #first>
|
|
12
|
-
<gl-form-checkbox value="
|
|
13
|
-
Slot option with help text
|
|
14
|
-
<template #help>
|
|
15
|
-
Help text
|
|
16
|
-
</template>
|
|
17
|
-
</gl-form-checkbox>
|
|
26
|
+
<gl-form-checkbox value="first">First</gl-form-checkbox>
|
|
18
27
|
</template>
|
|
19
|
-
<gl-form-checkbox value="Last option">Last option</gl-form-checkbox>
|
|
20
28
|
</gl-form-checkbox-group>
|
|
29
|
+
<gl-form-checkbox value="indeterminate-option" :indeterminate="indeterminate">Indeterminate option</gl-form-checkbox>
|
|
30
|
+
<gl-form-checkbox value="indeterminate-disabled-option" :indeterminate="indeterminate" :disabled="true">Indeterminate disabled option</gl-form-checkbox>
|
|
31
|
+
</div>
|
|
21
32
|
`;
|
|
22
33
|
|
|
23
34
|
const Template = () => ({
|
|
24
35
|
components,
|
|
36
|
+
data,
|
|
25
37
|
template,
|
|
26
38
|
});
|
|
27
39
|
|
|
@@ -2,31 +2,44 @@ import { GlFormRadio } from '../../../../index';
|
|
|
2
2
|
import readme from './form_radio.md';
|
|
3
3
|
|
|
4
4
|
const defaultOptions = [
|
|
5
|
-
{ value: '
|
|
6
|
-
{ value: '
|
|
7
|
-
{ value: '
|
|
5
|
+
{ value: 'Option', name: 'radio-group' },
|
|
6
|
+
{ value: 'Slot option', name: 'radio-group', slot: 'With help text' },
|
|
7
|
+
{ value: 'Checked option', name: 'radio-group' },
|
|
8
|
+
{
|
|
9
|
+
value: 'Checked disabled option',
|
|
10
|
+
disabled: true,
|
|
11
|
+
name: 'last-radio-group',
|
|
12
|
+
checked: 'Checked disabled option',
|
|
13
|
+
},
|
|
14
|
+
{ value: 'Disabled option', disabled: true, name: 'radio-group' },
|
|
15
|
+
{ value: 'Indeterminate option', name: 'indeterminate-radio-group' },
|
|
16
|
+
{ value: 'Indeterminate disabled option', disabled: true, name: 'indeterminate-radio-group' },
|
|
8
17
|
];
|
|
9
18
|
|
|
10
|
-
const
|
|
11
|
-
|
|
19
|
+
const template = `
|
|
20
|
+
<div>
|
|
21
|
+
<gl-form-radio
|
|
22
|
+
v-for="option in options"
|
|
23
|
+
:key="option.value"
|
|
24
|
+
:checked="option.checked || checked"
|
|
25
|
+
:disabled="option.disabled"
|
|
26
|
+
:name="option.name || name"
|
|
27
|
+
:value="option.value"
|
|
28
|
+
>
|
|
29
|
+
{{ option.value }}
|
|
30
|
+
<template v-if="option.slot" #help>{{ option.slot }}</template>
|
|
31
|
+
</gl-form-radio>
|
|
32
|
+
</div>
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const generateProps = ({ checked = 'Checked option' } = {}) => ({
|
|
12
36
|
checked,
|
|
13
37
|
});
|
|
14
38
|
|
|
15
39
|
const Template = (args) => ({
|
|
16
40
|
components: { GlFormRadio },
|
|
17
41
|
props: Object.keys(args),
|
|
18
|
-
template
|
|
19
|
-
<div>
|
|
20
|
-
<gl-form-radio
|
|
21
|
-
v-for="option in options"
|
|
22
|
-
:key="option.value"
|
|
23
|
-
:checked="checked"
|
|
24
|
-
:value="option.value"
|
|
25
|
-
:disabled="option.disabled"
|
|
26
|
-
:name="name"
|
|
27
|
-
>{{ option.text }}</gl-form-radio>
|
|
28
|
-
</div>
|
|
29
|
-
`,
|
|
42
|
+
template,
|
|
30
43
|
data() {
|
|
31
44
|
return {
|
|
32
45
|
options: defaultOptions,
|
|
@@ -64,7 +64,7 @@ describe('link component', () => {
|
|
|
64
64
|
|
|
65
65
|
// GlSafeLinkDirective is actually responsible to handle the unsafe URLs
|
|
66
66
|
// and GlLink uses this directive to make all the links secure by default
|
|
67
|
-
it('should set href to blank
|
|
67
|
+
it('should set href to blank', () => {
|
|
68
68
|
createWrapper({
|
|
69
69
|
propsData: {
|
|
70
70
|
href: unsafeUrl,
|
|
@@ -135,7 +135,7 @@ describe('base dropdown', () => {
|
|
|
135
135
|
buildWrapper();
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
it('should toggle menu visibility on toggle button click
|
|
138
|
+
it('should toggle menu visibility on toggle button click', async () => {
|
|
139
139
|
const toggle = findDropdownToggle();
|
|
140
140
|
const menu = findDropdownMenu();
|
|
141
141
|
|
|
@@ -52,7 +52,7 @@ describe('GlListbox', () => {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
describe('ARIA attributes', () => {
|
|
55
|
-
it('should provide `toggleId` to the base dropdown and reference it in`aria-labelledby` attribute of the list container`
|
|
55
|
+
it('should provide `toggleId` to the base dropdown and reference it in`aria-labelledby` attribute of the list container`', async () => {
|
|
56
56
|
await buildWrapper();
|
|
57
57
|
expect(findBaseDropdown().props('toggleId')).toBe(
|
|
58
58
|
findListContainer().attributes('aria-labelledby')
|
|
@@ -70,7 +70,7 @@ describe('GlListbox', () => {
|
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
it('should render items as selected when `selected` provided
|
|
73
|
+
it('should render items as selected when `selected` provided', () => {
|
|
74
74
|
expect(findListboxItems().at(1).props('isSelected')).toBe(true);
|
|
75
75
|
expect(findListboxItems().at(2).props('isSelected')).toBe(true);
|
|
76
76
|
});
|
|
@@ -106,7 +106,7 @@ describe('GlListbox', () => {
|
|
|
106
106
|
expect(wrapper).toHaveLoggedVueErrors();
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
it('should render item as selected when `selected` provided
|
|
109
|
+
it('should render item as selected when `selected` provided', () => {
|
|
110
110
|
expect(findListboxItems().at(1).props('isSelected')).toBe(true);
|
|
111
111
|
});
|
|
112
112
|
|
|
@@ -124,7 +124,7 @@ describe('GlListbox', () => {
|
|
|
124
124
|
buildWrapper({ selected, items: mockGroups });
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
it('should render item as selected when `selected` provided
|
|
127
|
+
it('should render item as selected when `selected` provided', () => {
|
|
128
128
|
expect(findListboxItems().at(3).props('isSelected')).toBe(true);
|
|
129
129
|
});
|
|
130
130
|
|
|
@@ -17,7 +17,7 @@ describe('GlListboxItem', () => {
|
|
|
17
17
|
const findCheckIcon = () => findItem().findComponent(GLIcon);
|
|
18
18
|
|
|
19
19
|
describe('toggleSelection', () => {
|
|
20
|
-
describe('when selected
|
|
20
|
+
describe('when selected', () => {
|
|
21
21
|
beforeEach(() => {
|
|
22
22
|
buildWrapper({ isSelected: true });
|
|
23
23
|
});
|
|
@@ -48,7 +48,7 @@ describe('GlListboxItem', () => {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
describe('when not selected
|
|
51
|
+
describe('when not selected', () => {
|
|
52
52
|
beforeEach(() => {
|
|
53
53
|
buildWrapper({ isSelected: false });
|
|
54
54
|
});
|
|
@@ -46,7 +46,7 @@ describe('area component', () => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
describe('Annotations tooltips', () => {
|
|
49
|
-
it('are hidden by default
|
|
49
|
+
it('are hidden by default', async () => {
|
|
50
50
|
createShallowWrapper();
|
|
51
51
|
|
|
52
52
|
await wrapper.vm.$nextTick();
|
|
@@ -54,7 +54,7 @@ describe('area component', () => {
|
|
|
54
54
|
expect(findAnnotationsTooltip().exists()).toBe(false);
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
it('are displayed if passed via annotations props
|
|
57
|
+
it('are displayed if passed via annotations props', async () => {
|
|
58
58
|
createShallowWrapper({
|
|
59
59
|
annotations: [
|
|
60
60
|
{
|
|
@@ -69,7 +69,7 @@ describe('area component', () => {
|
|
|
69
69
|
expect(findAnnotationsTooltip().exists()).toBe(true);
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
it('are displayed if passed via option props
|
|
72
|
+
it('are displayed if passed via option props', async () => {
|
|
73
73
|
createShallowWrapper({
|
|
74
74
|
option: {
|
|
75
75
|
series: [
|
|
@@ -45,7 +45,7 @@ describe('line component', () => {
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
describe('Annotations tooltips', () => {
|
|
48
|
-
it('are hidden by default
|
|
48
|
+
it('are hidden by default', async () => {
|
|
49
49
|
createShallowWrapper();
|
|
50
50
|
|
|
51
51
|
await wrapper.vm.$nextTick();
|
|
@@ -53,7 +53,7 @@ describe('line component', () => {
|
|
|
53
53
|
expect(findAnnotationsTooltip().exists()).toBe(false);
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
it('are displayed if passed via annotations props
|
|
56
|
+
it('are displayed if passed via annotations props', async () => {
|
|
57
57
|
createShallowWrapper({
|
|
58
58
|
annotations: [
|
|
59
59
|
{
|
|
@@ -68,7 +68,7 @@ describe('line component', () => {
|
|
|
68
68
|
expect(findAnnotationsTooltip().exists()).toBe(true);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
it('are displayed if passed via option props
|
|
71
|
+
it('are displayed if passed via option props', async () => {
|
|
72
72
|
createShallowWrapper({
|
|
73
73
|
option: {
|
|
74
74
|
series: [
|
|
@@ -252,7 +252,7 @@ describe('outside directive', () => {
|
|
|
252
252
|
});
|
|
253
253
|
});
|
|
254
254
|
|
|
255
|
-
describe('click event fired before directive binding
|
|
255
|
+
describe('click event fired before directive binding', () => {
|
|
256
256
|
// This *attempts* to simulate something like the following situation:
|
|
257
257
|
//
|
|
258
258
|
// <button @click="show = true">Show</button>
|
package/src/scss/utilities.scss
CHANGED
|
@@ -6308,6 +6308,16 @@
|
|
|
6308
6308
|
margin-left: #{$gl-spacing-scale-5} !important;
|
|
6309
6309
|
}
|
|
6310
6310
|
}
|
|
6311
|
+
.gl-gap-y-3 {
|
|
6312
|
+
> * + * {
|
|
6313
|
+
margin-top: #{$gl-spacing-scale-3};
|
|
6314
|
+
}
|
|
6315
|
+
}
|
|
6316
|
+
.gl-gap-y-3\! {
|
|
6317
|
+
> * + * {
|
|
6318
|
+
margin-top: #{$gl-spacing-scale-3} !important;
|
|
6319
|
+
}
|
|
6320
|
+
}
|
|
6311
6321
|
.gl-gap-3 {
|
|
6312
6322
|
gap: $gl-spacing-scale-3;
|
|
6313
6323
|
}
|