@gitlab/ui 40.2.1 → 40.4.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 +22 -0
- package/dist/components/base/alert/alert.js +1 -0
- package/dist/components/base/avatar/avatar.js +27 -11
- package/dist/components/base/badge/badge.js +1 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +1 -0
- package/dist/components/base/button/button.js +1 -0
- package/dist/components/base/card/card.js +1 -0
- package/dist/components/base/carousel/carousel.js +1 -0
- package/dist/components/base/collapse/collapse.js +1 -0
- package/dist/components/base/drawer/drawer.js +1 -0
- package/dist/components/base/dropdown/dropdown.js +2 -0
- package/dist/components/base/form/form.js +1 -0
- package/dist/components/base/icon/icon.js +2 -0
- package/dist/components/base/label/label.js +1 -0
- package/dist/components/base/link/link.js +1 -0
- package/dist/components/base/markdown/markdown.js +1 -0
- package/dist/components/base/modal/modal.js +2 -0
- package/dist/components/base/pagination/pagination.js +2 -0
- package/dist/components/base/popover/popover.js +1 -0
- package/dist/components/base/table/table.js +2 -0
- package/dist/components/base/tabs/tabs/tabs.js +2 -0
- package/dist/components/base/token/token.js +1 -0
- package/dist/components/base/tooltip/tooltip.js +1 -0
- package/dist/components/charts/area/area.js +1 -15
- package/dist/components/charts/bar/bar.js +1 -0
- package/dist/components/charts/chart/chart.js +1 -0
- package/dist/components/charts/column/column.js +1 -0
- package/dist/components/charts/heatmap/heatmap.js +1 -0
- package/dist/components/charts/legend/legend.js +1 -0
- package/dist/components/charts/line/line.js +1 -17
- package/dist/components/charts/sparkline/sparkline.js +2 -0
- package/dist/components/charts/tooltip/tooltip.js +1 -0
- package/dist/components/utilities/intersperse/intersperse.js +2 -0
- package/dist/components/utilities/truncate/truncate.js +1 -0
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/dist/utils/test_utils.js +3 -1
- package/package.json +2 -2
- package/src/components/base/alert/alert.vue +1 -0
- package/src/components/base/avatar/avatar.scss +143 -7
- package/src/components/base/avatar/avatar.spec.js +32 -6
- package/src/components/base/avatar/avatar.stories.js +16 -0
- package/src/components/base/avatar/avatar.vue +30 -11
- package/src/components/base/badge/badge.vue +1 -0
- package/src/components/base/breadcrumb/breadcrumb.spec.js +1 -1
- package/src/components/base/breadcrumb/breadcrumb.vue +1 -0
- package/src/components/base/button/button.vue +1 -0
- package/src/components/base/card/card.vue +1 -0
- package/src/components/base/carousel/carousel.vue +1 -0
- package/src/components/base/collapse/collapse.vue +1 -0
- package/src/components/base/datepicker/datepicker.vue +1 -0
- package/src/components/base/drawer/drawer.vue +1 -0
- package/src/components/base/dropdown/dropdown.vue +1 -0
- package/src/components/base/form/form.vue +1 -0
- package/src/components/base/form/form_group/form_group.scss +4 -1
- package/src/components/base/form/form_group/form_group.stories.js +1 -1
- package/src/components/base/icon/icon.spec.js +1 -1
- package/src/components/base/icon/icon.vue +1 -0
- package/src/components/base/keyset_pagination/keyset_pagination.spec.js +1 -1
- package/src/components/base/label/label.vue +1 -0
- package/src/components/base/link/link.vue +1 -0
- package/src/components/base/markdown/markdown.scss +32 -0
- package/src/components/base/markdown/markdown.stories.js +6 -3
- package/src/components/base/markdown/markdown.vue +1 -0
- package/src/components/base/markdown/markdown_typescale_demo.html +46 -0
- package/src/components/base/modal/modal.spec.js +1 -1
- package/src/components/base/modal/modal.vue +1 -0
- package/src/components/base/new_dropdowns/listbox/listbox.vue +1 -0
- package/src/components/base/paginated_list/paginated_list.vue +1 -1
- package/src/components/base/pagination/pagination.spec.js +1 -1
- package/src/components/base/pagination/pagination.vue +1 -0
- package/src/components/base/path/path.vue +1 -0
- package/src/components/base/popover/popover.vue +1 -0
- package/src/components/base/search_box_by_click/search_box_by_click.spec.js +1 -1
- package/src/components/base/search_box_by_click/search_box_by_click.vue +2 -2
- package/src/components/base/search_box_by_type/search_box_by_type.spec.js +1 -1
- package/src/components/base/table/table.vue +1 -0
- package/src/components/base/tabs/tab/tab.vue +1 -0
- package/src/components/base/tabs/tabs/scrollable_tabs.spec.js +1 -1
- package/src/components/base/tabs/tabs/tabs.vue +1 -0
- package/src/components/base/toggle/toggle.vue +1 -0
- package/src/components/base/token/token.vue +1 -0
- package/src/components/base/token_selector/token_container.spec.js +1 -1
- package/src/components/base/tooltip/tooltip.vue +1 -0
- package/src/components/charts/area/area.spec.js +2 -3
- package/src/components/charts/area/area.vue +1 -0
- package/src/components/charts/bar/bar.spec.js +2 -2
- package/src/components/charts/bar/bar.vue +1 -0
- package/src/components/charts/chart/chart.spec.js +1 -1
- package/src/components/charts/chart/chart.vue +1 -0
- package/src/components/charts/column/column.vue +1 -0
- package/src/components/charts/column/column_chart.spec.js +2 -2
- package/src/components/charts/gauge/gauge.spec.js +1 -1
- package/src/components/charts/gauge/gauge.vue +1 -0
- package/src/components/charts/heatmap/heatmap.spec.js +2 -2
- package/src/components/charts/heatmap/heatmap.vue +1 -0
- package/src/components/charts/legend/legend.spec.js +1 -1
- package/src/components/charts/legend/legend.vue +1 -0
- package/src/components/charts/line/line.spec.js +2 -4
- package/src/components/charts/line/line.vue +1 -0
- package/src/components/charts/sparkline/sparkline.spec.js +2 -2
- package/src/components/charts/sparkline/sparkline.vue +1 -0
- package/src/components/charts/stacked_column/stacked_column.spec.js +3 -4
- package/src/components/charts/tooltip/tooltip.spec.js +1 -1
- package/src/components/charts/tooltip/tooltip.vue +1 -0
- package/src/components/regions/empty_state/empty_state.spec.js +1 -1
- package/src/components/utilities/animated_number/animated_number.spec.js +1 -1
- package/src/components/utilities/intersection_observer/intersection_observer.spec.js +1 -1
- package/src/components/utilities/intersperse/intersperse.vue +1 -0
- package/src/components/utilities/sprintf/sprintf.vue +1 -0
- package/src/components/utilities/truncate/truncate.spec.js +1 -1
- package/src/components/utilities/truncate/truncate.vue +1 -0
- package/src/directives/hover_load/hover_load.spec.js +3 -1
- package/src/directives/outside/outside.spec.js +4 -1
- package/src/directives/resize_observer/resize_observer.spec.js +1 -1
- package/src/scss/utilities.scss +18 -0
- package/src/scss/utility-mixins/box-shadow.scss +9 -0
- package/src/utils/test_utils.js +4 -1
package/dist/utils/test_utils.js
CHANGED
|
@@ -7,7 +7,9 @@ function setStoryTimeout(fn, timeout) {
|
|
|
7
7
|
} // adopted this method from Bootstraps utils
|
|
8
8
|
// https://github.com/bootstrap-vue/bootstrap-vue/blob/2fd03f0b1d0cc41f9930078ba8b1c16b10e4ac2f/tests/utils.js#L6
|
|
9
9
|
|
|
10
|
-
const waitForAnimationFrame = () => new Promise(resolve =>
|
|
10
|
+
const waitForAnimationFrame = () => new Promise(resolve => {
|
|
11
|
+
requestAnimationFrame(resolve);
|
|
12
|
+
});
|
|
11
13
|
const getResetAnimationsCSS = () => `
|
|
12
14
|
*, *::after, *::before {
|
|
13
15
|
-webkit-transition: none !important;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.4.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@arkweid/lefthook": "0.7.7",
|
|
82
82
|
"@babel/core": "^7.10.2",
|
|
83
83
|
"@babel/preset-env": "^7.10.2",
|
|
84
|
-
"@gitlab/eslint-plugin": "12.0
|
|
84
|
+
"@gitlab/eslint-plugin": "12.2.0",
|
|
85
85
|
"@gitlab/stylelint-config": "4.0.0",
|
|
86
86
|
"@gitlab/svgs": "2.14.0",
|
|
87
87
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
$gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $green-50, $orange-50,
|
|
2
2
|
$gray-50;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
@mixin gl-avatar {
|
|
5
5
|
@include gl-border-1;
|
|
6
6
|
@include gl-border-solid;
|
|
7
7
|
@include gl-border-gray-a-08;
|
|
@@ -9,7 +9,7 @@ $gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $gree
|
|
|
9
9
|
@include gl-flex-shrink-0;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
@mixin gl-avatar-s16 {
|
|
13
13
|
@include gl-w-5;
|
|
14
14
|
@include gl-h-5;
|
|
15
15
|
@include gl-font-sm;
|
|
@@ -17,7 +17,7 @@ $gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $gree
|
|
|
17
17
|
@include gl-rounded-small;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
@mixin gl-avatar-s24 {
|
|
21
21
|
@include gl-w-6;
|
|
22
22
|
@include gl-h-6;
|
|
23
23
|
@include gl-font-sm;
|
|
@@ -25,7 +25,7 @@ $gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $gree
|
|
|
25
25
|
@include gl-rounded-base;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
@mixin gl-avatar-s32 {
|
|
29
29
|
@include gl-w-7;
|
|
30
30
|
@include gl-h-7;
|
|
31
31
|
@include gl-font-base;
|
|
@@ -33,7 +33,7 @@ $gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $gree
|
|
|
33
33
|
@include gl-rounded-base;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
@mixin gl-avatar-s48 {
|
|
37
37
|
@include gl-w-9;
|
|
38
38
|
@include gl-h-9;
|
|
39
39
|
@include gl-font-size-h2;
|
|
@@ -41,7 +41,7 @@ $gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $gree
|
|
|
41
41
|
@include gl-rounded-lg;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
@mixin gl-avatar-s64 {
|
|
45
45
|
@include gl-w-11;
|
|
46
46
|
@include gl-h-11;
|
|
47
47
|
@include gl-font-size-h-display;
|
|
@@ -49,7 +49,7 @@ $gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $gree
|
|
|
49
49
|
@include gl-rounded-lg;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
@mixin gl-avatar-s96 {
|
|
53
53
|
@include gl-w-13;
|
|
54
54
|
@include gl-h-13;
|
|
55
55
|
@include gl-font-size-h-display-xl;
|
|
@@ -57,6 +57,142 @@ $gl-avatar-identicon-bgs: $red-50, $purple-50, $theme-indigo-50, $blue-50, $gree
|
|
|
57
57
|
@include gl-rounded-lg;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.gl-avatar {
|
|
61
|
+
@include gl-avatar;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.gl-avatar-s16 {
|
|
65
|
+
@include gl-avatar-s16;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.gl-avatar-s24 {
|
|
69
|
+
@include gl-avatar-s24;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.gl-avatar-s32 {
|
|
73
|
+
@include gl-avatar-s32;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.gl-avatar-s48 {
|
|
77
|
+
@include gl-avatar-s48;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.gl-avatar-s64 {
|
|
81
|
+
@include gl-avatar-s64;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.gl-avatar-s96 {
|
|
85
|
+
@include gl-avatar-s96;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.gl-sm-avatar-s16 {
|
|
89
|
+
@include gl-media-breakpoint-up(sm) {
|
|
90
|
+
@include gl-avatar-s16;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.gl-md-avatar-s16 {
|
|
95
|
+
@include gl-media-breakpoint-up(md) {
|
|
96
|
+
@include gl-avatar-s16;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.gl-lg-avatar-s16 {
|
|
101
|
+
@include gl-media-breakpoint-up(lg) {
|
|
102
|
+
@include gl-avatar-s16;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.gl-sm-avatar-s24 {
|
|
107
|
+
@include gl-media-breakpoint-up(sm) {
|
|
108
|
+
@include gl-avatar-s24;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.gl-md-avatar-s24 {
|
|
113
|
+
@include gl-media-breakpoint-up(md) {
|
|
114
|
+
@include gl-avatar-s24;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.gl-lg-avatar-s24 {
|
|
119
|
+
@include gl-media-breakpoint-up(lg) {
|
|
120
|
+
@include gl-avatar-s24;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.gl-sm-avatar-s32 {
|
|
125
|
+
@include gl-media-breakpoint-up(sm) {
|
|
126
|
+
@include gl-avatar-s32;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.gl-md-avatar-s32 {
|
|
131
|
+
@include gl-media-breakpoint-up(md) {
|
|
132
|
+
@include gl-avatar-s32;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.gl-lg-avatar-s32 {
|
|
137
|
+
@include gl-media-breakpoint-up(lg) {
|
|
138
|
+
@include gl-avatar-s32;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.gl-sm-avatar-s48 {
|
|
143
|
+
@include gl-media-breakpoint-up(sm) {
|
|
144
|
+
@include gl-avatar-s48;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.gl-md-avatar-s48 {
|
|
149
|
+
@include gl-media-breakpoint-up(md) {
|
|
150
|
+
@include gl-avatar-s48;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.gl-lg-avatar-s48 {
|
|
155
|
+
@include gl-media-breakpoint-up(lg) {
|
|
156
|
+
@include gl-avatar-s48;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.gl-sm-avatar-s64 {
|
|
161
|
+
@include gl-media-breakpoint-up(sm) {
|
|
162
|
+
@include gl-avatar-s64;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.gl-md-avatar-s64 {
|
|
167
|
+
@include gl-media-breakpoint-up(md) {
|
|
168
|
+
@include gl-avatar-s64;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.gl-lg-avatar-s64 {
|
|
173
|
+
@include gl-media-breakpoint-up(lg) {
|
|
174
|
+
@include gl-avatar-s64;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.gl-sm-avatar-s96 {
|
|
179
|
+
@include gl-media-breakpoint-up(sm) {
|
|
180
|
+
@include gl-avatar-s96;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.gl-md-avatar-s96 {
|
|
185
|
+
@include gl-media-breakpoint-up(md) {
|
|
186
|
+
@include gl-avatar-s96;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.gl-lg-avatar-s96 {
|
|
191
|
+
@include gl-media-breakpoint-up(lg) {
|
|
192
|
+
@include gl-avatar-s96;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
60
196
|
.gl-avatar-circle {
|
|
61
197
|
@include gl-rounded-full;
|
|
62
198
|
}
|
|
@@ -18,16 +18,42 @@ describe('GlAvatar', () => {
|
|
|
18
18
|
expect(wrapper.props('size')).toBe(avatarSizeOptions[1]);
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
describe('when number is passed', () => {
|
|
22
|
+
it.each([96, 64, 48, 32, 24, 16])('accepts size %s', (size) => {
|
|
23
|
+
createWrapper({ size });
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
expect(wrapper.props('size')).toBe(size);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it.each([12, 28, 36, 54, 98])('displays an error for size %s', (size) => {
|
|
29
|
+
createWrapper({ size });
|
|
30
|
+
|
|
31
|
+
expect(wrapper).toHaveLoggedVueErrors();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('adds correct CSS class to avatar', () => {
|
|
35
|
+
createWrapper({ size: 16 });
|
|
36
|
+
|
|
37
|
+
expect(wrapper.classes()).toContain('gl-avatar-s16');
|
|
38
|
+
});
|
|
25
39
|
});
|
|
26
40
|
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
describe('when object is passed', () => {
|
|
42
|
+
it('displays error if any of the sizes are invalid', () => {
|
|
43
|
+
createWrapper({ size: { default: 16, md: 32, lg: 65 } });
|
|
44
|
+
|
|
45
|
+
expect(wrapper).toHaveLoggedVueErrors();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('adds correct CSS classes to avatar', () => {
|
|
49
|
+
createWrapper({ size: { default: 16, md: 32, lg: 64 } });
|
|
29
50
|
|
|
30
|
-
|
|
51
|
+
expect(wrapper.classes()).toContain(
|
|
52
|
+
'gl-avatar-s16',
|
|
53
|
+
'gl-md-avatar-s32',
|
|
54
|
+
'gl-lg-avatar-s64'
|
|
55
|
+
);
|
|
56
|
+
});
|
|
31
57
|
});
|
|
32
58
|
});
|
|
33
59
|
});
|
|
@@ -59,6 +59,22 @@ export const Image = (args, { argTypes }) => ({
|
|
|
59
59
|
});
|
|
60
60
|
Image.args = generateImageProps();
|
|
61
61
|
|
|
62
|
+
export const ResponsiveImage = (args, { argTypes }) => ({
|
|
63
|
+
components,
|
|
64
|
+
props: Object.keys(argTypes),
|
|
65
|
+
template: `
|
|
66
|
+
<gl-avatar
|
|
67
|
+
:size="size"
|
|
68
|
+
:shape="shape"
|
|
69
|
+
src="https://about.gitlab.com/images/press/gitlab-summit-south-africa.jpg"
|
|
70
|
+
/>
|
|
71
|
+
`,
|
|
72
|
+
});
|
|
73
|
+
ResponsiveImage.args = generateImageProps({ size: { default: 24, sm: 32, md: 48, lg: 96 } });
|
|
74
|
+
ResponsiveImage.argTypes = {
|
|
75
|
+
size: { control: 'object' },
|
|
76
|
+
};
|
|
77
|
+
|
|
62
78
|
export const ProjectFallback = (args, { argTypes }) => ({
|
|
63
79
|
components,
|
|
64
80
|
props: Object.keys(argTypes),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
<!-- eslint-disable vue/multi-word-component-names -->
|
|
1
2
|
<script>
|
|
3
|
+
import { isNumber } from 'lodash';
|
|
2
4
|
import { avatarShapeOptions, avatarSizeOptions } from '../../../utils/constants';
|
|
3
5
|
import { getAvatarChar } from '../../../utils/string_utils';
|
|
4
6
|
|
|
@@ -27,18 +29,24 @@ export default {
|
|
|
27
29
|
default: 'avatar',
|
|
28
30
|
},
|
|
29
31
|
size: {
|
|
30
|
-
type: Number,
|
|
32
|
+
type: [Number, Object],
|
|
31
33
|
required: false,
|
|
32
34
|
default: avatarSizeOptions[1],
|
|
33
35
|
validator: (value) => {
|
|
34
|
-
const
|
|
36
|
+
const sizes = isNumber(value) ? [value] : Object.values(value);
|
|
37
|
+
|
|
38
|
+
const areValidSizes = sizes.every((size) => {
|
|
39
|
+
const isValidSize = avatarSizeOptions.includes(size);
|
|
40
|
+
|
|
41
|
+
if (!isValidSize) {
|
|
42
|
+
/* eslint-disable-next-line no-console */
|
|
43
|
+
console.error(`Avatar size should be one of [${avatarSizeOptions}], received: ${size}`);
|
|
44
|
+
}
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
console.error(`Avatar size should be one of [${avatarSizeOptions}], received: ${value}`);
|
|
39
|
-
}
|
|
46
|
+
return isValidSize;
|
|
47
|
+
});
|
|
40
48
|
|
|
41
|
-
return
|
|
49
|
+
return areValidSizes;
|
|
42
50
|
},
|
|
43
51
|
},
|
|
44
52
|
shape: {
|
|
@@ -48,8 +56,19 @@ export default {
|
|
|
48
56
|
},
|
|
49
57
|
},
|
|
50
58
|
computed: {
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
sizeClasses() {
|
|
60
|
+
if (isNumber(this.size)) {
|
|
61
|
+
return `gl-avatar-s${this.size}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const { default: defaultSize, ...nonDefaultSizes } = this.size;
|
|
65
|
+
|
|
66
|
+
return [
|
|
67
|
+
`gl-avatar-s${defaultSize || avatarSizeOptions[1]}`,
|
|
68
|
+
...Object.entries(nonDefaultSizes).map(
|
|
69
|
+
([breakpoint, size]) => `gl-${breakpoint}-avatar-s${size}`
|
|
70
|
+
),
|
|
71
|
+
];
|
|
53
72
|
},
|
|
54
73
|
isCircle() {
|
|
55
74
|
return this.shape === avatarShapeOptions.circle;
|
|
@@ -73,14 +92,14 @@ export default {
|
|
|
73
92
|
v-if="src"
|
|
74
93
|
:src="src"
|
|
75
94
|
:alt="alt"
|
|
76
|
-
:class="['gl-avatar', { 'gl-avatar-circle': isCircle },
|
|
95
|
+
:class="['gl-avatar', { 'gl-avatar-circle': isCircle }, sizeClasses]"
|
|
77
96
|
/>
|
|
78
97
|
<div
|
|
79
98
|
v-else
|
|
80
99
|
:class="[
|
|
81
100
|
'gl-avatar gl-avatar-identicon',
|
|
82
101
|
{ 'gl-avatar-circle': isCircle },
|
|
83
|
-
|
|
102
|
+
sizeClasses,
|
|
84
103
|
identiconBackgroundClass,
|
|
85
104
|
]"
|
|
86
105
|
>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
import { nextTick } from 'vue';
|
|
3
|
+
import { createMockDirective } from '~helpers/vue_mock_directive';
|
|
3
4
|
import Breadcrumb, { COLLAPSE_AT_SIZE } from './breadcrumb.vue';
|
|
4
5
|
import GlBreadcrumbItem from './breadcrumb_item.vue';
|
|
5
|
-
import { createMockDirective } from '~helpers/vue_mock_directive';
|
|
6
6
|
|
|
7
7
|
describe('Breadcrumb component', () => {
|
|
8
8
|
let wrapper;
|
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
|
|
26
26
|
.form-control {
|
|
27
27
|
+ .invalid-feedback,
|
|
28
|
-
+ .text-gl-muted
|
|
28
|
+
+ .text-gl-muted,
|
|
29
|
+
&.is-valid + .invalid-feedback + .text-gl-muted {
|
|
30
|
+
// See https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2806
|
|
31
|
+
// for the reasoning behind the "valid+invalid" selector above
|
|
29
32
|
@include gl-mt-3;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
@@ -81,7 +81,7 @@ export const WithValidations = (_args, { argTypes }) => ({
|
|
|
81
81
|
invalidFeedback() {
|
|
82
82
|
let feedbackText = 'This field is required.';
|
|
83
83
|
|
|
84
|
-
if (this.name.length
|
|
84
|
+
if (this.name.length >= 4) {
|
|
85
85
|
feedbackText = '';
|
|
86
86
|
} else if (this.name.length > 0) {
|
|
87
87
|
feedbackText = 'Enter at least 4 characters.';
|
|
@@ -10,7 +10,7 @@ describe('GlKeysetPagination', () => {
|
|
|
10
10
|
const buttonTagName = 'BUTTON';
|
|
11
11
|
const linkTagName = 'A';
|
|
12
12
|
|
|
13
|
-
const createComponent = (props = {}, scopedSlots) => {
|
|
13
|
+
const createComponent = (props = {}, scopedSlots = {}) => {
|
|
14
14
|
wrapper = mount(GlKeysetPagination, {
|
|
15
15
|
propsData: props,
|
|
16
16
|
scopedSlots,
|
|
@@ -181,6 +181,31 @@
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
+
|
|
185
|
+
table {
|
|
186
|
+
@include gl-my-7;
|
|
187
|
+
|
|
188
|
+
th,
|
|
189
|
+
td {
|
|
190
|
+
@include gl-px-3;
|
|
191
|
+
@include gl-py-4;
|
|
192
|
+
@include gl-inset-border-b-1-gray-100;
|
|
193
|
+
@include gl-vertical-align-top;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
th {
|
|
197
|
+
@include gl-inset-border-y-1-gray-100;
|
|
198
|
+
@include gl-font-weight-bold;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
thead {
|
|
202
|
+
@include gl-bg-gray-50;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
tr:nth-child(even) {
|
|
206
|
+
@include gl-bg-gray-10;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
184
209
|
}
|
|
185
210
|
|
|
186
211
|
.gl-compact-markdown {
|
|
@@ -262,4 +287,11 @@
|
|
|
262
287
|
@include gl-font-size-monospace-sm;
|
|
263
288
|
}
|
|
264
289
|
}
|
|
290
|
+
|
|
291
|
+
table {
|
|
292
|
+
th,
|
|
293
|
+
td {
|
|
294
|
+
@include gl-py-3;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
265
297
|
}
|
|
@@ -3,7 +3,7 @@ import GlMarkdown from './markdown.vue';
|
|
|
3
3
|
import markdownTypescaleDemoContent from './markdown_typescale_demo.html';
|
|
4
4
|
|
|
5
5
|
const template = `
|
|
6
|
-
<gl-markdown :compact="compact">${markdownTypescaleDemoContent}</gl-markdown>
|
|
6
|
+
<gl-markdown :compact="compact">${markdownTypescaleDemoContent}</gl-markdown>
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
const generateProps = ({ compact = false } = {}) => ({ compact });
|
|
@@ -14,8 +14,11 @@ const Template = (args, { argTypes }) => ({
|
|
|
14
14
|
template,
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
export const
|
|
18
|
-
|
|
17
|
+
export const Documentation = Template.bind({});
|
|
18
|
+
Documentation.args = generateProps();
|
|
19
|
+
|
|
20
|
+
export const Compact = Template.bind({});
|
|
21
|
+
Compact.args = generateProps({ compact: true });
|
|
19
22
|
|
|
20
23
|
export default {
|
|
21
24
|
title: 'base/markdown',
|
|
@@ -27,6 +27,52 @@
|
|
|
27
27
|
<p>MD Doc Paragraph • GitLab uses "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few
|
|
28
28
|
significant ways to add some useful functionality. You can use GFM in the following areas: comments, issues, merge
|
|
29
29
|
requests, milestones, snippets and more.</p>
|
|
30
|
+
|
|
31
|
+
<table>
|
|
32
|
+
<thead>
|
|
33
|
+
<tr>
|
|
34
|
+
<th>Widget</th>
|
|
35
|
+
<th>Wording</th>
|
|
36
|
+
<th>Proposed</th>
|
|
37
|
+
</tr>
|
|
38
|
+
</thead>
|
|
39
|
+
<tbody>
|
|
40
|
+
<tr>
|
|
41
|
+
<td>
|
|
42
|
+
Test summary
|
|
43
|
+
</td>
|
|
44
|
+
<td>
|
|
45
|
+
Test summary contained 3 failed, 1 fixed test result out of 15 total tests
|
|
46
|
+
</td>
|
|
47
|
+
<td>
|
|
48
|
+
This is the only one that doesn't include the breakdown in the Level 1 subtext. Does it need to be updated?
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td>
|
|
53
|
+
Browser performance
|
|
54
|
+
</td>
|
|
55
|
+
<td>
|
|
56
|
+
Browser performance test metrics: 7 changes
|
|
57
|
+
</td>
|
|
58
|
+
<td>
|
|
59
|
+
Browser performance test metrics detected 7 changes
|
|
60
|
+
</td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr>
|
|
63
|
+
<td>
|
|
64
|
+
Load performance
|
|
65
|
+
</td>
|
|
66
|
+
<td>
|
|
67
|
+
Load performance test metrics detected 4 changes
|
|
68
|
+
</td>
|
|
69
|
+
<td>
|
|
70
|
+
✅
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</tbody>
|
|
74
|
+
</table>
|
|
75
|
+
|
|
30
76
|
<blockquote>
|
|
31
77
|
<p>
|
|
32
78
|
MD Doc Blockquote • GitLab uses "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
import { BModal } from 'bootstrap-vue';
|
|
3
3
|
import { merge } from 'lodash';
|
|
4
|
+
import { modalButtonDefaults } from '~/utils/constants';
|
|
4
5
|
import CloseButton from '../../shared_components/close_button/close_button.vue';
|
|
5
6
|
import Button from '../button/button.vue';
|
|
6
7
|
import { logWarning } from '../../../utils/utils';
|
|
7
8
|
import Modal from './modal.vue';
|
|
8
|
-
import { modalButtonDefaults } from '~/utils/constants';
|
|
9
9
|
|
|
10
10
|
const BModalStub = merge({}, BModal.options, {
|
|
11
11
|
methods: {
|