@gitlab/ui 36.7.1 → 37.0.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 +18 -0
- package/dist/components/base/alert/alert.js +1 -11
- package/dist/components/base/card/card.js +1 -1
- package/dist/components/charts/area/area.documentation.js +1 -7
- package/dist/components/charts/line/line.documentation.js +2 -5
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utils/stories_utils.js +13 -1
- package/documentation/documented_stories.js +2 -0
- package/package.json +2 -2
- package/src/components/base/accordion/accordion.stories.js +2 -1
- package/src/components/base/alert/alert.scss +0 -38
- package/src/components/base/alert/alert.spec.js +0 -1
- package/src/components/base/alert/alert.stories.js +0 -8
- package/src/components/base/alert/alert.vue +30 -41
- package/src/components/base/badge/badge.stories.js +4 -24
- package/src/components/base/card/card.vue +2 -2
- package/src/components/base/daterange_picker/daterange_picker.stories.js +10 -35
- package/src/components/base/icon/icon.stories.js +2 -5
- package/src/components/base/toggle/toggle.stories.js +2 -3
- package/src/components/charts/area/area.documentation.js +0 -5
- package/src/components/charts/area/area.stories.js +127 -127
- package/src/components/charts/bar/bar.stories.js +8 -5
- package/src/components/charts/heatmap/heatmap.stories.js +13 -16
- package/src/components/charts/line/line.documentation.js +0 -2
- package/src/components/charts/line/line.md +0 -2
- package/src/components/charts/line/line.stories.js +124 -113
- package/src/utils/stories_utils.js +6 -0
- package/src/utils/stories_utils.spec.js +18 -0
- package/dist/components/charts/area/examples/area.basic.example.js +0 -45
- package/dist/components/charts/area/examples/area.basic_plus.example.js +0 -53
- package/dist/components/charts/area/examples/index.js +0 -19
- package/dist/components/charts/line/examples/index.js +0 -19
- package/dist/components/charts/line/examples/line.basic.example.js +0 -45
- package/dist/components/charts/line/examples/line.series.example.js +0 -53
- package/src/components/charts/area/area.md +0 -1
- package/src/components/charts/area/examples/area.basic.example.vue +0 -14
- package/src/components/charts/area/examples/area.basic_plus.example.vue +0 -25
- package/src/components/charts/area/examples/index.js +0 -22
- package/src/components/charts/line/examples/index.js +0 -22
- package/src/components/charts/line/examples/line.basic.example.vue +0 -14
- package/src/components/charts/line/examples/line.series.example.vue +0 -25
|
@@ -9,5 +9,17 @@ const SERIES_NAME = {
|
|
|
9
9
|
[SERIES_NAME_LONG]: 'Series name long. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt interdum sapien ut blandit. Nulla fermentum nisi id euismod vulputate. END',
|
|
10
10
|
[SERIES_NAME_LONG_WITHOUT_SPACES]: 'Series_name_long._Lorem_ipsum_dolor_sit_amet,_consectetur_adipiscing_elit._Sed_tincidunt_interdum_sapien_ut_blandit._Nulla_fermentum_nisi_id_euismod_vulputate._END'
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Builds the parameters object disable one or multiple controls.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const disableControls = function () {
|
|
17
|
+
let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
18
|
+
return Object.fromEntries(controls.map(control => [control, {
|
|
19
|
+
control: {
|
|
20
|
+
disable: true
|
|
21
|
+
}
|
|
22
|
+
}]));
|
|
23
|
+
};
|
|
12
24
|
|
|
13
|
-
export { SERIES_NAME, SERIES_NAME_LONG, SERIES_NAME_LONG_WITHOUT_SPACES, SERIES_NAME_SHORT };
|
|
25
|
+
export { SERIES_NAME, SERIES_NAME_LONG, SERIES_NAME_LONG_WITHOUT_SPACES, SERIES_NAME_SHORT, disableControls };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@babel/preset-env": "^7.10.2",
|
|
86
86
|
"@gitlab/eslint-plugin": "10.0.2",
|
|
87
87
|
"@gitlab/stylelint-config": "4.0.0",
|
|
88
|
-
"@gitlab/svgs": "2.
|
|
88
|
+
"@gitlab/svgs": "2.6.0",
|
|
89
89
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
90
90
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
91
91
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
1
2
|
import readme from './accordion.md';
|
|
2
3
|
import GlAccordion from './accordion.vue';
|
|
3
4
|
import GlAccordionItem from './accordion_item.vue';
|
|
@@ -63,6 +64,6 @@ export default {
|
|
|
63
64
|
options: [1, 2, 3, 4, 5, 6],
|
|
64
65
|
},
|
|
65
66
|
},
|
|
66
|
-
autoCollapse
|
|
67
|
+
...disableControls(['autoCollapse']),
|
|
67
68
|
},
|
|
68
69
|
};
|
|
@@ -85,44 +85,6 @@
|
|
|
85
85
|
@include gl-right-4;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.gl-alert-max-content {
|
|
89
|
-
@include gl-display-flex;
|
|
90
|
-
@include gl-justify-content-center;
|
|
91
|
-
@include gl-p-5;
|
|
92
|
-
|
|
93
|
-
.gl-alert-icon {
|
|
94
|
-
@include gl-static;
|
|
95
|
-
@include gl-mr-5;
|
|
96
|
-
@include gl-flex-shrink-0;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.gl-dismiss-btn {
|
|
100
|
-
@include gl-static;
|
|
101
|
-
@include gl-align-self-start;
|
|
102
|
-
@include gl-ml-4;
|
|
103
|
-
// The negative margins optically align the × with the title text and right padding
|
|
104
|
-
margin-top: -$gl-spacing-scale-2;
|
|
105
|
-
margin-right: -$gl-spacing-scale-2;
|
|
106
|
-
order: 3;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.gl-alert-container {
|
|
110
|
-
@include gl-relative;
|
|
111
|
-
@include gl-display-flex;
|
|
112
|
-
@include gl-justify-content-space-between;
|
|
113
|
-
@include gl-flex-grow-1;
|
|
114
|
-
@include gl-mx-auto;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.gl-alert-content {
|
|
118
|
-
@include gl-flex-grow-1;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.gl-alert-layout-limited .gl-alert-container {
|
|
123
|
-
@include gl-layout-w-limited;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
88
|
.gl-alert-danger {
|
|
127
89
|
@include gl-bg-red-50;
|
|
128
90
|
|
|
@@ -154,7 +154,6 @@ describe('Alert component', () => {
|
|
|
154
154
|
describe('top-level classes', () => {
|
|
155
155
|
describe.each`
|
|
156
156
|
prop | cssClass | presentIf
|
|
157
|
-
${'contained'} | ${'gl-alert-max-content'} | ${true}
|
|
158
157
|
${'sticky'} | ${'gl-alert-sticky'} | ${true}
|
|
159
158
|
${'dismissible'} | ${'gl-alert-not-dismissible'} | ${false}
|
|
160
159
|
`('$cssClass', ({ prop, cssClass, presentIf }) => {
|
|
@@ -12,7 +12,6 @@ const template = `
|
|
|
12
12
|
:secondary-button-text="secondaryButtonText"
|
|
13
13
|
:primary-button-link="primaryButtonLink"
|
|
14
14
|
:secondary-button-link="secondaryButtonLink"
|
|
15
|
-
:contained="contained"
|
|
16
15
|
:sticky="sticky"
|
|
17
16
|
>{{ message }}</gl-alert>`;
|
|
18
17
|
|
|
@@ -27,7 +26,6 @@ const generateProps = ({
|
|
|
27
26
|
primaryButtonLink = defaultValue('primaryButtonLink'),
|
|
28
27
|
secondaryButtonText = defaultValue('secondaryButtonText'),
|
|
29
28
|
secondaryButtonLink = defaultValue('secondaryButtonLink'),
|
|
30
|
-
contained = defaultValue('contained'),
|
|
31
29
|
sticky = defaultValue('sticky'),
|
|
32
30
|
} = {}) => ({
|
|
33
31
|
title,
|
|
@@ -39,7 +37,6 @@ const generateProps = ({
|
|
|
39
37
|
primaryButtonLink,
|
|
40
38
|
secondaryButtonText,
|
|
41
39
|
secondaryButtonLink,
|
|
42
|
-
contained,
|
|
43
40
|
sticky,
|
|
44
41
|
});
|
|
45
42
|
|
|
@@ -118,11 +115,6 @@ Variants.parameters = {
|
|
|
118
115
|
storyshots: { disable: true },
|
|
119
116
|
};
|
|
120
117
|
|
|
121
|
-
export const Contained = Template.bind({});
|
|
122
|
-
Contained.args = generateProps({
|
|
123
|
-
contained: true,
|
|
124
|
-
});
|
|
125
|
-
|
|
126
118
|
export const Sticky = () => ({
|
|
127
119
|
components: { GlAlert },
|
|
128
120
|
variants: alertVariantOptions,
|
|
@@ -74,14 +74,6 @@ export default {
|
|
|
74
74
|
required: false,
|
|
75
75
|
default: '',
|
|
76
76
|
},
|
|
77
|
-
/**
|
|
78
|
-
* Contained alerts have their content's width limited.
|
|
79
|
-
*/
|
|
80
|
-
contained: {
|
|
81
|
-
type: Boolean,
|
|
82
|
-
required: false,
|
|
83
|
-
default: false,
|
|
84
|
-
},
|
|
85
77
|
sticky: {
|
|
86
78
|
type: Boolean,
|
|
87
79
|
required: false,
|
|
@@ -171,48 +163,45 @@ export default {
|
|
|
171
163
|
<div
|
|
172
164
|
:class="[
|
|
173
165
|
'gl-alert',
|
|
174
|
-
{ 'gl-alert-max-content gl-alert-layout-limited': contained },
|
|
175
166
|
{ 'gl-alert-sticky': sticky },
|
|
176
167
|
{ 'gl-alert-not-dismissible': !dismissible },
|
|
177
168
|
variantClass,
|
|
178
169
|
]"
|
|
179
170
|
>
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/>
|
|
171
|
+
<gl-icon
|
|
172
|
+
:name="iconName"
|
|
173
|
+
:class="{ 'gl-alert-icon': true, 'gl-alert-icon-no-title': !title }"
|
|
174
|
+
/>
|
|
185
175
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
176
|
+
<close-button
|
|
177
|
+
v-if="dismissible"
|
|
178
|
+
ref="dismiss"
|
|
179
|
+
class="gl-dismiss-btn"
|
|
180
|
+
:label="dismissLabel"
|
|
181
|
+
@click="onDismiss"
|
|
182
|
+
/>
|
|
193
183
|
|
|
194
|
-
|
|
195
|
-
|
|
184
|
+
<div class="gl-alert-content" role="alert">
|
|
185
|
+
<h4 v-if="title" class="gl-alert-title">{{ title }}</h4>
|
|
196
186
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
187
|
+
<div class="gl-alert-body">
|
|
188
|
+
<!-- @slot The alert message to display. -->
|
|
189
|
+
<slot></slot>
|
|
190
|
+
</div>
|
|
201
191
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
</div>
|
|
192
|
+
<div v-if="shouldRenderActions" class="gl-alert-actions">
|
|
193
|
+
<!-- @slot If the primary/secondary action buttons aren't flexible enough, place arbitrary content here. -->
|
|
194
|
+
<slot name="actions">
|
|
195
|
+
<gl-button
|
|
196
|
+
v-for="(actionButton, index) in actionButtons"
|
|
197
|
+
:key="index"
|
|
198
|
+
class="gl-alert-action"
|
|
199
|
+
v-bind="actionButton.attrs"
|
|
200
|
+
v-on="actionButton.listeners"
|
|
201
|
+
>
|
|
202
|
+
{{ actionButton.text }}
|
|
203
|
+
</gl-button>
|
|
204
|
+
</slot>
|
|
216
205
|
</div>
|
|
217
206
|
</div>
|
|
218
207
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
|
|
2
2
|
import { GlBadge } from '../../../index';
|
|
3
3
|
import { badgeSizeOptions, badgeVariantOptions } from '../../../utils/constants';
|
|
4
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
4
5
|
import readme from './badge.md';
|
|
5
6
|
|
|
6
7
|
const template = `
|
|
@@ -61,14 +62,7 @@ export const Variants = (args, { argTypes }) => ({
|
|
|
61
62
|
Variants.args = generateProps({
|
|
62
63
|
variant: badgeVariantOptions.warning,
|
|
63
64
|
});
|
|
64
|
-
Variants.argTypes =
|
|
65
|
-
content: {
|
|
66
|
-
control: { disable: true },
|
|
67
|
-
},
|
|
68
|
-
variant: {
|
|
69
|
-
control: { disable: true },
|
|
70
|
-
},
|
|
71
|
-
};
|
|
65
|
+
Variants.argTypes = disableControls(['content', 'variant']);
|
|
72
66
|
|
|
73
67
|
export const Actionable = (args, { argTypes }) => ({
|
|
74
68
|
components: { GlBadge },
|
|
@@ -95,14 +89,7 @@ Actionable.args = generateProps({
|
|
|
95
89
|
Actionable.parameters = {
|
|
96
90
|
storyshots: { disable: true },
|
|
97
91
|
};
|
|
98
|
-
Actionable.argTypes =
|
|
99
|
-
content: {
|
|
100
|
-
control: { disable: true },
|
|
101
|
-
},
|
|
102
|
-
variant: {
|
|
103
|
-
control: { disable: true },
|
|
104
|
-
},
|
|
105
|
-
};
|
|
92
|
+
Actionable.argTypes = disableControls(['content', 'variant']);
|
|
106
93
|
|
|
107
94
|
export const Sizes = (args, { argTypes }) => ({
|
|
108
95
|
components: { GlBadge },
|
|
@@ -125,14 +112,7 @@ export const Sizes = (args, { argTypes }) => ({
|
|
|
125
112
|
Sizes.args = generateProps({
|
|
126
113
|
variant: badgeVariantOptions.danger,
|
|
127
114
|
});
|
|
128
|
-
Sizes.argTypes =
|
|
129
|
-
content: {
|
|
130
|
-
control: { disable: true },
|
|
131
|
-
},
|
|
132
|
-
size: {
|
|
133
|
-
control: { disable: true },
|
|
134
|
-
},
|
|
135
|
-
};
|
|
115
|
+
Sizes.argTypes = disableControls(['content', 'size']);
|
|
136
116
|
|
|
137
117
|
export const BadgeIcon = (args, { argTypes }) => ({
|
|
138
118
|
components: { GlBadge },
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
33
|
<div class="gl-card">
|
|
34
|
-
<div v-if="
|
|
34
|
+
<div v-if="$slots.header" class="gl-card-header" :class="headerClass">
|
|
35
35
|
<!-- @slot The card's header content. -->
|
|
36
36
|
<slot name="header"></slot>
|
|
37
37
|
</div>
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
<!-- @slot The card's main content. -->
|
|
40
40
|
<slot></slot>
|
|
41
41
|
</div>
|
|
42
|
-
<div v-if="
|
|
42
|
+
<div v-if="$slots.footer" class="gl-card-footer" :class="footerClass">
|
|
43
43
|
<!-- @slot The card's footer content. -->
|
|
44
44
|
<slot name="footer"></slot>
|
|
45
45
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
1
2
|
import readme from './daterange_picker.md';
|
|
2
3
|
import GlDaterangePicker from './daterange_picker.vue';
|
|
3
4
|
|
|
@@ -121,31 +122,15 @@ export default {
|
|
|
121
122
|
},
|
|
122
123
|
},
|
|
123
124
|
argTypes: {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
startPickerContainer: {
|
|
135
|
-
control: {
|
|
136
|
-
disable: true,
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
endPickerTarget: {
|
|
140
|
-
control: {
|
|
141
|
-
disable: true,
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
endPickerContainer: {
|
|
145
|
-
control: {
|
|
146
|
-
disable: true,
|
|
147
|
-
},
|
|
148
|
-
},
|
|
125
|
+
...disableControls([
|
|
126
|
+
'i18n',
|
|
127
|
+
'startPickerTarget',
|
|
128
|
+
'startPickerContainer',
|
|
129
|
+
'endPickerTarget',
|
|
130
|
+
'endPickerContainer',
|
|
131
|
+
'defaultStartDate',
|
|
132
|
+
'defaultEndDate',
|
|
133
|
+
]),
|
|
149
134
|
defaultMinDate: {
|
|
150
135
|
control: {
|
|
151
136
|
type: 'date',
|
|
@@ -156,15 +141,5 @@ export default {
|
|
|
156
141
|
type: 'date',
|
|
157
142
|
},
|
|
158
143
|
},
|
|
159
|
-
defaultStartDate: {
|
|
160
|
-
control: {
|
|
161
|
-
disable: true,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
defaultEndDate: {
|
|
165
|
-
control: {
|
|
166
|
-
disable: true,
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
144
|
},
|
|
170
145
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
|
|
2
2
|
import { GlIcon } from '../../../index';
|
|
3
3
|
import { iconSizeOptions } from '../../../utils/constants';
|
|
4
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
4
5
|
import readme from './icon.md';
|
|
5
6
|
|
|
6
7
|
const components = {
|
|
@@ -41,6 +42,7 @@ export default {
|
|
|
41
42
|
storyshots: { disable: true },
|
|
42
43
|
},
|
|
43
44
|
argTypes: {
|
|
45
|
+
...disableControls(['useDeprecatedSizes']),
|
|
44
46
|
name: {
|
|
45
47
|
control: {
|
|
46
48
|
type: 'select',
|
|
@@ -53,10 +55,5 @@ export default {
|
|
|
53
55
|
options: iconSizeOptions,
|
|
54
56
|
},
|
|
55
57
|
},
|
|
56
|
-
useDeprecatedSizes: {
|
|
57
|
-
control: {
|
|
58
|
-
disable: true,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
58
|
},
|
|
62
59
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GlToggle } from '../../../index';
|
|
2
2
|
import { toggleLabelPosition } from '../../../utils/constants';
|
|
3
|
+
import { disableControls } from '../../../utils/stories_utils';
|
|
3
4
|
import readme from './toggle.md';
|
|
4
5
|
|
|
5
6
|
const defaultValue = (prop) => GlToggle.props[prop].default;
|
|
@@ -53,6 +54,7 @@ export default {
|
|
|
53
54
|
},
|
|
54
55
|
},
|
|
55
56
|
argTypes: {
|
|
57
|
+
...disableControls(['name']),
|
|
56
58
|
labelPosition: {
|
|
57
59
|
control: {
|
|
58
60
|
type: 'select',
|
|
@@ -69,8 +71,5 @@ export default {
|
|
|
69
71
|
type: 'text',
|
|
70
72
|
},
|
|
71
73
|
},
|
|
72
|
-
name: {
|
|
73
|
-
control: { disable: true },
|
|
74
|
-
},
|
|
75
74
|
},
|
|
76
75
|
};
|