@gitlab/ui 39.0.0 → 39.2.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 +22 -0
- package/dist/components/base/alert/alert.js +11 -1
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/package.json +3 -3
- package/src/components/base/alert/alert.scss +4 -0
- package/src/components/base/alert/alert.spec.js +11 -0
- package/src/components/base/alert/alert.stories.js +14 -0
- package/src/components/base/alert/alert.vue +10 -0
- package/src/components/base/dropdown/dropdown.scss +8 -0
- package/src/components/base/table/table.scss +4 -4
- package/src/components/base/table/table.stories.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "39.
|
|
3
|
+
"version": "39.2.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@babel/preset-env": "^7.10.2",
|
|
89
89
|
"@gitlab/eslint-plugin": "12.0.1",
|
|
90
90
|
"@gitlab/stylelint-config": "4.0.0",
|
|
91
|
-
"@gitlab/svgs": "2.
|
|
91
|
+
"@gitlab/svgs": "2.10.0",
|
|
92
92
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
93
93
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
94
94
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"eslint": "7.32.0",
|
|
115
115
|
"eslint-import-resolver-jest": "3.0.2",
|
|
116
116
|
"eslint-plugin-cypress": "2.12.1",
|
|
117
|
-
"eslint-plugin-storybook": "
|
|
117
|
+
"eslint-plugin-storybook": "0.5.7",
|
|
118
118
|
"file-loader": "^4.2.0",
|
|
119
119
|
"glob": "^7.2.0",
|
|
120
120
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -20,6 +20,7 @@ describe('Alert component', () => {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
const findIcon = () => wrapper.find('.gl-alert-icon');
|
|
23
24
|
const findDismissButton = () => wrapper.findComponent({ ref: 'dismiss' });
|
|
24
25
|
const findTitle = () => wrapper.find('.gl-alert-title');
|
|
25
26
|
const findBodyContainer = () => wrapper.find('.gl-alert-body');
|
|
@@ -31,6 +32,10 @@ describe('Alert component', () => {
|
|
|
31
32
|
createComponent({ slots: { default: DummyComponent } });
|
|
32
33
|
});
|
|
33
34
|
|
|
35
|
+
it('renders a variant icon', () => {
|
|
36
|
+
expect(findIcon().exists()).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
|
|
34
39
|
it('renders a dismiss button', () => {
|
|
35
40
|
expect(findDismissButton().exists()).toBe(true);
|
|
36
41
|
});
|
|
@@ -54,6 +59,12 @@ describe('Alert component', () => {
|
|
|
54
59
|
});
|
|
55
60
|
});
|
|
56
61
|
|
|
62
|
+
it('does not render a variant icon when showIcon = false', () => {
|
|
63
|
+
createComponent({ propsData: { showIcon: false } });
|
|
64
|
+
|
|
65
|
+
expect(findIcon().exists()).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
57
68
|
it('does not render a dismiss button when dismissible = false', () => {
|
|
58
69
|
createComponent({ propsData: { dismissible: false } });
|
|
59
70
|
|
|
@@ -6,6 +6,7 @@ const template = `
|
|
|
6
6
|
<gl-alert
|
|
7
7
|
:title="title"
|
|
8
8
|
:dismissible="dismissible"
|
|
9
|
+
:show-icon="showIcon"
|
|
9
10
|
:dismiss-label="dismissLabel"
|
|
10
11
|
:variant="variant"
|
|
11
12
|
:primary-button-text="primaryButtonText"
|
|
@@ -21,6 +22,7 @@ const generateProps = ({
|
|
|
21
22
|
title = defaultValue('title'),
|
|
22
23
|
variant = defaultValue('variant'),
|
|
23
24
|
dismissible = defaultValue('dismissible'),
|
|
25
|
+
showIcon = defaultValue('showIcon'),
|
|
24
26
|
dismissLabel = defaultValue('dismissLabel'),
|
|
25
27
|
primaryButtonText = defaultValue('primaryButtonText'),
|
|
26
28
|
primaryButtonLink = defaultValue('primaryButtonLink'),
|
|
@@ -32,6 +34,7 @@ const generateProps = ({
|
|
|
32
34
|
message: 'Lorem ipsum dolor sit amet',
|
|
33
35
|
variant,
|
|
34
36
|
dismissible,
|
|
37
|
+
showIcon,
|
|
35
38
|
dismissLabel,
|
|
36
39
|
primaryButtonText,
|
|
37
40
|
primaryButtonLink,
|
|
@@ -92,6 +95,17 @@ TextLinks.parameters = {
|
|
|
92
95
|
storyshots: { disable: true },
|
|
93
96
|
};
|
|
94
97
|
|
|
98
|
+
export const NoIcon = () => ({
|
|
99
|
+
components: { GlAlert },
|
|
100
|
+
template: `
|
|
101
|
+
<gl-alert :show-icon="false">
|
|
102
|
+
Lorem ipsum dolor sit amet
|
|
103
|
+
</gl-alert>`,
|
|
104
|
+
});
|
|
105
|
+
NoIcon.parameters = {
|
|
106
|
+
storyshots: { disable: true },
|
|
107
|
+
};
|
|
108
|
+
|
|
95
109
|
export const Variants = () => ({
|
|
96
110
|
components: { GlAlert },
|
|
97
111
|
variants: alertVariantOptions,
|
|
@@ -28,6 +28,14 @@ export default {
|
|
|
28
28
|
required: false,
|
|
29
29
|
default: true,
|
|
30
30
|
},
|
|
31
|
+
/**
|
|
32
|
+
* Shows icon based on variant.
|
|
33
|
+
*/
|
|
34
|
+
showIcon: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: false,
|
|
37
|
+
default: true,
|
|
38
|
+
},
|
|
31
39
|
/**
|
|
32
40
|
* Dismiss button's aria-label.
|
|
33
41
|
*/
|
|
@@ -165,10 +173,12 @@ export default {
|
|
|
165
173
|
'gl-alert',
|
|
166
174
|
{ 'gl-alert-sticky': sticky },
|
|
167
175
|
{ 'gl-alert-not-dismissible': !dismissible },
|
|
176
|
+
{ 'gl-alert-no-icon': !showIcon },
|
|
168
177
|
variantClass,
|
|
169
178
|
]"
|
|
170
179
|
>
|
|
171
180
|
<gl-icon
|
|
181
|
+
v-if="showIcon"
|
|
172
182
|
:name="iconName"
|
|
173
183
|
:class="{ 'gl-alert-icon': true, 'gl-alert-icon-no-title': !title }"
|
|
174
184
|
/>
|
|
@@ -121,6 +121,10 @@
|
|
|
121
121
|
|
|
122
122
|
&.gl-button {
|
|
123
123
|
@include gl-px-3;
|
|
124
|
+
|
|
125
|
+
&.btn-sm {
|
|
126
|
+
@include gl-px-2;
|
|
127
|
+
}
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
|
|
@@ -172,6 +176,10 @@
|
|
|
172
176
|
.dropdown-icon {
|
|
173
177
|
@include gl-mr-0;
|
|
174
178
|
}
|
|
179
|
+
|
|
180
|
+
&.btn-sm .dropdown-chevron {
|
|
181
|
+
@include gl-mx-0;
|
|
182
|
+
}
|
|
175
183
|
}
|
|
176
184
|
|
|
177
185
|
.split-content-button {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
table.gl-table {
|
|
2
|
-
@include gl-text-gray-500;
|
|
3
2
|
@include gl-bg-transparent;
|
|
4
3
|
|
|
5
4
|
tr {
|
|
6
5
|
th,
|
|
7
6
|
td {
|
|
8
|
-
@include gl-border-t-none;
|
|
9
7
|
@include gl-border-b-solid;
|
|
10
8
|
@include gl-border-b-1;
|
|
9
|
+
@include gl-border-gray-100;
|
|
11
10
|
@include gl-p-5;
|
|
12
11
|
@include gl-bg-transparent;
|
|
13
12
|
@include gl-line-height-normal;
|
|
14
13
|
@include gl-font-base;
|
|
14
|
+
@include gl-vertical-align-top;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
th {
|
|
18
18
|
@include gl-font-weight-bold;
|
|
19
|
-
@include gl-
|
|
19
|
+
@include gl-text-gray-900;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
td {
|
|
23
|
-
@include gl-
|
|
23
|
+
@include gl-text-gray-700;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -72,9 +72,9 @@ export const WithFilter = (args, { argTypes }) => ({
|
|
|
72
72
|
template: `<div class="gl-line-height-normal">
|
|
73
73
|
<gl-form-input v-model="filter" placeholder="Type to search" />
|
|
74
74
|
<br />
|
|
75
|
-
<gl-table
|
|
76
|
-
:items="$options.items"
|
|
77
|
-
:fields="$options.fields"
|
|
75
|
+
<gl-table
|
|
76
|
+
:items="$options.items"
|
|
77
|
+
:fields="$options.fields"
|
|
78
78
|
:filter=filter
|
|
79
79
|
:fixed="fixed"
|
|
80
80
|
:stacked="stacked"
|