@gitlab/ui 41.4.0 → 41.7.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 +21 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.js +1 -1
- 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 +11 -11
- package/scss_to_js/scss_variables.js +2 -0
- package/scss_to_js/scss_variables.json +10 -0
- package/src/components/base/avatar_labeled/avatar_labeled.spec.js +9 -0
- package/src/components/base/avatar_labeled/avatar_labeled.stories.js +20 -1
- package/src/components/base/avatar_labeled/avatar_labeled.vue +2 -0
- package/src/components/base/button/button.scss +2 -1
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +11 -3
- package/src/scss/utilities.scss +24 -0
- package/src/scss/utility-mixins/background.scss +10 -0
- package/src/scss/utility-mixins/sizing.scss +8 -0
- package/src/scss/variables.scss +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.7.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -83,19 +83,19 @@
|
|
|
83
83
|
"@babel/preset-env": "^7.10.2",
|
|
84
84
|
"@gitlab/eslint-plugin": "12.3.0",
|
|
85
85
|
"@gitlab/stylelint-config": "4.0.0",
|
|
86
|
-
"@gitlab/svgs": "2.
|
|
86
|
+
"@gitlab/svgs": "2.18.0",
|
|
87
87
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
88
88
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
89
89
|
"@rollup/plugin-replace": "^2.3.2",
|
|
90
|
-
"@storybook/addon-a11y": "6.5.
|
|
91
|
-
"@storybook/addon-docs": "6.5.
|
|
92
|
-
"@storybook/addon-essentials": "6.5.
|
|
90
|
+
"@storybook/addon-a11y": "6.5.8",
|
|
91
|
+
"@storybook/addon-docs": "6.5.8",
|
|
92
|
+
"@storybook/addon-essentials": "6.5.8",
|
|
93
93
|
"@storybook/addon-knobs": "6.4.0",
|
|
94
|
-
"@storybook/addon-storyshots": "6.5.
|
|
95
|
-
"@storybook/addon-storyshots-puppeteer": "6.5.
|
|
96
|
-
"@storybook/addon-viewport": "6.5.
|
|
97
|
-
"@storybook/theming": "6.5.
|
|
98
|
-
"@storybook/vue": "6.5.
|
|
94
|
+
"@storybook/addon-storyshots": "6.5.8",
|
|
95
|
+
"@storybook/addon-storyshots-puppeteer": "6.5.8",
|
|
96
|
+
"@storybook/addon-viewport": "6.5.8",
|
|
97
|
+
"@storybook/theming": "6.5.8",
|
|
98
|
+
"@storybook/vue": "6.5.8",
|
|
99
99
|
"@vue/test-utils": "1.3.0",
|
|
100
100
|
"autoprefixer": "^9.7.6",
|
|
101
101
|
"babel-jest": "^26.6.3",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"bootstrap": "4.5.3",
|
|
107
107
|
"cypress": "^6.6.0",
|
|
108
108
|
"emoji-regex": "^10.0.0",
|
|
109
|
-
"eslint": "8.
|
|
109
|
+
"eslint": "8.17.0",
|
|
110
110
|
"eslint-import-resolver-jest": "3.0.2",
|
|
111
111
|
"eslint-plugin-cypress": "2.12.1",
|
|
112
112
|
"eslint-plugin-storybook": "0.5.12",
|
|
@@ -17,7 +17,9 @@ export const glSpacingScale15 = '7.5rem'
|
|
|
17
17
|
export const glSpacingScale20 = '10rem'
|
|
18
18
|
export const glSpacingScale26 = '13rem'
|
|
19
19
|
export const glSpacingScale28 = '14rem'
|
|
20
|
+
export const glSpacingScale34 = '17rem'
|
|
20
21
|
export const glSpacingScale62 = '31rem'
|
|
22
|
+
export const glSpacingScale80 = '40rem'
|
|
21
23
|
export const breakpointSm = '576px'
|
|
22
24
|
export const breakpointMd = '768px'
|
|
23
25
|
export const breakpointLg = '992px'
|
|
@@ -95,11 +95,21 @@
|
|
|
95
95
|
"value": "28 * $grid-size",
|
|
96
96
|
"compiledValue": "14rem"
|
|
97
97
|
},
|
|
98
|
+
{
|
|
99
|
+
"name": "$gl-spacing-scale-34",
|
|
100
|
+
"value": "34 * $grid-size",
|
|
101
|
+
"compiledValue": "17rem"
|
|
102
|
+
},
|
|
98
103
|
{
|
|
99
104
|
"name": "$gl-spacing-scale-62",
|
|
100
105
|
"value": "62 * $grid-size",
|
|
101
106
|
"compiledValue": "31rem"
|
|
102
107
|
},
|
|
108
|
+
{
|
|
109
|
+
"name": "$gl-spacing-scale-80",
|
|
110
|
+
"value": "80 * $grid-size",
|
|
111
|
+
"compiledValue": "40rem"
|
|
112
|
+
},
|
|
103
113
|
{
|
|
104
114
|
"name": "$breakpoint-sm",
|
|
105
115
|
"value": "576px",
|
|
@@ -49,6 +49,15 @@ describe('avatar labeled', () => {
|
|
|
49
49
|
expect(wrapper.find('[data-testid="user-meta"]').exists()).toBe(true);
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
it('displays `default` slot', () => {
|
|
53
|
+
buildWrapper(
|
|
54
|
+
{ label, subLabel },
|
|
55
|
+
{ default: '<span data-testid="default-slot">Foo Bar</span>' }
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
expect(wrapper.find('[data-testid="default-slot"]').exists()).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
|
|
52
61
|
describe('with label links', () => {
|
|
53
62
|
beforeEach(() => {
|
|
54
63
|
buildWrapper({ label, subLabel, labelLink: 'http://label', subLabelLink: 'http://subLabel' });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
-
import { GlAvatarLabeled, GlBadge } from '../../../index';
|
|
2
|
+
import { GlAvatarLabeled, GlBadge, GlButton } from '../../../index';
|
|
3
3
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
4
4
|
import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
|
|
5
5
|
import avatarPath from '../../../../static/img/avatar.png';
|
|
@@ -90,6 +90,25 @@ export const WithBadges = (args, { argTypes }) => ({
|
|
|
90
90
|
});
|
|
91
91
|
WithBadges.args = generateProps();
|
|
92
92
|
|
|
93
|
+
export const WithDefaultSlot = (args, { argTypes }) => ({
|
|
94
|
+
components: { GlAvatarLabeled, GlButton },
|
|
95
|
+
props: Object.keys(argTypes),
|
|
96
|
+
template: `
|
|
97
|
+
<gl-avatar-labeled
|
|
98
|
+
:shape="shape"
|
|
99
|
+
:size="size"
|
|
100
|
+
:src="src"
|
|
101
|
+
:label="label"
|
|
102
|
+
:sub-label="subLabel"
|
|
103
|
+
>
|
|
104
|
+
<template>
|
|
105
|
+
<gl-button class="gl-mt-3 gl-align-self-start" size="small">Follow</gl-button>
|
|
106
|
+
</template>
|
|
107
|
+
</gl-avatar-labeled>
|
|
108
|
+
`,
|
|
109
|
+
});
|
|
110
|
+
WithDefaultSlot.args = generateProps({ size: 64 });
|
|
111
|
+
|
|
93
112
|
export default {
|
|
94
113
|
title: 'base/avatar/labeled',
|
|
95
114
|
component: GlAvatarLabeled,
|
|
@@ -56,6 +56,8 @@ export default {
|
|
|
56
56
|
<span class="gl-avatar-labeled-sublabel">{{ subLabel }}</span>
|
|
57
57
|
</gl-link>
|
|
58
58
|
<span v-else class="gl-avatar-labeled-sublabel">{{ subLabel }}</span>
|
|
59
|
+
<!-- @slot Add additional information below the avatar label. -->
|
|
60
|
+
<slot></slot>
|
|
59
61
|
</div>
|
|
60
62
|
</div>
|
|
61
63
|
</template>
|
|
@@ -80,6 +80,7 @@ const generateProps = ({
|
|
|
80
80
|
icon = '',
|
|
81
81
|
multiple = defaultValue('multiple'),
|
|
82
82
|
ariaLabelledby,
|
|
83
|
+
startOpened = true,
|
|
83
84
|
} = {}) => ({
|
|
84
85
|
items,
|
|
85
86
|
category,
|
|
@@ -94,6 +95,7 @@ const generateProps = ({
|
|
|
94
95
|
icon,
|
|
95
96
|
multiple,
|
|
96
97
|
ariaLabelledby,
|
|
98
|
+
startOpened,
|
|
97
99
|
});
|
|
98
100
|
|
|
99
101
|
function openListbox(component) {
|
|
@@ -136,7 +138,9 @@ export const Default = (args, { argTypes }) => ({
|
|
|
136
138
|
};
|
|
137
139
|
},
|
|
138
140
|
mounted() {
|
|
139
|
-
|
|
141
|
+
if (this.startOpened) {
|
|
142
|
+
openListbox(this);
|
|
143
|
+
}
|
|
140
144
|
},
|
|
141
145
|
template: template('', `<span class="gl-my-0" id="listbox-label">Select a department</span>`),
|
|
142
146
|
});
|
|
@@ -157,7 +161,9 @@ export const HeaderAndFooter = (args, { argTypes }) => ({
|
|
|
157
161
|
};
|
|
158
162
|
},
|
|
159
163
|
mounted() {
|
|
160
|
-
|
|
164
|
+
if (this.startOpened) {
|
|
165
|
+
openListbox(this);
|
|
166
|
+
}
|
|
161
167
|
},
|
|
162
168
|
methods: {
|
|
163
169
|
selectItem(index) {
|
|
@@ -193,7 +199,9 @@ export const CustomListItem = (args, { argTypes }) => ({
|
|
|
193
199
|
GlAvatar,
|
|
194
200
|
},
|
|
195
201
|
mounted() {
|
|
196
|
-
|
|
202
|
+
if (this.startOpened) {
|
|
203
|
+
openListbox(this);
|
|
204
|
+
}
|
|
197
205
|
},
|
|
198
206
|
computed: {
|
|
199
207
|
headerText() {
|
package/src/scss/utilities.scss
CHANGED
|
@@ -881,6 +881,14 @@
|
|
|
881
881
|
.gl-bg-chevron-down\! {
|
|
882
882
|
background-image: url($gl-icon-chevron-down) !important
|
|
883
883
|
}
|
|
884
|
+
|
|
885
|
+
.gl-backdrop-filter-blur-1 {
|
|
886
|
+
backdrop-filter: blur($gl-spacing-scale-1)
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.gl-backdrop-filter-blur-1\! {
|
|
890
|
+
backdrop-filter: blur($gl-spacing-scale-1) !important
|
|
891
|
+
}
|
|
884
892
|
.gl-border {
|
|
885
893
|
border: solid $gl-border-size-1 $border-color;
|
|
886
894
|
}
|
|
@@ -4783,6 +4791,14 @@
|
|
|
4783
4791
|
max-width: $gl-spacing-scale-26 !important;
|
|
4784
4792
|
}
|
|
4785
4793
|
|
|
4794
|
+
.gl-max-w-34 {
|
|
4795
|
+
max-width: $gl-spacing-scale-34;
|
|
4796
|
+
}
|
|
4797
|
+
|
|
4798
|
+
.gl-max-w-34\! {
|
|
4799
|
+
max-width: $gl-spacing-scale-34 !important;
|
|
4800
|
+
}
|
|
4801
|
+
|
|
4786
4802
|
.gl-max-w-62 {
|
|
4787
4803
|
max-width: $gl-spacing-scale-62;
|
|
4788
4804
|
}
|
|
@@ -4791,6 +4807,14 @@
|
|
|
4791
4807
|
max-width: $gl-spacing-scale-62 !important;
|
|
4792
4808
|
}
|
|
4793
4809
|
|
|
4810
|
+
.gl-max-w-80 {
|
|
4811
|
+
max-width: $gl-spacing-scale-80;
|
|
4812
|
+
}
|
|
4813
|
+
|
|
4814
|
+
.gl-max-w-80\! {
|
|
4815
|
+
max-width: $gl-spacing-scale-80 !important;
|
|
4816
|
+
}
|
|
4817
|
+
|
|
4794
4818
|
.gl-max-w-none {
|
|
4795
4819
|
max-width: none;
|
|
4796
4820
|
}
|
|
@@ -397,3 +397,13 @@
|
|
|
397
397
|
@mixin gl-bg-chevron-down {
|
|
398
398
|
background-image: url($gl-icon-chevron-down);
|
|
399
399
|
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Backdrop filter utilities
|
|
403
|
+
*
|
|
404
|
+
* naming convention: gl-filter-{filter-type}-{filter-intensity}
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
@mixin gl-backdrop-filter-blur-1 {
|
|
408
|
+
backdrop-filter: blur($gl-spacing-scale-1);
|
|
409
|
+
}
|
|
@@ -341,10 +341,18 @@
|
|
|
341
341
|
max-width: $gl-spacing-scale-26;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
+
@mixin gl-max-w-34 {
|
|
345
|
+
max-width: $gl-spacing-scale-34;
|
|
346
|
+
}
|
|
347
|
+
|
|
344
348
|
@mixin gl-max-w-62 {
|
|
345
349
|
max-width: $gl-spacing-scale-62;
|
|
346
350
|
}
|
|
347
351
|
|
|
352
|
+
@mixin gl-max-w-80 {
|
|
353
|
+
max-width: $gl-spacing-scale-80;
|
|
354
|
+
}
|
|
355
|
+
|
|
348
356
|
@mixin gl-max-w-none {
|
|
349
357
|
max-width: none;
|
|
350
358
|
}
|
package/src/scss/variables.scss
CHANGED
|
@@ -20,7 +20,9 @@ $gl-spacing-scale-15: 15 * $grid-size;
|
|
|
20
20
|
$gl-spacing-scale-20: 20 * $grid-size;
|
|
21
21
|
$gl-spacing-scale-26: 26 * $grid-size;
|
|
22
22
|
$gl-spacing-scale-28: 28 * $grid-size;
|
|
23
|
+
$gl-spacing-scale-34: 34 * $grid-size;
|
|
23
24
|
$gl-spacing-scale-62: 62 * $grid-size;
|
|
25
|
+
$gl-spacing-scale-80: 80 * $grid-size;
|
|
24
26
|
|
|
25
27
|
// Responsive breakpoints
|
|
26
28
|
|