@gitlab/ui 36.3.0 → 36.6.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 +28 -0
- package/dist/components/base/drawer/drawer.documentation.js +2 -5
- package/dist/components/charts/single_stat/single_stat.documentation.js +1 -4
- package/dist/components/regions/empty_state/empty_state.js +3 -2
- 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/documentation/documented_stories.js +2 -0
- package/package.json +9 -9
- package/scss_to_js/scss_variables.js +1 -0
- package/scss_to_js/scss_variables.json +5 -0
- package/src/components/base/breadcrumb/breadcrumb.stories.js +8 -8
- package/src/components/base/drawer/drawer.documentation.js +0 -2
- package/src/components/base/drawer/drawer.md +0 -6
- package/src/components/base/drawer/drawer.stories.js +66 -34
- package/src/components/charts/single_stat/single_stat.documentation.js +0 -2
- package/src/components/charts/single_stat/single_stat.md +0 -2
- package/src/components/charts/single_stat/single_stat.stories.js +73 -80
- package/src/components/regions/empty_state/empty_state.spec.js +49 -0
- package/src/components/regions/empty_state/empty_state.vue +11 -8
- package/src/scss/utilities.scss +48 -0
- package/src/scss/utility-mixins/border.scss +21 -0
- package/src/scss/utility-mixins/grid.scss +4 -0
- package/src/scss/variables.scss +2 -0
- package/dist/components/base/drawer/examples/drawer.basic.example.js +0 -58
- package/dist/components/base/drawer/examples/index.js +0 -13
- package/dist/components/charts/single_stat/examples/index.js +0 -32
- package/dist/components/charts/single_stat/examples/single_stat.badge.example.js +0 -38
- package/dist/components/charts/single_stat/examples/single_stat.hover.example.js +0 -38
- package/dist/components/charts/single_stat/examples/single_stat.meta_icon.example.js +0 -38
- package/dist/components/charts/single_stat/examples/single_stat.simple.example.js +0 -38
- package/dist/components/charts/single_stat/examples/single_stat.title_icon.example.js +0 -38
- package/src/components/base/drawer/examples/drawer.basic.example.vue +0 -29
- package/src/components/base/drawer/examples/index.js +0 -15
- package/src/components/charts/single_stat/examples/index.js +0 -38
- package/src/components/charts/single_stat/examples/single_stat.badge.example.vue +0 -31
- package/src/components/charts/single_stat/examples/single_stat.hover.example.vue +0 -7
- package/src/components/charts/single_stat/examples/single_stat.meta_icon.example.vue +0 -10
- package/src/components/charts/single_stat/examples/single_stat.simple.example.vue +0 -7
- package/src/components/charts/single_stat/examples/single_stat.title_icon.example.vue +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.6.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -88,15 +88,15 @@
|
|
|
88
88
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
89
89
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
90
90
|
"@rollup/plugin-replace": "^2.3.2",
|
|
91
|
-
"@storybook/addon-a11y": "6.4.
|
|
92
|
-
"@storybook/addon-docs": "6.4.
|
|
93
|
-
"@storybook/addon-essentials": "6.4.
|
|
91
|
+
"@storybook/addon-a11y": "6.4.19",
|
|
92
|
+
"@storybook/addon-docs": "6.4.19",
|
|
93
|
+
"@storybook/addon-essentials": "6.4.19",
|
|
94
94
|
"@storybook/addon-knobs": "6.4.0",
|
|
95
|
-
"@storybook/addon-storyshots": "6.4.
|
|
96
|
-
"@storybook/addon-storyshots-puppeteer": "6.4.
|
|
97
|
-
"@storybook/addon-viewport": "6.4.
|
|
98
|
-
"@storybook/theming": "6.4.
|
|
99
|
-
"@storybook/vue": "6.4.
|
|
95
|
+
"@storybook/addon-storyshots": "6.4.19",
|
|
96
|
+
"@storybook/addon-storyshots-puppeteer": "6.4.19",
|
|
97
|
+
"@storybook/addon-viewport": "6.4.19",
|
|
98
|
+
"@storybook/theming": "6.4.19",
|
|
99
|
+
"@storybook/vue": "6.4.19",
|
|
100
100
|
"@vue/test-utils": "1.3.0",
|
|
101
101
|
"autoprefixer": "^9.7.6",
|
|
102
102
|
"babel-jest": "^26.6.3",
|
|
@@ -276,6 +276,7 @@ export const glFontSizeMonospaceSm = '0.6875rem'
|
|
|
276
276
|
export const glMonospaceFont = 'Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace'
|
|
277
277
|
export const glRegularFont = '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji'
|
|
278
278
|
export const glFonts = '("monospace": "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace, "regular": -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji")'
|
|
279
|
+
export const borderColor = '#dbdbdb'
|
|
279
280
|
export const glBorderSize1 = '1px'
|
|
280
281
|
export const glBorderSize2 = '2px'
|
|
281
282
|
export const glBorderSize3 = '3px'
|
|
@@ -1441,6 +1441,11 @@
|
|
|
1441
1441
|
],
|
|
1442
1442
|
"compiledValue": "(\"monospace\": \"Menlo\", \"DejaVu Sans Mono\", \"Liberation Mono\", \"Consolas\", \"Ubuntu Mono\", \"Courier New\", \"andale mono\", \"lucida console\", monospace, \"regular\": -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Noto Sans\", Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\")"
|
|
1443
1443
|
},
|
|
1444
|
+
{
|
|
1445
|
+
"name": "$border-color",
|
|
1446
|
+
"value": "$gray-100",
|
|
1447
|
+
"compiledValue": "#dbdbdb"
|
|
1448
|
+
},
|
|
1444
1449
|
{
|
|
1445
1450
|
"name": "$gl-border-size-1",
|
|
1446
1451
|
"value": "1px",
|
|
@@ -16,19 +16,19 @@ const template = `
|
|
|
16
16
|
|
|
17
17
|
const defaultItems = [
|
|
18
18
|
{
|
|
19
|
-
text: 'First
|
|
19
|
+
text: 'First item',
|
|
20
20
|
href: '#',
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
text: 'Second
|
|
23
|
+
text: 'Second item',
|
|
24
24
|
href: '#',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
text: 'Third
|
|
27
|
+
text: 'Third item',
|
|
28
28
|
href: '#',
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
text: 'Fourth
|
|
31
|
+
text: 'Fourth item',
|
|
32
32
|
to: { name: 'fourth-item' },
|
|
33
33
|
},
|
|
34
34
|
];
|
|
@@ -63,19 +63,19 @@ export default {
|
|
|
63
63
|
|
|
64
64
|
const extraItems = [
|
|
65
65
|
{
|
|
66
|
-
text: 'Fifth
|
|
66
|
+
text: 'Fifth item',
|
|
67
67
|
href: '#',
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
|
-
text: 'Sixth
|
|
70
|
+
text: 'Sixth item',
|
|
71
71
|
href: '#',
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
text: 'Seventh
|
|
74
|
+
text: 'Seventh item',
|
|
75
75
|
href: '#',
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
text: 'Eighth
|
|
78
|
+
text: 'Eighth item',
|
|
79
79
|
href: '#',
|
|
80
80
|
},
|
|
81
81
|
];
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
|
-
import { GlButton } from '../../../index';
|
|
1
|
+
import { GlDrawer, GlButton } from '../../../index';
|
|
4
2
|
import readme from './drawer.md';
|
|
5
|
-
import GlDrawer from './drawer.vue';
|
|
6
3
|
|
|
7
|
-
const components = {
|
|
8
|
-
GlDrawer,
|
|
9
|
-
GlButton,
|
|
10
|
-
};
|
|
4
|
+
const components = { GlDrawer, GlButton };
|
|
11
5
|
|
|
12
6
|
const drawerContent = [
|
|
13
7
|
'One',
|
|
@@ -31,7 +25,8 @@ const drawerContent = [
|
|
|
31
25
|
)
|
|
32
26
|
.join('');
|
|
33
27
|
|
|
34
|
-
const
|
|
28
|
+
export const Default = (_args, { viewMode }) => ({
|
|
29
|
+
components,
|
|
35
30
|
methods: {
|
|
36
31
|
toggle() {
|
|
37
32
|
this.open = !this.open;
|
|
@@ -42,45 +37,68 @@ const getStory = (template) => ({
|
|
|
42
37
|
},
|
|
43
38
|
data() {
|
|
44
39
|
return {
|
|
45
|
-
open:
|
|
40
|
+
open: viewMode !== 'docs',
|
|
46
41
|
};
|
|
47
42
|
},
|
|
48
|
-
|
|
49
|
-
template,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
documentedStoriesOf('base/drawer', readme)
|
|
53
|
-
.addDecorator(withKnobs)
|
|
54
|
-
.add('default', () =>
|
|
55
|
-
getStory(`
|
|
43
|
+
template: `
|
|
56
44
|
<div>
|
|
57
45
|
<gl-button @click="toggle">Toggle Drawer</gl-button>
|
|
58
46
|
<gl-drawer :open="open" @close="close">
|
|
59
47
|
<template #title>List Settings</template>
|
|
60
48
|
${drawerContent}
|
|
61
49
|
</gl-drawer>
|
|
62
|
-
</div
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
</div>`,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const WithActions = (_args, { viewMode }) => ({
|
|
54
|
+
components,
|
|
55
|
+
methods: {
|
|
56
|
+
toggle() {
|
|
57
|
+
this.open = !this.open;
|
|
58
|
+
},
|
|
59
|
+
close() {
|
|
60
|
+
this.open = false;
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
open: viewMode !== 'docs',
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
template: `
|
|
66
69
|
<div>
|
|
67
70
|
<gl-button @click="toggle">Toggle Drawer</gl-button>
|
|
68
71
|
<gl-drawer :open="open" @close="close">
|
|
69
|
-
|
|
72
|
+
<template #title>
|
|
70
73
|
<h3>custom-network-policy</h3>
|
|
71
74
|
</template>
|
|
72
75
|
<template #header>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
<div class="gl-mt-5">
|
|
77
|
+
<gl-button variant="confirm">Save</gl-button>
|
|
78
|
+
<gl-button class="gl-ml-3" @click="toggle">Cancel</gl-button>
|
|
79
|
+
</div>
|
|
77
80
|
</template>
|
|
78
|
-
|
|
81
|
+
${drawerContent}
|
|
79
82
|
</gl-drawer>
|
|
80
|
-
</div
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
</div>`,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export const SidebarVariant = (_args, { viewMode }) => ({
|
|
87
|
+
components,
|
|
88
|
+
methods: {
|
|
89
|
+
toggle() {
|
|
90
|
+
this.open = !this.open;
|
|
91
|
+
},
|
|
92
|
+
close() {
|
|
93
|
+
this.open = false;
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return {
|
|
98
|
+
open: viewMode !== 'docs',
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
template: `
|
|
84
102
|
<div>
|
|
85
103
|
<gl-button @click="toggle">Toggle Drawer</gl-button>
|
|
86
104
|
<gl-drawer :open="open" @close="close" variant="sidebar">
|
|
@@ -94,5 +112,19 @@ documentedStoriesOf('base/drawer', readme)
|
|
|
94
112
|
</template>
|
|
95
113
|
${drawerContent}
|
|
96
114
|
</gl-drawer>
|
|
97
|
-
</div
|
|
98
|
-
|
|
115
|
+
</div>`,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export default {
|
|
119
|
+
title: 'base/drawer',
|
|
120
|
+
component: GlDrawer,
|
|
121
|
+
parameters: {
|
|
122
|
+
knobs: { disabled: true },
|
|
123
|
+
controls: { disable: true },
|
|
124
|
+
docs: {
|
|
125
|
+
description: {
|
|
126
|
+
component: readme,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
};
|
|
@@ -1,100 +1,93 @@
|
|
|
1
1
|
import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
|
|
2
|
-
import { withKnobs, text, select, boolean, number } from '@storybook/addon-knobs';
|
|
3
2
|
import { GlSingleStat } from '../../../charts';
|
|
4
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
5
3
|
import { badgeVariantOptions } from '../../../utils/constants';
|
|
6
4
|
import readme from './single_stat.md';
|
|
7
5
|
|
|
8
|
-
const components = {
|
|
9
|
-
GlSingleStat,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const template = `
|
|
13
|
-
<gl-single-stat
|
|
14
|
-
:title="title"
|
|
15
|
-
:value="value"
|
|
16
|
-
:unit="unit"
|
|
17
|
-
:variant="variant"
|
|
18
|
-
:meta-text="metaText"
|
|
19
|
-
:meta-icon="metaIcon"
|
|
20
|
-
:title-icon="titleIcon"
|
|
21
|
-
:should-animate="shouldAnimate"
|
|
22
|
-
:animation-decimal-places="animationDecimalPlaces"
|
|
23
|
-
/>
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
6
|
const generateProps = ({
|
|
27
7
|
variant = GlSingleStat.props.variant.default,
|
|
28
8
|
title = 'Single stat',
|
|
29
9
|
value = '100',
|
|
30
|
-
unit =
|
|
31
|
-
metaText =
|
|
10
|
+
unit = '',
|
|
11
|
+
metaText = '',
|
|
32
12
|
metaIcon = null,
|
|
33
13
|
titleIcon = null,
|
|
34
14
|
shouldAnimate = false,
|
|
35
15
|
animationDecimalPlaces = 0,
|
|
36
16
|
} = {}) => ({
|
|
37
|
-
variant
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
type: String,
|
|
47
|
-
default: text('value', value),
|
|
48
|
-
},
|
|
49
|
-
unit: {
|
|
50
|
-
type: [String, Number],
|
|
51
|
-
default: text('unit', unit),
|
|
52
|
-
},
|
|
53
|
-
metaText: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: text('metaText', metaText),
|
|
56
|
-
},
|
|
57
|
-
metaIcon: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: select('metaIcon', ['', ...iconSpriteInfo.icons], metaIcon),
|
|
60
|
-
},
|
|
61
|
-
titleIcon: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: select('titleIcon', ['', ...iconSpriteInfo.icons], titleIcon),
|
|
64
|
-
},
|
|
65
|
-
shouldAnimate: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: boolean('shouldAnimate', shouldAnimate),
|
|
68
|
-
},
|
|
69
|
-
animationDecimalPlaces: {
|
|
70
|
-
type: Number,
|
|
71
|
-
default: number('animationDecimalPlaces', animationDecimalPlaces),
|
|
72
|
-
},
|
|
17
|
+
variant,
|
|
18
|
+
title,
|
|
19
|
+
value,
|
|
20
|
+
unit,
|
|
21
|
+
metaText,
|
|
22
|
+
metaIcon,
|
|
23
|
+
titleIcon,
|
|
24
|
+
shouldAnimate,
|
|
25
|
+
animationDecimalPlaces,
|
|
73
26
|
});
|
|
74
27
|
|
|
75
28
|
const metaText = 'Super fast';
|
|
76
29
|
const metaIcon = 'check-circle';
|
|
77
30
|
const titleIcon = 'hourglass';
|
|
78
31
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
32
|
+
const Template = (args, { argTypes }) => ({
|
|
33
|
+
components: {
|
|
34
|
+
GlSingleStat,
|
|
35
|
+
},
|
|
36
|
+
props: Object.keys(argTypes),
|
|
37
|
+
template: `
|
|
38
|
+
<gl-single-stat
|
|
39
|
+
:title="title"
|
|
40
|
+
:value="value"
|
|
41
|
+
:unit="unit"
|
|
42
|
+
:variant="variant"
|
|
43
|
+
:meta-text="metaText"
|
|
44
|
+
:meta-icon="metaIcon"
|
|
45
|
+
:title-icon="titleIcon"
|
|
46
|
+
:should-animate="shouldAnimate"
|
|
47
|
+
:animation-decimal-places="animationDecimalPlaces"
|
|
48
|
+
/>`,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const Default = Template.bind({});
|
|
52
|
+
Default.args = generateProps();
|
|
53
|
+
|
|
54
|
+
export const WithBadge = Template.bind({});
|
|
55
|
+
WithBadge.args = generateProps({ metaText, metaIcon });
|
|
56
|
+
|
|
57
|
+
export const WithMetaIcon = Template.bind({});
|
|
58
|
+
WithMetaIcon.args = generateProps({ metaIcon });
|
|
59
|
+
|
|
60
|
+
export const WithTitleIcon = Template.bind({});
|
|
61
|
+
WithTitleIcon.args = generateProps({ titleIcon });
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
title: 'charts/single-stat',
|
|
65
|
+
component: GlSingleStat,
|
|
66
|
+
parameters: {
|
|
67
|
+
knobs: { disable: true },
|
|
68
|
+
docs: {
|
|
69
|
+
description: {
|
|
70
|
+
component: readme,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
argTypes: {
|
|
75
|
+
variant: {
|
|
76
|
+
options: Object.values(badgeVariantOptions),
|
|
77
|
+
control: {
|
|
78
|
+
type: 'select',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
metaIcon: {
|
|
82
|
+
options: iconSpriteInfo.icons,
|
|
83
|
+
control: 'select',
|
|
84
|
+
},
|
|
85
|
+
titleIcon: {
|
|
86
|
+
options: iconSpriteInfo.icons,
|
|
87
|
+
control: 'select',
|
|
88
|
+
},
|
|
89
|
+
unit: {
|
|
90
|
+
control: 'text',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
@@ -148,6 +148,55 @@ describe('empty state component', () => {
|
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
+
describe('with different titles', () => {
|
|
152
|
+
it('should render title from prop', () => {
|
|
153
|
+
component = shallowMount(EmptyState, {
|
|
154
|
+
propsData: {
|
|
155
|
+
...props,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
const title = component.find('h1');
|
|
160
|
+
expect(title.text()).toBe(props.title);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it('should render title from slot', () => {
|
|
164
|
+
const slotTitle = 'Slotted title';
|
|
165
|
+
|
|
166
|
+
component = shallowMount(EmptyState, {
|
|
167
|
+
propsData: {
|
|
168
|
+
...props,
|
|
169
|
+
title: null,
|
|
170
|
+
},
|
|
171
|
+
slots: {
|
|
172
|
+
title: `<strong id="slotted">${slotTitle}</strong>`,
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const title = component.find('#slotted');
|
|
177
|
+
expect(title.text()).toBe(slotTitle);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('should render a slotted title over a props title', () => {
|
|
181
|
+
const slotTitle = 'Slotted title';
|
|
182
|
+
|
|
183
|
+
component = shallowMount(EmptyState, {
|
|
184
|
+
propsData: {
|
|
185
|
+
...props,
|
|
186
|
+
},
|
|
187
|
+
slots: {
|
|
188
|
+
title: `<strong id="slotted">${slotTitle}</strong>`,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
const title = component.find('#slotted');
|
|
193
|
+
const propTitle = component.find('h1');
|
|
194
|
+
|
|
195
|
+
expect(title.text()).toBe(slotTitle);
|
|
196
|
+
expect(propTitle.exists()).toBe(false);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
151
200
|
describe('with different descriptions', () => {
|
|
152
201
|
it('should render description from prop', () => {
|
|
153
202
|
component = shallowMount(EmptyState, {
|
|
@@ -11,7 +11,8 @@ export default {
|
|
|
11
11
|
*/
|
|
12
12
|
title: {
|
|
13
13
|
type: String,
|
|
14
|
-
required:
|
|
14
|
+
required: false,
|
|
15
|
+
default: null,
|
|
15
16
|
},
|
|
16
17
|
/**
|
|
17
18
|
* The illustration's URL.
|
|
@@ -112,13 +113,15 @@ export default {
|
|
|
112
113
|
</div>
|
|
113
114
|
<div :class="compact ? 'gl-flex-grow-1 gl-flex-basis-0 gl-px-4' : 'gl-max-w-full gl-m-auto'">
|
|
114
115
|
<div class="gl-mx-auto gl-my-0" :class="{ 'gl-p-5': !compact }">
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
>
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
<!--
|
|
117
|
+
@slot Use this slot to customize the empty state's title area.
|
|
118
|
+
Overrides the `title` prop.
|
|
119
|
+
-->
|
|
120
|
+
<slot ref="title" name="title">
|
|
121
|
+
<h1 class="gl-font-size-h-display gl-line-height-36" :class="compact ? 'h5' : 'h4'">
|
|
122
|
+
{{ title }}
|
|
123
|
+
</h1>
|
|
124
|
+
</slot>
|
|
122
125
|
<p v-if="description || $scopedSlots.description" ref="description" class="gl-mt-3">
|
|
123
126
|
<!--
|
|
124
127
|
@slot Use this slot to customize the empty state's description
|
package/src/scss/utilities.scss
CHANGED
|
@@ -865,6 +865,46 @@
|
|
|
865
865
|
.gl-bg-chevron-down\! {
|
|
866
866
|
background-image: url($gl-icon-chevron-down) !important
|
|
867
867
|
}
|
|
868
|
+
.gl-border {
|
|
869
|
+
border: solid $gl-border-size-1 $border-color;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.gl-border\! {
|
|
873
|
+
border: solid $gl-border-size-1 $border-color !important;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.gl-border-t {
|
|
877
|
+
border-top: solid $gl-border-size-1 $border-color;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.gl-border-t\! {
|
|
881
|
+
border-top: solid $gl-border-size-1 $border-color !important;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.gl-border-b {
|
|
885
|
+
border-bottom: solid $gl-border-size-1 $border-color;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
.gl-border-b\! {
|
|
889
|
+
border-bottom: solid $gl-border-size-1 $border-color !important;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.gl-border-l {
|
|
893
|
+
border-left: solid $gl-border-size-1 $border-color;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
.gl-border-l\! {
|
|
897
|
+
border-left: solid $gl-border-size-1 $border-color !important;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.gl-border-r {
|
|
901
|
+
border-right: solid $gl-border-size-1 $border-color;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.gl-border-r\! {
|
|
905
|
+
border-right: solid $gl-border-size-1 $border-color !important;
|
|
906
|
+
}
|
|
907
|
+
|
|
868
908
|
.gl-border-none {
|
|
869
909
|
border-style: none;
|
|
870
910
|
}
|
|
@@ -3295,6 +3335,14 @@
|
|
|
3295
3335
|
grid-column-start: 1 !important
|
|
3296
3336
|
}
|
|
3297
3337
|
|
|
3338
|
+
.gl-grid-template-columns-2 {
|
|
3339
|
+
grid-template-columns: 1fr 1fr
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
.gl-grid-template-columns-2\! {
|
|
3343
|
+
grid-template-columns: 1fr 1fr !important
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3298
3346
|
.gl-list-style-none {
|
|
3299
3347
|
list-style-type: none
|
|
3300
3348
|
}
|
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
*
|
|
4
4
|
* naming convention: gl-border-{position}-{style}
|
|
5
5
|
*/
|
|
6
|
+
|
|
7
|
+
@mixin gl-border {
|
|
8
|
+
border: solid $gl-border-size-1 $border-color;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin gl-border-t {
|
|
12
|
+
border-top: solid $gl-border-size-1 $border-color;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@mixin gl-border-b {
|
|
16
|
+
border-bottom: solid $gl-border-size-1 $border-color;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin gl-border-l {
|
|
20
|
+
border-left: solid $gl-border-size-1 $border-color;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin gl-border-r {
|
|
24
|
+
border-right: solid $gl-border-size-1 $border-color;
|
|
25
|
+
}
|
|
26
|
+
|
|
6
27
|
@mixin gl-border-none {
|
|
7
28
|
border-style: none;
|
|
8
29
|
}
|
package/src/scss/variables.scss
CHANGED