@gitlab/ui 34.0.0 → 36.1.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 +45 -0
- package/dist/components/base/filtered_search/filtered_search.documentation.js +6 -0
- package/dist/components/base/filtered_search/filtered_search.js +12 -2
- package/dist/components/base/filtered_search/filtered_search_term.documentation.js +6 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +11 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.documentation.js +6 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +11 -1
- package/dist/components/base/nav/nav.documentation.js +2 -7
- package/dist/components/base/search_box_by_click/search_box_by_click.documentation.js +3 -0
- package/dist/components/base/search_box_by_click/search_box_by_click.js +6 -1
- package/dist/components/base/tabs/tabs/tabs.documentation.js +1 -1
- package/dist/components/base/tabs/tabs/tabs.js +2 -12
- package/dist/components/utilities/truncate/truncate.documentation.js +2 -17
- package/dist/components/utilities/truncate/truncate.js +11 -0
- 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/documentation/all_components.js +2 -2
- package/documentation/components_documentation.js +0 -2
- package/documentation/documented_stories.js +4 -0
- package/package.json +7 -10
- package/src/charts.js +19 -0
- package/src/components/base/alert/alert.stories.js +1 -1
- package/src/components/base/avatar/avatar.stories.js +8 -0
- package/src/components/base/avatar_labeled/avatar_labeled.stories.js +7 -0
- package/src/components/base/avatar_link/avatar_link.stories.js +7 -0
- package/src/components/base/avatars_inline/avatars_inline.stories.js +1 -1
- package/src/components/base/badge/badge.stories.js +115 -10
- package/src/components/base/banner/banner.stories.js +1 -1
- package/src/components/base/breadcrumb/breadcrumb.stories.js +1 -1
- package/src/components/base/broadcast_message/broadcast_message.stories.js +3 -3
- package/src/components/base/button/button.stories.js +11 -11
- package/src/components/base/button_group/button_group.stories.js +1 -1
- package/src/components/base/collapse/collapse.stories.js +1 -1
- package/src/components/base/drawer/drawer.stories.js +1 -1
- package/src/components/base/dropdown/dropdown.stories.js +5 -3
- package/src/components/base/dropdown/dropdown_divider.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_form.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_item.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_section_header.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_text.stories.js +1 -1
- package/src/components/base/filtered_search/filtered_search.documentation.js +6 -0
- package/src/components/base/filtered_search/filtered_search.spec.js +81 -47
- package/src/components/base/filtered_search/filtered_search.stories.js +11 -1
- package/src/components/base/filtered_search/filtered_search.vue +13 -0
- package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_term.documentation.js +6 -0
- package/src/components/base/filtered_search/filtered_search_term.spec.js +42 -9
- package/src/components/base/filtered_search/filtered_search_term.vue +13 -0
- package/src/components/base/filtered_search/filtered_search_token.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +6 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.spec.js +53 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +12 -0
- package/src/components/base/form/form.stories.js +1 -1
- package/src/components/base/form/form_checkbox/form_checkbox.stories.js +1 -1
- package/src/components/base/form/form_group/form_group.stories.js +6 -5
- package/src/components/base/form/form_input/form_input.stories.js +1 -1
- package/src/components/base/form/form_input_group/form_input_group.stories.js +1 -1
- package/src/components/base/form/form_radio/form_radio.stories.js +1 -1
- package/src/components/base/form/form_radio_group/form_radio_group.stories.js +2 -1
- package/src/components/base/form/form_select/form_select.stories.js +1 -1
- package/src/components/base/form/form_text/form_text.vue +3 -1
- package/src/components/base/form/form_textarea/form_textarea.stories.js +1 -1
- package/src/components/base/icon/icon.stories.js +1 -1
- package/src/components/base/infinite_scroll/infinite_scroll.stories.js +1 -1
- package/src/components/base/label/label.stories.js +1 -1
- package/src/components/base/link/link.stories.js +1 -1
- package/src/components/base/loading_icon/loading_icon.stories.js +2 -1
- package/src/components/base/modal/modal.scss +5 -2
- package/src/components/base/modal/modal.stories.js +1 -1
- package/src/components/base/nav/nav.documentation.js +0 -4
- package/src/components/base/nav/nav.md +8 -5
- package/src/components/base/nav/nav.stories.js +52 -15
- package/src/components/base/navbar/navbar.stories.js +1 -1
- package/src/components/base/paginated_list/paginated_list.stories.js +1 -1
- package/src/components/base/pagination/pagination.stories.js +7 -0
- package/src/components/base/path/path.stories.js +2 -2
- package/src/components/base/popover/popover.stories.js +6 -0
- package/src/components/base/progress_bar/progress_bar.stories.js +1 -1
- package/src/components/base/search_box_by_click/search_box_by_click.documentation.js +3 -0
- package/src/components/base/search_box_by_click/search_box_by_click.spec.js +14 -3
- package/src/components/base/search_box_by_click/search_box_by_click.stories.js +1 -1
- package/src/components/base/search_box_by_click/search_box_by_click.vue +7 -0
- package/src/components/base/search_box_by_type/search_box_by_type.stories.js +1 -1
- package/src/components/base/segmented_control/segmented_control.stories.js +1 -1
- package/src/components/base/skeleton_loader/skeleton_loader.stories.js +1 -1
- package/src/components/base/skeleton_loading/skeleton_loading.stories.js +1 -1
- package/src/components/base/sorting/sorting.stories.js +1 -1
- package/src/components/base/sorting/sorting_item.stories.js +1 -1
- package/src/components/base/table/table.stories.js +6 -1
- package/src/components/base/tabs/tabs/scrollable_tabs.spec.js +0 -1
- package/src/components/base/tabs/tabs/tabs.md +2 -2
- package/src/components/base/tabs/tabs/tabs.scss +3 -115
- package/src/components/base/tabs/tabs/tabs.spec.js +8 -5
- package/src/components/base/tabs/tabs/tabs.stories.js +9 -13
- package/src/components/base/tabs/tabs/tabs.vue +2 -11
- package/src/components/base/toast/toast.stories.js +6 -4
- package/src/components/base/toggle/toggle.stories.js +1 -1
- package/src/components/base/token/token.stories.js +2 -2
- package/src/components/base/tooltip/tooltip.stories.js +2 -1
- package/src/components/charts/area/area.stories.js +1 -1
- package/src/components/charts/bar/bar.stories.js +1 -1
- package/src/components/charts/chart/chart.stories.js +2 -2
- package/src/components/charts/column/column.stories.js +1 -1
- package/src/components/charts/discrete_scatter/discrete_scatter.stories.js +1 -1
- package/src/components/charts/heatmap/heatmap.stories.js +1 -1
- package/src/components/charts/legend/legend.stories.js +1 -1
- package/src/components/charts/line/line.stories.js +1 -1
- package/src/components/charts/series_label/series_label.stories.js +1 -1
- package/src/components/charts/single_stat/single_stat.stories.js +1 -1
- package/src/components/charts/sparkline/sparkline.stories.js +1 -1
- package/src/components/charts/stacked_column/stacked_column.stories.js +1 -1
- package/src/components/charts/tooltip/tooltip.stories.js +1 -1
- package/src/components/regions/dashboard_skeleton/dashboard_skeleton.stories.js +1 -1
- package/src/components/regions/empty_state/empty_state.stories.js +1 -1
- package/src/components/utilities/friendly_wrap/friendly_wrap.stories.js +1 -1
- package/src/components/utilities/intersection_observer/intersection_observer.stories.js +1 -1
- package/src/components/utilities/intersperse/intersperse.stories.js +1 -1
- package/src/components/utilities/sprintf/sprintf.stories.js +1 -1
- package/src/components/utilities/truncate/truncate.documentation.js +0 -14
- package/src/components/utilities/truncate/truncate.md +0 -4
- package/src/components/utilities/truncate/truncate.stories.js +38 -27
- package/src/components/utilities/truncate/truncate.vue +9 -0
- package/{config.js → src/config.js} +1 -1
- package/src/directives/hover_load/hover_load.stories.js +1 -1
- package/src/directives/outside/outside.stories.js +1 -1
- package/src/directives/resize_observer/resize_observer.stories.js +1 -1
- package/src/directives/safe_html/safe_html.stories.js +1 -1
- package/src/index.js +111 -0
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/box-shadow.scss +4 -0
- package/{utils.js → src/utils.js} +1 -1
- package/charts.js +0 -19
- package/dist/components/base/nav/examples/index.js +0 -13
- package/dist/components/base/nav/examples/nav.basic.example.js +0 -38
- package/dist/components/base/nav/nav_item.documentation.js +0 -13
- package/dist/components/base/nav/nav_item_dropdown.documentation.js +0 -14
- package/dist/components/utilities/truncate/examples/index.js +0 -13
- package/dist/components/utilities/truncate/examples/truncate.basic.example.js +0 -38
- package/index.js +0 -111
- package/src/components/base/nav/examples/index.js +0 -15
- package/src/components/base/nav/examples/nav.basic.example.vue +0 -8
- package/src/components/base/nav/nav_item.documentation.js +0 -6
- package/src/components/base/nav/nav_item.md +0 -7
- package/src/components/base/nav/nav_item.stories.js +0 -23
- package/src/components/base/nav/nav_item_dropdown.documentation.js +0 -7
- package/src/components/base/nav/nav_item_dropdown.md +0 -7
- package/src/components/base/nav/nav_item_dropdown.stories.js +0 -51
- package/src/components/utilities/truncate/examples/index.js +0 -15
- package/src/components/utilities/truncate/examples/truncate.basic.example.vue +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as chartComponents from '../charts';
|
|
2
|
-
import * as components from '../
|
|
1
|
+
import * as chartComponents from '../src/charts';
|
|
2
|
+
import * as components from '../src';
|
|
3
3
|
|
|
4
4
|
export const gitlabComponents = { ...components, ...chartComponents };
|
|
5
5
|
export const gitlabChartComponents = { ...chartComponents };
|
|
@@ -9,9 +9,7 @@ export { default as GlFormTextDocumentation } from '../src/components/base/form/
|
|
|
9
9
|
export { default as GlFormComboboxDocumentation } from '../src/components/base/form/form_combobox/form_combobox.documentation';
|
|
10
10
|
export { default as GlGaugeChartDocumentation } from '../src/components/charts/gauge/gauge.documentation';
|
|
11
11
|
export { default as GlTokenSelectorDocumentation } from '../src/components/base/token_selector/token_selector.documentation';
|
|
12
|
-
export { default as GlNavItemDropdownDocumentation } from '../src/components/base/nav/nav_item_dropdown.documentation';
|
|
13
12
|
export { default as GlNavDocumentation } from '../src/components/base/nav/nav.documentation';
|
|
14
|
-
export { default as GlNavItemDocumentation } from '../src/components/base/nav/nav_item.documentation';
|
|
15
13
|
export { default as GlFormCheckboxTreeDocumentation } from '../src/components/base/form/form_checkbox_tree/form_checkbox_tree.documentation';
|
|
16
14
|
export { default as GlMarkdownDocumentation } from '../src/components/base/markdown/markdown.documentation';
|
|
17
15
|
export { default as GlNavbarDocumentation } from '../src/components/base/navbar/navbar.documentation';
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "36.1.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
8
|
"jsnext:main": "dist/index.js",
|
|
9
|
+
"source": "src/index.js",
|
|
9
10
|
"sideEffects": [
|
|
10
11
|
"*.css",
|
|
11
12
|
"*.scss"
|
|
@@ -17,11 +18,7 @@
|
|
|
17
18
|
"src",
|
|
18
19
|
"dist",
|
|
19
20
|
"scss_to_js",
|
|
20
|
-
"documentation"
|
|
21
|
-
"index.js",
|
|
22
|
-
"charts.js",
|
|
23
|
-
"utils.js",
|
|
24
|
-
"config.js"
|
|
21
|
+
"documentation"
|
|
25
22
|
],
|
|
26
23
|
"scripts": {
|
|
27
24
|
"build": "NODE_ENV=production rollup -c",
|
|
@@ -85,8 +82,8 @@
|
|
|
85
82
|
"@arkweid/lefthook": "^0.7.6",
|
|
86
83
|
"@babel/core": "^7.10.2",
|
|
87
84
|
"@babel/preset-env": "^7.10.2",
|
|
88
|
-
"@gitlab/eslint-plugin": "10.0.
|
|
89
|
-
"@gitlab/stylelint-config": "
|
|
85
|
+
"@gitlab/eslint-plugin": "10.0.2",
|
|
86
|
+
"@gitlab/stylelint-config": "4.0.0",
|
|
90
87
|
"@gitlab/svgs": "2.2.0",
|
|
91
88
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
92
89
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
@@ -129,7 +126,7 @@
|
|
|
129
126
|
"npm-run-all": "^4.1.5",
|
|
130
127
|
"pikaday": "^1.8.0",
|
|
131
128
|
"plop": "^2.5.4",
|
|
132
|
-
"postcss": "
|
|
129
|
+
"postcss": "8.4.5",
|
|
133
130
|
"postcss-loader": "^3.0.0",
|
|
134
131
|
"postcss-scss": "^2.1.1",
|
|
135
132
|
"prettier": "2.2.1",
|
|
@@ -147,7 +144,7 @@
|
|
|
147
144
|
"sass-true": "^5.0.0",
|
|
148
145
|
"start-server-and-test": "^1.10.6",
|
|
149
146
|
"storybook-readme": "5.0.9",
|
|
150
|
-
"stylelint": "
|
|
147
|
+
"stylelint": "14.3.0",
|
|
151
148
|
"stylelint-config-prettier": "9.0.3",
|
|
152
149
|
"stylelint-prettier": "2.0.0",
|
|
153
150
|
"vue": "^2.6.11",
|
package/src/charts.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Add config files
|
|
2
|
+
import setConfigs from './config';
|
|
3
|
+
|
|
4
|
+
setConfigs();
|
|
5
|
+
|
|
6
|
+
export { default as GlChart } from './components/charts/chart/chart.vue';
|
|
7
|
+
export { default as GlAreaChart } from './components/charts/area/area.vue';
|
|
8
|
+
export { default as GlBarChart } from './components/charts/bar/bar.vue';
|
|
9
|
+
export { default as GlGaugeChart } from './components/charts/gauge/gauge.vue';
|
|
10
|
+
export { default as GlLineChart } from './components/charts/line/line.vue';
|
|
11
|
+
export { default as GlChartLegend } from './components/charts/legend/legend.vue';
|
|
12
|
+
export { default as GlChartSeriesLabel } from './components/charts/series_label/series_label.vue';
|
|
13
|
+
export { default as GlChartTooltip } from './components/charts/tooltip/tooltip.vue';
|
|
14
|
+
export { default as GlHeatmap } from './components/charts/heatmap';
|
|
15
|
+
export { default as GlColumnChart } from './components/charts/column/column.vue';
|
|
16
|
+
export { default as GlStackedColumnChart } from './components/charts/stacked_column/stacked_column.vue';
|
|
17
|
+
export { default as GlDiscreteScatterChart } from './components/charts/discrete_scatter/discrete_scatter.vue';
|
|
18
|
+
export { default as GlSingleStat } from './components/charts/single_stat/single_stat.vue';
|
|
19
|
+
export { default as GlSparklineChart } from './components/charts/sparkline/sparkline.vue';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
+
import { GlAvatar } from '../../../index';
|
|
2
3
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
3
4
|
import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
|
|
4
5
|
import readme from './avatar.md';
|
|
5
6
|
|
|
6
7
|
Vue.directive('gl-tooltip', GlTooltipDirective);
|
|
7
8
|
|
|
9
|
+
const components = { GlAvatar };
|
|
10
|
+
|
|
8
11
|
const generateImageProps = ({ size = 64, shape = 'circle' } = {}) => ({
|
|
9
12
|
size,
|
|
10
13
|
shape,
|
|
@@ -44,6 +47,7 @@ const template = `
|
|
|
44
47
|
`;
|
|
45
48
|
|
|
46
49
|
export const Image = (args, { argTypes }) => ({
|
|
50
|
+
components,
|
|
47
51
|
props: Object.keys(argTypes),
|
|
48
52
|
template: `
|
|
49
53
|
<gl-avatar
|
|
@@ -56,18 +60,21 @@ export const Image = (args, { argTypes }) => ({
|
|
|
56
60
|
Image.args = generateImageProps();
|
|
57
61
|
|
|
58
62
|
export const ProjectFallback = (args, { argTypes }) => ({
|
|
63
|
+
components,
|
|
59
64
|
props: Object.keys(argTypes),
|
|
60
65
|
template,
|
|
61
66
|
});
|
|
62
67
|
ProjectFallback.args = generateProjectFallbackProps();
|
|
63
68
|
|
|
64
69
|
export const EmojiProjectName = (args, { argTypes }) => ({
|
|
70
|
+
components,
|
|
65
71
|
props: Object.keys(argTypes),
|
|
66
72
|
template,
|
|
67
73
|
});
|
|
68
74
|
EmojiProjectName.args = generateEmojiProjectProps();
|
|
69
75
|
|
|
70
76
|
export const WithTooltip = (args, { argTypes }) => ({
|
|
77
|
+
components,
|
|
71
78
|
props: Object.keys(argTypes),
|
|
72
79
|
template: `
|
|
73
80
|
<gl-avatar
|
|
@@ -83,6 +90,7 @@ WithTooltip.args = { ...generateImageProps(), ...generateTooltipProps() };
|
|
|
83
90
|
|
|
84
91
|
export default {
|
|
85
92
|
title: 'base/avatar',
|
|
93
|
+
component: GlAvatar,
|
|
86
94
|
parameters: {
|
|
87
95
|
knobs: { disable: true },
|
|
88
96
|
docs: {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
+
import { GlAvatarLabeled, GlBadge } from '../../../index';
|
|
2
3
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
3
4
|
import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
|
|
4
5
|
import readme from './avatar_labeled.md';
|
|
5
6
|
|
|
6
7
|
Vue.directive('gl-tooltip', GlTooltipDirective);
|
|
7
8
|
|
|
9
|
+
const components = { GlAvatarLabeled };
|
|
10
|
+
|
|
8
11
|
const generateProps = ({
|
|
9
12
|
label = 'GitLab User',
|
|
10
13
|
subLabel = '@gitlab',
|
|
@@ -25,6 +28,7 @@ const generateTooltipProps = ({ tooltipText = 'Avatar tooltip', placement = 'top
|
|
|
25
28
|
});
|
|
26
29
|
|
|
27
30
|
export const Default = (args, { argTypes }) => ({
|
|
31
|
+
components,
|
|
28
32
|
props: Object.keys(argTypes),
|
|
29
33
|
template: `
|
|
30
34
|
<gl-avatar-labeled
|
|
@@ -39,6 +43,7 @@ export const Default = (args, { argTypes }) => ({
|
|
|
39
43
|
Default.args = generateProps();
|
|
40
44
|
|
|
41
45
|
export const WithTooltip = (args, { argTypes }) => ({
|
|
46
|
+
components,
|
|
42
47
|
props: Object.keys(argTypes),
|
|
43
48
|
template: `
|
|
44
49
|
<gl-avatar-labeled
|
|
@@ -63,6 +68,7 @@ WithTooltip.argTypes = {
|
|
|
63
68
|
};
|
|
64
69
|
|
|
65
70
|
export const WithBadges = (args, { argTypes }) => ({
|
|
71
|
+
components: { GlAvatarLabeled, GlBadge },
|
|
66
72
|
props: Object.keys(argTypes),
|
|
67
73
|
template: `
|
|
68
74
|
<gl-avatar-labeled
|
|
@@ -87,6 +93,7 @@ WithBadges.args = generateProps();
|
|
|
87
93
|
|
|
88
94
|
export default {
|
|
89
95
|
title: 'base/avatar/labeled',
|
|
96
|
+
component: GlAvatarLabeled,
|
|
90
97
|
parameters: {
|
|
91
98
|
knobs: { disable: true },
|
|
92
99
|
docs: {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { GlAvatarLink, GlAvatar, GlAvatarLabeled } from '../../../index';
|
|
1
2
|
import { avatarSizeOptions, avatarShapeOptions } from '../../../utils/constants';
|
|
2
3
|
import readme from './avatar_link.md';
|
|
3
4
|
|
|
5
|
+
const components = { GlAvatarLink, GlAvatar };
|
|
6
|
+
|
|
4
7
|
const generateDefaultProps = ({
|
|
5
8
|
href = 'https://gitlab.com/gitlab-org/gitlab',
|
|
6
9
|
shape = 'circle',
|
|
@@ -23,6 +26,7 @@ const generateImageProps = ({
|
|
|
23
26
|
});
|
|
24
27
|
|
|
25
28
|
export const Default = (args, { argTypes }) => ({
|
|
29
|
+
components,
|
|
26
30
|
props: Object.keys(argTypes),
|
|
27
31
|
template: `
|
|
28
32
|
<gl-avatar-link target="blank" :href="href">
|
|
@@ -33,6 +37,7 @@ export const Default = (args, { argTypes }) => ({
|
|
|
33
37
|
Default.args = { ...generateDefaultProps(), ...generateImageProps() };
|
|
34
38
|
|
|
35
39
|
export const WithLabeledAvatar = (args, { argTypes }) => ({
|
|
40
|
+
components: { GlAvatarLink, GlAvatarLabeled },
|
|
36
41
|
props: Object.keys(argTypes),
|
|
37
42
|
template: `
|
|
38
43
|
<gl-avatar-link target="blank" :href="href">
|
|
@@ -47,6 +52,7 @@ WithLabeledAvatar.args = {
|
|
|
47
52
|
};
|
|
48
53
|
|
|
49
54
|
export const WithNoImageAvatar = (args, { argTypes }) => ({
|
|
55
|
+
components,
|
|
50
56
|
props: Object.keys(argTypes),
|
|
51
57
|
template: `
|
|
52
58
|
<gl-avatar-link target="blank" :href="href">
|
|
@@ -58,6 +64,7 @@ WithNoImageAvatar.args = { ...generateDefaultProps({}), ...generateLabelsProps({
|
|
|
58
64
|
|
|
59
65
|
export default {
|
|
60
66
|
title: 'base/avatar/avatar-link',
|
|
67
|
+
component: GlAvatarLink,
|
|
61
68
|
parameters: {
|
|
62
69
|
knobs: { disable: true },
|
|
63
70
|
docs: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlAvatarsInline, GlAvatar, GlAvatarLink, GlTooltipDirective } from '
|
|
1
|
+
import { GlAvatarsInline, GlAvatar, GlAvatarLink, GlTooltipDirective } from '../../../index';
|
|
2
2
|
import { avatarsInlineSizeOptions } from '../../../utils/constants';
|
|
3
3
|
import readme from './avatars_inline.md';
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
|
|
2
|
-
import { GlBadge } from '
|
|
2
|
+
import { GlBadge } from '../../../index';
|
|
3
3
|
import { badgeSizeOptions, badgeVariantOptions } from '../../../utils/constants';
|
|
4
4
|
import readme from './badge.md';
|
|
5
5
|
|
|
@@ -36,23 +36,128 @@ const Template = (args, { argTypes }) => ({
|
|
|
36
36
|
|
|
37
37
|
export const Default = Template.bind({});
|
|
38
38
|
Default.args = generateProps();
|
|
39
|
+
Default.parameters = {
|
|
40
|
+
storyshots: { disable: true },
|
|
41
|
+
};
|
|
39
42
|
|
|
40
|
-
export const
|
|
41
|
-
|
|
43
|
+
export const Variants = (args, { argTypes }) => ({
|
|
44
|
+
components: { GlBadge },
|
|
45
|
+
props: Object.keys(argTypes),
|
|
46
|
+
template: `
|
|
47
|
+
<div>
|
|
48
|
+
<gl-badge
|
|
49
|
+
v-for="variant in $options.badgeVariantOptions"
|
|
50
|
+
:key="variant"
|
|
51
|
+
:href="href"
|
|
52
|
+
:variant="variant"
|
|
53
|
+
:size="size"
|
|
54
|
+
:icon="icon"
|
|
55
|
+
class="gl-mr-3"
|
|
56
|
+
>{{ variant }}</gl-badge>
|
|
57
|
+
</div>
|
|
58
|
+
`,
|
|
59
|
+
badgeVariantOptions,
|
|
60
|
+
});
|
|
61
|
+
Variants.args = generateProps({
|
|
62
|
+
variant: badgeVariantOptions.warning,
|
|
63
|
+
});
|
|
64
|
+
Variants.argTypes = {
|
|
65
|
+
content: {
|
|
66
|
+
control: { disable: true },
|
|
67
|
+
},
|
|
68
|
+
variant: {
|
|
69
|
+
control: { disable: true },
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const Actionable = (args, { argTypes }) => ({
|
|
74
|
+
components: { GlBadge },
|
|
75
|
+
props: Object.keys(argTypes),
|
|
76
|
+
template: `
|
|
77
|
+
<div>
|
|
78
|
+
<gl-badge
|
|
79
|
+
v-for="variant in $options.badgeVariantOptions"
|
|
80
|
+
:key="variant"
|
|
81
|
+
:href="href"
|
|
82
|
+
:variant="variant"
|
|
83
|
+
:size="size"
|
|
84
|
+
:icon="icon"
|
|
85
|
+
class="gl-mr-3"
|
|
86
|
+
>{{ variant }}</gl-badge>
|
|
87
|
+
</div>
|
|
88
|
+
`,
|
|
89
|
+
badgeVariantOptions,
|
|
90
|
+
});
|
|
91
|
+
Actionable.args = generateProps({
|
|
42
92
|
href: '#foo',
|
|
43
93
|
variant: badgeVariantOptions.warning,
|
|
44
94
|
});
|
|
95
|
+
Actionable.parameters = {
|
|
96
|
+
storyshots: { disable: true },
|
|
97
|
+
};
|
|
98
|
+
Actionable.argTypes = {
|
|
99
|
+
content: {
|
|
100
|
+
control: { disable: true },
|
|
101
|
+
},
|
|
102
|
+
variant: {
|
|
103
|
+
control: { disable: true },
|
|
104
|
+
},
|
|
105
|
+
};
|
|
45
106
|
|
|
46
|
-
export const
|
|
47
|
-
|
|
48
|
-
|
|
107
|
+
export const Sizes = (args, { argTypes }) => ({
|
|
108
|
+
components: { GlBadge },
|
|
109
|
+
props: Object.keys(argTypes),
|
|
110
|
+
template: `
|
|
111
|
+
<div>
|
|
112
|
+
<gl-badge
|
|
113
|
+
v-for="size in $options.badgeSizeOptions"
|
|
114
|
+
:key="size"
|
|
115
|
+
:href="href"
|
|
116
|
+
:variant="variant"
|
|
117
|
+
:size="size"
|
|
118
|
+
:icon="icon"
|
|
119
|
+
class="gl-mr-3"
|
|
120
|
+
>{{ size }}</gl-badge>
|
|
121
|
+
</div>
|
|
122
|
+
`,
|
|
123
|
+
badgeSizeOptions,
|
|
124
|
+
});
|
|
125
|
+
Sizes.args = generateProps({
|
|
49
126
|
variant: badgeVariantOptions.danger,
|
|
50
127
|
});
|
|
128
|
+
Sizes.argTypes = {
|
|
129
|
+
content: {
|
|
130
|
+
control: { disable: true },
|
|
131
|
+
},
|
|
132
|
+
size: {
|
|
133
|
+
control: { disable: true },
|
|
134
|
+
},
|
|
135
|
+
};
|
|
51
136
|
|
|
52
|
-
export const BadgeIcon =
|
|
137
|
+
export const BadgeIcon = (args, { argTypes }) => ({
|
|
138
|
+
components: { GlBadge },
|
|
139
|
+
props: Object.keys(argTypes),
|
|
140
|
+
template: `
|
|
141
|
+
<div>
|
|
142
|
+
<gl-badge
|
|
143
|
+
:href="href"
|
|
144
|
+
:variant="variant"
|
|
145
|
+
:size="size"
|
|
146
|
+
:icon="icon"
|
|
147
|
+
>{{ content }}</gl-badge>
|
|
148
|
+
<gl-badge
|
|
149
|
+
:href="href"
|
|
150
|
+
:variant="variant"
|
|
151
|
+
:size="size"
|
|
152
|
+
:icon="icon"
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
`,
|
|
156
|
+
});
|
|
53
157
|
BadgeIcon.args = generateProps({
|
|
54
158
|
variant: badgeVariantOptions.success,
|
|
55
159
|
icon: 'calendar',
|
|
160
|
+
content: 'Badge icon',
|
|
56
161
|
});
|
|
57
162
|
|
|
58
163
|
export default {
|
|
@@ -68,21 +173,21 @@ export default {
|
|
|
68
173
|
},
|
|
69
174
|
argTypes: {
|
|
70
175
|
variant: {
|
|
176
|
+
options: Object.keys(badgeVariantOptions),
|
|
71
177
|
control: {
|
|
72
178
|
type: 'select',
|
|
73
|
-
options: badgeVariantOptions,
|
|
74
179
|
},
|
|
75
180
|
},
|
|
76
181
|
size: {
|
|
182
|
+
options: Object.keys(badgeSizeOptions),
|
|
77
183
|
control: {
|
|
78
184
|
type: 'select',
|
|
79
|
-
options: badgeSizeOptions,
|
|
80
185
|
},
|
|
81
186
|
},
|
|
82
187
|
icon: {
|
|
188
|
+
options: ['', ...iconSpriteInfo.icons],
|
|
83
189
|
control: {
|
|
84
190
|
type: 'select',
|
|
85
|
-
options: ['', ...iconSpriteInfo.icons],
|
|
86
191
|
},
|
|
87
192
|
},
|
|
88
193
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clusterPopoverSvg from '@gitlab/svgs/dist/illustrations/cluster_popover.svg';
|
|
2
2
|
import serviceDeskCalloutSvg from '@gitlab/svgs/dist/illustrations/service_desk_callout.svg';
|
|
3
|
-
import { GlBanner, GlButton } from '
|
|
3
|
+
import { GlBanner, GlButton } from '../../../index';
|
|
4
4
|
import { bannerVariants } from '../../../utils/constants';
|
|
5
5
|
import readme from './banner.md';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
|
|
2
|
-
import { GlBroadcastMessage } from '
|
|
2
|
+
import { GlBroadcastMessage } from '../../../index';
|
|
3
3
|
import { colorThemes } from '../../../utils/constants';
|
|
4
4
|
import readme from './broadcast_message.md';
|
|
5
5
|
|
|
@@ -29,7 +29,7 @@ const generateProps = ({
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const Template = (args, { argTypes }) => ({
|
|
32
|
-
|
|
32
|
+
components: {
|
|
33
33
|
GlBroadcastMessage,
|
|
34
34
|
},
|
|
35
35
|
props: Object.keys(argTypes),
|
|
@@ -39,7 +39,7 @@ export const Default = Template.bind({});
|
|
|
39
39
|
Default.args = generateProps();
|
|
40
40
|
|
|
41
41
|
const StackedStory = (args, { argTypes }) => ({
|
|
42
|
-
|
|
42
|
+
components: {
|
|
43
43
|
GlBroadcastMessage,
|
|
44
44
|
},
|
|
45
45
|
props: Object.keys(argTypes),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlButton } from '
|
|
1
|
+
import { GlButton, GlButtonGroup, GlBadge, GlDropdown, GlDropdownItem } from '../../../index';
|
|
2
2
|
import {
|
|
3
3
|
buttonCategoryOptions,
|
|
4
4
|
buttonVariantOptions,
|
|
@@ -111,7 +111,7 @@ IconButton.args = generateProps({
|
|
|
111
111
|
|
|
112
112
|
export const DropdownButton = (args, { argTypes }) => ({
|
|
113
113
|
props: Object.keys(argTypes),
|
|
114
|
-
components,
|
|
114
|
+
components: { GlDropdown, GlDropdownItem },
|
|
115
115
|
template: wrapDropdownButton(`
|
|
116
116
|
<gl-dropdown
|
|
117
117
|
text="Some dropdown"
|
|
@@ -129,7 +129,7 @@ DropdownButton.args = generateProps();
|
|
|
129
129
|
|
|
130
130
|
export const DropdownIconButton = (args, { argTypes }) => ({
|
|
131
131
|
props: Object.keys(argTypes),
|
|
132
|
-
components,
|
|
132
|
+
components: { GlDropdown, GlDropdownItem },
|
|
133
133
|
template: wrapDropdownButton(`
|
|
134
134
|
<gl-dropdown
|
|
135
135
|
icon="download"
|
|
@@ -149,7 +149,7 @@ DropdownIconButton.args = generateProps();
|
|
|
149
149
|
|
|
150
150
|
export const DropdownIconTextButton = (args, { argTypes }) => ({
|
|
151
151
|
props: Object.keys(argTypes),
|
|
152
|
-
components,
|
|
152
|
+
components: { GlDropdown, GlDropdownItem },
|
|
153
153
|
template: wrapDropdownButton(`
|
|
154
154
|
<gl-dropdown
|
|
155
155
|
icon="notifications"
|
|
@@ -168,7 +168,7 @@ DropdownIconTextButton.args = generateProps();
|
|
|
168
168
|
|
|
169
169
|
export const DropdownIconOnlyButton = (args, { argTypes }) => ({
|
|
170
170
|
props: Object.keys(argTypes),
|
|
171
|
-
components,
|
|
171
|
+
components: { GlDropdown, GlDropdownItem },
|
|
172
172
|
template: wrapDropdownButton(`
|
|
173
173
|
<gl-dropdown
|
|
174
174
|
icon="ellipsis_v"
|
|
@@ -191,7 +191,7 @@ DropdownIconOnlyButton.args = generateProps({
|
|
|
191
191
|
|
|
192
192
|
export const DropdownSplitButton = (args, { argTypes }) => ({
|
|
193
193
|
props: Object.keys(argTypes),
|
|
194
|
-
components,
|
|
194
|
+
components: { GlDropdown, GlDropdownItem },
|
|
195
195
|
template: wrapDropdownButton(`
|
|
196
196
|
<gl-dropdown
|
|
197
197
|
split
|
|
@@ -210,7 +210,7 @@ DropdownSplitButton.args = generateProps({ category: 'primary', variant: 'confir
|
|
|
210
210
|
|
|
211
211
|
export const DropdownIconSplitButton = (args, { argTypes }) => ({
|
|
212
212
|
props: Object.keys(argTypes),
|
|
213
|
-
components,
|
|
213
|
+
components: { GlDropdown, GlDropdownItem },
|
|
214
214
|
template: wrapDropdownButton(`
|
|
215
215
|
<gl-dropdown
|
|
216
216
|
split
|
|
@@ -230,7 +230,7 @@ DropdownIconSplitButton.args = generateProps({ category: 'secondary', variant: '
|
|
|
230
230
|
|
|
231
231
|
export const DropdownLoadingButton = (args, { argTypes }) => ({
|
|
232
232
|
props: Object.keys(argTypes),
|
|
233
|
-
components,
|
|
233
|
+
components: { GlDropdown, GlDropdownItem },
|
|
234
234
|
template: `
|
|
235
235
|
<gl-dropdown text="Some dropdown" :category="category" :loading="true">
|
|
236
236
|
<gl-dropdown-item>Dropdown item</gl-dropdown-item>
|
|
@@ -333,7 +333,7 @@ BorderlessTertiary.args = generateProps({ category: 'tertiary' });
|
|
|
333
333
|
|
|
334
334
|
export const LabelButton = (args, { argTypes = {} }) => ({
|
|
335
335
|
props: Object.keys(argTypes),
|
|
336
|
-
components,
|
|
336
|
+
components: { GlButton, GlButtonGroup },
|
|
337
337
|
template: `
|
|
338
338
|
<div>
|
|
339
339
|
<gl-button label>Label</gl-button>
|
|
@@ -451,7 +451,7 @@ Sizes.parameters = { controls: { disable: true } };
|
|
|
451
451
|
|
|
452
452
|
export const Badges = (args, { argTypes = {} }) => ({
|
|
453
453
|
props: Object.keys(argTypes),
|
|
454
|
-
components,
|
|
454
|
+
components: { GlButton, GlBadge },
|
|
455
455
|
variants: Object.keys(badgeForButtonOptions),
|
|
456
456
|
categories: buttonCategoryOptions,
|
|
457
457
|
style: {
|
|
@@ -483,7 +483,7 @@ Badges.parameters = { controls: { disable: true } };
|
|
|
483
483
|
|
|
484
484
|
export const BadgeWithSROnlyText = (args, { argTypes = {} }) => ({
|
|
485
485
|
props: Object.keys(argTypes),
|
|
486
|
-
components,
|
|
486
|
+
components: { GlButton, GlBadge },
|
|
487
487
|
template: `
|
|
488
488
|
<gl-button variant="confirm" buttonTextClasses="gl-display-flex gl-align-items-center">
|
|
489
489
|
Submit review
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlButton, GlButtonGroup, GlDropdown, GlDropdownItem } from '
|
|
1
|
+
import { GlButton, GlButtonGroup, GlDropdown, GlDropdownItem } from '../../../index';
|
|
2
2
|
import readme from './button_group.md';
|
|
3
3
|
|
|
4
4
|
const generateProps = ({ vertical = false } = {}) => ({ vertical });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
2
|
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
|
-
import { GlButton } from '
|
|
3
|
+
import { GlButton } from '../../../index';
|
|
4
4
|
import readme from './drawer.md';
|
|
5
5
|
import GlDrawer from './drawer.vue';
|
|
6
6
|
|
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
GlDropdownItem,
|
|
10
10
|
GlDropdownText,
|
|
11
11
|
GlDropdownForm,
|
|
12
|
-
|
|
12
|
+
GlButton,
|
|
13
|
+
GlSearchBoxByType,
|
|
14
|
+
} from '../../../index';
|
|
13
15
|
import {
|
|
14
16
|
buttonCategoryOptions,
|
|
15
17
|
buttonSizeOptions,
|
|
@@ -213,7 +215,7 @@ documentedStoriesOf('base/dropdown', readme)
|
|
|
213
215
|
}))
|
|
214
216
|
.add('with form', () => ({
|
|
215
217
|
props: generateProps({ text: 'Some dropdown' }),
|
|
216
|
-
components,
|
|
218
|
+
components: { ...components, GlButton },
|
|
217
219
|
template: wrap`
|
|
218
220
|
<gl-dropdown-form class="gl-px-4">
|
|
219
221
|
<gl-button>One</gl-button>
|
|
@@ -242,7 +244,7 @@ documentedStoriesOf('base/dropdown', readme)
|
|
|
242
244
|
}))
|
|
243
245
|
.add('with header and footer', () => ({
|
|
244
246
|
props: generateProps({ text: 'Some dropdown', headerText: 'Header', hideHeaderBorder: true }),
|
|
245
|
-
components,
|
|
247
|
+
components: { ...components, GlSearchBoxByType },
|
|
246
248
|
template: wrap`
|
|
247
249
|
<template #header>
|
|
248
250
|
<gl-search-box-by-type />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
2
|
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
|
-
import { GlDropdownDivider } from '
|
|
3
|
+
import { GlDropdownDivider } from '../../../index';
|
|
4
4
|
import readme from './dropdown_divider.md';
|
|
5
5
|
|
|
6
6
|
const components = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
2
|
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
|
-
import { GlDropdownForm, GlButton } from '
|
|
3
|
+
import { GlDropdownForm, GlButton } from '../../../index';
|
|
4
4
|
import readme from './dropdown_form.md';
|
|
5
5
|
|
|
6
6
|
const components = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
2
|
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
|
-
import { GlDropdownItem } from '
|
|
3
|
+
import { GlDropdownItem } from '../../../index';
|
|
4
4
|
import readme from './dropdown_item.md';
|
|
5
5
|
|
|
6
6
|
const components = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
2
|
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
|
-
import { GlDropdownSectionHeader } from '
|
|
3
|
+
import { GlDropdownSectionHeader } from '../../../index';
|
|
4
4
|
import readme from './dropdown_section_header.md';
|
|
5
5
|
|
|
6
6
|
const components = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
2
|
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
|
-
import { GlDropdownText } from '
|
|
3
|
+
import { GlDropdownText } from '../../../index';
|
|
4
4
|
import readme from './dropdown_text.md';
|
|
5
5
|
|
|
6
6
|
const components = {
|