@gitlab/ui 40.6.2 → 40.6.5
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/form/form_input_group/form_input_group.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +11 -10
- package/src/components/base/badge/badge.md +3 -2
- package/src/components/base/datepicker/datepicker.stories.js +13 -16
- package/src/components/base/daterange_picker/daterange_picker.stories.js +2 -0
- package/src/components/base/form/form_group/form_group.scss +2 -0
- package/src/components/base/form/form_group/form_group.stories.js +12 -25
- package/src/components/base/form/form_input/form_input.scss +4 -0
- package/src/components/base/form/form_input_group/form_input_group.vue +33 -35
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +2 -2
- package/src/components/base/search_box_by_click/search_box_by_click.scss +5 -6
- package/src/components/charts/legend/legend.stories.js +1 -0
- package/src/scss/storybook.scss +2 -0
- package/src/scss/storybook_dark_mode.scss +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "40.6.
|
|
3
|
+
"version": "40.6.5",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -81,21 +81,21 @@
|
|
|
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.
|
|
84
|
+
"@gitlab/eslint-plugin": "12.3.0",
|
|
85
85
|
"@gitlab/stylelint-config": "4.0.0",
|
|
86
86
|
"@gitlab/svgs": "2.14.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.5",
|
|
91
|
+
"@storybook/addon-docs": "6.5.5",
|
|
92
|
+
"@storybook/addon-essentials": "6.5.5",
|
|
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.5",
|
|
95
|
+
"@storybook/addon-storyshots-puppeteer": "6.5.5",
|
|
96
|
+
"@storybook/addon-viewport": "6.5.5",
|
|
97
|
+
"@storybook/theming": "6.5.5",
|
|
98
|
+
"@storybook/vue": "6.5.5",
|
|
99
99
|
"@vue/test-utils": "1.3.0",
|
|
100
100
|
"autoprefixer": "^9.7.6",
|
|
101
101
|
"babel-jest": "^26.6.3",
|
|
@@ -140,6 +140,7 @@
|
|
|
140
140
|
"sass-loader": "^10.2.0",
|
|
141
141
|
"sass-true": "^5.0.0",
|
|
142
142
|
"start-server-and-test": "^1.10.6",
|
|
143
|
+
"storybook-dark-mode": "^1.0.8",
|
|
143
144
|
"stylelint": "14.3.0",
|
|
144
145
|
"stylelint-config-prettier": "9.0.3",
|
|
145
146
|
"stylelint-prettier": "2.0.0",
|
|
@@ -31,7 +31,8 @@ While this component is based on
|
|
|
31
31
|
|
|
32
32
|
- Has a different set of valid `variant`s. See the examples or props
|
|
33
33
|
documentation for those values.
|
|
34
|
-
- Always sets the `pill` prop of the underlying
|
|
34
|
+
- Always sets the `pill` prop of the underlying
|
|
35
|
+
[`BBadge`](https://bootstrap-vue.org/docs/components/badge) to `true`. Any passed
|
|
35
36
|
in `pill` prop value is ignored.
|
|
36
37
|
- Does _not_ scale itself to match the size of its immediate parent, like
|
|
37
|
-
`BBadge` does.
|
|
38
|
+
[`BBadge`](https://bootstrap-vue.org/docs/components/badge) does.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GlDatepicker } from '../../../index';
|
|
2
2
|
import { disableControls } from '../../../utils/stories_utils';
|
|
3
3
|
import { useFakeDate } from '../../../utils/use_fake_date';
|
|
4
|
+
import { makeContainer } from '../../../utils/story_decorators/container';
|
|
4
5
|
import readme from './datepicker.md';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
@@ -18,8 +19,6 @@ const generateProps = ({ minDate = defaultMinDate, maxDate = defaultMaxDate } =
|
|
|
18
19
|
maxDate,
|
|
19
20
|
});
|
|
20
21
|
|
|
21
|
-
const wrap = (template) => `<div style="height: 280px">${template}</div>`;
|
|
22
|
-
|
|
23
22
|
export const Default = (_args, { argTypes }) => ({
|
|
24
23
|
...defaults,
|
|
25
24
|
props: Object.keys(argTypes),
|
|
@@ -28,9 +27,7 @@ export const Default = (_args, { argTypes }) => ({
|
|
|
28
27
|
pickerValue: defaultDate,
|
|
29
28
|
};
|
|
30
29
|
},
|
|
31
|
-
template:
|
|
32
|
-
<gl-datepicker :max-date="maxDate" :min-date="minDate" :start-opened="true" v-model="pickerValue" />
|
|
33
|
-
`),
|
|
30
|
+
template: `<gl-datepicker :max-date="maxDate" :min-date="minDate" :start-opened="true" v-model="pickerValue" />`,
|
|
34
31
|
});
|
|
35
32
|
Default.args = generateProps();
|
|
36
33
|
|
|
@@ -42,14 +39,15 @@ export const CustomTrigger = (_args, { argTypes }) => ({
|
|
|
42
39
|
pickerValue: null,
|
|
43
40
|
};
|
|
44
41
|
},
|
|
45
|
-
template:
|
|
46
|
-
<div
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
template: `
|
|
43
|
+
<div>
|
|
44
|
+
<div class="dropdown">
|
|
45
|
+
<button type="button" class="dropdown-menu-toggle">
|
|
46
|
+
<span class="dropdown-toggle-text"> Start date: {{value}} </span>
|
|
47
|
+
</button>
|
|
48
|
+
</div>
|
|
49
|
+
<gl-datepicker v-model="pickerValue" target=".dropdown-menu-toggle" :container="null" />
|
|
50
|
+
</div>`,
|
|
53
51
|
});
|
|
54
52
|
CustomTrigger.args = generateProps();
|
|
55
53
|
|
|
@@ -61,15 +59,14 @@ export const WithClearButton = (_args, { argTypes }) => ({
|
|
|
61
59
|
pickerValue: defaultDate,
|
|
62
60
|
};
|
|
63
61
|
},
|
|
64
|
-
template:
|
|
65
|
-
<gl-datepicker showClearButton :max-date="maxDate" :min-date="minDate" v-model="pickerValue" />
|
|
66
|
-
`),
|
|
62
|
+
template: `<gl-datepicker showClearButton :max-date="maxDate" :min-date="minDate" v-model="pickerValue" />`,
|
|
67
63
|
});
|
|
68
64
|
WithClearButton.args = generateProps();
|
|
69
65
|
|
|
70
66
|
export default {
|
|
71
67
|
title: 'base/datepicker',
|
|
72
68
|
component: GlDatepicker,
|
|
69
|
+
decorators: [makeContainer({ height: '280px' })],
|
|
73
70
|
parameters: {
|
|
74
71
|
docs: {
|
|
75
72
|
description: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { disableControls } from '../../../utils/stories_utils';
|
|
2
|
+
import { makeContainer } from '../../../utils/story_decorators/container';
|
|
2
3
|
import readme from './daterange_picker.md';
|
|
3
4
|
import GlDaterangePicker from './daterange_picker.vue';
|
|
4
5
|
|
|
@@ -113,6 +114,7 @@ export default {
|
|
|
113
114
|
followsDesignSystem: true,
|
|
114
115
|
title: 'base/daterange-picker',
|
|
115
116
|
component: GlDaterangePicker,
|
|
117
|
+
decorators: [makeContainer({ height: '300px' })],
|
|
116
118
|
parameters: {
|
|
117
119
|
knobs: { disable: true },
|
|
118
120
|
docs: {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.invalid-feedback,
|
|
21
|
+
.valid-feedback,
|
|
21
22
|
.text-gl-muted {
|
|
22
23
|
@include gl-font-base;
|
|
23
24
|
@include gl-line-height-normal;
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
|
|
26
27
|
.form-control {
|
|
27
28
|
+ .invalid-feedback,
|
|
29
|
+
+ .valid-feedback,
|
|
28
30
|
+ .text-gl-muted,
|
|
29
31
|
&.is-valid + .invalid-feedback + .text-gl-muted {
|
|
30
32
|
// See https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2806
|
|
@@ -74,31 +74,18 @@ WithLabelDescription.args = generateProps({
|
|
|
74
74
|
export const WithValidations = (_args, { argTypes }) => ({
|
|
75
75
|
props: Object.keys(argTypes),
|
|
76
76
|
components: { ...components, GlFormInput },
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return feedbackText;
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
data() {
|
|
94
|
-
return {
|
|
95
|
-
name: '',
|
|
96
|
-
};
|
|
97
|
-
},
|
|
98
|
-
template: wrap(
|
|
99
|
-
'<gl-form-input :id="id" :state="state" v-model.trim="name" />',
|
|
100
|
-
':invalid-feedback="invalidFeedback"'
|
|
101
|
-
),
|
|
77
|
+
template: `
|
|
78
|
+
<div>
|
|
79
|
+
${wrap(
|
|
80
|
+
'<gl-form-input :id="id" :state="false" />',
|
|
81
|
+
'invalid-feedback="This field is required."'
|
|
82
|
+
)}
|
|
83
|
+
${wrap(
|
|
84
|
+
'<gl-form-input :id="id" :state="true" value="Sidney Jones" />',
|
|
85
|
+
'valid-feedback="This field is valid."'
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
`,
|
|
102
89
|
});
|
|
103
90
|
WithValidations.args = generateProps({
|
|
104
91
|
label: 'Name',
|
|
@@ -64,39 +64,37 @@ export default {
|
|
|
64
64
|
};
|
|
65
65
|
</script>
|
|
66
66
|
<template>
|
|
67
|
-
<
|
|
68
|
-
<b-input-group>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<gl-dropdown
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</b-input-group>
|
|
101
|
-
</div>
|
|
67
|
+
<b-input-group>
|
|
68
|
+
<b-input-group-prepend v-if="activeOption || $scopedSlots.prepend">
|
|
69
|
+
<!-- @slot Is rendered in front of the input field. -->
|
|
70
|
+
<slot name="prepend"></slot>
|
|
71
|
+
<gl-dropdown v-if="activeOption" :text="activeOption">
|
|
72
|
+
<gl-dropdown-item
|
|
73
|
+
v-for="option in predefinedOptions"
|
|
74
|
+
:key="option.value"
|
|
75
|
+
is-check-item
|
|
76
|
+
:is-checked="activeOption === option.name"
|
|
77
|
+
@click="updateValue(option)"
|
|
78
|
+
>
|
|
79
|
+
{{ option.name }}
|
|
80
|
+
</gl-dropdown-item>
|
|
81
|
+
</gl-dropdown>
|
|
82
|
+
</b-input-group-prepend>
|
|
83
|
+
<!-- @slot Allows replacement of default input field. -->
|
|
84
|
+
<slot>
|
|
85
|
+
<b-form-input
|
|
86
|
+
ref="input"
|
|
87
|
+
v-model="localValue"
|
|
88
|
+
:class="['gl-form-input', inputClass]"
|
|
89
|
+
:aria-label="label"
|
|
90
|
+
v-bind="$attrs"
|
|
91
|
+
v-on="$listeners"
|
|
92
|
+
@click="handleClick"
|
|
93
|
+
/>
|
|
94
|
+
</slot>
|
|
95
|
+
<b-input-group-append v-if="$scopedSlots.append">
|
|
96
|
+
<!-- @slot Is rendered after the input field. -->
|
|
97
|
+
<slot name="append"></slot>
|
|
98
|
+
</b-input-group-append>
|
|
99
|
+
</b-input-group>
|
|
102
100
|
</template>
|
|
@@ -141,7 +141,7 @@ export const Default = (args, { argTypes }) => ({
|
|
|
141
141
|
template: template('', `<span class="gl-my-0" id="listbox-label">Select a department</span>`),
|
|
142
142
|
});
|
|
143
143
|
Default.args = generateProps({ ariaLabelledby: 'listbox-label' });
|
|
144
|
-
Default.decorators = [makeContainer({ height: '
|
|
144
|
+
Default.decorators = [makeContainer({ height: '370px' })];
|
|
145
145
|
|
|
146
146
|
export const HeaderAndFooter = (args, { argTypes }) => ({
|
|
147
147
|
props: Object.keys(argTypes),
|
|
@@ -178,7 +178,7 @@ export const HeaderAndFooter = (args, { argTypes }) => ({
|
|
|
178
178
|
</template>`),
|
|
179
179
|
});
|
|
180
180
|
HeaderAndFooter.args = generateProps({ toggleText: 'Header and Footer', multiple: true });
|
|
181
|
-
HeaderAndFooter.decorators = [makeContainer({ height: '
|
|
181
|
+
HeaderAndFooter.decorators = [makeContainer({ height: '370px' })];
|
|
182
182
|
|
|
183
183
|
export const CustomListItem = (args, { argTypes }) => ({
|
|
184
184
|
props: Object.keys(argTypes),
|
|
@@ -41,17 +41,16 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
&.input-group {
|
|
45
45
|
> .input-group-prepend,
|
|
46
46
|
> .input-group-append {
|
|
47
47
|
@include gl-bg-white;
|
|
48
48
|
}
|
|
49
|
+
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
@include gl-inset-border-1-gray-400;
|
|
54
|
-
}
|
|
51
|
+
.gl-search-box-by-click-search-button {
|
|
52
|
+
@include gl-text-gray-500;
|
|
53
|
+
@include gl-inset-border-1-gray-400;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
.gl-search-box-by-click-input {
|
package/src/scss/storybook.scss
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// conditional overrides for dark mode for use in storybook.
|
|
2
|
+
// Because we only use application.css from gitlab (and not
|
|
3
|
+
// application_dark), we need to override some base rules so
|
|
4
|
+
// that we can more easily test components in dark mode
|
|
5
|
+
|
|
6
|
+
// This is because dark mode in gitlab currently depends on
|
|
7
|
+
// overriding SCSS variables, but we want gitlab-ui dark mode
|
|
8
|
+
// to use Custom Properties instead
|
|
9
|
+
|
|
10
|
+
.gl-dark {
|
|
11
|
+
--color-body-bg: #1f1f1f;
|
|
12
|
+
--color-body-text: #fff;
|
|
13
|
+
|
|
14
|
+
color-scheme: dark;
|
|
15
|
+
|
|
16
|
+
&,
|
|
17
|
+
body {
|
|
18
|
+
// We can delete these once $body-bg and $body-color
|
|
19
|
+
// variables in variables.scss are updated to use CSS custom properties
|
|
20
|
+
background-color: var(--color-body-bg);
|
|
21
|
+
color: var(--color-body-text);
|
|
22
|
+
}
|
|
23
|
+
}
|